12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- #define variable
- #include <Text.h>
- #include "Globals.h"
- #include "Login.h"
- #include "DirectConnect.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();
- });
- network = new NetworkHandler();
- currentGame = 0;
- 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("login", RCPointer<Menu>::of(new LoginMenu(uiFactory.initParam.bildschirm)));
- menuRegister->put("directConnect", RCPointer<Menu>::of(new DirectConnect(uiFactory.initParam.bildschirm)));
- menuRegister->put("game", RCPointer<Menu>::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;
- }
|