Beispiel #1
0
/* Destroy a spritesheet */
void Destroy_Spritesheet(Spritesheet *s) {
	if (!s) {
		fprintf(stderr, "Warning: multiple free of spritesheet\n");
		return;
	}
	Destroy_Texture(s->texture);
	free(s->frames_in_animation);
	free(s);
	s = NULL;
}
Beispiel #2
0
//Destroy all of the world's components and then the world itself
void World_Destroy(World *w) {
	for (int i = 0; i < 3; i++) {
		debug_msg("Destroying enemy type %d\n", i);
		Destroy_CharacterType(w->EnemyTypes[i]);
	}
	for (int i = 0; i < w->ObjectTypeCount; i++) {
		Destroy_ObjectType(w->ObjectTypes[i]);
	}
	Destroy_ObjectType(w->goalpost);
	Destroy_Player(w->player);
	Destroy_Texture(w->background.still);
	free(w);
}
Beispiel #3
0
/* Destroy the main menu */
void MainMenu_Destroy(MainMenu *m) {
	Destroy_Texture(m->buttons.start.texture);
	Destroy_Texture(m->buttons.quit.texture);
	Destroy_Texture(m->background);
	free(m);
}
Beispiel #4
0
/* Destroy a textbox */
void Textbox_Destroy(Textbox *t) {
	Destroy_Texture(t->texture);
	free(t->text);
	free(t);
}