Exemplo n.º 1
0
int GameMain(MFInitParams *pInitParams)
{
	MFRand_Seed((uint32)(MFSystem_ReadRTC() & 0xFFFFFFFF));

	MFSystem_RegisterSystemCallback(MFCB_InitDone, Game_Init);
	MFSystem_RegisterSystemCallback(MFCB_Update, Game_Update);
	MFSystem_RegisterSystemCallback(MFCB_Draw, Game_Draw);
	MFSystem_RegisterSystemCallback(MFCB_Deinit, Game_Deinit);

	pInitFujiFS = MFSystem_RegisterSystemCallback(MFCB_FileSystemInit, Game_InitFilesystem);

	return MFMain(pInitParams);
}
Exemplo n.º 2
0
void HKUserInterface::Init()
{
	HKWidgetStyle::Init();

//	pChainResizeCallback = MFSystem_RegisterSystemCallback(MFCB_DisplayResize, ResizeCallback);
	pChainResizeCallback = MFSystem_RegisterSystemCallback(MFCB_DisplayReset, ResizeCallback);

	if(!pFactory)
	{
		pFactory = new HKFactory<HKWidget>();

		HKWidgetFactory::FactoryType *pWidget = RegisterWidget<HKWidget>(NULL);

		HKWidgetFactory::FactoryType *pLabel = RegisterWidget<HKWidgetLabel>(pWidget);
		RegisterWidget<HKWidgetButton>(pLabel);
		HKWidgetFactory::FactoryType *pFrame = RegisterWidget<HKWidgetLayoutFrame>(pWidget);
		RegisterWidget<HKWidgetLayoutLinear>(pWidget);
		RegisterWidget<HKWidgetPrefab>(pFrame);
		RegisterWidget<HKWidgetTextbox>(pWidget);
		RegisterWidget<HKWidgetListbox>(pWidget);
		RegisterWidget<HKWidgetSelectbox>(pFrame);
	}

	if(!pRendererFactory)
	{
		pRendererFactory = new HKFactory<HKWidgetRenderer>();

		HKWidgetRendererFactory::FactoryType *pWidget = RegisterWidgetRenderer(HKWidget::TypeName(), HKWidgetRenderer::Create, NULL);
		RegisterWidgetRenderer(HKWidgetLabel::TypeName(), HKWidgetRendererLabel::Create, pWidget);
		RegisterWidgetRenderer(HKWidgetTextbox::TypeName(), HKWidgetRendererTextbox::Create, pWidget);
	}

	eventHandlerRegistry.Init(256, 256, 32);
}
Exemplo n.º 3
0
int GameMain(MFInitParams *pInitParams)
{
	MFRand_Seed((uint32)(MFSystem_ReadRTC() & 0xFFFFFFFF));

	Fuji_CreateEngineInstance();

	MFSystem_RegisterSystemCallback(MFCB_InitDone, Game_Init);
	MFSystem_RegisterSystemCallback(MFCB_Update, Game_Update);
	MFSystem_RegisterSystemCallback(MFCB_Draw, Game_Draw);
	MFSystem_RegisterSystemCallback(MFCB_Deinit, Game_Deinit);

	pInitFujiFS = MFSystem_RegisterSystemCallback(MFCB_FileSystemInit, Game_InitFilesystem);

	int r = MFMain(pInitParams);

	Fuji_DestroyEngineInstance();

	return r;
}