diff options
author | eriktorbjorn | 2011-06-19 07:59:37 +0200 |
---|---|---|
committer | eriktorbjorn | 2011-06-19 07:59:37 +0200 |
commit | 3871c71f0e6f5202e935ac7119fefedde1f8e449 (patch) | |
tree | f38c170ce19b222531750db7f105c60e56e85eda | |
parent | 77d5c25472f414c2b0c49a920329a6811d271281 (diff) | |
download | scummvm-rg350-3871c71f0e6f5202e935ac7119fefedde1f8e449.tar.gz scummvm-rg350-3871c71f0e6f5202e935ac7119fefedde1f8e449.tar.bz2 scummvm-rg350-3871c71f0e6f5202e935ac7119fefedde1f8e449.zip |
CGE: Fix compilation under GCC
Unfortunately, I had to stub a few things but this all looks like
code that will have to be rewritten later anyway.
-rw-r--r-- | engines/cge/bitmap.cpp | 1 | ||||
-rw-r--r-- | engines/cge/btfile.cpp | 2 | ||||
-rw-r--r-- | engines/cge/btfile.h | 9 | ||||
-rw-r--r-- | engines/cge/cfile.cpp | 1 | ||||
-rw-r--r-- | engines/cge/cfile.h | 1 | ||||
-rw-r--r-- | engines/cge/cge_main.cpp | 3 | ||||
-rw-r--r-- | engines/cge/cge_main.h | 4 | ||||
-rw-r--r-- | engines/cge/game.cpp | 1 | ||||
-rw-r--r-- | engines/cge/general.cpp | 17 | ||||
-rw-r--r-- | engines/cge/general.h | 9 | ||||
-rw-r--r-- | engines/cge/jbw.h | 1 | ||||
-rw-r--r-- | engines/cge/keybd.cpp | 1 | ||||
-rw-r--r-- | engines/cge/mouse.cpp | 1 | ||||
-rw-r--r-- | engines/cge/snail.cpp | 9 | ||||
-rw-r--r-- | engines/cge/startup.cpp | 2 | ||||
-rw-r--r-- | engines/cge/talk.cpp | 1 | ||||
-rw-r--r-- | engines/cge/text.cpp | 1 | ||||
-rw-r--r-- | engines/cge/vga13h.cpp | 3 | ||||
-rw-r--r-- | engines/cge/vga13h.h | 2 | ||||
-rw-r--r-- | engines/cge/wav.h | 2 |
20 files changed, 40 insertions, 31 deletions
diff --git a/engines/cge/bitmap.cpp b/engines/cge/bitmap.cpp index 36723aba28..b528b5578d 100644 --- a/engines/cge/bitmap.cpp +++ b/engines/cge/bitmap.cpp @@ -29,7 +29,6 @@ #include "cge/cfile.h" #include "cge/jbw.h" #include "cge/vol.h" -#include <dos.h> #include "cge/cfile.h" #include "common/system.h" diff --git a/engines/cge/btfile.cpp b/engines/cge/btfile.cpp index 7bb835f704..3cdb3c7199 100644 --- a/engines/cge/btfile.cpp +++ b/engines/cge/btfile.cpp @@ -90,6 +90,8 @@ BT_PAGE *BTFILE::GetPage(int lev, uint16 pgn) { return Buff[lev].Page; } +// Does this work, or does it have to compare the entire buffer? +#define memicmp(s1, s2, n) scumm_strnicmp((const char *)s1, (const char *)s2, n) BT_KEYPACK *BTFILE::Find(const char *key) { int lev = 0; diff --git a/engines/cge/btfile.h b/engines/cge/btfile.h index 3ab4880585..6e6398f4de 100644 --- a/engines/cge/btfile.h +++ b/engines/cge/btfile.h @@ -46,6 +46,10 @@ struct BT_KEYPACK { uint16 Size; }; +typedef struct { + uint8 Key[BT_KEYLEN]; + uint16 Down; +} INNER; struct BT_PAGE { struct HEA { @@ -56,10 +60,7 @@ struct BT_PAGE { // dummy filler to make proper size of union uint8 Data[BT_SIZE - sizeof(HEA)]; // inner version of data: key + word-sized page link - struct INNER { - uint8 Key[BT_KEYLEN]; - uint16 Down; - } Inn[(BT_SIZE - sizeof(HEA)) / sizeof(INNER)]; + INNER Inn[(BT_SIZE - sizeof(HEA)) / sizeof(INNER)]; // leaf version of data: key + all user data BT_KEYPACK Lea[(BT_SIZE - sizeof(HEA)) / sizeof(BT_KEYPACK)]; }; diff --git a/engines/cge/cfile.cpp b/engines/cge/cfile.cpp index 72ec73030f..da56587ebe 100644 --- a/engines/cge/cfile.cpp +++ b/engines/cge/cfile.cpp @@ -26,7 +26,6 @@ */ #include "cge/cfile.h" -#include <dos.h> #include <fcntl.h> #include <string.h> #include "common/system.h" diff --git a/engines/cge/cfile.h b/engines/cge/cfile.h index d2d5320ae5..f045c48c0f 100644 --- a/engines/cge/cfile.h +++ b/engines/cge/cfile.h @@ -29,7 +29,6 @@ #define __CFILE__ #include "cge/general.h" -#include <io.h> namespace CGE { diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp index 22168fe44c..8cfa3a1cf6 100644 --- a/engines/cge/cge_main.cpp +++ b/engines/cge/cge_main.cpp @@ -44,13 +44,10 @@ #include "cge/gettext.h" #include "cge/mixer.h" #include "cge/cge_main.h" -#include <conio.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <dos.h> #include <fcntl.h> -#include <io.h> #include "common/str.h" diff --git a/engines/cge/cge_main.h b/engines/cge/cge_main.h index fa27274803..3c9fede6fb 100644 --- a/engines/cge/cge_main.h +++ b/engines/cge/cge_main.h @@ -28,8 +28,8 @@ #ifndef __CGE__ #define __CGE__ -#include "cge\wav.h" -#include "cge\vga13h.h" +#include "cge/wav.h" +#include "cge/vga13h.h" namespace CGE { diff --git a/engines/cge/game.cpp b/engines/cge/game.cpp index 4102e080b6..655cfbe4ec 100644 --- a/engines/cge/game.cpp +++ b/engines/cge/game.cpp @@ -28,7 +28,6 @@ #include "cge/game.h" #include "cge/mouse.h" #include <stdlib.h> -#include <dos.h> namespace CGE { diff --git a/engines/cge/general.cpp b/engines/cge/general.cpp index 73e5b4d21f..e547921bb5 100644 --- a/engines/cge/general.cpp +++ b/engines/cge/general.cpp @@ -251,22 +251,39 @@ uint16 IOHAND::Write(void *buf, uint16 len) { } long IOHAND::Mark(void) { + /* return (Handle < 0) ? 0 : tell(Handle); + */ + warning("STUB: IOHAND::Mark"); + return 0; } long IOHAND::Seek(long pos) { + /* if (Handle < 0) return 0; lseek(Handle, pos, SEEK_SET); return tell(Handle); + */ + warning("STUB: IOHAND::Seek"); + return 0; } long IOHAND::Size(void) { + /* if (Handle < 0) return 0; + return filelength(Handle); + */ + warning("STUB: IOHAND::Size"); + return 0; } bool IOHAND::Exist(const char *name) { + /* return access(name, 0) == 0; + */ + warning("STUB: IOHAND::Exist"); + return 0; } //#define EMS_ADR(a) (FP_SEG(a) > 0xA000) diff --git a/engines/cge/general.h b/engines/cge/general.h index c1c417c237..16b0c1e2bf 100644 --- a/engines/cge/general.h +++ b/engines/cge/general.h @@ -33,7 +33,6 @@ #include "common/textconsole.h" #include "common/str.h" #include "cge/jbw.h" -#include <io.h> #include "cge/boot.h" namespace CGE { @@ -114,22 +113,22 @@ class EMS; class EMM { - friend EMS; + friend class EMS; bool Test(void); long Top, Lim; EMS *List; int Han; static void *Frame; public: - EMM::EMM(long size = 0); - EMM::~EMM(void); + EMM(long size = 0); + ~EMM(void); EMS *Alloc(uint16 siz); void Release(void); }; class EMS { - friend EMM; + friend class EMM; EMM *Emm; long Ptr; uint16 Siz; diff --git a/engines/cge/jbw.h b/engines/cge/jbw.h index 4a341fbbb7..82647ed49a 100644 --- a/engines/cge/jbw.h +++ b/engines/cge/jbw.h @@ -47,7 +47,6 @@ namespace CGE { #define FF 12 #define CR 13 #define MAXFILE 128 -#define NULL 0 #define IsWhite(c) ((c) == ' ' || (c) == '\t' || (c) == '\n') #define IsUpper(c) ((c) >= 'A' && (c) <= 'Z') diff --git a/engines/cge/keybd.cpp b/engines/cge/keybd.cpp index 35e6c72c11..c912555949 100644 --- a/engines/cge/keybd.cpp +++ b/engines/cge/keybd.cpp @@ -27,7 +27,6 @@ #include "cge/keybd.h" #include "cge/mouse.h" -#include <dos.h> namespace CGE { diff --git a/engines/cge/mouse.cpp b/engines/cge/mouse.cpp index 601d02999f..78e686ff95 100644 --- a/engines/cge/mouse.cpp +++ b/engines/cge/mouse.cpp @@ -27,7 +27,6 @@ #include "cge/mouse.h" #include "cge/text.h" -#include <dos.h> namespace CGE { diff --git a/engines/cge/snail.cpp b/engines/cge/snail.cpp index 382b6dbc62..ec1fae515c 100644 --- a/engines/cge/snail.cpp +++ b/engines/cge/snail.cpp @@ -33,13 +33,20 @@ #include "cge/text.h" #include "cge/mouse.h" #include "cge/cge_main.h" -#include <dos.h> #include <stdio.h> #include <stdlib.h> #include "cge/keybd.h" namespace CGE { +static void _enable() { + warning("STUB: _enable"); +} + +static void _disable() { + warning("STUB: _disable"); +} + int MaxCave = 0; SCB Scb = { NULL, 0, NULL }; diff --git a/engines/cge/startup.cpp b/engines/cge/startup.cpp index 10967afbc4..e534e04257 100644 --- a/engines/cge/startup.cpp +++ b/engines/cge/startup.cpp @@ -32,8 +32,6 @@ #include "cge/cfile.h" #include "cge/snddrv.h" #include <stdio.h> -#include <process.h> -#include <dos.h> #include <string.h> #include <stdlib.h> diff --git a/engines/cge/talk.cpp b/engines/cge/talk.cpp index e707e4e705..f4c0c1ac27 100644 --- a/engines/cge/talk.cpp +++ b/engines/cge/talk.cpp @@ -30,7 +30,6 @@ #include "cge/vol.h" #include "cge/game.h" #include "cge/mouse.h" -#include <dos.h> namespace CGE { diff --git a/engines/cge/text.cpp b/engines/cge/text.cpp index 9b79147cff..3695c955f5 100644 --- a/engines/cge/text.cpp +++ b/engines/cge/text.cpp @@ -35,7 +35,6 @@ #include <string.h> #include <stdlib.h> #include <stdio.h> -#include <dos.h> namespace CGE { diff --git a/engines/cge/vga13h.cpp b/engines/cge/vga13h.cpp index c1587fa45a..a7dd76273d 100644 --- a/engines/cge/vga13h.cpp +++ b/engines/cge/vga13h.cpp @@ -30,13 +30,10 @@ #include "cge/bitmap.h" #include "cge/vol.h" #include "cge/text.h" -#include <conio.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <dos.h> #include <fcntl.h> -#include <io.h> namespace CGE { diff --git a/engines/cge/vga13h.h b/engines/cge/vga13h.h index 2660274c23..19453a4523 100644 --- a/engines/cge/vga13h.h +++ b/engines/cge/vga13h.h @@ -129,7 +129,7 @@ extern SEQ Seq2[]; class HEART : public ENGINE { - friend ENGINE; + friend class ENGINE; public: static bool Enable; static uint16 *XTimer; diff --git a/engines/cge/wav.h b/engines/cge/wav.h index 6d46769cf9..304c2827d8 100644 --- a/engines/cge/wav.h +++ b/engines/cge/wav.h @@ -95,7 +95,7 @@ class FMTCK : public CKHEA { } Wav; union { - struct PCM { + struct { uint16 wBitsPerSample; // Sample size } Pcm; }; |