/** Object **/ void ApplicationBase::init(){ Super::init(); // basic ::init_platform(); ObjectPool::Set(New<ObjectPool>()); // misc { OPH(); // logger & monitor Logger::Init(); Monitor::Init(); // process local ProcessLocal::Init(); // register register_misc(); register_lua(); register_protocol(); register_class(); // observer & actor ObserverManager::Init(); ActorManager::Init(); } }
int main() { int i; #ifndef NOSERIAL serial_init(57600); usleep(2000000); printf("Serial OK\r\n"); #endif atexit(quit); g_registry = new Registry(); g_registry->set("DataDir", "/GRIMDATA"); g_registry->set("good_times", "TRUE"); g_driver = new DriverRonin(); g_engine = new Engine(); g_resourceloader = new ResourceLoader(); g_localizer = new Localizer(); g_mixer = new SoundMixer(); g_mixer->setVolume(255); g_timer = new Timer(); g_smush = new Smush(); g_imuse = new Imuse(20); Bitmap *splash_bm = NULL; splash_bm = g_resourceloader->loadBitmap("splash.bm"); splash_bm->ref(); g_driver->clearScreen(); splash_bm->draw(); g_driver->flipBuffer(); splash_bm->deref(); lua_iolibopen(); lua_strlibopen(); lua_mathlibopen(); register_lua(); g_lua_initialized = true; bundle_dofile("_system.lua"); lua_pushnil(); // resumeSave lua_pushnil(); // bootParam // lua_pushnumber(0); // bootParam lua_call("BOOT"); g_engine->setMode(ENGINE_MODE_NORMAL); g_engine->mainLoop(); quit(); return 0; }