[Scummvm-cvs-logs] SF.net SVN: scummvm:[38758] scummvm/trunk/engines/sci
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Sat Feb 21 23:40:58 CET 2009
Revision: 38758
http://scummvm.svn.sourceforge.net/scummvm/?rev=38758&view=rev
Author: fingolfin
Date: 2009-02-21 22:40:58 +0000 (Sat, 21 Feb 2009)
Log Message:
-----------
SCI: More cleanup
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kfile.cpp
scummvm/trunk/engines/sci/engine/scriptconsole.cpp
scummvm/trunk/engines/sci/module.mk
scummvm/trunk/engines/sci/sci.cpp
scummvm/trunk/engines/sci/scicore/resource.cpp
scummvm/trunk/engines/sci/scicore/resource_map.cpp
scummvm/trunk/engines/sci/sfx/device/devices.cpp
scummvm/trunk/engines/sci/sfx/iterator.cpp
scummvm/trunk/engines/sci/sfx/seq/oss-adlib.cpp
scummvm/trunk/engines/sci/tools.cpp
scummvm/trunk/engines/sci/tools.h
Modified: scummvm/trunk/engines/sci/engine/kfile.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kfile.cpp 2009-02-21 22:38:17 UTC (rev 38757)
+++ scummvm/trunk/engines/sci/engine/kfile.cpp 2009-02-21 22:40:58 UTC (rev 38758)
@@ -38,12 +38,23 @@
#include <errno.h>
#include <sys/stat.h> // for S_IREAD/S_IWRITE
+// FIXME: Get rid of the following (needed for O_RDONLY etc.)
+#include <fcntl.h>
+
+
namespace Sci {
#ifndef O_BINARY
#define O_BINARY 0
#endif
+#ifdef WIN32
+# define FO_BINARY "b"
+#else
+# define FO_BINARY ""
+#endif
+
+
static int _savegame_indices_nr = -1; // means 'uninitialized'
static struct _savegame_index_struct {
Modified: scummvm/trunk/engines/sci/engine/scriptconsole.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/scriptconsole.cpp 2009-02-21 22:38:17 UTC (rev 38757)
+++ scummvm/trunk/engines/sci/engine/scriptconsole.cpp 2009-02-21 22:40:58 UTC (rev 38758)
@@ -696,7 +696,6 @@
return -1;
}
- sciprintf("FreeSCI, version " VERSION "\n");
sciprintf("Resource file version: %s\n", sci_version_types[s->resmgr->sci_version]);
sciprintf("Emulated interpreter version: %d.%03d.%03d\n", SCI_VERSION_MAJOR(s->version),
SCI_VERSION_MINOR(s->version), SCI_VERSION_PATCHLEVEL(s->version));
Modified: scummvm/trunk/engines/sci/module.mk
===================================================================
--- scummvm/trunk/engines/sci/module.mk 2009-02-21 22:38:17 UTC (rev 38757)
+++ scummvm/trunk/engines/sci/module.mk 2009-02-21 22:40:58 UTC (rev 38758)
@@ -79,6 +79,9 @@
sfx/player/players.o \
sfx/player/polled.o \
sfx/player/realtime.o \
+ sfx/seq/gm.o \
+ sfx/seq/instrument-map.o \
+ sfx/seq/map-mt32-to-gm.o \
sfx/seq/sequencers.o \
sfx/softseq/amiga.o \
sfx/softseq/opl2.o \
Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp 2009-02-21 22:38:17 UTC (rev 38757)
+++ scummvm/trunk/engines/sci/sci.cpp 2009-02-21 22:40:58 UTC (rev 38758)
@@ -229,8 +229,6 @@
map_MIDI_instruments(resmgr);
#endif
- sciprintf("Imported FreeSCI, version "VERSION"\n");
-
EngineState* gamestate = (EngineState *) sci_malloc(sizeof(EngineState));
memset(gamestate, 0, sizeof(EngineState));
gamestate->resmgr = resmgr;
Modified: scummvm/trunk/engines/sci/scicore/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/resource.cpp 2009-02-21 22:38:17 UTC (rev 38757)
+++ scummvm/trunk/engines/sci/scicore/resource.cpp 2009-02-21 22:40:58 UTC (rev 38758)
@@ -396,7 +396,7 @@
return NULL;
}
if (resource_error == SCI_ERROR_RESMAP_NOT_FOUND) {
- // fixme: Try reading w/o resource.map
+ // FIXME: Try reading w/o resource.map
resource_error = SCI_ERROR_NO_RESOURCE_FILES_FOUND;
}
@@ -414,7 +414,7 @@
resource_error = sci1_read_resource_map(mgr, source, scir_get_volume(mgr, source, 0),
&mgr->_resources, &mgr->_resourcesNr, detected_version);
if (resource_error == SCI_ERROR_RESMAP_NOT_FOUND) {
- // fixme: Try reading w/o resource.map
+ // FIXME: Try reading w/o resource.map
resource_error = SCI_ERROR_NO_RESOURCE_FILES_FOUND;
}
Modified: scummvm/trunk/engines/sci/scicore/resource_map.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/resource_map.cpp 2009-02-21 22:38:17 UTC (rev 38757)
+++ scummvm/trunk/engines/sci/scicore/resource_map.cpp 2009-02-21 22:40:58 UTC (rev 38758)
@@ -106,10 +106,7 @@
if (read_ok) {
sprintf(filename, "resource.%03i", SCI0_RESFILE_GET_FILE(buf + 2));
- Common::File temp;
-
- // FIXME: Maybe better to use File::exists here?
- if (!temp.open(filename)) {
+ if (!Common::File::exists(filename)) {
files_ok = 0;
break;
}
Modified: scummvm/trunk/engines/sci/sfx/device/devices.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/device/devices.cpp 2009-02-21 22:38:17 UTC (rev 38757)
+++ scummvm/trunk/engines/sci/sfx/device/devices.cpp 2009-02-21 22:40:58 UTC (rev 38758)
@@ -23,11 +23,8 @@
*
*/
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-#include "../device.h"
-#include <stdio.h>
+#include "common/scummsys.h"
+#include "sci/sfx/device.h"
#include "sci/tools.h"
Modified: scummvm/trunk/engines/sci/sfx/iterator.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/iterator.cpp 2009-02-21 22:38:17 UTC (rev 38757)
+++ scummvm/trunk/engines/sci/sfx/iterator.cpp 2009-02-21 22:40:58 UTC (rev 38758)
@@ -48,9 +48,7 @@
fprintf(stderr, "[%08lx] ", id);
}
-#ifndef HAVE_MEMCHR
-static void *
-memchr(void *_data, int c, int n) {
+static unsigned char *sci_memchr(void *_data, int c, int n) {
unsigned char *data = (unsigned char *) _data;
while (n && !(*data == c)) {
@@ -63,7 +61,6 @@
else
return NULL;
}
-#endif
static void _common_init(base_song_iterator_t *self) {
self->fade.action = FADE_ACTION_NONE;
@@ -491,7 +488,7 @@
while ((tries--) && (offset < self->size) && (!found_it)) {
/* Search through the garbage manually */
- unsigned char *fc = (unsigned char*)memchr(self->data + offset,
+ unsigned char *fc = sci_memchr(self->data + offset,
SCI0_END_OF_SONG,
self->size - offset);
Modified: scummvm/trunk/engines/sci/sfx/seq/oss-adlib.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/seq/oss-adlib.cpp 2009-02-21 22:38:17 UTC (rev 38757)
+++ scummvm/trunk/engines/sci/sfx/seq/oss-adlib.cpp 2009-02-21 22:40:58 UTC (rev 38758)
@@ -23,10 +23,7 @@
*
*/
-#include <stdio.h>
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include "common/scummsys.h"
#include "../sequencer.h"
#ifdef HAVE_SYS_SOUNDCARD_H
Modified: scummvm/trunk/engines/sci/tools.cpp
===================================================================
--- scummvm/trunk/engines/sci/tools.cpp 2009-02-21 22:38:17 UTC (rev 38757)
+++ scummvm/trunk/engines/sci/tools.cpp 2009-02-21 22:40:58 UTC (rev 38758)
@@ -47,6 +47,9 @@
#include "sci/include/engine.h"
+// FIXME: Get rid of the following (needed for O_RDONLY etc.)
+#include <fcntl.h>
+
namespace Sci {
// FIXME: Get rid of G_DIR_SEPARATOR / G_DIR_SEPARATOR_S
@@ -59,7 +62,7 @@
#endif
-#ifdef HAVE_SYS_TIME_H
+#ifndef _MSC_VER
# include <sys/time.h>
#endif
@@ -148,7 +151,7 @@
}
-#if defined(HAVE_GETTIMEOFDAY)
+#ifndef _MSC_VER
void sci_gettime(long *seconds, long *useconds) {
struct timeval tv;
Modified: scummvm/trunk/engines/sci/tools.h
===================================================================
--- scummvm/trunk/engines/sci/tools.h 2009-02-21 22:38:17 UTC (rev 38757)
+++ scummvm/trunk/engines/sci/tools.h 2009-02-21 22:40:58 UTC (rev 38758)
@@ -44,27 +44,6 @@
/*#define _SCI_RESOURCE_DEBUG */
/*#define _SCI_DECOMPRESS_DEBUG*/
-//TODO: Remove these defines by replacing their functionality by their ScummVM counterparts
-#define HAVE_MEMCHR
-#define HAVE_FCNTL_H
-#ifndef _MSC_VER
-#define HAVE_UNISTD_H
-#define HAVE_SYS_TIME_H
-#define HAVE_GETTIMEOFDAY
-#endif
-#define VERSION "0.6.4"
-
-// FIXME: Mostly for close() in lots of places. Get rid of this!
-#ifndef _MSC_VER
-#include <unistd.h>
-#endif
-
-// FIXME: Get rid of the following (needed for O_RDONLY etc.)
-#ifdef HAVE_FCNTL_H
-# include <fcntl.h>
-#endif
-
-
// FIXME: rework sci_dir_t to use common/fs.h and remove these includes
#include <sys/types.h>
#ifndef _MSC_VER
@@ -73,11 +52,9 @@
#include <io.h>
#endif
-
-#ifdef WIN32
-# define FO_BINARY "b"
-#else
-# define FO_BINARY ""
+// FIXME: For chdir() etc.
+#ifndef _MSC_VER
+#include <unistd.h>
#endif
namespace Sci {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list