From 93b30540541734ec62505344267010ee932feabc Mon Sep 17 00:00:00 2001 From: nkorslund Date: Sat, 5 Jul 2008 18:59:54 +0000 Subject: [PATCH] Closing in on a windows build (not quite there yet) git-svn-id: https://openmw.svn.sourceforge.net/svnroot/openmw/trunk@8 ea6a568a-9f4f-0410-981a-c910a81bb256 --- bsa/bsatool.d => bsatool.d | 2 +- core/filefinder.d | 2 +- core/inifile.d | 8 +++- dsss.conf | 9 ++-- esm/esmtool.d => esmtool.d | 2 +- morro.ini | 88 +++++++++++++++++++------------------- nif/niftool.d => niftool.d | 2 +- nodsss_openmw.bat | 23 ++++++++++ ogre.cfg | 26 ++++++++--- ogre.cfg.linux | 7 +++ ogre.cfg.win32 | 19 ++++++++ ogre/cpp_interface.cpp | 8 +++- plugins.cfg | 13 +++--- plugins.cfg.linux | 13 ++++++ plugins.cfg.win32 | 14 ++++++ 15 files changed, 166 insertions(+), 70 deletions(-) rename bsa/bsatool.d => bsatool.d (99%) rename esm/esmtool.d => esmtool.d (99%) rename nif/niftool.d => niftool.d (98%) create mode 100755 nodsss_openmw.bat create mode 100644 ogre.cfg.linux create mode 100755 ogre.cfg.win32 create mode 100644 plugins.cfg.linux create mode 100755 plugins.cfg.win32 diff --git a/bsa/bsatool.d b/bsatool.d similarity index 99% rename from bsa/bsatool.d rename to bsatool.d index b8282548a..956883941 100644 --- a/bsa/bsatool.d +++ b/bsatool.d @@ -21,7 +21,7 @@ */ -module bsa.bsatool; +module bsatool; import std.stdio; diff --git a/core/filefinder.d b/core/filefinder.d index 66512e533..ec57e8466 100644 --- a/core/filefinder.d +++ b/core/filefinder.d @@ -221,4 +221,4 @@ struct FilenameHasher } } -version(Windows) alias CITextHasher FilenameHasher; +version(Windows) alias CITextHash FilenameHasher; diff --git a/core/inifile.d b/core/inifile.d index 2727fa5d5..5e3cba11c 100644 --- a/core/inifile.d +++ b/core/inifile.d @@ -39,8 +39,14 @@ struct IniWriter void openFile(char[] file) { if(ini is null) ini = new File(); + char[] oldFile = file~".old"; + + // Windows doesn't support renaming into an existing file + version(Windows) + if(exists(oldFile)) remove(oldFile); + if(exists(file)) - rename(file, file~".old"); + rename(file, oldFile); ini.open(file, FileMode.OutNew); } diff --git a/dsss.conf b/dsss.conf index 210e5cbe7..f139b32b4 100644 --- a/dsss.conf +++ b/dsss.conf @@ -19,14 +19,12 @@ prebuild += dsss clean niftool ########################### # Bsa inspection tool # ########################### -[bsa/bsatool.d] -target=bsatool +[bsatool.d] ########################### # Esm inspection tool # ########################### -[esm/esmtool.d] -target=esmtool +[esmtool.d] # Because of interdepencies between the ESM code and the resource # manager, we have to include all the C++ stuff. buildflags = -llOgreMain -llaudiere -llOIS cpp_audiere.o cpp_ogre.o @@ -34,8 +32,7 @@ buildflags = -llOgreMain -llaudiere -llOIS cpp_audiere.o cpp_ogre.o ########################### # Nif inspection tool # ########################### -[nif/niftool.d] -target=niftool +[niftool.d] buildflags = -debug=warnstd -debug=check -debug=statecheck -debug=strict -debug=verbose # Clean the nif object files to make sure they are recompiled in debug mode prebuild = dsss clean niftool diff --git a/esm/esmtool.d b/esmtool.d similarity index 99% rename from esm/esmtool.d rename to esmtool.d index 1ceb6d4f9..c63e583ee 100644 --- a/esm/esmtool.d +++ b/esmtool.d @@ -21,7 +21,7 @@ */ -module esm.esmtool; +module esmtool; import std.stdio; diff --git a/morro.ini b/morro.ini index b4cbf3cff..45d34f718 100644 --- a/morro.ini +++ b/morro.ini @@ -1,44 +1,44 @@ -; Don't write your own comments in this file, they -; will disappear when the file is rewritten. -[General] -ESM Directory=data/ -BSA Directory=data/ -SFX Directory=data/Sound/ -Explore Music Directory=data/Music/Explore/ -Battle Music Directory=data/Music/Battle/ -Screenshots=11 -Default Cell=Sud - -[Controls] -Mouse Sensitivity X=0.2 -Mouse Sensitivity Y=0.2 -Flip Mouse Y Axis=no - -[Bindings] -; Key bindings. The strings must match exactly. -Move Left=a,left -Move Right=d,right -Turn Left= -Turn Right= -Move Forward=w,up -Move Backward=s,down -Move Up=left_shift -Move Down=left_ctrl -Increase Main Volume=numpad_plus -Decrease Main Volume=numpad_minus -Increase Music Volume=2 -Decrease Music Volume=1 -Increase SFX Volume=4 -Decrease SFX Volume=3 -Mute Sound=m -Toggle Battle Music=space -OGRE Test Action=g -Pause=pause,p -Screen Shot=print_screen -Quick Exit=q,escape - -[Sound] -Main Volume=0.7 -Music Volume=0.4 -SFX Volume=0.6 -Enable Music=yes +; Don't write your own comments in this file, they +; will disappear when the file is rewritten. +[General] +ESM Directory=data/ +BSA Directory=data/ +SFX Directory=data/Sound/ +Explore Music Directory=data/Music/Explore/ +Battle Music Directory=data/Music/Battle/ +Screenshots=11 +Default Cell=Sud + +[Controls] +Mouse Sensitivity X=0.20000000298023223877 +Mouse Sensitivity Y=0.20000000298023223877 +Flip Mouse Y Axis=no + +[Bindings] +; Key bindings. The strings must match exactly. +Move Left=a,left +Move Right=d,right +Turn Left= +Turn Right= +Move Forward=w,up +Move Backward=s,down +Move Up=left_shift +Move Down=left_ctrl +Increase Main Volume=numpad_plus +Decrease Main Volume=numpad_minus +Increase Music Volume=2 +Decrease Music Volume=1 +Increase SFX Volume=4 +Decrease SFX Volume=3 +Mute Sound=m +Toggle Battle Music=space +OGRE Test Action=g +Pause=pause,p +Screen Shot=print_screen +Quick Exit=q,escape + +[Sound] +Main Volume=0.6999999880790710449 +Music Volume=0.40000000596046447754 +SFX Volume=0.60000002384185791016 +Enable Music=yes diff --git a/nif/niftool.d b/niftool.d similarity index 98% rename from nif/niftool.d rename to niftool.d index 6e60d23c3..5dfde5235 100644 --- a/nif/niftool.d +++ b/niftool.d @@ -21,7 +21,7 @@ */ -module nif.niftool; +module niftool; import nif.nif; import nif.niffile; diff --git a/nodsss_openmw.bat b/nodsss_openmw.bat new file mode 100755 index 000000000..133992313 --- /dev/null +++ b/nodsss_openmw.bat @@ -0,0 +1,23 @@ +@echo off +rem See INSTALL.txt for instructions. + +rem This batch file assumes you have run nodsss_monster.bat in the +rem Monster directory. It assumes Monster is located in ..\monster, +rem Ogre in ..\ogre and Audiere in ..\audiere + +echo Compiling C++ files +g++ -c sound\cpp_audiere.cpp -I..\audiere\include +g++ -c ogre\cpp_ogre.cpp -I..\ogre\include + +copy ..\ogre\bin\debug\ogremain_d.dll . +copy ..\ogre\bin\debug\ois_d.dll . +copy ..\ogre\bin\debug\cg.dll . +copy ..\audiere\bin\audiere.dll . +copy \windows\system32\d3dx9_30.dll d3dx9d_30.dll + +echo Compiling main program (morro.exe) +gdc morro.d bsa\*.d core\*.d esm\*.d input\*.d nif\*.d ogre\*.d scene\*.d sound\*.d util\*.d cpp_audiere.o cpp_ogre.o ..\monster\monster\util\*.d ..\monster\monster\minibos\*.d ..\monster\monster\minibos\c\*.d ..\monster\monster\minibos\c\windows\*.d -I..\monster ogremain_d.dll ..\audiere\lib\audiere.lib OIS_d.dll -lstdc++ -o morro.exe + +echo Setting up the correct Ogre cfg files +copy ogre.cfg.win32 ogre.cfg +copy plugins.cfg.win32 plugins.cfg diff --git a/ogre.cfg b/ogre.cfg index 90dc40523..3a7853b05 100644 --- a/ogre.cfg +++ b/ogre.cfg @@ -1,7 +1,19 @@ -Render System=OpenGL Rendering Subsystem - -[OpenGL Rendering Subsystem] -FSAA=0 -Full Screen=No -RTT Preferred Mode=FBO -Video Mode=800 x 600 +Render System=Direct3D9 Rendering Subsystem + +[Direct3D9 Rendering Subsystem] +Allow NVPerfHUD=No +Anti aliasing=None +Floating-point mode=Fastest +Full Screen=No +Rendering Device=NVIDIA Quadro NVS 135M +VSync=No +Video Mode=800 x 600 @ 32-bit colour + +[OpenGL Rendering Subsystem] +Colour Depth=32 +Display Frequency=N/A +FSAA=0 +Full Screen=No +RTT Preferred Mode=FBO +VSync=No +Video Mode=800 x 600 diff --git a/ogre.cfg.linux b/ogre.cfg.linux new file mode 100644 index 000000000..90dc40523 --- /dev/null +++ b/ogre.cfg.linux @@ -0,0 +1,7 @@ +Render System=OpenGL Rendering Subsystem + +[OpenGL Rendering Subsystem] +FSAA=0 +Full Screen=No +RTT Preferred Mode=FBO +Video Mode=800 x 600 diff --git a/ogre.cfg.win32 b/ogre.cfg.win32 new file mode 100755 index 000000000..c676565f4 --- /dev/null +++ b/ogre.cfg.win32 @@ -0,0 +1,19 @@ +Render System=Direct3D9 Rendering Subsystem + +[Direct3D9 Rendering Subsystem] +Allow NVPerfHUD=No +Anti aliasing=None +Floating-point mode=Fastest +Full Screen=No +Rendering Device= +VSync=No +Video Mode=800 x 600 @ 32-bit colour + +[OpenGL Rendering Subsystem] +Colour Depth=32 +Display Frequency=60 +FSAA=0 +Full Screen=No +RTT Preferred Mode=FBO +VSync=No +Video Mode=800 x 600 diff --git a/ogre/cpp_interface.cpp b/ogre/cpp_interface.cpp index 3e6968ad2..d032a641e 100644 --- a/ogre/cpp_interface.cpp +++ b/ogre/cpp_interface.cpp @@ -74,8 +74,12 @@ extern "C" int32_t cpp_configure() // You can skip this and use root.restoreConfig() to load configuration // settings if you were sure there are valid ones saved in ogre.cfg - //if(mRoot->showConfigDialog()) - if(mRoot->restoreConfig()) + // TODO: This should be controlled through the ini file. It's + // sensible to open the dialoge the first time, and later only + // open it when a command line parameter is given. + + if(mRoot->showConfigDialog()) + //if(mRoot->restoreConfig()) return 0; return 1; } diff --git a/plugins.cfg b/plugins.cfg index 31deb6ef6..593f51d5e 100644 --- a/plugins.cfg +++ b/plugins.cfg @@ -1,13 +1,14 @@ # Defines plugins to load # Define plugin folder -PluginFolder=/usr/lib/OGRE +PluginFolder=..\Ogre\bin\debug\ # Define plugins -Plugin=RenderSystem_GL -Plugin=Plugin_ParticleFX -Plugin=Plugin_BSPSceneManager -Plugin=Plugin_OctreeSceneManager -# Plugin=Plugin_CgProgramManager +Plugin=RenderSystem_Direct3D9_d +Plugin=RenderSystem_GL_d +Plugin=Plugin_ParticleFX_d +Plugin=Plugin_BSPSceneManager_d +Plugin=Plugin_OctreeSceneManager_d +Plugin=Plugin_CgProgramManager_d diff --git a/plugins.cfg.linux b/plugins.cfg.linux new file mode 100644 index 000000000..31deb6ef6 --- /dev/null +++ b/plugins.cfg.linux @@ -0,0 +1,13 @@ +# Defines plugins to load + +# Define plugin folder +PluginFolder=/usr/lib/OGRE + +# Define plugins +Plugin=RenderSystem_GL +Plugin=Plugin_ParticleFX +Plugin=Plugin_BSPSceneManager +Plugin=Plugin_OctreeSceneManager +# Plugin=Plugin_CgProgramManager + + diff --git a/plugins.cfg.win32 b/plugins.cfg.win32 new file mode 100755 index 000000000..593f51d5e --- /dev/null +++ b/plugins.cfg.win32 @@ -0,0 +1,14 @@ +# Defines plugins to load + +# Define plugin folder +PluginFolder=..\Ogre\bin\debug\ + +# Define plugins +Plugin=RenderSystem_Direct3D9_d +Plugin=RenderSystem_GL_d +Plugin=Plugin_ParticleFX_d +Plugin=Plugin_BSPSceneManager_d +Plugin=Plugin_OctreeSceneManager_d +Plugin=Plugin_CgProgramManager_d + +