# HG changeset patch # User smxx # Date 1267628679 0 # Node ID 908851e59958be1e02346ae30dcf66afe5230f1a # Parent e33ecd95aa1afba37e94b2f8230ce1113f354b27 Engine: * Renamed proto.inc to config.inc to receive other config values from cmake as well * Moved Lua library lookup back to CMake - hope this finally fixes all issues * Fixed training once again diff -r e33ecd95aa1a -r 908851e59958 cmake_modules/FindLua.cmake --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmake_modules/FindLua.cmake Wed Mar 03 15:04:39 2010 +0000 @@ -0,0 +1,11 @@ +# Find the Lua library +# + +IF(UNIX) + FIND_LIBRARY(LUA_LIBRARY NAMES lua5.1 lua) +ELSE(UNIX) + IF(WIN32) + SET(LUA_LIBRARY lua.dll CACHE FILEPATH "Path to the lua library to be used. This should be set to 'lua.dll' or 'lua' under Win32/Apple to use the bundled copy.") + else(WIN32) + ENDIF(WIN32) +ENDIF(UNIX) \ No newline at end of file diff -r e33ecd95aa1a -r 908851e59958 hedgewars/CMakeLists.txt --- a/hedgewars/CMakeLists.txt Wed Mar 03 14:49:10 2010 +0000 +++ b/hedgewars/CMakeLists.txt Wed Mar 03 15:04:39 2010 +0000 @@ -1,10 +1,11 @@ -configure_file(${hedgewars_SOURCE_DIR}/hedgewars/proto.inc.in ${CMAKE_CURRENT_BINARY_DIR}/proto.inc) +configure_file(${hedgewars_SOURCE_DIR}/hedgewars/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc) find_package(SDL) find_package(SDL_image) find_package(SDL_net) find_package(SDL_ttf) find_package(SDL_mixer) +find_package(Lua) #find which version of SDL_image and SDL_mixer we have (for IMG_Init and Mix_Init) #if the headers are not installed, the newer apis won't be activated @@ -73,7 +74,7 @@ HHHandlers.inc SinTable.inc options.inc - ${CMAKE_CURRENT_BINARY_DIR}/proto.inc + ${CMAKE_CURRENT_BINARY_DIR}/config.inc ) find_program(fpc_executable ${fpc_tryexe}) diff -r e33ecd95aa1a -r 908851e59958 hedgewars/LuaPas.pas --- a/hedgewars/LuaPas.pas Wed Mar 03 14:49:10 2010 +0000 +++ b/hedgewars/LuaPas.pas Wed Mar 03 15:04:39 2010 +0000 @@ -10,6 +10,7 @@ interface {.$DEFINE LUA_GETHOOK} +{$INCLUDE "config.inc"} type size_t = type Cardinal; @@ -20,15 +21,7 @@ Plua_State = ^lua_State; const -{$IFDEF UNIX} - {$IFDEF DARWIN} - LuaLibName = 'lua'; - {$ELSE} - LuaLibName = 'lua5.1.so'; - {$ENDIF} -{$ELSE} - LuaLibName = 'lua.dll'; -{$ENDIF} + LuaLibName = cLuaLibrary; (*****************************************************************************) diff -r e33ecd95aa1a -r 908851e59958 hedgewars/PascalExports.pas --- a/hedgewars/PascalExports.pas Wed Mar 03 14:49:10 2010 +0000 +++ b/hedgewars/PascalExports.pas Wed Mar 03 15:04:39 2010 +0000 @@ -15,7 +15,7 @@ interface uses uKeys, uConsole; -{$INCLUDE "proto.inc"} +{$INCLUDE "config.inc"} {$IFDEF IPHONEOS} // called by pascal code, they deal with the objc code diff -r e33ecd95aa1a -r 908851e59958 hedgewars/config.inc.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hedgewars/config.inc.in Wed Mar 03 15:04:39 2010 +0000 @@ -0,0 +1,21 @@ +(* + * Hedgewars, a free turn based strategy game + * Copyright (c) 2006, 2007 Andrey Korotaev + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + *) + +const cNetProtoVersion = ${HEDGEWARS_PROTO_VER}; + cVersionString = '${HEDGEWARS_VERSION}'; + cLuaLibrary = '${LUA_LIBRARY}'; diff -r e33ecd95aa1a -r 908851e59958 hedgewars/proto.inc.in --- a/hedgewars/proto.inc.in Wed Mar 03 14:49:10 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -(* - * Hedgewars, a free turn based strategy game - * Copyright (c) 2006, 2007 Andrey Korotaev - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - *) - -const cNetProtoVersion = ${HEDGEWARS_PROTO_VER}; - cVersionString = '${HEDGEWARS_VERSION}'; diff -r e33ecd95aa1a -r 908851e59958 hedgewars/uConsts.pas --- a/hedgewars/uConsts.pas Wed Mar 03 14:49:10 2010 +0000 +++ b/hedgewars/uConsts.pas Wed Mar 03 15:04:39 2010 +0000 @@ -29,7 +29,7 @@ {$ENDIF} -{$INCLUDE "proto.inc"} +{$INCLUDE "config.inc"} // typed const is a variable despite const qualifier // in freepascal you may actually use var for the same purpose diff -r e33ecd95aa1a -r 908851e59958 hedgewars/uRandom.pas --- a/hedgewars/uRandom.pas Wed Mar 03 14:49:10 2010 +0000 +++ b/hedgewars/uRandom.pas Wed Mar 03 15:04:39 2010 +0000 @@ -21,7 +21,7 @@ unit uRandom; interface uses uFloat; -{$INCLUDE "proto.inc"} +{$INCLUDE "config.inc"} procedure init_uRandom; procedure free_uRandom; diff -r e33ecd95aa1a -r 908851e59958 hedgewars/uScript.pas --- a/hedgewars/uScript.pas Wed Mar 03 14:49:10 2010 +0000 +++ b/hedgewars/uScript.pas Wed Mar 03 15:04:39 2010 +0000 @@ -207,7 +207,7 @@ end else begin - ParseCommand('addteam ' + lua_tostring(L, 2) + ' ' + lua_tostring(L, 1), true); + ParseCommand('addteam x ' + lua_tostring(L, 2) + ' ' + lua_tostring(L, 1), true); ParseCommand('grave ' + lua_tostring(L, 3), true); ParseCommand('fort ' + lua_tostring(L, 4), true); ParseCommand('voicepack ' + lua_tostring(L, 5), true);