Permalink
Browse files

Windows WIP.

  • Loading branch information...
1 parent 44b7cb2 commit e2fca77952f3932db1eca8d5effbc0ddf015ac04 unknown committed May 7, 2008
View
@@ -182,8 +182,6 @@ extern DISPLAYBLOCK *Player;
/***************************************************************/
/************************ AVP high level control **************/
-extern RECT_AVP screenRect;
-
/* KJL 15:42:23 10/02/96 - These two are mine. */
extern void MaintainPlayer(void);
extern void MaintainHUD(void);
@@ -77,7 +77,7 @@ typedef struct pffont
int num_chars_in_font; /*number of chars in this font */
FONT_TYPE font_type;
FONT_FLAGS flags;
- RECT_AVP srcRect[MAXNUM_CHARS_IN_FONT]; /*source rectangles*/
+ RECT srcRect[MAXNUM_CHARS_IN_FONT]; /*source rectangles*/
int fttexWidth; /* filled in during loading */
int fttexHeight;
@@ -115,7 +115,7 @@ typedef struct pffont
{
if ( bPrintable(ProjCh) )
{
- const RECT_AVP& charRect = srcRect[ ProjCharToOffset(ProjCh) ] ;
+ const RECT& charRect = srcRect[ ProjCharToOffset(ProjCh) ] ;
return (charRect . right - charRect . left);
}
@@ -34,8 +34,7 @@
/* used to get file time */
#include <sys/types.h>
#include <sys/stat.h>
-#include <unistd.h>
-
+
extern void StartMenuBackgroundBink(void);
extern int PlayMenuBackgroundBink(void);
extern void EndMenuBackgroundBink(void);
@@ -86,7 +86,7 @@ static int find_empty_game_sound()
}
-static int find_permanent_game_sound(char * wavname)
+static int find_permanent_game_sound(const char * wavname)
{
if(!SoundSwitchedOn) return (-1);
@@ -109,15 +109,15 @@ LOADED_SOUND const * GetSound (char const * fname)
{
if(!SoundSwitchedOn) return (0);
- char * wavname = strrchr (fname, '\\');
+ const char * wavname = strrchr (fname, '\\');
if (wavname)
{
wavname ++;
}
else
{
- wavname = (char *)fname;
+ wavname = fname;
}
// check if wavname already loaded
View
@@ -1,6 +1,6 @@
#define _BSD_SOURCE
-#include <unistd.h>
+//#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
View
@@ -1,6 +1,11 @@
-#ifndef __FILES_H__
-#define __FILES_H__
+#ifndef FILES_H
+#define FILES_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdio.h>
#include <time.h>
#define FILEMODE_READONLY 0x01
@@ -33,4 +38,8 @@ void *OpenGameDirectory(const char *dirname, const char *pattern, int type);
GameDirectoryFile *ScanGameDirectory(void *dir);
int CloseGameDirectory(void *dir);
+#ifdef __cplusplus
+};
+#endif
+
#endif
View
@@ -1,6 +1,88 @@
#ifndef __FIXER_H__
#define __FIXER_H__
+#if defined(_MSC_VER)
+
+// just include the windows header to get everything.
+#undef Yes
+#undef No
+#include <windows.h>
+#include <tchar.h>
+#include <mbstring.h>
+#pragma warning( disable: 4996 ) // unsafe function (strcpy, fopen, etc.) used
+
+#define Yes 1
+#define No 0
+
+#include "files.h"
+
+// gonna deal with this one later.
+#define PACKED
+
+// unused directplay code.
+typedef int DPID;
+
+// not sure where this was originally defined.
+#define RGBA_MAKE(r, g, b, a) ((((a) << 24) | ((r) << 16) | ((g) << 8) | (b)))
+
+typedef struct DPNAME
+{
+ int dwSize;
+
+ char *lpszShortNameA;
+ char *lpszLongNameA;
+} DPNAME;
+
+#define DP_OK 0
+
+#define DPRECEIVE_ALL 1
+#define DPSYS_ADDPLAYERTOGROUP 2
+#define DPSYS_CREATEPLAYERORGROUP 3
+#define DPPLAYERTYPE_PLAYER 4
+#define DPSYS_DELETEPLAYERFROMGROUP 5
+#define DPSYS_HOST 6
+#define DPSYS_SESSIONLOST 7
+#define DPSYS_SETPLAYERORGROUPDATA 8
+#define DPSYS_SETPLAYERORGROUPNAME 9
+#define DPEXT_HEADER_SIZE 10
+#define DPERR_BUSY 11
+#define DPERR_CONNECTIONLOST 12
+#define DPERR_INVALIDPARAMS 13
+#define DPERR_INVALIDPLAYER 14
+#define DPERR_NOTLOGGEDIN 15
+#define DPERR_SENDTOOBIG 16
+#define DPERR_BUFFERTOOSMALL 17
+#define DPID_SYSMSG 18
+#define DPSYS_DESTROYPLAYERORGROUP 19
+#define DPID_ALLPLAYERS 20
+
+typedef struct DPMSG_GENERIC
+{
+ int dwType;
+} DPMSG_GENERIC;
+typedef DPMSG_GENERIC * LPDPMSG_GENERIC;
+
+typedef struct DPMSG_CREATEPLAYERORGROUP
+{
+ int dwType;
+
+ DPID dpId;
+ int dwPlayerType;
+
+ DPNAME dpnName;
+} DPMSG_CREATEPLAYERORGROUP;
+typedef DPMSG_CREATEPLAYERORGROUP * LPDPMSG_CREATEPLAYERORGROUP;
+
+typedef struct DPMSG_DESTROYPLAYERORGROUP
+{
+ int dwType;
+
+ DPID dpId;
+ int dwPlayerType;
+} DPMSG_DESTROYPLAYERORGROUP;
+typedef DPMSG_DESTROYPLAYERORGROUP * LPDPMSG_DESTROYPLAYERORGROUP;
+
+#else
#ifdef __cplusplus
extern "C" {
#endif
@@ -9,7 +91,7 @@ extern "C" {
#include <stdlib.h>
#include <string.h>
#include <limits.h>
-#include <inttypes.h> /* int64_t */
+//#include <stdint.h> /* int64_t */
#include "files.h"
@@ -26,6 +108,8 @@ extern "C" {
#define __cdecl
+#define NO_ERROR 0
+
#define TRUE 1
#define FALSE 0
@@ -227,3 +311,5 @@ typedef struct JOYCAPS
#endif
#endif
+
+#endif
@@ -8,6 +8,7 @@
#endif
+#include "fixer.h" // make sure system headers get included first, because windows headers use Yes/No
#include "system.h"
#include <stddef.h>
View
@@ -2,7 +2,6 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
-#include <unistd.h>
#include <assert.h>
#include "SDL.h"
Oops, something went wrong.

0 comments on commit e2fca77

Please sign in to comment.