Example #1
0
bool AllegroEngine::Init(int winwidth,int winheight)
  {
  map<int,bool> errormap;
  //
  if (!al_init()) errormap.insert(pair<int,bool>(E_ALLEGRO,true)); //Did Allegro fail to open?
  //
  root = al_create_display(winwidth, winheight); 
  if (!root) errormap.insert(pair<int,bool>(E_DISPLAY,true)); //Did the root display fail to be created?
  //
  al_init_font_addon(); // initialize the font addon
  al_init_ttf_addon();// initialize the ttf (True Type Font) addon
  font = al_load_ttf_font("malgun.ttf",72,0 ); 
  if (!font) errormap.insert(pair<int,bool>(E_FONT,true)); //Did the font fail to load?
  //
  setFPS(errormap, 10);
  //
  if (!al_install_mouse()) 
    errormap.insert(pair<int,bool>(E_MOUSE,true)); //No mouse?
  if (!al_install_keyboard()) 
    errormap.insert(pair<int,bool>(E_KEYBOARD,true)); //No mouse?
  //
  event_queue = al_create_event_queue();
  if (!event_queue) errormap.insert(pair<int,bool>(E_EVENTQUEUE,true)); //Did the event queue not appear?
  //
  al_register_event_source(event_queue, al_get_display_event_source(root)); //register display as event source
  al_register_event_source(event_queue, al_get_timer_event_source(timer_fps)); //register timer as event source
  al_register_event_source(event_queue, al_get_keyboard_event_source());
  al_register_event_source(event_queue, al_get_mouse_event_source());
  //
  bool errors = EngineInit(errormap);
  return errors || errormap.size()==0?true:false;
  }
Example #2
0
int main(){
	EngineInit();

	while(true){
		Input();
		Gui();
		Logic();
		Render();
	}
  
	return 0;
}
Example #3
0
int32 GuardedMain(const TCHAR* CmdLine, HINSTANCE hInInstance, HINSTANCE hPrevInstance, int32 nCmdShow)
{
	// make sure GEngineLoop::Exit() is always called.
	struct EngineLoopCleanupGuard
	{
		~EngineLoopCleanupGuard()
		{
			EngineExit();
		}
	} CleanupGuard;

	// Game without wxWindows.
	int32 ErrorLevel = EngineInit(TEXT("PC/Splash.bmp"));
	while (!GIsRequestingExit)
	{
		EngineTick();
	}

	return ErrorLevel;
}         
Example #4
0
void AppInit( void )
{
	g_Camera.position.Init(0,0,0);
	g_Camera.angles.Init(0,0,0);
	g_Camera.speed = 1500.0f;

	EngineInit();
	font.Init( "Arial", 14 );

	const char *pMapName = FindParameterArg( "-map" );

	int speed = FindNumParameter( "-speed" );
	if ( speed > 0 )
	{
		g_Camera.speed = (float)speed;
	}

	if ( !pMapName )
	{
		Error("Usage vview -map <mapname.bsp>\n");
		return;
	}
	if ( !BspLoad( pMapName ) )
		return;

	mapentity_t *pEntity = Map_FindEntity( "info_player_start" );
	if ( pEntity )
	{
		VectorCopy( pEntity->origin, g_Camera.position ); 
		VectorCopy( pEntity->angles, g_Camera.angles ); 
	}

	glCullFace( GL_BACK );
	glEnable( GL_CULL_FACE );
	glFrontFace( GL_CW );
	glAlphaFunc( GL_GREATER, 0.25 );
}
Example #5
0
File: init.c Project: AEUG/400plus
void my_task_Startup() {
	DebugManager(1, 0x1F, 0x180000, 0x40000, 0x1C0000);

	dmstart();
	dmProcInit();

#ifdef ENABLE_MASSIVE_DEBUG
	// the 2nd level is 32 flags for debug classes
	// the 3rd arg is log level, 0 == full debug, >0 == less debug
	dmSetStoreLevel(hDbgMgr, 0xFF, 0);
	dmSetPrintLevel(hDbgMgr, 0xFF, 0);
#endif

	initialize();
	
	sub_FFAFE5BC();
	SetAssert();
	EventProcedureServiceInit();
	ShutDownProcInit();
	Install3VMemory(0xF8000000);
	RomManagerInit();
	CreateParamPubInstance();
	PropertyServiceInit();
	ErrorNumberListInit();
	FatalErrorsProcInit();
	RegisterISRs_OCH();
	BlockUntilAfterTimeoutProcInit(50);

	sub_FFB07740(0x10, 8, 0x1BBC);
	ResourceNameServiceInit();

	MemorySuite(0);

	sysClockRateSet_100(3);

	sub_FFB2BD6C();

	InitializeSerialIO();

	RtcInit(0x386D4380);

	AdjDefectsInit();

	CameraAdjsInit();

	SetAssertProc(AssertPrepare, 0);

	my_InitializeIntercom(); // InitializeIntercom();

	AfeGainCmosParamInit();

	EngineInit();

	EDmacPriorityManager();

	EngineResourceInit();

	PowerMgrInit(0);

	ClockInit(1);

	RegisterISR_CAPREADY();

	FaceSensorInit();

	RemDrvInit();
	ActSweepInit();

	LcdInit();

	DisplayInit1();

	DisplayInit2();

	PowerSaveProcInit();

	sub_FFA03B0C();

	sub_FFA05114();

	InitializeImagePlayDriver();

	LensNameTblInit();

	LensPOTblInit();

	FlyingInit();

	CaptureInit();

	BathtubSaturateInit();

	Module_CaptureImagePass();

	ClearSomeCapMem();

	ColorAdjustmentsInit();

	Module_PreDarkPassInit();

	LoadSystemInfo();

	SharedBufferInit(0x10800000, 0x18000000, 0xEE0000, 0xEE0000);

	FileCacheInit();
	PackMemInit();

	ImagePropInit();
	DigPropInit();

	ShootMainInit();

	OlcInfoInit();

	RegisterISR_EMERGENCY_CARDDOOR();

	my_MainCtrlInit();

	CaptureSemaphoreInit();

	VShadingInit();

	Module_CaptureDarkPassInit();

	Module_DarkSubtractionPassInit();
	BathtubInit();

	Module_BathtubCorrectPassInit();

	Module_VObIntegPassInit();

	SetProjectionInit();
	Module_DefectsDetectPassInit();

	DefsInit();
	WbDetectionInit();
	ObInit();

	Module_WbDetectionPassInit();
	DefsProcInit();

	Module_ObAreaCopyPassInit();
	Module_AdditionVTwoLinePassInit();

	VShadingProcInit();
	Module_VShadingCorrectPassInit();

	sub_FFA24838();
	HuffmanInit();

	RawToJpegPass_L_Init();
	RawToJpegPass_M2_Init();

	RawToJpegPass_S_Init();
	YcToJpegLargeFastInit();

	YcToJpegM2FastInit();
	YcToJpegSFastInit();

	RawToLosslessInit();
	Module_YcToTwainInit();

	RawToYcPass_S_Init();
	RawToYPackPass_S_Init();

	DvlpInit();
	DecodeJpegPassInit();
	HistPassInit();
	RectangleColorPassInit();
	RectangleCopyPassInit();

	ResizeYuvPassInit();
	sub_FFA35354();
	LpfPassInit();

	EncodeJpegPassInit();
	AdjRgbGainInit();
	LuckyInit();

	SysInfoProcInit();

	TablesInit();

	ColorInit();

	CtrlManRecursiveLock();

	CtrlSrvInit(0x19);

	LangConInit();
	sub_FF926E40();

	CreateDispSwControlPubInstance();

	CreateMemoryManagerPubInstance();

	my_GUIInit(); //GUIInit();
	GUIApiCalls();

	InitializeImagePlayer();

	ColorBarProcsInit();
	LcdAdjustProcsInit();

	sub_FFB29348();
	CMOSParamInit();

	CameraSettingsInit();
	BootDiskProcsInit();

	DDDInit();
	TFTInit();

	RegisterResourceName(hResourceName, "USR ROOT DEVICE HANDLE", 0x7B);

	RegisterResource_env(0xC02200B8, "U2VBUS");
	RegisterResource_env(1, "USBC20 VBUS SUPPORT");

	RegisterResource_env(0x14, "DEVICESPEED");
	USBC20_Init();
	USBC20_USBIF_Init();

	USBC20_BUFCON_Init();
	USBC20_CLK_Init();
	USBC20_HDMAC_Init();

	DCPClassFunctionsInit();
	USBDriverInit();
	RapiSwitcherInit();

	DCPClassInit();
	RAPITransportUSBInit();
	PTPRespondInit();

	PTPFrameworkInit();
	StartupPtpResponder();

	RapiTransportManagerInit();
	DCPClassInit();

	EventProcServerInit();
	sub_FFA5D8A0();
	DCPInit();

	SesnMngrInit();
	MemMngrInit();
	InitializeRapiTransportManager();

	PrintInit();
	sub_FF95EC54();
	SomePrintInit();
	sub_FF9EB94C();

	InitializeUSBDriver();
	TransMemoryInit();
	InitializeComCtrl();

	FactoryModeInit();
	DP_Init(0, 0x1B, 0, 0);
	return_0();

	sub_FF98CF4C();
	EdLedProcsInit();
	CallBacksInit();

	RegistNotifyConnectDT();
	DPOF_Initialize();

	MpuMonInit();

	StartConsole();
}