<commit_before>/*
 * Copyright (c) 2007 SIEGE Development Team
 * All rights reserved.
 *
 * This file is part of libSIEGE.
 *
 * This software is copyrighted work licensed under the terms of the
 * 2-clause BSD license. Please consult the file "license.txt" for
 * details.
 *
 * If you did not recieve the file with this program, please email
 * <NAME> <<EMAIL>>.
 */

#define SG_BUILD_LIBRARY
#include <siege/core/entity.h>
#include <siege/audio/source.h>
#include <siege/graphics/sprite.h>
#include <siege/graphics/mask.h>
#include <siege/physics/body.h>

#include <stdlib.h>
#include <string.h>
#include <math.h>

SGbool SG_EXPORT _sgEntityInit(void)
{
	_sg_cList = sgPListCreate(SG_PLIST_HFO);
	if(_sg_cList != NULL)
		return SG_TRUE;
	return SG_FALSE;
}
SGbool SG_EXPORT _sgEntityDeinit(void)
{
	//SGPListNode* node;
	//for(node = _sg_cList->first; node != NULL; node = node->next)
	//	  free(node);
	sgListDestroy(_sg_cList);
	return SG_TRUE;
}

SGbool SG_EXPORT _sg_evCall(SGEntity* entity, va_list args)
{
	if(!entity->active)
		return SG_TRUE;

    SGuint num = va_arg(args, SGuint);
    SGenum type;

    size_t siz[2];
    SGuint val[2];
    void* ptr[2];

	SGuint i;
	for(i = 0; i < num; i++)
	{
        type = va_arg(args, SGenum);
		if(entity->type & (type & SG_EVT_ALL))
			switch(type)
			{
				case SG_EVF_INIT:
					if(entity->evInit != NULL)
						entity->evInit(entity);
					break;
				case SG_EVF_DEINIT:
					if(entity->evDeinit != NULL)
						entity->evDeinit(entity);
					break;<commit_msg>Fixed a bug in SIEGE - namely, entities would not get destroyed when SIEGE exited with "living" entities.<commit_after>/*
 * Copyright (c) 2007 SIEGE Development Team
 * All rights reserved.
 *
 * This file is part of libSIEGE.
 *
 * This software is copyrighted work licensed under the terms of the
 * 2-clause BSD license. Please consult the file "license.txt" for
 * details.
 *
 * If you did not recieve the file with this program, please email
 * <NAME> <<EMAIL>>.
 */

#define SG_BUILD_LIBRARY
#include <siege/core/entity.h>
#include <siege/audio/source.h>
#include <siege/graphics/sprite.h>
#include <siege/graphics/mask.h>
#include <siege/physics/body.h>

#include <stdlib.h>
#include <string.h>
#include <math.h>

SGbool SG_EXPORT _sgEntityInit(void)
{
	_sg_cList = sgPListCreate(SG_PLIST_HFO);
	if(_sg_cList != NULL)
		return SG_TRUE;
	return SG_FALSE;
}
SGbool SG_EXPORT _sgEntityDeinit(void)
{
	while(_sg_cList->first)
		sgEntityDestroy(_sg_cList->first->item);
	sgListDestroy(_sg_cList);
	return SG_TRUE;
}

SGbool SG_EXPORT _sg_evCall(SGEntity* entity, va_list args)
{
	if(!entity->active)
		return SG_TRUE;

    SGuint num = va_arg(args, SGuint);
    SGenum type;

    size_t siz[2];
    SGuint val[2];
    void* ptr[2];

	SGuint i;
	for(i = 0; i < num; i++)
	{
        type = va_arg(args, SGenum);
		if(entity->type & (type & SG_EVT_ALL))
			switch(type)
			{
				case SG_EVF_INIT:
					if(entity->evInit != NULL)
						entity->evInit(entity);
					break;
				case SG_EVF_DEINIT:
					if(entity->evDeinit != NULL)
						entity->evDeinit(entity);
					break;
{'fraction_non_alphanumeric': 0.12908443869297961, 'fraction_numerical': 0.005823358136525397, 'mean_word_length': 3.6990881458966567, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 42, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5967947', 'n_tokens_mistral': 1314, 'n_tokens_neox': 1173, 'n_words': 292}