removed duplicate g_timer object (one was global, one was static to timer.cpp); set g_system earlier (might prevent a few race conditions)
svn-id: r10471
This commit is contained in:
parent
84ed3e272d
commit
17bf7b95aa
10 changed files with 17 additions and 27 deletions
|
@ -22,7 +22,6 @@
|
||||||
#include "sound/mididrv.h"
|
#include "sound/mididrv.h"
|
||||||
#include "sound/fmopl.h"
|
#include "sound/fmopl.h"
|
||||||
#include "sound/mixer.h"
|
#include "sound/mixer.h"
|
||||||
#include "base/engine.h" // for g_system
|
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
|
|
||||||
#define BASE_FREQ 250
|
#define BASE_FREQ 250
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
|
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "sound/mpu401.h"
|
#include "sound/mpu401.h"
|
||||||
#include "base/engine.h" // for g_system
|
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
#include "morphos.h"
|
#include "morphos.h"
|
||||||
#include "morphos_sound.h"
|
#include "morphos_sound.h"
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
|
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "sound/mpu401.h"
|
#include "sound/mpu401.h"
|
||||||
#include "base/engine.h" // for g_system
|
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
|
|
||||||
#include "Pa1Lib.h"
|
#include "Pa1Lib.h"
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#include "sound/mixer.h"
|
#include "sound/mixer.h"
|
||||||
|
|
||||||
/* FIXME - BIG HACK for MidiEmu */
|
/* FIXME - BIG HACK for MidiEmu */
|
||||||
OSystem *g_system = 0;
|
|
||||||
Engine *g_engine = 0;
|
Engine *g_engine = 0;
|
||||||
|
|
||||||
Engine::Engine(GameDetector *detector, OSystem *syst)
|
Engine::Engine(GameDetector *detector, OSystem *syst)
|
||||||
|
@ -39,9 +38,6 @@ Engine::Engine(GameDetector *detector, OSystem *syst)
|
||||||
|
|
||||||
_gameDataPath = detector->_gameDataPath;
|
_gameDataPath = detector->_gameDataPath;
|
||||||
|
|
||||||
g_system = _system; // FIXME - BIG HACK for MidiEmu
|
|
||||||
|
|
||||||
extern Timer *g_timer;
|
|
||||||
_timer = g_timer;
|
_timer = g_timer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,9 +60,6 @@ class GameDetector;
|
||||||
class Timer;
|
class Timer;
|
||||||
struct TargetSettings;
|
struct TargetSettings;
|
||||||
|
|
||||||
/* FIXME - BIG HACK for MidiEmu */
|
|
||||||
extern OSystem *g_system;
|
|
||||||
|
|
||||||
class Engine {
|
class Engine {
|
||||||
public:
|
public:
|
||||||
OSystem *_system;
|
OSystem *_system;
|
||||||
|
|
|
@ -85,7 +85,7 @@ const char *gScummVMFullVersion = "ScummVM 0.5.3cvs (" __DATE__ " " __TIME__ ")"
|
||||||
|
|
||||||
Config *g_config = 0;
|
Config *g_config = 0;
|
||||||
NewGui *g_gui = 0;
|
NewGui *g_gui = 0;
|
||||||
Timer *g_timer = 0;
|
OSystem *g_system = 0;
|
||||||
|
|
||||||
#if defined(WIN32) && defined(NO_CONSOLE)
|
#if defined(WIN32) && defined(NO_CONSOLE)
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
@ -197,10 +197,6 @@ static void launcherDialog(GameDetector &detector, OSystem *system) {
|
||||||
|
|
||||||
system->set_palette(dummy_palette, 0, 16);
|
system->set_palette(dummy_palette, 0, 16);
|
||||||
|
|
||||||
// FIXME - hack we use because LauncherDialog accesses g_system
|
|
||||||
extern OSystem *g_system;
|
|
||||||
g_system = system;
|
|
||||||
|
|
||||||
LauncherDialog dlg(g_gui, detector);
|
LauncherDialog dlg(g_gui, detector);
|
||||||
dlg.runModal();
|
dlg.runModal();
|
||||||
}
|
}
|
||||||
|
@ -281,6 +277,7 @@ int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
// Create the system object
|
// Create the system object
|
||||||
OSystem *system = detector.createSystem();
|
OSystem *system = detector.createSystem();
|
||||||
|
g_system = system;
|
||||||
|
|
||||||
// Set initial window caption
|
// Set initial window caption
|
||||||
prop.caption = "ScummVM";
|
prop.caption = "ScummVM";
|
||||||
|
|
|
@ -349,4 +349,7 @@ public:
|
||||||
//@}
|
//@}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** The global OSystem instance. Inited in main(). */
|
||||||
|
extern OSystem *g_system;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include "common/timer.h"
|
#include "common/timer.h"
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
|
|
||||||
static Timer *g_timer = NULL;
|
Timer *g_timer = NULL;
|
||||||
|
|
||||||
Timer::Timer(OSystem *system) :
|
Timer::Timer(OSystem *system) :
|
||||||
_system(system),
|
_system(system),
|
||||||
|
|
|
@ -60,6 +60,8 @@ protected:
|
||||||
int handler(int t);
|
int handler(int t);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern Timer *g_timer;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -24,8 +24,6 @@
|
||||||
#include "common/timer.h"
|
#include "common/timer.h"
|
||||||
#include "common/util.h" // for ARRAYSIZE
|
#include "common/util.h" // for ARRAYSIZE
|
||||||
|
|
||||||
extern Timer *g_timer;
|
|
||||||
|
|
||||||
void MidiChannel_MPU401::init(MidiDriver_MPU401 *owner, byte channel) {
|
void MidiChannel_MPU401::init(MidiDriver_MPU401 *owner, byte channel) {
|
||||||
_owner = owner;
|
_owner = owner;
|
||||||
_channel = channel;
|
_channel = channel;
|
||||||
|
@ -122,7 +120,7 @@ MidiChannel *MidiDriver_MPU401::allocateChannel() {
|
||||||
chan = &_midi_channels[i];
|
chan = &_midi_channels[i];
|
||||||
if (!chan->_allocated) {
|
if (!chan->_allocated) {
|
||||||
chan->allocate();
|
chan->allocate();
|
||||||
return (chan);
|
return chan;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue