From 9ff29461f97aba34ec09a104fecbb1aafda6994e Mon Sep 17 00:00:00 2001 From: nkorslund Date: Tue, 13 Oct 2009 20:35:56 +0000 Subject: [PATCH] fixed 'noSound' linker error git-svn-id: https://openmw.svn.sourceforge.net/svnroot/openmw/trunk@135 ea6a568a-9f4f-0410-981a-c910a81bb256 --- core/config.d | 3 +++ input/events.d | 4 +--- openmw.d | 14 ++++++-------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/core/config.d b/core/config.d index bb44c89c4..55daa2be1 100644 --- a/core/config.d +++ b/core/config.d @@ -72,6 +72,9 @@ struct ConfigManager // Other settings bool firstRun; + // Set to true if sound is completely disabled + bool noSound = false; + // Number of current screen shot. Saved upon exit, so that shots // from separate sessions don't overwrite each other. int screenShotNum; diff --git a/input/events.d b/input/events.d index 0158a0aa4..9273c7129 100644 --- a/input/events.d +++ b/input/events.d @@ -45,8 +45,6 @@ import gui.gui; import input.keys; import input.ois; -import openmw; - // Debug output //debug=printMouse; // Mouse button events //debug=printMouseMove; // Mouse movement events @@ -345,7 +343,7 @@ extern(C) int d_frameStarted(float time) playerData.position.position[1] = y; playerData.position.position[2] = z; - if(!noSound) + if(!config.noSound) { // Tell the sound scene that the player has moved sndCumTime += time; diff --git a/openmw.d b/openmw.d index ce6d43a1f..33a492eb8 100644 --- a/openmw.d +++ b/openmw.d @@ -81,8 +81,6 @@ void poolSize() } //*/ -bool noSound = false; - void main(char[][] args) { bool render = true; @@ -116,7 +114,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 if(a == "-ns") config.noSound = true; else if(a == "-debug") { // Enable Monster debug output @@ -192,7 +190,7 @@ void main(char[][] args) return; } - if(!noSound) initializeSound(); + if(!config.noSound) initializeSound(); resources.initResources(); // Load all ESM and ESP files @@ -300,7 +298,7 @@ Try specifying another cell name on the command line, or edit openmw.ini."); { NodePtr n = putObject(ls.m.model, ls.getPos(), ls.getScale()); ls.lightNode = attachLight(n, ls.m.data.color, ls.m.data.radius); - if(!noSound) + if(!config.noSound) { Sound *s = ls.m.sound; if(s) @@ -321,7 +319,7 @@ Try specifying another cell name on the command line, or edit openmw.ini."); { NodePtr n = putObject(ls.m.model, ls.getPos(), ls.getScale(), true); ls.lightNode = attachLight(n, ls.m.data.color, ls.m.data.radius); - if(!noSound) + if(!config.noSound) { Sound *s = ls.m.sound; if(s) @@ -389,7 +387,7 @@ Try specifying another cell name on the command line, or edit openmw.ini."); startGUI(); // Play some old tunes - if(!noSound) + if(!config.noSound) Music.play(); // Run it until the user tells us to quit @@ -397,7 +395,7 @@ Try specifying another cell name on the command line, or edit openmw.ini."); } else if(debugOut) writefln("Skipping rendering"); - if(!noSound) + if(!config.noSound) { soundScene.kill(); shutdownSound();