1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-05 00:49:09 +02:00

Merged most of the changes from trunk.

Because of really huge amount of modifications here I've probably missed some minor stuff. I doubt if it's still compatible with gcc - some changes should be reapplied.
This commit is contained in:
Michał W. Urbańczyk
2008-08-02 15:08:03 +00:00
parent dc82232e70
commit cc7be20b07
79 changed files with 1635 additions and 721 deletions

View File

@ -1,11 +1,10 @@
#include "stdafx.h"
#include "CGameInterface.h"
#include "CAdvMapInterface.h"
#include "CAdvmapInterface.h"
#include "CMessage.h"
#include "mapHandler.h"
#include "SDL_Extensions.h"
#include "SDL_framerate.h"
#include "CScreenHandler.h"
#include "CCursorHandler.h"
#include "CCallback.h"
#include "SDL_Extensions.h"
@ -14,6 +13,7 @@
#include <sstream>
#include "hch/CHeroHandler.h"
#include "SDL_framerate.h"
#include "AI/EmptyAI/CEmptyAI.h"
#ifdef _WIN32
#include <windows.h> //for .dll libs
@ -28,6 +28,7 @@ CGlobalAI * CAIHandler::getNewAI(CCallback * cb, std::string dllname)
CGlobalAI * ret=NULL;
CGlobalAI*(*getAI)();
void(*getName)(char*);
#ifdef _WIN32
HINSTANCE dll = LoadLibraryA(dllname.c_str());
if (!dll)
@ -42,11 +43,17 @@ CGlobalAI * CAIHandler::getNewAI(CCallback * cb, std::string dllname)
; //TODO: handle AI library on Linux
#endif
char * temp = new char[50];
#if !defined(__amigaos4__) && !defined(__unix__)
getName(temp);
#endif
std::cout << "Loaded .dll with AI named " << temp << std::endl;
delete temp;
#if !defined(__amigaos4__) && !defined(__unix__)
ret = getAI();
ret->init(cb);
#else
//ret = new CEmptyAI();
#endif
return ret;
}
//CGlobalAI::CGlobalAI()