[Scummvm-cvs-logs] CVS: scummvm/backends/dc audio.cpp,1.11,1.12 dc.h,1.20,1.21 dcmain.cpp,1.21,1.22 display.cpp,1.17,1.18 input.cpp,1.15,1.16
Marcus Comstedt
marcus_c at users.sourceforge.net
Sat Mar 13 05:51:26 CET 2004
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/gui font.h,1.3,1.4 newgui.cpp,1.80,1.81 newgui.h,1.39,1.40
- Next message: [Scummvm-cvs-logs] CVS: scummvm/backends/dc dc.h,1.21,1.22 dcmain.cpp,1.22,1.23
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/backends/dc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18098
Modified Files:
audio.cpp dc.h dcmain.cpp display.cpp input.cpp
Log Message:
Harmonized with new OSystem API.
Index: audio.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/dc/audio.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- audio.cpp 24 Feb 2004 22:39:35 -0000 1.11
+++ audio.cpp 13 Mar 2004 13:41:50 -0000 1.12
@@ -36,13 +36,8 @@
bool OSystem_Dreamcast::setSoundCallback(SoundProc proc, void *param)
{
-#if SAMPLE_MODE == 0
- assert(format == SOUND_16BIT);
-#elif SAMPLE_MODE == 1
- assert(format == SOUND_8BIT);
-#else
-#error Invalid SAMPLE_MODE
-#endif
+ assert(SAMPLE_MODE == 0);
+
_sound_proc_param = param;
_sound_proc = proc;
@@ -93,3 +88,9 @@
if((fillpos += n) >= curr_ring_buffer_samples)
fillpos = 0;
}
+
+int OSystem_Dreamcast::getOutputSampleRate() const
+{
+ return 22050;
+}
+
Index: dc.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/dc/dc.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- dc.h 28 Feb 2004 12:57:50 -0000 1.20
+++ dc.h 13 Mar 2004 13:41:50 -0000 1.21
@@ -30,6 +30,19 @@
public:
OSystem_Dreamcast();
+
+ // Retrieve a list of all graphics modes supported by this backend.
+ const GraphicsMode *getSupportedGraphicsModes() const;
+
+ // Switch to the specified graphics mode.
+ bool setGraphicsMode(int mode);
+
+ // Switch to the specified graphics mode.
+ bool setGraphicsMode(const char *name);
+
+ // Determine which graphics mode is currently active.
+ int getGraphicsMode() const;
+
// Set colors of the palette
void setPalette(const byte *colors, uint start, uint num);
@@ -49,11 +62,10 @@
// Either show or hide the mouse cursor
bool show_mouse(bool visible);
+
+ // Move ("warp") the mouse cursor to the specified position.
void warp_mouse(int x, int y);
- // Set the position of the mouse cursor
- void set_mouse_pos(int x, int y);
-
// Set the bitmap that's used when drawing the cursor.
void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y);
@@ -73,7 +85,14 @@
// Set function that generates samples
bool setSoundCallback(SoundProc proc, void *param);
void clearSoundCallback();
+
+ // Determine the output sample rate. Audio data provided by the sound
+ // callback will be played using this rate.
+ int getOutputSampleRate() const;
+ // Initialise the specified CD drive for audio playback.
+ bool openCD(int drive);
+
// Poll cdrom status
// Returns true if cd audio is playing
bool poll_cdrom();
@@ -90,9 +109,6 @@
// Quit
void quit();
- // Set a parameter
- uint32 property(int param, Property *value);
-
// Overlay
void show_overlay();
void hide_overlay();
@@ -101,16 +117,20 @@
void copy_rect_overlay(const int16 *buf, int pitch, int x, int y, int w, int h);
// Add a callback timer
- virtual void set_timer(TimerProc callback, int timer);
+ void set_timer(TimerProc callback, int timer);
// Mutex handling
- virtual MutexRef createMutex();
- virtual void lockMutex(MutexRef mutex);
- virtual void unlockMutex(MutexRef mutex);
- virtual void deleteMutex(MutexRef mutex);
+ MutexRef createMutex();
+ void lockMutex(MutexRef mutex);
+ void unlockMutex(MutexRef mutex);
+ void deleteMutex(MutexRef mutex);
+
+ // Set a window caption or any other comparable status display to the
+ // given value.
+ void setWindowCaption(const char *caption);
// Savefile handling
- virtual SaveFileManager *get_savefile_manager();
+ SaveFileManager *get_savefile_manager();
static OSystem *create();
Index: dcmain.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/dc/dcmain.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- dcmain.cpp 28 Feb 2004 12:57:51 -0000 1.21
+++ dcmain.cpp 13 Mar 2004 13:41:50 -0000 1.22
@@ -109,20 +109,15 @@
// Dummy. The CD drive takes care of itself.
}
-uint32 OSystem_Dreamcast::property(int param, Property *value)
+bool OSystem_Dreamcast::openCD(int drive)
{
- switch(param) {
-
- case PROP_GET_SAMPLE_RATE:
- return 22050;
-
- case PROP_SET_WINDOW_CAPTION:
- gGameName = value->caption;
- break;
+ // Dummy.
+ return true;
+}
- }
-
- return 0;
+void OSystem_Dreamcast::setWindowCaption(const char *caption)
+{
+ gGameName = caption;
}
void OSystem_Dreamcast::quit() {
Index: display.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/dc/display.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- display.cpp 28 Feb 2004 12:57:51 -0000 1.17
+++ display.cpp 13 Mar 2004 13:41:50 -0000 1.18
@@ -238,7 +238,7 @@
return last;
}
-void OSystem_Dreamcast::set_mouse_pos(int x, int y)
+void OSystem_Dreamcast::warp_mouse(int x, int y)
{
if (_overlay_visible) {
x += _overlay_x;
@@ -248,11 +248,6 @@
_ms_cur_y = (_hires? (y>>1):y);
}
-void OSystem_Dreamcast::warp_mouse(int x, int y)
-{
- set_mouse_pos(x, y);
-}
-
void OSystem_Dreamcast::set_mouse_cursor(const byte *buf, uint w, uint h,
int hotspot_x, int hotspot_y)
{
@@ -570,3 +565,30 @@
} while (--h);
_overlay_dirty = true;
}
+
+
+static const OSystem::GraphicsMode gfxmodes[] = {
+ { "default", "640×480 16bpp", 0 },
+ { NULL, NULL, 0 }
+};
+
+const OSystem::GraphicsMode *OSystem_Dreamcast::getSupportedGraphicsModes() const
+{
+ return gfxmodes;
+}
+
+bool OSystem_Dreamcast::setGraphicsMode(int mode)
+{
+ return mode == 0;
+}
+
+bool OSystem_Dreamcast::setGraphicsMode(const char *name)
+{
+ return strcmp(name, "default") == 0;
+}
+
+int OSystem_Dreamcast::getGraphicsMode() const
+{
+ return 0;
+}
+
Index: input.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/dc/input.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- input.cpp 6 Jan 2004 12:45:26 -0000 1.15
+++ input.cpp 13 Mar 2004 13:41:50 -0000 1.16
@@ -196,7 +196,7 @@
event->event_code = EVENT_MOUSEMOVE;
_ms_old_x = _ms_cur_x;
_ms_old_y = _ms_cur_y;
- set_mouse_pos(event->mouse.x, event->mouse.y);
+ warp_mouse(event->mouse.x, event->mouse.y);
return true;
} else {
event->event_code = (EventCode)0;
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/gui font.h,1.3,1.4 newgui.cpp,1.80,1.81 newgui.h,1.39,1.40
- Next message: [Scummvm-cvs-logs] CVS: scummvm/backends/dc dc.h,1.21,1.22 dcmain.cpp,1.22,1.23
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list