12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- #define variable
- #include <Text.h>
- #include "Globals.h"
- #include "ServerSelection.h"
- #include "AddServerMenu.h"
- #include "Game.h"
- #include "Load.h"
- void initVariables()
- {
- dlls = new DLLRegister();
- menuRegister = new HashMap<Framework::Text, Framework::RCPointer<Menu>>(10, [](Text txt)
- {
- return txt.hashCode();
- });
- fontRegister = new HashMap<Framework::Text, Framework::RCPointer<Schrift>>(10, [](Text txt)
- {
- return txt.hashCode();
- });
- window = 0;
- itemIcons = new RCArray<Bild>();
- blockTypes = 0;
- blockTypeCount = 0;
- itemTypes = 0;
- itemTypeCount = 0;
- entityTypes = 0;
- entityTypeCount = 0;
- }
- void initMenus()
- {
- menuRegister->put("load", RCPointer<Menu>::of(new LoadMenu(uiFactory.initParam.bildschirm)));
- menuRegister->put("serverSelection", RCPointer<Menu>::of(new ServerSelectionMenu(uiFactory.initParam.bildschirm)));
- menuRegister->put("addServer", RCPointer<Menu>::of(new AddServerMenu(uiFactory.initParam.bildschirm)));
- menuRegister->put("game", RCPointer<Menu>::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;
- }
|