aboutsummaryrefslogtreecommitdiff
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
parent06b5b22a8cae7eb8baad17c280383c37e699e2de (diff)
downloadscummvm-rg350-311344b4451894120fa4688e431c67d5f08bd2fe.tar.gz
scummvm-rg350-311344b4451894120fa4688e431c67d5f08bd2fe.tar.bz2
scummvm-rg350-311344b4451894120fa4688e431c67d5f08bd2fe.zip
fixed msvc9 compilation
svn-id: r38208
-rw-r--r--dists/msvc9/sci.vcproj236
-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
17 files changed, 314 insertions, 25 deletions
diff --git a/dists/msvc9/sci.vcproj b/dists/msvc9/sci.vcproj
index d545e3759e..61a8b5efca 100644
--- a/dists/msvc9/sci.vcproj
+++ b/dists/msvc9/sci.vcproj
@@ -646,6 +646,242 @@
</File>
</Filter>
</Filter>
+ <Filter
+ Name="include"
+ >
+ <File
+ RelativePath="..\..\engines\sci\include\aatree.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\conf_driver.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\conf_extension.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\conf_parse.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\conf_subsystems.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\conf_summary.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\console.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\engine.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\event.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\game_select.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\gfx_driver.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\gfx_operations.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\gfx_options.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\gfx_res_options.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\gfx_resmgr.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\gfx_resource.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\gfx_state_internal.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\gfx_system.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\gfx_tools.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\gfx_widgets.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\hashmap.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\heapmgr.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\int_hashmap.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\kdebug.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\kernel.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\list.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\listener.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\menubar.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\modules.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\old_objects.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\reg_t_hashmap.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\resource.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\sbtree.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\sci_conf.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\sci_dos.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\sci_memory.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\sci_midi.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\sci_widgets.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\sciresource.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\scitypes.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\script.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\seg_manager.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\sfx_core.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\sfx_engine.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\sfx_iterator.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\sfx_iterator_internal.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\sfx_pcm.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\sfx_player.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\sfx_songlib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\sfx_time.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\sfx_timer.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\sys_strings.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\uinput.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\util.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\versions.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\vm.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\vm_types.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\sci\include\vocabulary.h"
+ >
+ </File>
+ </Filter>
</Files>
<Globals>
</Globals>
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>