Ejemplo n.º 1
0
void sounds_close(void)
{
	sound_free(sound_burning);
	sound_free(sound_bulbul);
	sound_free(sound_sinked);
	sound_free(sound_missed);

	sound_close();
}
Ejemplo n.º 2
0
int	trap_FreeSound(lua_State *s)
{
	SOUND *w;
	
	trap_args(s, "FreeSound", "p", &w);
	sound_free(w);
	return 0;
}
Ejemplo n.º 3
0
void clean_up( void ) {
	sound_free();
	game_list_free();
	submenu_free();
	platform_free();
	menu_free();
	hint_free();
	font_free();
	bg_free();
	location_free();
	event_free();
	snap_free();
	video_free();
	sdl_free();
}
Ejemplo n.º 4
0
int dgreed_main(int argc, const char** argv) {
	params_init(argc, argv);
	rand_init(time(NULL));
	layouts_init();
	layouts_set("dvorak");

	bool fullscreen = true;
	if(params_find("-windowed") != ~0)
		fullscreen = false;

	video_init_ex(SCREEN_WIDTH, SCREEN_HEIGHT, 
		SCREEN_WIDTH, SCREEN_HEIGHT, "KeyMingler", fullscreen);
	font = font_load(FONT_FILE);	
	float text_width = font_width(font, LOADING_TEXT);
	float text_height = font_height(font);
	Vector2 pos = vec2((SCREEN_WIDTH - text_width) / 2.0f,
		(SCREEN_HEIGHT - text_height) / 2.0f);
	font_draw(font, LOADING_TEXT, 0, &pos, COLOR_WHITE);	
	video_present();
	system_update();

	game_init();
	sounds_init();
	music = sound_load_stream(MUSIC_FILE);
	sound_play(music);

	while(system_update()) {
		game_update();
		game_render();
		video_present();
		sound_update();

		if(key_up(KEY_QUIT))
			break;
	}
	
	font_free(font);
	sound_free(music);
	sounds_close();
	game_close();
	video_close();
	layouts_close();

	return 0;
}
Ejemplo n.º 5
0
/**
 * @brief Cleans up after the sound subsytem.
 */
void sound_exit (void)
{
   int i;
   alVoice *v;

   /* Nothing to disable. */
   if (sound_disabled || !sound_initialized)
      return;

   /* Exit music subsystem. */
   music_exit();

   if (voice_mutex != NULL) {
      voiceLock();
      /* free the voices. */
      while (voice_active != NULL) {
         v = voice_active;
         voice_active = v->next;
         free(v);
      }
      while (voice_pool != NULL) {
         v = voice_pool;
         voice_pool = v->next;
         free(v);
      }
      voiceUnlock();

      /* Destroy voice lock. */
      SDL_DestroyMutex(voice_mutex);
      voice_mutex = NULL;
   }

   /* free the sounds */
   for (i=0; i<sound_nlist; i++)
      sound_free( &sound_list[i] );
   free( sound_list );
   sound_list = NULL;
   sound_nlist = 0;

   /* Exit sound subsystem. */
   sound_sys_exit();

   /* Sound is done. */
   sound_initialized = 0;
}
Ejemplo n.º 6
0
void core_run()
{
	/* Setup. */
	core_assets_init();

	/* Loop until the user closes the window */
	graphics_loop(&core_global->graphics);

	/* Release assets. */
	core_release();

	/* Free OpenAL. */
	sound_free(&core_global->sound);

	/* If we reach here, quit the core. */
	graphics_free(&core_global->graphics);

	/* Release game memory */
	free(core_global->shared_memory.game_memory);
}
Ejemplo n.º 7
0
/* used in headerbuttons.c image.c mesh.c screen.c sound.c and library.c */
void free_libblock(ListBase *lb, void *idv)
{
	ID *id= idv;

#ifdef WITH_PYTHON
	BPY_id_release(id);
#endif

	switch( GS(id->name) ) {	/* GetShort from util.h */
		case ID_SCE:
			free_scene((Scene *)id);
			break;
		case ID_LI:
			free_library((Library *)id);
			break;
		case ID_OB:
			free_object((Object *)id);
			break;
		case ID_ME:
			free_mesh((Mesh *)id);
			break;
		case ID_CU:
			free_curve((Curve *)id);
			break;
		case ID_MB:
			free_mball((MetaBall *)id);
			break;
		case ID_MA:
			free_material((Material *)id);
			break;
		case ID_TE:
			free_texture((Tex *)id);
			break;
		case ID_IM:
			free_image((Image *)id);
			break;
		case ID_LT:
			free_lattice((Lattice *)id);
			break;
		case ID_LA:
			free_lamp((Lamp *)id);
			break;
		case ID_CA:
			free_camera((Camera*) id);
			break;
		case ID_IP:
			free_ipo((Ipo *)id);
			break;
		case ID_KE:
			free_key((Key *)id);
			break;
		case ID_WO:
			free_world((World *)id);
			break;
		case ID_SCR:
			free_screen((bScreen *)id);
			break;
		case ID_VF:
			free_vfont((VFont *)id);
			break;
		case ID_TXT:
			free_text((Text *)id);
			break;
		case ID_SCRIPT:
			//XXX free_script((Script *)id);
			break;
		case ID_SPK:
			free_speaker((Speaker *)id);
			break;
		case ID_SO:
			sound_free((bSound*)id);
			break;
		case ID_GR:
			free_group_objects((Group *)id);
			break;
		case ID_AR:
			free_armature((bArmature *)id);
			break;
		case ID_AC:
			free_action((bAction *)id);
			break;
		case ID_NT:
			ntreeFreeTree((bNodeTree *)id);
			break;
		case ID_BR:
			free_brush((Brush *)id);
			break;
		case ID_PA:
			psys_free_settings((ParticleSettings *)id);
			break;
		case ID_WM:
			if(free_windowmanager_cb)
				free_windowmanager_cb(NULL, (wmWindowManager *)id);
			break;
		case ID_GD:
			free_gpencil_data((bGPdata *)id);
			break;
	}

	if (id->properties) {
		IDP_FreeProperty(id->properties);
		MEM_freeN(id->properties);
	}

	BLI_remlink(lb, id);

	/* this ID may be a driver target! */
	BKE_animdata_main_cb(G.main, animdata_dtar_clear_cb, (void *)id);

	MEM_freeN(id);
}
Ejemplo n.º 8
0
void sound_pause( void ) {
	sound_free();
}