示例#1
0
文件: dEngine.c 项目: slarti88/Shmup
void dEngine_GoToNextScene(void)
{	
	if (engine.mode == DE_MODE_MULTIPLAYER && NET_IsRunning())
		NET_OnNextLevelLoad();
	else
		dEngine_RequireSceneId(engine.sceneId + 1  % engine.numScenes);
	
	
}
示例#2
0
文件: menu.c 项目: shanfl/Shmup
void Action_BackToHomeAfterGameOver(void* tag)
{
	
	
	NET_Free();
	MENU_Set(MENU_HOME);
	dEngine_RequireSceneId(0);
	
}
示例#3
0
文件: dEngine.c 项目: slarti88/Shmup
void dEngine_Init(void) 
{
	FS_InitFilesystem();
    Log_Printf("dEngine Initialization...\n");
    
	ENT_InitCacheSystem();
	TEXT_InitCacheSystem();
	MAT_InitCacheSystem();

#ifdef GENERATE_VIDEO	
	dEngine_INIT_ScreenshotBuffer();
#endif
	
	engine.sceneId = -1;
	dEngine_RequireSceneId(0);
	
	//engine.recordVideo = 0;
	
	engine.musicFilename[0] = '\0';
	engine.musicStartAt = 0;
	engine.playback.filename[0] = '\0';
	
	// Enable/disable sounds here
	engine.soundEnabled = 0;
	engine.musicEnabled = 0;

	engine.gameCenterEnabled = 0;
	
	ENPAR_Init();
	
	

	dEngine_ReadConfig();

	SCR_Init();
	
	
	
	
	MATLIB_LoadLibraries();
	

	
	COLL_InitUnitCube();
	
	
	ENE_Mem_Init();
	
	//SND_Init();
	
	
	MENU_Init();
	
	
}
示例#4
0
文件: dEngine.c 项目: slarti88/Shmup
void dEngine_Resume(void)
{
	//Timer_Resume();
	//unsigned int mode = 0x27F;
	//asm volatile ("fldcw %0" : : "m" (*&mode));
	
	
	dEngine_RequireSceneId(0);
	P_ResetPlayers();
	COM_ResetTouchesBuffer();
}
示例#5
0
文件: menu.c 项目: shanfl/Shmup
void Action_GoToTutorial(void* tag)
{
	int i;
	
	PL_ResetPlayersScore();
	for(i=0 ; i < MAX_NUM_PLAYERS ; i++)
		players[i].respawnCounter = numPlayerRespawn[DIFFICULTY_NORMAL];
	
	if (engine.controlMode == CONTROL_MODE_SWIP)
	{	
		dEngine_RequireSceneId(14);
		MENU_Set(MENU_NONE);
	}
	else 
	{
		dEngine_RequireSceneId(15);
		MENU_Set(MENU_NONE);
	}

		
}
示例#6
0
文件: menu.c 项目: shanfl/Shmup
void Action_PlayDemo(void* tag)
{
	int i;
	char* actId = (char*)tag;
	
	PL_ResetPlayersScore();
	for(i=0 ; i < MAX_NUM_PLAYERS ; i++)
		players[i].respawnCounter = numPlayerRespawn[DIFFICULTY_NORMAL];
	
	engine.difficultyLevel = DIFFICULTY_NORMAL;
	
	dEngine_RequireSceneId(*actId);
	MENU_Set(MENU_NONE);
}
示例#7
0
文件: menu.c 项目: shanfl/Shmup
void Action_ReplayAct(void* tag)
{
	menu_button_t* button;
	int actToPlay;
	int* buttonPressed = (int*)tag;
	
	button = &menuScreens[currentMenuId].buttons[*buttonPressed];
	
	actToPlay = '0' - button->text[5];
	
	engine.playback.play = 1;
	
	dEngine_RequireSceneId(actToPlay);
//	engine.requiredSceneId = actToPlay;
	MENU_Set(MENU_NONE);	
	//Use lastButtonPressed
}
示例#8
0
文件: menu.c 项目: shanfl/Shmup
void Action_startNewGame(void* tag)
{
	int i;
	uchar difficultyLevel;
	
	difficultyLevel = *(char*)tag; 
	
	MENU_Set(MENU_NONE);
	dEngine_RequireSceneId(1);
	
	//Parameter set the difficulty level
	
	engine.mode = DE_MODE_SINGLEPLAYER;
	PL_ResetPlayersScore();
	numPlayers = 1;
	
	
	for(i=0 ; i < MAX_NUM_PLAYERS ; i++)
		players[i].respawnCounter = numPlayerRespawn[difficultyLevel];
	
	engine.difficultyLevel = difficultyLevel;
}
示例#9
0
文件: menu.c 项目: shanfl/Shmup
void Action_GoToAct(void* tag)
{
	char* actId = (char*)tag;
	dEngine_RequireSceneId(*actId);
	MENU_Set(MENU_NONE);
}
示例#10
0
void dEngine_Init()
{
	ENT_InitCacheSystem();
	TEXT_InitCacheSystem();
	MAT_InitCacheSystem();

#ifdef GENERATE_VIDEO	
	dEngine_INIT_ScreenshotBuffer();
#endif
	
	engine.sceneId = -1;
	dEngine_RequireSceneId(0);
	
	//engine.recordVideo = 0;
	
	engine.musicFilename[0] = '\0';
	engine.musicStartAt = 0;
	engine.playback.filename[0] = '\0';
	
	engine.soundEnabled = 1;
	engine.musicEnabled = 1;
	engine.gameCenterEnabled = 0;
	
	ENPAR_Init();
	
	
	FS_InitFilesystem();

	dEngine_ReadConfig();

	SCR_Init();
	
	
	
	
	MATLIB_LoadLibraries();
	

	
	COLL_InitUnitCube();
	
	
	ENE_Mem_Init();
	
	SND_Init();
	
	
	MENU_Init();
	
	
	
	//TESTS
	/*
	char c = CHAR_MAX;
	unsigned char uc = UCHAR_MAX;
	short s = SHRT_MAX;
	unsigned short us = USHRT_MAX;
	int i = INT_MAX;
	unsigned int ui = UINT_MAX;
	long l = LONG_MAX;
	unsigned long ul = ULONG_MAX;
	
	printf("\n");
	printf("LIMITS: c:%d, uc:%u, s:%d, us:%u\n"
		   "LIMITS: i:%d, ui:%u, l:%ld, ul:%lu\n",
		   c, uc, s, us, i, ui, l, ul);
	
	// promotion 
	printf("\n");
	printf("i = s: %d, \n", i = s);
	printf("i = us: %d, \n", i = us);
	printf("ui = s: %u, \n", ui = s);
	printf("ui = us: %u\n", ui = us);
	
	// narrowing 
	printf("\n");
	printf("c = s: %d, \n", c = s);
	printf("c = us: %d, \n", c = us);
	printf("uc = s: %d, \n", uc = s); //Ln:31
	printf("uc = us: %d\n", uc = us);
	
	printf("\n");
	printf("uc = UCHAR_MAX (%u) + 1: %u, \n",
		   UCHAR_MAX, uc = UCHAR_MAX + 1); // Ln:36 
	printf("uc = -1: %d\n", uc = -1);
	*/
	
}