aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaweł Kołodziejski2009-02-15 09:56:04 +0000
committerPaweł Kołodziejski2009-02-15 09:56:04 +0000
commit311344b4451894120fa4688e431c67d5f08bd2fe (patch)
tree8372dd946fd954d439f2efb2509e8c336a66b0a8 /engines
parent06b5b22a8cae7eb8baad17c280383c37e699e2de (diff)
downloadscummvm-rg350-311344b4451894120fa4688e431c67d5f08bd2fe.tar.gz
scummvm-rg350-311344b4451894120fa4688e431c67d5f08bd2fe.tar.bz2
scummvm-rg350-311344b4451894120fa4688e431c67d5f08bd2fe.zip
fixed msvc9 compilation
svn-id: r38208
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/game.c14
-rw-r--r--engines/sci/engine/kernel.c4
-rw-r--r--engines/sci/engine/kfile.c5
-rw-r--r--engines/sci/engine/scriptconsole.c4
-rw-r--r--engines/sci/engine/scriptdebug.c22
-rw-r--r--engines/sci/gfx/gfx_res_options.c1
-rw-r--r--engines/sci/include/resource.h7
-rw-r--r--engines/sci/include/sci_memory.h7
-rw-r--r--engines/sci/include/scitypes.h6
-rw-r--r--engines/sci/include/sfx_core.h2
-rw-r--r--engines/sci/scicore/fnmatch.c2
-rw-r--r--engines/sci/scicore/games.h2
-rw-r--r--engines/sci/scicore/resource_patch.c3
-rw-r--r--engines/sci/scicore/tools.c18
-rw-r--r--engines/sci/sfx/seq/sequencers.c2
-rw-r--r--engines/sci/sfx/softseq/opl2.c4
16 files changed, 78 insertions, 25 deletions
diff --git a/engines/sci/engine/game.c b/engines/sci/engine/game.c
index d630b3c963..63d3fb9e94 100644
--- a/engines/sci/engine/game.c
+++ b/engines/sci/engine/game.c
@@ -25,20 +25,6 @@
***************************************************************************/
-
-/* Attempt to guess if recent version of Platform SDK */
-#ifdef _MSC_VER
-# pragma message("******************** IMPORTANT MESSAGE ********************")
-# pragma message("You must have installed a recent Platform and DirectX SDK")
-# pragma message("for this build to be successful. Download MS SDKs from:")
-# pragma message("www.microsoft.com/msdownload/platformsdk/sdkupdate")
-# pragma message("***********************************************************")
-# include <windows.h>
-# if (WINVER < 0x500)
-# error *** BUILD FAILED: Need more recent SDKs or fix your SDK paths in Tools Options ***
-# endif
-#endif
-
#include "sci/include/sciresource.h"
#include "sci/include/engine.h"
#include "sci/include/versions.h"
diff --git a/engines/sci/engine/kernel.c b/engines/sci/engine/kernel.c
index e0092bfb69..ec7ac6e241 100644
--- a/engines/sci/engine/kernel.c
+++ b/engines/sci/engine/kernel.c
@@ -32,6 +32,10 @@
# include <windows.h>
#endif /* _WIN32 */
+#ifdef _MSC_VER
+# include <mmsystem.h>
+#endif
+
#include "sci/include/gfx_operations.h"
#include "sci/engine/kernel_types.h"
diff --git a/engines/sci/engine/kfile.c b/engines/sci/engine/kfile.c
index de260ca4d7..04abbb8782 100644
--- a/engines/sci/engine/kfile.c
+++ b/engines/sci/engine/kfile.c
@@ -27,6 +27,11 @@
#include "sci/include/engine.h"
+
+#ifdef _MSC_VER
+#define MAX_PATHLEN MAXPATHLEN
+#endif
+
#ifdef _WIN32
# ifndef PATH_MAX
# define PATH_MAX 255
diff --git a/engines/sci/engine/scriptconsole.c b/engines/sci/engine/scriptconsole.c
index 661fa253e9..d208210d4a 100644
--- a/engines/sci/engine/scriptconsole.c
+++ b/engines/sci/engine/scriptconsole.c
@@ -27,8 +27,8 @@
/* Second half of the console implementation: VM dependent stuff */
/* Remember, it doesn't have to be fast. */
-#include <sci_memory.h>
-#include <engine.h>
+#include "sci/include/sci_memory.h"
+#include "sci/include/engine.h"
#ifdef SCI_CONSOLE
state_t *con_gamestate = NULL;
diff --git a/engines/sci/engine/scriptdebug.c b/engines/sci/engine/scriptdebug.c
index a3e31e3b7c..36d80c01c8 100644
--- a/engines/sci/engine/scriptdebug.c
+++ b/engines/sci/engine/scriptdebug.c
@@ -37,10 +37,30 @@
#include "sci/include/reg_t_hashmap.h"
#ifdef _WIN32
-# include <win32/sci_win32.h>
# include <windows.h>
# include <io.h>
#endif
+
+# ifdef sleep
+# undef sleep
+# endif
+
+#ifdef _MSC_VER
+# include <mmsystem.h>
+# define sleep(x) \
+ do { \
+ if (x == 0) { \
+ Sleep(0); \
+ } else { \
+ if (timeBeginPeriod(1) != TIMERR_NOERROR) \
+ fprintf(stderr, "timeBeginPeriod(1) failed\n"); \
+ Sleep(x); \
+ if (timeEndPeriod(1) != TIMERR_NOERROR) \
+ fprintf(stderr, "timeEndPeriod(1) failed\n"); \
+ } \
+ } while (0);
+#endif
+
#ifdef HAVE_UNISTD_H
# include <unistd.h>
/* Assume this is a sufficient precondition */
diff --git a/engines/sci/gfx/gfx_res_options.c b/engines/sci/gfx/gfx_res_options.c
index 0692fece0f..0a58f5aa94 100644
--- a/engines/sci/gfx/gfx_res_options.c
+++ b/engines/sci/gfx/gfx_res_options.c
@@ -30,6 +30,7 @@
#include "sci/include/gfx_system.h"
#include "sci/include/gfx_options.h"
#include "sci/include/gfx_resmgr.h"
+#include "sci/include/resource.h"
#include <ctype.h>
diff --git a/engines/sci/include/resource.h b/engines/sci/include/resource.h
index aa3e31a671..03069006ac 100644
--- a/engines/sci/include/resource.h
+++ b/engines/sci/include/resource.h
@@ -60,6 +60,7 @@
#ifdef SCUMMVM
//TODO: Remove these defines by replacing their functionality by their ScummVM counterparts
#define HAVE_ISBLANK
+#ifndef _MSC_VER
#define HAVE_UNISTD_H
#define HAVE_FCNTL_H
#define HAVE_UNLINK
@@ -68,6 +69,7 @@
#define HAVE_FNMATCH_H
#define HAVE_SYS_TIME_H
#define HAVE_GETTIMEOFDAY
+#endif
#define VERSION "0.6.4"
#endif // SCUMMVM
@@ -107,7 +109,6 @@
#ifdef _WIN32
# include <io.h>
-# include <sci_win32.h>
#else /* !_WIN32 */
# define DLLEXTERN
#endif /* !_WIN32 */
@@ -121,6 +122,10 @@
# include <sys/timeb.h>
# include <fcntl.h>
# include <windows.h>
+# undef strcasecmp
+# undef strncasecmp
+# define strcasecmp _stricmp
+# define strncasecmp _strnicmp
#endif
diff --git a/engines/sci/include/sci_memory.h b/engines/sci/include/sci_memory.h
index 9ef7fa41cb..4b02454e1d 100644
--- a/engines/sci/include/sci_memory.h
+++ b/engines/sci/include/sci_memory.h
@@ -81,6 +81,13 @@
# define scim_inline inline
#endif
+#ifdef _MSC_VER
+# undef strcasecmp
+# undef strncasecmp
+# define strcasecmp _stricmp
+# define strncasecmp _strnicmp
+#endif
+
/********** macros for error messages **********/
/*
diff --git a/engines/sci/include/scitypes.h b/engines/sci/include/scitypes.h
index b252d59565..be13a1d03b 100644
--- a/engines/sci/include/scitypes.h
+++ b/engines/sci/include/scitypes.h
@@ -33,7 +33,13 @@
// TODO: rework sci_dir_t to use common/fs.h and remove these includes
#include <sys/types.h>
+#ifndef _MSC_VER
#include <dirent.h>
+#else
+#include <io.h>
+# undef inline /* just to be sure it is not defined */
+# define inline __inline
+#endif
typedef int8 gint8;
typedef uint8 guint8;
diff --git a/engines/sci/include/sfx_core.h b/engines/sci/include/sfx_core.h
index 9a04e9f9e5..3b8498b5bc 100644
--- a/engines/sci/include/sfx_core.h
+++ b/engines/sci/include/sfx_core.h
@@ -30,7 +30,9 @@
#ifndef _SFX_CORE_H_
#define _SFX_CORE_H_
+#ifndef _MSC_VER
#include <config.h>
+#endif
#define SFX_OK 0
#define SFX_ERROR -1
diff --git a/engines/sci/scicore/fnmatch.c b/engines/sci/scicore/fnmatch.c
index ffc9a1b451..a3b5a0ad69 100644
--- a/engines/sci/scicore/fnmatch.c
+++ b/engines/sci/scicore/fnmatch.c
@@ -27,8 +27,6 @@
#include <stdio.h> /* for debugging */
-#include <beos/fnmatch.h>
-#include <beos/collsyms.h>
#include <ctype.h>
#if defined (HAVE_STRING_H)
diff --git a/engines/sci/scicore/games.h b/engines/sci/scicore/games.h
index d8b9642fba..b5c4a02b29 100644
--- a/engines/sci/scicore/games.h
+++ b/engines/sci/scicore/games.h
@@ -32,7 +32,7 @@
# error "You shouldn't be including this header file."
#endif
-#include <versions.h>
+#include "sci/include/versions.h"
typedef struct _sci_game {
int id; /* currently CRC of resource.001 */
diff --git a/engines/sci/scicore/resource_patch.c b/engines/sci/scicore/resource_patch.c
index b17058c09b..037b082476 100644
--- a/engines/sci/scicore/resource_patch.c
+++ b/engines/sci/scicore/resource_patch.c
@@ -29,6 +29,9 @@
#include "sci/include/sciresource.h"
#include "sci/include/sci_memory.h"
+#ifdef _WIN32
+#include <direct.h>
+#endif
void
sci0_sprintf_patch_file_name(char *string, resource_t *res)
diff --git a/engines/sci/scicore/tools.c b/engines/sci/scicore/tools.c
index 11bc00d5a7..802a4f9db1 100644
--- a/engines/sci/scicore/tools.c
+++ b/engines/sci/scicore/tools.c
@@ -35,9 +35,25 @@
#ifdef _MSC_VER
# include <sys/timeb.h>
# include <windows.h>
-# include <sci_win32.h>
+# include <mmsystem.h>
# include <sys/types.h>
# include <sys/stat.h>
+# ifdef sleep
+# undef sleep
+# endif
+
+# define sleep(x) \
+ do { \
+ if (x == 0) { \
+ Sleep(0); \
+ } else { \
+ if (timeBeginPeriod(1) != TIMERR_NOERROR) \
+ fprintf(stderr, "timeBeginPeriod(1) failed\n"); \
+ Sleep(x); \
+ if (timeEndPeriod(1) != TIMERR_NOERROR) \
+ fprintf(stderr, "timeEndPeriod(1) failed\n"); \
+ } \
+ } while (0);
#else
#ifdef _WIN32
# include <windows.h>
diff --git a/engines/sci/sfx/seq/sequencers.c b/engines/sci/sfx/seq/sequencers.c
index cb43381fa9..3ba7f25a46 100644
--- a/engines/sci/sfx/seq/sequencers.c
+++ b/engines/sci/sfx/seq/sequencers.c
@@ -26,7 +26,7 @@
***************************************************************************/
#include "../sequencer.h"
-#include <resource.h>
+#include "sci/include/resource.h"
#ifndef SCUMMVM
extern sfx_sequencer_t sfx_sequencer_gm;
diff --git a/engines/sci/sfx/softseq/opl2.c b/engines/sci/sfx/softseq/opl2.c
index ed2f3001c8..c19de1388a 100644
--- a/engines/sci/sfx/softseq/opl2.c
+++ b/engines/sci/sfx/softseq/opl2.c
@@ -17,8 +17,8 @@
***************************************************************************/
-#include <resource.h>
-#include <sfx_iterator.h>
+#include "sci/include/resource.h"
+#include "sci/include/sfx_iterator.h"
#include "../softseq.h"
#include "../adlib.h"
#include <math.h>