#define variable #include #include "Globals.h" #include "ServerSelection.h" #include "AddServerMenu.h" #include "Game.h" #include "Load.h" void initVariables() { dlls = new DLLRegister(); menuRegister = new HashMap>(10, [](Text txt) { return txt.hashCode(); }); fontRegister = new HashMap>(10, [](Text txt) { return txt.hashCode(); }); window = 0; itemIcons = new RCArray(); blockTypes = 0; blockTypeCount = 0; itemTypes = 0; itemTypeCount = 0; entityTypes = 0; entityTypeCount = 0; } void initMenus() { menuRegister->put("load", RCPointer::of(new LoadMenu(uiFactory.initParam.bildschirm))); menuRegister->put("serverSelection", RCPointer::of(new ServerSelectionMenu(uiFactory.initParam.bildschirm))); menuRegister->put("addServer", RCPointer::of(new AddServerMenu(uiFactory.initParam.bildschirm))); menuRegister->put("game", RCPointer::of(new Game(uiFactory.initParam.bildschirm))); menuRegister->get("load")->show(); } void releaseVariables() { if (World::INSTANCE) World::INSTANCE->release(); menuRegister->release(); fontRegister->release(); dlls->release(); itemIcons->release(); for (int i = 0; i < blockTypeCount; i++) blockTypes[i]->release(); delete[] blockTypes; for (int i = 0; i < itemTypeCount; i++) itemTypes[i]->release(); delete[] itemTypes; for (int i = 0; i < entityTypeCount; i++) entityTypes[i]->release(); delete[] entityTypes; blockTypes = 0; blockTypeCount = 0; itemTypes = 0; itemTypeCount = 0; entityTypes = 0; entityTypeCount = 0; }