- full support for all megaglest modules to compile with the following:

release / debug
 linux / windows
This commit is contained in:
Mark Vejvoda
2010-12-08 20:03:15 +00:00
parent 7341886b11
commit 7a7bc828f1
7 changed files with 81 additions and 24 deletions

View File

@@ -131,7 +131,8 @@
</Linker> </Linker>
</Target> </Target>
<Target title="Release Win32"> <Target title="Release Win32">
<Option output="glest_game.exe" prefix_auto="0" extension_auto="0" /> <Option output="../../data/glest_game/glest_game.exe" prefix_auto="0" extension_auto="0" />
<Option working_dir="../../data/glest_game/" />
<Option object_output="Release Win32/glest_game" /> <Option object_output="Release Win32/glest_game" />
<Option type="1" /> <Option type="1" />
<Option compiler="mingw32_compiler" /> <Option compiler="mingw32_compiler" />
@@ -267,6 +268,7 @@
<Add option="-frounding-math" /> <Add option="-frounding-math" />
<Add option="-fsignaling-nans" /> <Add option="-fsignaling-nans" />
<Add option="-mfpmath=sse -msse" /> <Add option="-mfpmath=sse -msse" />
<Add option="`sdl-config --cflags`" />
<Add option="-DNDEBUG" /> <Add option="-DNDEBUG" />
<Add option="-DUSE_STREFLOP" /> <Add option="-DUSE_STREFLOP" />
<Add option="-DSTREFLOP_SSE" /> <Add option="-DSTREFLOP_SSE" />
@@ -298,7 +300,6 @@
<Add directory="../../source/shared_lib/include/streflop" /> <Add directory="../../source/shared_lib/include/streflop" />
<Add directory="../../source/shared_lib/include/platform/common" /> <Add directory="../../source/shared_lib/include/platform/common" />
<Add directory="../../source/shared_lib/include/map" /> <Add directory="../../source/shared_lib/include/map" />
<Add directory="$(THIRDPARTY_INCLUDE_DIR)/SDL" />
<Add directory="$(THIRDPARTY_INCLUDE_DIR)/lua5.1" /> <Add directory="$(THIRDPARTY_INCLUDE_DIR)/lua5.1" />
</Compiler> </Compiler>
<ResourceCompiler> <ResourceCompiler>
@@ -331,6 +332,7 @@
<Add directory="../../source/shared_lib/include/map" /> <Add directory="../../source/shared_lib/include/map" />
</ResourceCompiler> </ResourceCompiler>
<Linker> <Linker>
<Add option="`sdl-config --libs`" />
<Add library="ogg" /> <Add library="ogg" />
<Add library="vorbis" /> <Add library="vorbis" />
<Add library="vorbisfile" /> <Add library="vorbisfile" />
@@ -367,6 +369,7 @@
<Add option="-frounding-math" /> <Add option="-frounding-math" />
<Add option="-fsignaling-nans" /> <Add option="-fsignaling-nans" />
<Add option="-mfpmath=sse -msse" /> <Add option="-mfpmath=sse -msse" />
<Add option="`sdl-config --cflags`" />
<Add option="-DDEBUG" /> <Add option="-DDEBUG" />
<Add option="-DUSE_STREFLOP" /> <Add option="-DUSE_STREFLOP" />
<Add option="-DSTREFLOP_SSE" /> <Add option="-DSTREFLOP_SSE" />
@@ -398,7 +401,6 @@
<Add directory="../../source/shared_lib/include/streflop" /> <Add directory="../../source/shared_lib/include/streflop" />
<Add directory="../../source/shared_lib/include/platform/common" /> <Add directory="../../source/shared_lib/include/platform/common" />
<Add directory="../../source/shared_lib/include/map" /> <Add directory="../../source/shared_lib/include/map" />
<Add directory="$(THIRDPARTY_INCLUDE_DIR)/SDL" />
<Add directory="$(THIRDPARTY_INCLUDE_DIR)/lua5.1" /> <Add directory="$(THIRDPARTY_INCLUDE_DIR)/lua5.1" />
</Compiler> </Compiler>
<ResourceCompiler> <ResourceCompiler>
@@ -431,6 +433,7 @@
<Add directory="../../source/shared_lib/include/map" /> <Add directory="../../source/shared_lib/include/map" />
</ResourceCompiler> </ResourceCompiler>
<Linker> <Linker>
<Add option="`sdl-config --libs`" />
<Add library="ogg" /> <Add library="ogg" />
<Add library="vorbis" /> <Add library="vorbis" />
<Add library="vorbisfile" /> <Add library="vorbisfile" />
@@ -450,8 +453,8 @@
<Add directory="../../source/linux_deps/lib" /> <Add directory="../../source/linux_deps/lib" />
</Linker> </Linker>
<Environment> <Environment>
<Variable name="THIRDPARTY_LIB_DIR" value="/usr/lib" />
<Variable name="THIRDPARTY_INCLUDE_DIR" value="/usr/include" /> <Variable name="THIRDPARTY_INCLUDE_DIR" value="/usr/include" />
<Variable name="THIRDPARTY_LIB_DIR" value="/usr/lib" />
</Environment> </Environment>
</Target> </Target>
</Build> </Build>

View File

@@ -4,10 +4,10 @@
<File name="../../source/glest_game/ai/ai.cpp" open="1" top="0" tabpos="9"> <File name="../../source/glest_game/ai/ai.cpp" open="1" top="0" tabpos="9">
<Cursor position="12418" topLine="415" /> <Cursor position="12418" topLine="415" />
</File> </File>
<File name="../../source/glest_game/facilities/game_util.cpp" open="1" top="0" tabpos="10"> <File name="../../source/glest_game/facilities/game_util.cpp" open="1" top="0" tabpos="12">
<Cursor position="4305" topLine="136" /> <Cursor position="1286" topLine="27" />
</File> </File>
<File name="../../source/glest_game/facilities/game_util.h" open="1" top="0" tabpos="11"> <File name="../../source/glest_game/facilities/game_util.h" open="0" top="0" tabpos="11">
<Cursor position="1282" topLine="0" /> <Cursor position="1282" topLine="0" />
</File> </File>
<File name="../../source/glest_game/game/game.cpp" open="1" top="0" tabpos="5"> <File name="../../source/glest_game/game/game.cpp" open="1" top="0" tabpos="5">
@@ -19,9 +19,18 @@
<File name="../../source/glest_game/global/core_data.cpp" open="1" top="0" tabpos="3"> <File name="../../source/glest_game/global/core_data.cpp" open="1" top="0" tabpos="3">
<Cursor position="836" topLine="138" /> <Cursor position="836" topLine="138" />
</File> </File>
<File name="../../source/glest_game/global/core_data.h" open="1" top="1" tabpos="17">
<Cursor position="603" topLine="1" />
</File>
<File name="../../source/glest_game/global/lang.cpp" open="1" top="0" tabpos="4"> <File name="../../source/glest_game/global/lang.cpp" open="1" top="0" tabpos="4">
<Cursor position="900" topLine="17" /> <Cursor position="900" topLine="17" />
</File> </File>
<File name="../../source/glest_game/graphics/particle_type.cpp" open="1" top="0" tabpos="0">
<Cursor position="0" topLine="0" />
</File>
<File name="../../source/glest_game/graphics/particle_type.h" open="0" top="0" tabpos="0">
<Cursor position="654" topLine="2" />
</File>
<File name="../../source/glest_game/graphics/renderer.cpp" open="1" top="0" tabpos="7"> <File name="../../source/glest_game/graphics/renderer.cpp" open="1" top="0" tabpos="7">
<Cursor position="4897" topLine="109" /> <Cursor position="4897" topLine="109" />
</File> </File>
@@ -34,11 +43,11 @@
<File name="../../source/glest_game/menu/menu_state_connected_game.cpp" open="0" top="0" tabpos="11"> <File name="../../source/glest_game/menu/menu_state_connected_game.cpp" open="0" top="0" tabpos="11">
<Cursor position="12506" topLine="308" /> <Cursor position="12506" topLine="308" />
</File> </File>
<File name="../../source/glest_game/menu/menu_state_custom_game.cpp" open="1" top="1" tabpos="15"> <File name="../../source/glest_game/menu/menu_state_custom_game.cpp" open="1" top="0" tabpos="11">
<Cursor position="77903" topLine="1933" /> <Cursor position="77903" topLine="1933" />
</File> </File>
<File name="../../source/glest_game/network/network_manager.cpp" open="1" top="0" tabpos="14"> <File name="../../source/glest_game/network/network_manager.cpp" open="1" top="0" tabpos="10">
<Cursor position="2716" topLine="42" /> <Cursor position="2716" topLine="34" />
</File> </File>
<File name="../../source/glest_game/type_instances/unit.cpp" open="1" top="0" tabpos="8"> <File name="../../source/glest_game/type_instances/unit.cpp" open="1" top="0" tabpos="8">
<Cursor position="50789" topLine="1676" /> <Cursor position="50789" topLine="1676" />

View File

@@ -4,6 +4,8 @@
<Project filename="libstreflop.cbp" /> <Project filename="libstreflop.cbp" />
<Project filename="shared_lib.cbp" /> <Project filename="shared_lib.cbp" />
<Project filename="glest_game.cbp" /> <Project filename="glest_game.cbp" />
<Project filename="glest_editor.cbp" active="1" /> <Project filename="glest_editor.cbp" />
<Project filename="g3d_viewer.cbp" active="1" />
<Project filename="glest_configurator.cbp" />
</Workspace> </Workspace>
</CodeBlocks_workspace_file> </CodeBlocks_workspace_file>

View File

@@ -214,6 +214,7 @@
<Add option="-fsignaling-nans" /> <Add option="-fsignaling-nans" />
<Add option="-mfpmath=sse -msse" /> <Add option="-mfpmath=sse -msse" />
<Add option="-fPIC" /> <Add option="-fPIC" />
<Add option="`sdl-config --cflags`" />
<Add option="-DNDEBUG" /> <Add option="-DNDEBUG" />
<Add option="-DUSE_STREFLOP" /> <Add option="-DUSE_STREFLOP" />
<Add option="-DSTREFLOP_SSE" /> <Add option="-DSTREFLOP_SSE" />
@@ -234,7 +235,6 @@
<Add directory="../../source/shared_lib/include/streflop/libm_flt32_source" /> <Add directory="../../source/shared_lib/include/streflop/libm_flt32_source" />
<Add directory="../../source/shared_lib/include/platform/common" /> <Add directory="../../source/shared_lib/include/platform/common" />
<Add directory="../../source/shared_lib/include/map" /> <Add directory="../../source/shared_lib/include/map" />
<Add directory="$(THIRDPARTY_INCLUDE_DIR)/SDL" />
<Add directory="$(THIRDPARTY_INCLUDE_DIR)/lua5.1" /> <Add directory="$(THIRDPARTY_INCLUDE_DIR)/lua5.1" />
</Compiler> </Compiler>
<ResourceCompiler> <ResourceCompiler>
@@ -255,6 +255,7 @@
<Add directory="../../source/shared_lib/include/map" /> <Add directory="../../source/shared_lib/include/map" />
</ResourceCompiler> </ResourceCompiler>
<Linker> <Linker>
<Add option="`sdl-config --libs`" />
<Add library="jpeg" /> <Add library="jpeg" />
<Add library="lua5.1" /> <Add library="lua5.1" />
<Add library="png" /> <Add library="png" />
@@ -271,8 +272,8 @@
<Add directory="../../source/linux_deps/lib" /> <Add directory="../../source/linux_deps/lib" />
</Linker> </Linker>
<Environment> <Environment>
<Variable name="THIRDPARTY_LIB_DIR" value="/usr/lib" />
<Variable name="THIRDPARTY_INCLUDE_DIR" value="/usr/include" /> <Variable name="THIRDPARTY_INCLUDE_DIR" value="/usr/include" />
<Variable name="THIRDPARTY_LIB_DIR" value="/usr/lib" />
</Environment> </Environment>
</Target> </Target>
<Target title="Debug Linux"> <Target title="Debug Linux">
@@ -301,6 +302,7 @@
<Add option="-fsignaling-nans" /> <Add option="-fsignaling-nans" />
<Add option="-mfpmath=sse -msse" /> <Add option="-mfpmath=sse -msse" />
<Add option="-fPIC" /> <Add option="-fPIC" />
<Add option="`sdl-config --cflags`" />
<Add option="-DDEBUG" /> <Add option="-DDEBUG" />
<Add option="-DUSE_STREFLOP" /> <Add option="-DUSE_STREFLOP" />
<Add option="-DSTREFLOP_SSE" /> <Add option="-DSTREFLOP_SSE" />
@@ -321,7 +323,6 @@
<Add directory="../../source/shared_lib/include/streflop/libm_flt32_source" /> <Add directory="../../source/shared_lib/include/streflop/libm_flt32_source" />
<Add directory="../../source/shared_lib/include/platform/common" /> <Add directory="../../source/shared_lib/include/platform/common" />
<Add directory="../../source/shared_lib/include/map" /> <Add directory="../../source/shared_lib/include/map" />
<Add directory="$(THIRDPARTY_INCLUDE_DIR)/SDL" />
<Add directory="$(THIRDPARTY_INCLUDE_DIR)/lua5.1" /> <Add directory="$(THIRDPARTY_INCLUDE_DIR)/lua5.1" />
</Compiler> </Compiler>
<ResourceCompiler> <ResourceCompiler>
@@ -342,6 +343,7 @@
<Add directory="../../source/shared_lib/include/map" /> <Add directory="../../source/shared_lib/include/map" />
</ResourceCompiler> </ResourceCompiler>
<Linker> <Linker>
<Add option="`sdl-config --libs`" />
<Add library="jpeg" /> <Add library="jpeg" />
<Add library="lua5.1" /> <Add library="lua5.1" />
<Add library="png" /> <Add library="png" />

View File

@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_layout_file> <CodeBlocks_layout_file>
<ActiveTarget name="Debug Win32" /> <ActiveTarget name="Release Win32" />
<File name="../../source/shared_lib/include/graphics/graphics_interface.h" open="0" top="0" tabpos="0"> <File name="../../source/shared_lib/include/graphics/graphics_interface.h" open="0" top="0" tabpos="0">
<Cursor position="566" topLine="0" /> <Cursor position="566" topLine="0" />
</File> </File>
<File name="../../source/shared_lib/include/lua/lua_script.h" open="1" top="0" tabpos="26"> <File name="../../source/shared_lib/include/lua/lua_script.h" open="1" top="0" tabpos="12">
<Cursor position="558" topLine="0" /> <Cursor position="558" topLine="0" />
</File> </File>
<File name="../../source/shared_lib/include/platform/common/platform_common.h" open="1" top="0" tabpos="22"> <File name="../../source/shared_lib/include/platform/common/platform_common.h" open="1" top="0" tabpos="11">
<Cursor position="747" topLine="9" /> <Cursor position="747" topLine="9" />
</File> </File>
<File name="../../source/shared_lib/include/platform/posix/socket.h" open="0" top="0" tabpos="0"> <File name="../../source/shared_lib/include/platform/posix/socket.h" open="0" top="0" tabpos="0">
@@ -22,7 +22,7 @@
<File name="../../source/shared_lib/include/platform/sdl/thread.h" open="0" top="0" tabpos="0"> <File name="../../source/shared_lib/include/platform/sdl/thread.h" open="0" top="0" tabpos="0">
<Cursor position="557" topLine="0" /> <Cursor position="557" topLine="0" />
</File> </File>
<File name="../../source/shared_lib/include/streflop/FPUSettings.h" open="1" top="0" tabpos="18"> <File name="../../source/shared_lib/include/streflop/FPUSettings.h" open="1" top="0" tabpos="9">
<Cursor position="6002" topLine="172" /> <Cursor position="6002" topLine="172" />
</File> </File>
<File name="../../source/shared_lib/include/streflop/Random.h" open="0" top="0" tabpos="0"> <File name="../../source/shared_lib/include/streflop/Random.h" open="0" top="0" tabpos="0">
@@ -52,10 +52,10 @@
<File name="../../source/shared_lib/sources/platform/common/platform_common.cpp" open="0" top="0" tabpos="0"> <File name="../../source/shared_lib/sources/platform/common/platform_common.cpp" open="0" top="0" tabpos="0">
<Cursor position="507" topLine="0" /> <Cursor position="507" topLine="0" />
</File> </File>
<File name="../../source/shared_lib/sources/platform/common/simple_threads.cpp" open="1" top="1" tabpos="30"> <File name="../../source/shared_lib/sources/platform/common/simple_threads.cpp" open="1" top="0" tabpos="14">
<Cursor position="3961" topLine="82" /> <Cursor position="3961" topLine="82" />
</File> </File>
<File name="../../source/shared_lib/sources/platform/posix/socket.cpp" open="1" top="0" tabpos="27"> <File name="../../source/shared_lib/sources/platform/posix/socket.cpp" open="1" top="0" tabpos="13">
<Cursor position="686" topLine="14" /> <Cursor position="686" topLine="14" />
</File> </File>
<File name="../../source/shared_lib/sources/sound/openal/sound_player_openal.cpp" open="1" top="0" tabpos="7"> <File name="../../source/shared_lib/sources/sound/openal/sound_player_openal.cpp" open="1" top="0" tabpos="7">
@@ -64,13 +64,13 @@
<File name="../../source/shared_lib/sources/util/conversion.cpp" open="1" top="0" tabpos="6"> <File name="../../source/shared_lib/sources/util/conversion.cpp" open="1" top="0" tabpos="6">
<Cursor position="663" topLine="7" /> <Cursor position="663" topLine="7" />
</File> </File>
<File name="../../source/shared_lib/sources/util/profiler.cpp" open="1" top="0" tabpos="21"> <File name="../../source/shared_lib/sources/util/profiler.cpp" open="1" top="0" tabpos="10">
<Cursor position="1919" topLine="57" /> <Cursor position="1919" topLine="57" />
</File> </File>
<File name="../../source/shared_lib/sources/util/properties.cpp" open="1" top="0" tabpos="4"> <File name="../../source/shared_lib/sources/util/properties.cpp" open="1" top="0" tabpos="4">
<Cursor position="4900" topLine="115" /> <Cursor position="4900" topLine="115" />
</File> </File>
<File name="../../source/shared_lib/sources/util/util.cpp" open="1" top="0" tabpos="17"> <File name="../../source/shared_lib/sources/util/util.cpp" open="1" top="0" tabpos="8">
<Cursor position="0" topLine="0" /> <Cursor position="0" topLine="0" />
</File> </File>
</CodeBlocks_layout_file> </CodeBlocks_layout_file>

View File

@@ -218,7 +218,12 @@ void IntField::createControl(wxWindow *parent, wxSizer *sizer){
} }
void IntField::updateValue(){ void IntField::updateValue(){
#if defined(__MINGW32__)
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(textCtrl->GetValue()));
value = tmp_buf;
#else
value= (const char*)wxFNCONV(textCtrl->GetValue()); value= (const char*)wxFNCONV(textCtrl->GetValue());
#endif
} }
void IntField::updateControl(){ void IntField::updateControl(){
@@ -245,7 +250,13 @@ void FloatField::createControl(wxWindow *parent, wxSizer *sizer){
} }
void FloatField::updateValue(){ void FloatField::updateValue(){
#if defined(__MINGW32__)
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(textCtrl->GetValue()));
value = tmp_buf;
#else
value= (const char*)wxFNCONV(textCtrl->GetValue()); value= (const char*)wxFNCONV(textCtrl->GetValue());
#endif
} }
void FloatField::updateControl(){ void FloatField::updateControl(){
@@ -273,7 +284,13 @@ void StringField::createControl(wxWindow *parent, wxSizer *sizer){
} }
void StringField::updateValue(){ void StringField::updateValue(){
#if defined(__MINGW32__)
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(textCtrl->GetValue()));
value = tmp_buf;
#else
value= (const char*)wxFNCONV(textCtrl->GetValue()); value= (const char*)wxFNCONV(textCtrl->GetValue());
#endif
} }
void StringField::updateControl(){ void StringField::updateControl(){
@@ -298,7 +315,13 @@ void EnumField::createControl(wxWindow *parent, wxSizer *sizer){
} }
void EnumField::updateValue(){ void EnumField::updateValue(){
#if defined(__MINGW32__)
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(comboBox->GetValue()));
value = tmp_buf;
#else
value= (const char*)wxFNCONV(comboBox->GetValue()); value= (const char*)wxFNCONV(comboBox->GetValue());
#endif
} }
void EnumField::updateControl(){ void EnumField::updateControl(){
@@ -366,7 +389,12 @@ void FloatRangeField::createControl(wxWindow *parent, wxSizer *sizer){
} }
void FloatRangeField::updateValue(){ void FloatRangeField::updateValue(){
#if defined(__MINGW32__)
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(textCtrl->GetValue()));
value = tmp_buf;
#else
value= (const char*)wxFNCONV(textCtrl->GetValue()); value= (const char*)wxFNCONV(textCtrl->GetValue());
#endif
} }
void FloatRangeField::updateControl(){ void FloatRangeField::updateControl(){

View File

@@ -135,7 +135,13 @@ MainWindow::MainWindow(const string &modelPath)
wxInitAllImageHandlers(); wxInitAllImageHandlers();
#ifdef WIN32 #ifdef WIN32
wxIcon icon("IDI_ICON1");
#if defined(__MINGW32__)
wxIcon icon(ToUnicode("IDI_ICON1"));
#else
wxIcon icon("IDI_ICON1");
#endif
#else #else
wxIcon icon; wxIcon icon;
std::ifstream testFile("g3dviewer.ico"); std::ifstream testFile("g3dviewer.ico");
@@ -978,7 +984,14 @@ bool App::OnInit(){
std::cout << "Press R to restart particles, this also reloads all files if they are changed." << std::endl << std::endl; std::cout << "Press R to restart particles, this also reloads all files if they are changed." << std::endl << std::endl;
exit (0); exit (0);
} }
modelPath= wxFNCONV(argv[1]);
#if defined(__MINGW32__)
const wxWX2MBbuf tmp_buf = wxConvCurrent->cWX2MB(wxFNCONV(argv[1]));
modelPath = tmp_buf;
#else
modelPath = wxFNCONV(argv[1]);
#endif
} }
mainWindow= new MainWindow(modelPath); mainWindow= new MainWindow(modelPath);