Commit of the X11 driver using the new OSystem interface. Plus some warning fixes and gameDetector hacks.

svn-id: r4024
This commit is contained in:
Lionel Ulmer 2002-04-20 17:41:42 +00:00
parent 32d69e8c02
commit c673d1c760
8 changed files with 551 additions and 539 deletions

46
Makefile.x11 Normal file
View File

@ -0,0 +1,46 @@
# $Header$
CC = gcc
CFLAGS = -g -O -Wall -Wstrict-prototypes -Wuninitialized -Wno-long-long -Wno-multichar -DCOMPRESSED_SOUND_FILE
DEFINES = -DUNIX_X11
LDFLAGS := -L/usr/X11R6/lib -L/usr/local/lib
INCLUDES:= -I/usr/X11R6/include -I./ -I./sound -I/usr/local/include
CPPFLAGS= $(DEFINES) $(INCLUDES)
# Add -lmad for -DCOMPRESSED_SOUND_FILE
LIBS = -lXext -lX11 -lncurses -lm -lmad -lpthread
ZIPFILE := scummvm-`date '+%Y-%m-%d'`.zip
INCS = scumm.h scummsys.h stdafx.h
OBJS = actor.o boxes.o costume.o gfx.o object.o resource.o \
saveload.o script.o scummvm.o sound.o string.o \
sys.o verbs.o script_v1.o script_v2.o debug.o gui.o \
sound/imuse.o sound/fmopl.o sound/mixer.o debugrl.o \
akos.o vars.o insane.o gameDetector.o init.o mp3_cd.o\
v3/resource_v3.o v4/resource_v4.o 2xsai.o main.o \
simon/midi.o simon/simon.o simon/simonsys.o sound/mididrv.o x11.o
DISTFILES=$(OBJS:.o=.cpp) Makefile scumm.h scummsys.h stdafx.h stdafx.cpp \
windows.cpp debugrl.h whatsnew.txt readme.txt copying.txt \
scummvm.dsp scummvm.dsw sound/fmopl.h gui.h sound.h
.cpp.o:
$(CC) $(CFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
all: scummvm
scummvm: $(OBJS)
$(CC) $(LDFLAGS) -o $(@) $(OBJS) $(LIBS)
$(OBJS): Makefile
clean:
rm -f $(OBJS) scummvm
dist:
rm -f $(ZIPFILE)
zip -q $(ZIPFILE) $(DISTFILES)
check:
$(OBJS): $(INCS)

View File

@ -340,12 +340,21 @@ int GameDetector::detectMain(int argc, char **argv)
_noSubtitles = 0; // use by default - should this depend on soundtrack?
_gfx_mode = GFX_DOUBLESIZE;
_gfx_driver = GD_AUTO;
_sfx_volume = 100;
#ifdef USE_NULL_DRIVER
#if defined(USE_NULL_DRIVER)
_gfx_driver = GD_NULL;
#elif defined(__DC__)
_gfx_driver = GD_DC;
#elif defined(UNIX_X11)
_gfx_driver = GD_X;
#elif defined(__MORPHOS__)
_gfx_driver = GD_MORPHOS;
#elif defined(WIN32_WCE)
_gfx_driver = GD_WINCE;
#else
/* SDL is the default driver for now */
_gfx_driver = GD_SDL;
#endif
_gameDataPath = NULL;
@ -396,41 +405,26 @@ int GameDetector::detectMain(int argc, char **argv)
}
OSystem *GameDetector::createSystem() {
#ifdef __MORPHOS__
_gfx_driver = GD_MORPHOS;
#endif
/* auto is to use SDL */
switch(_gfx_driver) {
#ifdef __DC__
case GD_AUTO:
return OSystem_Dreamcast_create();
#else
case GD_SDL:
case GD_AUTO:
#ifdef _WIN32_WCE
return OSystem_WINCE3_create();
#endif
#if !defined(__MORPHOS__)
return OSystem_SDL_create(_gfx_mode, _fullScreen);
#endif
case GD_WIN32:
/* not implemented yet */
break;
#if defined(UNIX_X11)
case GD_X:
/* not implemented yet */
break;
return OSystem_X11_create();
#elif defined(__DC__)
case GD_DC:
return OSystem_Dreamcast_create();
#elif defined(WIN32_WCE)
case GD_WINCE:
return OSystem_WINCE3_create();
#elif defined(__MORPHOS__)
case GD_MORPHOS:
#if defined(__MORPHOS__)
return OSystem_MorphOS_create(_gameId, _gfx_mode, _fullScreen);
#endif
break;
#ifdef USE_NULL_DRIVER
#elif defined(USE_NULL_DRIVER)
case GD_NULL:
return OSystem_NULL_create();
#endif
#else
case GD_SDL:
return OSystem_SDL_create(_gfx_mode, _fullScreen);
#endif
}

View File

@ -911,7 +911,6 @@ void Scumm::o5_cursorCommand()
{
int i, j, k;
int16 table[16];
byte origop = _opcode;
switch ((_opcode = fetchScriptByte()) & 0x1F) {
case 1: /* cursor show */
_cursorState = 1;

View File

@ -102,12 +102,19 @@ typedef signed long int32;
#define START_PACK_STRUCTS pack (push,1)
#define END_PACK_STRUCTS pack(pop)
#elif (defined(UNIX) || defined(__APPLE__))
#elif (defined(UNIX) || defined(__APPLE__) || defined(UNIX_X11))
#define scumm_stricmp strcasecmp
#define CHECK_HEAP
#ifdef UNIX_X11
/* You need to set those manually */
#define SCUMM_LITTLE_ENDIAN
/* #define SCUMM_NEED_ALIGNMENT */
#else
/* need this for the SDL_BYTEORDER define */
#include <SDL_byteorder.h>
@ -119,6 +126,7 @@ typedef signed long int32;
#else
#error Neither SDL_BIG_ENDIAN nor SDL_LITTLE_ENDIAN is set.
#endif
#endif
#define FORCEINLINE inline
#define CDECL

View File

@ -220,7 +220,7 @@ struct VgaFile1Struct0x6 {
};
/* dummy typedefs to make it compile in *nix */
#if defined(UNIX) || defined(__MORPHOS__) || defined(__DC__)
#if defined(UNIX) || defined(UNIX_X11) || defined(__MORPHOS__) || defined(__DC__)
typedef void* HMIDISTRM;
typedef void* HMIDIOUT;
typedef uint32 UINT;

View File

@ -781,7 +781,7 @@ void MidiDriver::midiInitNull()
#ifdef WIN32
#include <winsock.h>
#elif defined(UNIX)
#elif (defined(UNIX) || defined(UNIX_X11))
#include <sys/time.h>
#include <unistd.h>
#include <sys/types.h>

View File

@ -122,6 +122,7 @@ OSystem *OSystem_NULL_create();
OSystem *OSystem_MorphOS_create(int game_id, int gfx_driver, bool full_screen);
OSystem *OSystem_Dreamcast_create();
OSystem *OSystem_WINCE3_create();
OSystem *OSystem_X11_create();
enum {
GFX_NORMAL = 0,
@ -135,13 +136,12 @@ enum {
/* Graphics drivers */
enum {
GD_AUTO = 0,
GD_SDL = 1,
GD_WIN32 = 2,
GD_X = 3,
GD_NULL = 4,
GD_MORPHOS = 5,
GD_WINCE = 6
GD_NULL = 0,
GD_SDL,
GD_X,
GD_MORPHOS,
GD_WINCE,
GD_DC
};

959
x11.cpp

File diff suppressed because it is too large Load Diff