Ejemplo n.º 1
0
void dEngine_JumpInTime(void)
{
	event_t* event;
	event_t* toDelete;
	int i;
	
	if (timeJumpCounter >0)
	{
		//Pause the timer
		Timer_Pause();
		renderer.enabled=0;
		
		//Remove all futur enemy spawning events.
		event = EV_GetNextEvent();
		
		while (event != NULL) 
		{			
			while (event->next != NULL && event->next->time <= timeJumpTarget && event->next->type == EV_SPAWN_ENEMY)
			{
				//Log_Printf("[dEngine_JumpInTime] Cleaning EV_SPAWN_ENEMY events t=%d.\n",event->next->time);
				
				toDelete = event->next;
				event->next = event->next->next;
				
				free(toDelete->payload);
				free(toDelete);
			}
			
			
			event = event->next;
		}
		
	//	Log_Printf("[dEngine_JumpInTime] events cleaned.\n");
		
		while (simulationTime < timeJumpTarget) 
		{
			//Move one step ahead
			timediff = 16; //We are going to simulate by slice of 16ms until we reached the jumpTime.
			simulationTime+=timediff;
			
			
			//Play all frames
		//	Log_Printf("[dEngine_JumpInTime] t=%d.\n",simulationTime);
			dEngine_HostFrame();
		}
		
		for (i=0; i < numPlayers; i++) {
			players[i].showPointer = 0;
		}
		
		//Resume the timer
		Timer_Resume();
		renderer.enabled = 1;
		timeJumpCounter--;
	}
}
Ejemplo n.º 2
0
/**
 * Just the current frame in the display.
 */
static void engine_draw_frame(struct engine_info_t* engine) {
	if (engine->display == NULL) {
		// No display.
		return;
	}

	dEngine_HostFrame();

	eglSwapBuffers(engine->display, engine->surface);
}