#include "StdInc.h" #include "VCMI_Lib.h" #include "CArtHandler.h" #include "CCreatureHandler.h" #include "CDefObjInfoHandler.h" #include "CHeroHandler.h" #include "CLodHandler.h" #include "CObjectHandler.h" #include "CTownHandler.h" #include "CBuildingHandler.h" #include "CSpellHandler.h" #include "CGeneralTextHandler.h" #include "IGameEventsReceiver.h" #include "CStopWatch.h" /* * VCMI_Lib.cpp, part of VCMI engine * * Authors: listed in file AUTHORS in main folder * * License: GNU General Public License v2.0 or later * Full text of license available in license.txt file, in main folder * */ class CLodHandler; LibClasses * VLC = NULL; DLL_LINKAGE CLodHandler *bitmaph = NULL, *spriteh = NULL, *bitmaph_ab = NULL; DLL_LINKAGE void initDLL(CConsoleHandler *Console, std::ostream *Logfile) { console = Console; logfile = Logfile; VLC = new LibClasses; try { VLC->init(); } HANDLE_EXCEPTION; } DLL_LINKAGE void loadToIt(std::string &dest, const std::string &src, int &iter, int mode) { switch(mode) { case 0: { int hmcr = 0; for(; iterload(); tlog0<<"\tGeneral text handler: "<loadHeroes(); heroh->loadObstacles(); heroh->loadPuzzleInfo(); tlog0 <<"\tHero handler: "<loadArtifacts(false); tlog0<<"\tArtifact handler: "<loadCreatures(); tlog0<<"\tCreature handler: "<loadStructures(); tlog0<<"\tTown handler: "<loadObjects(); tlog0<<"\tObject handler: "<load(); tlog0<<"\tDef information handler: "<loadBuildings(); tlog0<<"\tBuilding handler: "<loadSpells(); tlog0<<"\tSpell handler: "<init(GameConstants::DATA_DIR + "/Data/H3sprite.lod", GameConstants::DATA_DIR + "/Sprites"); bitmaph = new CLodHandler; bitmaph->init(GameConstants::DATA_DIR + "/Data/H3bitmap.lod", GameConstants::DATA_DIR + "/Data"); bitmaph_ab = new CLodHandler(); bitmaph_ab->init(GameConstants::DATA_DIR + "/Data/H3ab_bmp.lod", GameConstants::DATA_DIR + "/Data"); tlog0<<"Loading .lod files: "<load(); arth->loadArtifacts(true); } LibClasses::~LibClasses() { clear(); }