#define variable #include #include "Globals.h" #include "Login.h" #include "DirectConnect.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(); }); network = new NetworkHandler(); currentGame = 0; 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("login", RCPointer::of(new LoginMenu(uiFactory.initParam.bildschirm))); menuRegister->put("directConnect", RCPointer::of(new DirectConnect(uiFactory.initParam.bildschirm))); menuRegister->put("game", RCPointer::of(new Game(uiFactory.initParam.bildschirm))); menuRegister->get("load")->show(); } void releaseVariables() { if (currentGame) currentGame->release(); menuRegister->release(); fontRegister->release(); network->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; }