mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Very little changes to compile under linux and other unix-like OS. Added autoconf/automake scripts to easy compile on all unix-like OS(try autoconf; automake --add-missing;./configure)
This commit is contained in:
		| @@ -14,7 +14,9 @@ | |||||||
| #include "CPlayerInterface.h" | #include "CPlayerInterface.h" | ||||||
| #include "hch/CBuildingHandler.h" | #include "hch/CBuildingHandler.h" | ||||||
|  |  | ||||||
|  | extern "C" { | ||||||
| LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...); | LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...); | ||||||
|  | } | ||||||
|  |  | ||||||
| int CCallback::lowestSpeed(CGHeroInstance * chi) | int CCallback::lowestSpeed(CGHeroInstance * chi) | ||||||
| { | { | ||||||
|   | |||||||
| @@ -3,7 +3,7 @@ | |||||||
|  |  | ||||||
| #include "StartInfo.h" | #include "StartInfo.h" | ||||||
| #include "SDL.h" | #include "SDL.h" | ||||||
| #include "CPregame.h" | #include "CPreGame.h" | ||||||
|  |  | ||||||
| #include <vector> | #include <vector> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| 	#include "stdafx.h" | #include "stdafx.h" | ||||||
| #include "CGameInterface.h" | #include "CGameInterface.h" | ||||||
| #include "CAdvMapInterface.h" | #include "CAdvmapInterface.h" | ||||||
| #include "CMessage.h" | #include "CMessage.h" | ||||||
| #include "mapHandler.h" | #include "mapHandler.h" | ||||||
| #include "SDL_Extensions.h" | #include "SDL_Extensions.h" | ||||||
| @@ -44,12 +44,12 @@ CGlobalAI * CAIHandler::getNewAI(CCallback * cb, std::string dllname) | |||||||
| 	; //TODO: handle AI library on Linux | 	; //TODO: handle AI library on Linux | ||||||
| #endif | #endif | ||||||
| 	char * temp = new char[50]; | 	char * temp = new char[50]; | ||||||
| #ifndef __amigaos4__ | #if !defined(__amigaos4__) && !defined(__unix__) | ||||||
| 	getName(temp); | 	getName(temp); | ||||||
| #endif | #endif | ||||||
| 	std::cout << "Loaded .dll with AI named " << temp << std::endl; | 	std::cout << "Loaded .dll with AI named " << temp << std::endl; | ||||||
| 	delete temp; | 	delete temp; | ||||||
| #ifndef __amigaos4__ | #if !defined(__amigaos4__) && !defined(__unix__) | ||||||
| 	ret = getAI(); | 	ret = getAI(); | ||||||
| 	ret->init(cb); | 	ret->init(cb); | ||||||
| #else | #else | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ | |||||||
| #include "CGameInterface.h" | #include "CGameInterface.h" | ||||||
| #include "CPlayerInterface.h" | #include "CPlayerInterface.h" | ||||||
| #include <algorithm> | #include <algorithm> | ||||||
| #include "SDL_Thread.h" | #include "SDL_thread.h" | ||||||
| #include "SDL_Extensions.h" | #include "SDL_Extensions.h" | ||||||
| #include "CBattleInterface.h" //for CBattleHex | #include "CBattleInterface.h" //for CBattleHex | ||||||
| #include <queue> | #include <queue> | ||||||
|   | |||||||
| @@ -1030,7 +1030,7 @@ void LClickableArea::clickLeft(boost::logic::tribool down) | |||||||
| { | { | ||||||
| 	if(!down) | 	if(!down) | ||||||
| 	{ | 	{ | ||||||
| 		#ifndef __amigaos4__ | 		#if !defined(__amigaos4__) && !defined(__unix__) | ||||||
| 		LOCPLINT->showInfoDialog("TEST TEST AAA", std::vector<SComponent*>()); | 		LOCPLINT->showInfoDialog("TEST TEST AAA", std::vector<SComponent*>()); | ||||||
| 		#else | 		#else | ||||||
| 		#warning error here! | 		#warning error here! | ||||||
| @@ -1050,7 +1050,7 @@ void RClickableArea::clickRight(boost::logic::tribool down) | |||||||
| { | { | ||||||
| 	if(!down) | 	if(!down) | ||||||
| 	{ | 	{ | ||||||
| 		#ifndef __amigaos4__ | 		#if !defined(__amigaos4__) && !defined(__unix__) | ||||||
| 		LOCPLINT->showInfoDialog("TEST TEST AAA", std::vector<SComponent*>()); | 		LOCPLINT->showInfoDialog("TEST TEST AAA", std::vector<SComponent*>()); | ||||||
| 		#else | 		#else | ||||||
| 		#warning error here! | 		#warning error here! | ||||||
| @@ -1062,7 +1062,7 @@ void LRClickableAreaWText::clickLeft(boost::logic::tribool down) | |||||||
| { | { | ||||||
| 	if(!down) | 	if(!down) | ||||||
| 	{ | 	{ | ||||||
| 		#ifndef __amigaos4__ | 		#if !defined(__amigaos4__) && !defined(__unix__) | ||||||
| 		LOCPLINT->showInfoDialog(text, std::vector<SComponent*>()); | 		LOCPLINT->showInfoDialog(text, std::vector<SComponent*>()); | ||||||
| 		#else | 		#else | ||||||
| 		#warning error here! | 		#warning error here! | ||||||
| @@ -1110,7 +1110,7 @@ void LRClickableAreaWTextComp::clickLeft(boost::logic::tribool down) | |||||||
| { | { | ||||||
| 	if((!down) && pressedL) | 	if((!down) && pressedL) | ||||||
| 	{ | 	{ | ||||||
| #ifndef __amigaos4__ | #if !defined(__amigaos4__) && !defined(__unix__) | ||||||
| 		LOCPLINT->showInfoDialog(text, std::vector<SComponent*>(1, new SComponent(SComponent::Etype(baseType), type, bonus))); | 		LOCPLINT->showInfoDialog(text, std::vector<SComponent*>(1, new SComponent(SComponent::Etype(baseType), type, bonus))); | ||||||
| #else | #else | ||||||
| #warning error here! | #warning error here! | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								CLua.cpp
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								CLua.cpp
									
									
									
									
									
								
							| @@ -2,12 +2,14 @@ | |||||||
| #include "CLua.h" | #include "CLua.h" | ||||||
| #include "CLuaHandler.h" | #include "CLuaHandler.h" | ||||||
| #include "hch/CHeroHandler.h" | #include "hch/CHeroHandler.h" | ||||||
|  | extern "C" { | ||||||
| #include "lua.h" | #include "lua.h" | ||||||
| #include "lualib.h" | #include "lualib.h" | ||||||
| #include "lauxlib.h" | #include "lauxlib.h" | ||||||
| #include "lobject.h" | #include "lobject.h" | ||||||
| #include "lgc.h" | #include "lgc.h" | ||||||
| #include "lapi.h" | #include "lapi.h" | ||||||
|  | } | ||||||
| #include "CGameInfo.h" | #include "CGameInfo.h" | ||||||
| #include "CGameState.h" | #include "CGameState.h" | ||||||
| #include <sstream> | #include <sstream> | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								CLua.h
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								CLua.h
									
									
									
									
									
								
							| @@ -1,6 +1,8 @@ | |||||||
| #pragma once | #pragma once | ||||||
| #include "global.h" | #include "global.h" | ||||||
|  | extern "C" { | ||||||
| #include "lstate.h" | #include "lstate.h" | ||||||
|  | } | ||||||
| #include <set> | #include <set> | ||||||
| #include <map> | #include <map> | ||||||
| class CLua; | class CLua; | ||||||
|   | |||||||
| @@ -1,8 +1,10 @@ | |||||||
| #include "stdafx.h" | #include "stdafx.h" | ||||||
|  |  | ||||||
|  | extern "C" { | ||||||
| #include "lua.h" | #include "lua.h" | ||||||
| #include "lualib.h" | #include "lualib.h" | ||||||
| #include "lauxlib.h" | #include "lauxlib.h"  | ||||||
|  | } | ||||||
| //#include <luabind/luabind.hpp> | //#include <luabind/luabind.hpp> | ||||||
| //#include <luabind/function.hpp> | //#include <luabind/function.hpp> | ||||||
| //#include <luabind/class.hpp> | //#include <luabind/class.hpp> | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								CMT.cpp
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								CMT.cpp
									
									
									
									
									
								
							| @@ -2,7 +2,7 @@ | |||||||
| // | // | ||||||
| #include "stdafx.h" | #include "stdafx.h" | ||||||
| #include "SDL.h" | #include "SDL.h" | ||||||
| #include "SDL_TTF.h" | #include "SDL_ttf.h" | ||||||
| #include "hch/CVideoHandler.h" | #include "hch/CVideoHandler.h" | ||||||
| #include "SDL_mixer.h" | #include "SDL_mixer.h" | ||||||
| #include "hch/CBuildingHandler.h" | #include "hch/CBuildingHandler.h" | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| #include "stdafx.h" | #include "stdafx.h" | ||||||
| #include "CMessage.h" | #include "CMessage.h" | ||||||
| #include "SDL_TTF.h" | #include "SDL_ttf.h" | ||||||
| #include "hch/CSemiDefHandler.h" | #include "hch/CSemiDefHandler.h" | ||||||
| #include "hch/CDefHandler.h" | #include "hch/CDefHandler.h" | ||||||
| #include "CGameInfo.h" | #include "CGameInfo.h" | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ | |||||||
| #define CMESSAGE_H | #define CMESSAGE_H | ||||||
|  |  | ||||||
| #include "global.h" | #include "global.h" | ||||||
| #include "SDL_TTF.h" | #include "SDL_ttf.h" | ||||||
| #include "SDL.h" | #include "SDL.h" | ||||||
| #include "CPreGame.h" | #include "CPreGame.h" | ||||||
|  |  | ||||||
|   | |||||||
| @@ -93,7 +93,7 @@ public: | |||||||
| 	IntSelBut( SDL_Rect Pos, T Fun,CDefHandler* Imgs, bool Sel=false, CPoinGroup<T>* gr=NULL, int My=-1) | 	IntSelBut( SDL_Rect Pos, T Fun,CDefHandler* Imgs, bool Sel=false, CPoinGroup<T>* gr=NULL, int My=-1) | ||||||
| 		: Button<T>(Pos,Fun,Imgs,Sel,gr),key(My){ourPoinGroup=gr;}; | 		: Button<T>(Pos,Fun,Imgs,Sel,gr),key(My){ourPoinGroup=gr;}; | ||||||
| 	void select(bool on=true) {(*this).Button<T>::select(on);ourPoinGroup->setYour(this); | 	void select(bool on=true) {(*this).Button<T>::select(on);ourPoinGroup->setYour(this); | ||||||
| 		#ifndef __amigaos4__ | 		#if !defined(__amigaos4__) && !defined(__unix__) | ||||||
| 		CPG->printRating(); | 		CPG->printRating(); | ||||||
| 		#else | 		#else | ||||||
| 		#warning not compile here | 		#warning not compile here | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| #include "stdafx.h" | #include "stdafx.h" | ||||||
| #include "SDL_Extensions.h" | #include "SDL_Extensions.h" | ||||||
| #include "SDL_TTF.h" | #include "SDL_ttf.h" | ||||||
| #include "CGameInfo.h" | #include "CGameInfo.h" | ||||||
| #include <iostream> | #include <iostream> | ||||||
| #include <utility> | #include <utility> | ||||||
|   | |||||||
| @@ -7,7 +7,7 @@ | |||||||
| #include "CTownHandler.h" | #include "CTownHandler.h" | ||||||
| #include "CDefObjInfoHandler.h" | #include "CDefObjInfoHandler.h" | ||||||
| #include "../SDL_Extensions.h" | #include "../SDL_Extensions.h" | ||||||
| #include "boost\filesystem.hpp" | #include "boost/filesystem.hpp" | ||||||
| #include "../CGameState.h" | #include "../CGameState.h" | ||||||
| #include "CLodHandler.h" | #include "CLodHandler.h" | ||||||
| #include <set> | #include <set> | ||||||
|   | |||||||
| @@ -114,7 +114,7 @@ struct SMKStruct | |||||||
| class DLLHandler | class DLLHandler | ||||||
| { | { | ||||||
| public: | public: | ||||||
| #ifndef __amigaos4__ | #if !defined(__amigaos4__) && !defined(__unix__) | ||||||
| 	HINSTANCE dll; | 	HINSTANCE dll; | ||||||
| #else | #else | ||||||
| 	void *dll; | 	void *dll; | ||||||
| @@ -131,7 +131,7 @@ class CBIKHandler | |||||||
| public: | public: | ||||||
| 	DLLHandler ourLib; | 	DLLHandler ourLib; | ||||||
| 	int newmode; | 	int newmode; | ||||||
| #ifndef __amigaos4__ | #if !defined(__amigaos4__) && !defined(__unix__) | ||||||
| 	HANDLE hBinkFile; | 	HANDLE hBinkFile; | ||||||
| #else | #else | ||||||
| 	void *hBinkFile; | 	void *hBinkFile; | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								nodrze.h
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								nodrze.h
									
									
									
									
									
								
							| @@ -189,7 +189,7 @@ template <typename T> void nodrze<T>::wypiszObficie(std::ostream & strum) | |||||||
| template <typename T, class X> T* operator%(nodrze<T> & drzewko, X co) | template <typename T, class X> T* operator%(nodrze<T> & drzewko, X co) | ||||||
| { | { | ||||||
| 	CLOG ("Szukam " <<co <<std::endl); | 	CLOG ("Szukam " <<co <<std::endl); | ||||||
| #ifndef __amigaos4__ | #if !defined(__amigaos4__) && !defined(__unix__) | ||||||
| 	drzewko.wypiszObficie(*C->gl->loguj); | 	drzewko.wypiszObficie(*C->gl->loguj); | ||||||
| #endif | #endif | ||||||
| 	wezel<T> * w = drzewko.korzen; | 	wezel<T> * w = drzewko.korzen; | ||||||
|   | |||||||
| @@ -42,6 +42,9 @@ | |||||||
|  * NOTE: This tests _UNICODE, which is different from the UNICODE define |  * NOTE: This tests _UNICODE, which is different from the UNICODE define | ||||||
|  *       used to differentiate Win32 API calls. |  *       used to differentiate Win32 API calls. | ||||||
|  */ |  */ | ||||||
|  | #ifdef __unix__ | ||||||
|  | #define _TCHAR char* | ||||||
|  | #endif | ||||||
| #ifdef	_UNICODE | #ifdef	_UNICODE | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user