aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2009-05-26 11:35:35 +0000
committerMax Horn2009-05-26 11:35:35 +0000
commitc5539b4e4e948825c0116194e06ddf3dbde3ed17 (patch)
tree3ea5b833659e673536bfd42b9d9cd5dcb6ec210f /engines
parent7fbbaff990e9a5b2f372d1c1d9ddb8d1c10644e3 (diff)
downloadscummvm-rg350-c5539b4e4e948825c0116194e06ddf3dbde3ed17.tar.gz
scummvm-rg350-c5539b4e4e948825c0116194e06ddf3dbde3ed17.tar.bz2
scummvm-rg350-c5539b4e4e948825c0116194e06ddf3dbde3ed17.zip
SCI: Preparing to transform sfx_player_t into a class
svn-id: r40911
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/module.mk2
-rw-r--r--engines/sci/sfx/player.h4
-rw-r--r--engines/sci/sfx/player/new_player.cpp (renamed from engines/sci/sfx/player/player.cpp)7
-rw-r--r--engines/sci/sfx/player/new_player.h37
-rw-r--r--engines/sci/sfx/player/polled.cpp4
-rw-r--r--engines/sci/sfx/player/polled.h37
-rw-r--r--engines/sci/sfx/player/realtime.cpp4
-rw-r--r--engines/sci/sfx/player/realtime.h (renamed from engines/sci/sfx/player/players.cpp)29
8 files changed, 87 insertions, 37 deletions
diff --git a/engines/sci/module.mk b/engines/sci/module.mk
index 979bf08cd9..6521aa4cac 100644
--- a/engines/sci/module.mk
+++ b/engines/sci/module.mk
@@ -63,7 +63,7 @@ MODULE_OBJS = \
sfx/iterator.o \
sfx/songlib.o \
sfx/device/devices.o \
- sfx/player/player.o \
+ sfx/player/new_player.o \
sfx/player/players.o \
sfx/player/polled.o \
sfx/player/realtime.o \
diff --git a/engines/sci/sfx/player.h b/engines/sci/sfx/player.h
index e2bf952d28..5a5da2c673 100644
--- a/engines/sci/sfx/player.h
+++ b/engines/sci/sfx/player.h
@@ -28,11 +28,11 @@
#ifndef SCI_SFX_SFX_PLAYER_H
#define SCI_SFX_SFX_PLAYER_H
+#include "common/scummsys.h"
+
#include "sci/resource.h"
#include "sci/sfx/iterator.h"
-#include "common/scummsys.h"
-
namespace Sci {
typedef void tell_synth_func(int buf_nr, byte *buf);
diff --git a/engines/sci/sfx/player/player.cpp b/engines/sci/sfx/player/new_player.cpp
index 5c811f8ab8..deb4d06d34 100644
--- a/engines/sci/sfx/player/player.cpp
+++ b/engines/sci/sfx/player/new_player.cpp
@@ -24,7 +24,7 @@
*/
#include "sci/tools.h"
-#include "sci/sfx/player.h"
+#include "sci/sfx/player/new_player.h"
#include "sci/sfx/sequencer.h"
#include "sci/sfx/iterator.h"
#include "sci/sfx/core.h"
@@ -36,7 +36,6 @@
namespace Sci {
-extern sfx_player_t sfx_player_player;
static MidiPlayer *mididrv;
static SongIterator *play_it = NULL;
@@ -135,7 +134,7 @@ static Common::Error player_init(ResourceManager *resmgr, int expected_latency)
assert(mididrv);
- sfx_player_player.polyphony = mididrv->getPolyphony();
+ sfx_new_player.polyphony = mididrv->getPolyphony();
tempo = mididrv->getBaseTempo();
uint32 time = g_system->getMillis();
@@ -230,7 +229,7 @@ static Common::Error player_exit(void) {
return Common::kNoError;
}
-sfx_player_t sfx_player_player = {
+sfx_player_t sfx_new_player = {
"new",
"0.1",
&player_set_option,
diff --git a/engines/sci/sfx/player/new_player.h b/engines/sci/sfx/player/new_player.h
new file mode 100644
index 0000000000..79c6d93acd
--- /dev/null
+++ b/engines/sci/sfx/player/new_player.h
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef SCI_SFX_SFX_PLAYER_NEW_H
+#define SCI_SFX_SFX_PLAYER_NEW_H
+
+#include "sci/sfx/player.h"
+
+namespace Sci {
+
+extern sfx_player_t sfx_new_player;
+
+} // End of namespace Sci
+
+#endif
diff --git a/engines/sci/sfx/player/polled.cpp b/engines/sci/sfx/player/polled.cpp
index 842b7c5df5..a326eb508a 100644
--- a/engines/sci/sfx/player/polled.cpp
+++ b/engines/sci/sfx/player/polled.cpp
@@ -27,7 +27,7 @@
#include "common/util.h"
#include "common/file.h"
-#include "sci/sfx/player.h"
+#include "sci/sfx/player/polled.h"
#include "sci/sfx/softseq.h"
#include "sci/sfx/iterator.h"
@@ -253,8 +253,6 @@ static int ppf_poll(int frame_size, byte *dest, int size) {
return size; /* Apparently, we wrote all that was requested */
}
-extern sfx_player_t sfx_player_polled;
-
/*=======================*/
/* Player implementation */
/*=======================*/
diff --git a/engines/sci/sfx/player/polled.h b/engines/sci/sfx/player/polled.h
new file mode 100644
index 0000000000..9a1e31e44b
--- /dev/null
+++ b/engines/sci/sfx/player/polled.h
@@ -0,0 +1,37 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef SCI_SFX_SFX_PLAYER_POLLED_H
+#define SCI_SFX_SFX_PLAYER_POLLED_H
+
+#include "sci/sfx/player.h"
+
+namespace Sci {
+
+extern sfx_player_t sfx_player_polled;
+
+} // End of namespace Sci
+
+#endif
diff --git a/engines/sci/sfx/player/realtime.cpp b/engines/sci/sfx/player/realtime.cpp
index b279e91908..08c355388b 100644
--- a/engines/sci/sfx/player/realtime.cpp
+++ b/engines/sci/sfx/player/realtime.cpp
@@ -28,7 +28,7 @@
** enough, I guess. */
#include "sci/tools.h"
-#include "sci/sfx/player.h"
+#include "sci/sfx/player/realtime.h"
#include "sci/sfx/sequencer.h"
#include "sci/sfx/iterator.h"
#include "sci/sfx/core.h"
@@ -39,8 +39,6 @@ namespace Sci {
static sfx_sequencer_t *seq;
-extern sfx_player_t sfx_player_realtime;
-
/* Playing mechanism */
static inline int delta_time(const uint32 comp, const uint32 base) {
diff --git a/engines/sci/sfx/player/players.cpp b/engines/sci/sfx/player/realtime.h
index d84d9cdd33..bdf2777708 100644
--- a/engines/sci/sfx/player/players.cpp
+++ b/engines/sci/sfx/player/realtime.h
@@ -23,34 +23,15 @@
*
*/
+#ifndef SCI_SFX_SFX_PLAYER_REALTIME_H
+#define SCI_SFX_SFX_PLAYER_REALTIME_H
+
#include "sci/sfx/player.h"
namespace Sci {
extern sfx_player_t sfx_player_realtime;
-extern sfx_player_t sfx_player_polled;
-extern sfx_player_t sfx_player_player;
-
-sfx_player_t *sfx_players[] = {
- &sfx_player_player,
- &sfx_player_polled,
- &sfx_player_realtime,
- NULL
-};
-
-sfx_player_t *sfx_find_player(char *name) {
- if (!name) {
- /* Implement platform policy here */
-
- return sfx_players[0];
- } else {
- int n = 0;
- while (sfx_players[n] &&
- scumm_stricmp(sfx_players[n]->name, name))
- ++n;
-
- return sfx_players[n];
- }
-}
} // End of namespace Sci
+
+#endif