diff --git a/build_openmw.bat b/build_openmw.bat index 6e06f9df2..3a25fa230 100755 --- a/build_openmw.bat +++ b/build_openmw.bat @@ -12,11 +12,13 @@ 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 ..\ffmpeg\libavcodec\cygavcodec-51.dll cygavcodec.dll -copy ..\ffmpeg\libavformat\cygavformat-52.dll cygavformat.dll -copy ..\ffmpeg\libavdevice\cygavdevice-52.dll cygavdevice.dll -copy ..\ffmpeg\libavutil\cygavutil-49.dll cygavutil.dll +copy ..\ogre\bin\debug\RenderSystem*.dll . +copy ..\ogre\bin\debug\Plugin*.dll . +copy ..\ffmpeg\libavcodec\avcodec-51.dll . +copy ..\ffmpeg\libavformat\avformat-52.dll . +copy ..\ffmpeg\libavdevice\avdevice-52.dll . +copy ..\ffmpeg\libavutil\avutil-49.dll . copy \windows\system32\d3dx9_30.dll d3dx9d_30.dll echo Compiling main program (openmw.exe) -gdc -Wall -g openmw.d bsa\*.d core\*.d esm\*.d input\*.d nif\*.d ogre\*.d scene\*.d sound\*.d util\*.d cpp_ogre.o cpp_avcodec.o monster\util\*.d cygavcodec.dll cygavformat.dll cygavdevice.dll cygavutil.dll openal32.dll ogremain_d.dll OIS_d.dll -lstdc++ -o openmw.exe +gdc -Wall -g openmw.d bsa\*.d core\*.d esm\*.d input\*.d nif\*.d ogre\*.d scene\*.d sound\*.d util\*.d cpp_ogre.o cpp_avcodec.o monster\util\*.d avcodec-51.dll avformat-52.dll avdevice-52.dll avutil-49.dll openal32.dll ogremain_d.dll OIS_d.dll -lstdc++ -o openmw.exe diff --git a/openmw.d b/openmw.d index f3cfe93c6..829e8f1db 100644 --- a/openmw.d +++ b/openmw.d @@ -63,6 +63,7 @@ void main(char[][] args) bool help = false; bool resetKeys = false; bool showOgreFlag = false; + bool noSound = false; // Some examples to try: // @@ -92,6 +93,7 @@ void main(char[][] args) else if(a == "-h") help=true; else if(a == "-rk") resetKeys = true; else if(a == "-oc") showOgreFlag = true; + else if(a == "-ns") noSound = true; else cells ~= a; if(cells.length + eCells.length/2 > 1 ) @@ -107,7 +109,8 @@ void main(char[][] args) writefln(" -n Only load, do not render"); writefln(" -ex,y Load exterior cell (x,y)"); writefln(" -rk Reset key bindings to default"); - writefln(" -oc Show the Ogre config dialogue"); + writefln(" -oc Show the Ogre config dialogue"); + writefln(" -ns Completely disable sound"); writefln(" -h Show this help"); writefln(""); writefln("Specifying more than one cell implies -n"); @@ -155,7 +158,7 @@ void main(char[][] args) return; } - initializeSound(); + if(!noSound) initializeSound(); resources.initResources(); // Load all ESM and ESP files @@ -244,12 +247,6 @@ void main(char[][] args) cpp_makeSky(); } - // TODO: We get some strange lamp-shaped activators in some scenes, - // eg in Abebaal. These are sound activators (using scripts), but - // they still appear. Find out if they have some special flags - // somewhere (eg. only-show-in-editor), or if we just have to filter - // them by the "Sound_*" name. Deal with it later. - // Insert the meshes of statics into the scene foreach(ref LiveStatic ls; cd.statics) putObject(ls.m.model, &ls.base.pos, ls.base.scale); @@ -258,8 +255,10 @@ void main(char[][] args) { NodePtr n = putObject(ls.m.model, &ls.base.pos, ls.base.scale); ls.lightNode = attachLight(n, ls.m.data.color, ls.m.data.radius); - Sound *s = ls.m.sound; - if(s) + if(!noSound) + { + Sound *s = ls.m.sound; + if(s) { writefln("Dynamic light %s has sound %s", ls.m.id, s.id); ls.loopSound = soundScene.insert(s, true); @@ -268,12 +267,15 @@ void main(char[][] args) ls.base.pos.position[1], ls.base.pos.position[2]); } + } } // Static lights foreach(ref LiveLight ls; cd.statLights) { NodePtr n = putObject(ls.m.model, &ls.base.pos, ls.base.scale); ls.lightNode = attachLight(n, ls.m.data.color, ls.m.data.radius); + if(!noSound) + { Sound *s = ls.m.sound; if(s) { @@ -284,6 +286,7 @@ void main(char[][] args) ls.base.pos.position[1], ls.base.pos.position[2]); } + } } // Misc items foreach(ref LiveMisc ls; cd.miscItems) @@ -336,15 +339,18 @@ void main(char[][] args) initializeInput(); // Start swangin' - jukebox.enableMusic(); + if(!noSound) jukebox.enableMusic(); // Run it until the user tells us to quit startRendering(); } else debug(verbose) writefln("Skipping rendering"); - soundScene.kill(); - shutdownSound(); + if(!noSound) + { + soundScene.kill(); + shutdownSound(); + } debug(verbose) {