diff options
Diffstat (limited to 'backends/platform')
52 files changed, 748 insertions, 703 deletions
diff --git a/backends/platform/ds/arm9/makefile b/backends/platform/ds/arm9/makefile index db8e41af48..bf9fc1d826 100644 --- a/backends/platform/ds/arm9/makefile +++ b/backends/platform/ds/arm9/makefile @@ -1,13 +1,10 @@ srcdir ?= . DEPDIR := .deps -VERBOSE_BUILD = 0 -DYNAMIC_MODULES = 1 +#DYNAMIC_MODULES = 1 libndsdir = $(DEVKITPRO)/libnds #libndsdir = /home/neil/devkitpror21/libnds -ENABLED = DYNAMIC_PLUGIN - # Select the build by setting SCUMM_BUILD to a,b,c,d,e,f or g. # Anything else gets build a. @@ -15,7 +12,7 @@ ifeq ($(SCUMM_BUILD),k) DS_BUILD_K = 1 else ifeq ($(SCUMM_BUILD),j) - DS_BUILD_J = 1 + DS_BUILD_J = 1 else ifeq ($(SCUMM_BUILD),i) DS_BUILD_I = 1 @@ -67,7 +64,7 @@ ifdef DS_BUILD_F else ifdef DS_BUILD_E # TODO: Inherit the earth uses so much RAM that I have removed libmad in order to - # claw some back. + # claw some back. @@ -78,7 +75,7 @@ else ifdef DS_BUILD_K else - #USE_MAD = 1 + # USE_MAD = 1 endif endif endif @@ -115,7 +112,7 @@ USE_ARM_COSTUME_ASM = 1 ifdef DS_BUILD_A DEFINES = -DDS_BUILD_A -DUSE_ARM_GFX_ASM -DUSE_ARM_COSTUME_ASM LOGO = logoa.bmp - ENABLE_SCUMM = $(ENABLED) + ENABLE_SCUMM = STATIC_PLUGIN USE_ARM_GFX_ASM = 1 BUILD=scummvm-A endif @@ -123,66 +120,66 @@ endif ifdef DS_BUILD_B DEFINES = -DDS_BUILD_B LOGO = logob.bmp - ENABLE_SKY = $(ENABLED) - ENABLE_QUEEN = $(ENABLED) + ENABLE_SKY = STATIC_PLUGIN + ENABLE_QUEEN = STATIC_PLUGIN BUILD=scummvm-B endif ifdef DS_BUILD_C DEFINES = -DDS_BUILD_C LOGO = logoc.bmp - ENABLE_AGOS = $(ENABLED) + ENABLE_AGOS = STATIC_PLUGIN BUILD=scummvm-C endif ifdef DS_BUILD_D DEFINES = -DDS_BUILD_D LOGO = logod.bmp - ENABLE_GOB = $(ENABLED) - ENABLE_CINE = $(ENABLED) - ENABLE_AGI = $(ENABLED) + ENABLE_GOB = STATIC_PLUGIN + ENABLE_CINE = STATIC_PLUGIN + ENABLE_AGI = STATIC_PLUGIN BUILD=scummvm-D endif ifdef DS_BUILD_E DEFINES = -DDS_BUILD_E LOGO = logoe.bmp - ENABLE_SAGA = $(ENABLED) + ENABLE_SAGA = STATIC_PLUGIN BUILD=scummvm-E endif ifdef DS_BUILD_F DEFINES = -DDS_BUILD_F LOGO = logof.bmp - ENABLE_KYRA = $(ENABLED) + ENABLE_KYRA = STATIC_PLUGIN BUILD=scummvm-F endif ifdef DS_BUILD_G DEFINES = -DDS_BUILD_G LOGO = logog.bmp - ENABLE_LURE = $(ENABLED) + ENABLE_LURE = STATIC_PLUGIN BUILD=scummvm-G endif ifdef DS_BUILD_H DEFINES = -DDS_BUILD_H LOGO = logoh.bmp - ENABLE_PARALLACTION = $(ENABLED) + ENABLE_PARALLACTION = STATIC_PLUGIN BUILD=scummvm-H endif ifdef DS_BUILD_I DEFINES = -DDS_BUILD_I LOGO = logoi.bmp - ENABLE_MADE = $(ENABLED) + ENABLE_MADE = STATIC_PLUGIN BUILD=scummvm-I endif ifdef DS_BUILD_K DEFINES = -DDS_BUILD_K LOGO = logok.bmp - ENABLE_CRUISE = $(ENABLED) + ENABLE_CRUISE = STATIC_PLUGIN BUILD=scummvm-K endif @@ -190,18 +187,18 @@ endif #ifdef DS_BUILD_L # DEFINES = -DDS_BUILD_L # LOGO = logog.bmp -# ENABLE_DRASCULA = $(ENABLED) +# ENABLE_DRASCULA = STATIC_PLUGIN # BUILD=scummvm-K #endif #ifdef DS_BUILD_M # DEFINES = -DDS_BUILD_M # LOGO = logog.bmp -# ENABLE_TUCKER = $(ENABLED) +# ENABLE_TUCKER = STATIC_PLUGIN # BUILD=scummvm-K #endif -ARM7BIN := -7 $(CURDIR)/../arm7/arm7.bin +ARM7BIN := -7 $(CURDIR)/../../arm7/arm7.bin CC = arm-eabi-gcc CXX = arm-eabi-g++ @@ -239,14 +236,14 @@ CXXFLAGS= $(CFLAGS) -Wno-non-virtual-dtor -Wno-unknown-pragmas -Wno-reorder \ ASFLAGS = -mcpu=arm9tdmi -mthumb-interwork -DEFINES += -D__DS__ -DNDS -DARM9 -DNONSTANDARD_PORT -DDISABLE_TEXT_CONSOLE -DDISABLE_FANCY_THEMES -DVECTOR_RENDERER_FORMAT=1555 -DDISABLE_DOSBOX_OPL -DDISABLE_DEFAULT_SAVEFILEMANAGER -DUSE_ELF_LOADER -DARM -DARM_TARGET -DONE_PLUGIN_AT_A_TIME +DEFINES += -D__DS__ -DNDS -DARM9 -DNONSTANDARD_PORT -DDISABLE_TEXT_CONSOLE -DDISABLE_FANCY_THEMES -DVECTOR_RENDERER_FORMAT=1555 -DDISABLE_DOSBOX_OPL -DDISABLE_DEFAULT_SAVEFILEMANAGER -DARM ifdef USE_MAD DEFINES += -DUSE_MAD endif DEFINES += -DREDUCE_MEMORY_USAGE -LDFLAGS = -specs=ds_arm9.specs -mthumb-interwork -mno-fpu -Wl,--target1-abs,-Map,map.txt#-Wl,--gc-sections +LDFLAGS = -specs=ds_arm9.specs -mthumb-interwork -mno-fpu -Wl,-Map,map.txt -Wl,--gc-sections ifdef WRAP_MALLOC LDFLAGS += -Wl,--wrap,malloc @@ -255,11 +252,12 @@ endif BACKEND := ds -INCLUDES= -I$(portdir) -I$(srcdir) -I$(srcdir)/engines \ +INCLUDES= -I$(portdir)/$(BUILD) -I$(srcdir) -I$(srcdir)/engines \ -I$(portdir)/data -I$(portdir)/../commoninclude \ -I$(portdir)/source -I$(portdir)/source/mad \ -I$(libndsdir)/include -include $(srcdir)/common/scummsys.h + LIBS = -lm -L$(libndsdir)/lib -L$(portdir)/lib -lnds9 ifdef USE_MAD LIBS += -lmad @@ -268,19 +266,7 @@ ifdef USE_DEBUGGER LIBS += -ldsdebugger -ldswifi9 endif -ifeq ($(DYNAMIC_MODULES),1) -DEFINES += -DDYNAMIC_MODULES -PRE_OBJS_FLAGS = -Wl,--whole-archive -POST_OBJS_FLAGS = -Wl,--no-whole-archive -endif - EXECUTABLE = scummvm.elf - -PLUGIN_PREFIX = -PLUGIN_SUFFIX = .plg -PLUGIN_EXTRA_DEPS = $(srcdir)/backends/plugins/ds/plugin.ld $(srcdir)/backends/plugins/elf/plugin.syms $(EXECUTABLE) -PLUGIN_LDFLAGS += -nostartfiles -Wl,-q,--target1-abs,--just-symbols,$(EXECUTABLE),-T$(srcdir)/backends/plugins/ds/plugin.ld,--retain-symbols-file,$(srcdir)/backends/plugins/elf/plugin.syms -lstdc++ -lc -mthumb-interwork -mno-fpu#-Wl,--gc-sections -mno-crt0 $(DEVKITPRO)/devkitARM/arm-eabi/lib/ds_arm9_crt0.o - MKDIR = mkdir -p RM = rm -f RM_REC = rm -rf @@ -354,22 +340,25 @@ OPT_SIZE := -Os -mthumb OBJS := $(DATA_OBJS) $(PORT_OBJS) $(FAT_OBJS) + MODULE_DIRS += . -ndsall: plugins - make -f makefile scummvm.nds scummvm.ds.gba +ndsall: + @[ -d $(BUILD) ] || mkdir -p $(BUILD) + make -C ./$(BUILD) -f ../makefile scummvm.nds scummvm.ds.gba include $(srcdir)/Makefile.common semiclean: $(RM) $(portdir)/source/dsoptions.o $(portdir)/source/dsmain.o $(FAT_OBJS) $(DATA_OBJS) $(portdir)/source/wordcompletion.o $(portdir)/source/dsoptions.o -clean: #TODO: Manual removal of engine, plugins, etc. isn't very elegant! +clean: $(RM) $(OBJS) $(EXECUTABLE) - rm -rf *.h engines plugins graphics gui common sound backends base map.txt scummvm.nds scummvm.ds.gba + rm -fr $(BUILD) dist : SCUMMVM.BIN plugins plugin_dist + #--------------------------------------------------------------------------------- # canned command sequence for binary data #--------------------------------------------------------------------------------- @@ -411,14 +400,13 @@ endef #--------------------------------------------------------------------------------- %.nds: %.bin - ndstool -c $@ -9 $< $(ARM7BIN) -b ../$(LOGO) "$(@F);ScummVM $(VERSION);DS Port" + ndstool -c $@ -9 $< $(ARM7BIN) -b ../../$(LOGO) "$(@F);ScummVM $(VERSION);DS Port" %.ds.gba: %.nds dsbuild $< -o $@ -l $(portdir)/ndsloader.bin padbin 16 $@ #--------------------------------------------------------------------------------- - %.bin: %.elf $(OBJCOPY) -S -O binary $< $@ diff --git a/backends/platform/ds/arm9/source/dsmain.cpp b/backends/platform/ds/arm9/source/dsmain.cpp index 3e33b168ee..a9dc05b89c 100644 --- a/backends/platform/ds/arm9/source/dsmain.cpp +++ b/backends/platform/ds/arm9/source/dsmain.cpp @@ -3229,15 +3229,11 @@ int main(void) { } // End of namespace DS -#ifndef DISABLE_TEXT_CONSOLE -extern int gDebugLevel; -#endif int main() { #ifndef DISABLE_TEXT_CONSOLE consoleDebugInit(DebugDevice_NOCASH); nocashMessage("startup\n"); - gDebugLevel = 2; #endif DS::main(); } diff --git a/backends/platform/gp2x/gp2x-hw.cpp b/backends/platform/gp2x/gp2x-hw.cpp index 6f544258ec..8818ff9fe9 100644 --- a/backends/platform/gp2x/gp2x-hw.cpp +++ b/backends/platform/gp2x/gp2x-hw.cpp @@ -51,6 +51,10 @@ #include <sys/time.h> #include <unistd.h> +extern "C" { +static unsigned long gp2x_dev[8]={0,0,0,0,0,0,0,0};//, gp2x_ticks_per_second; +} + namespace GP2X_HW { enum { diff --git a/backends/platform/gp2x/gp2x-mem.cpp b/backends/platform/gp2x/gp2x-mem.cpp index 4a1802f311..0968087cfd 100644 --- a/backends/platform/gp2x/gp2x-mem.cpp +++ b/backends/platform/gp2x/gp2x-mem.cpp @@ -42,8 +42,11 @@ #include "backends/platform/gp2x/gp2x-mem.h" -void SetClock (unsigned c) -{ +extern "C" { +static volatile unsigned short *gp2x_memregs; +} + +void SetClock (unsigned c) { unsigned v; unsigned mdiv,pdiv=3,scale=0; @@ -57,8 +60,7 @@ void SetClock (unsigned c) gp2x_memregs[0x910>>1] = v; } -void patchMMU (void) -{ +void patchMMU (void) { //volatile unsigned int *secbuf = (unsigned int *)malloc (204800); printf ("Reconfiguring cached memory regions...\n"); @@ -71,19 +73,15 @@ void patchMMU (void) int mmufd = open("/dev/mmuhack", O_RDWR); - if(mmufd < 0) - { + if(mmufd < 0) { printf ("Upper memory uncached (attempt failed, access to upper memory will be slower)...\n"); - } - else - { + } else { printf ("Upper memory cached...\n"); close(mmufd); } } -void unpatchMMU (void) -{ +void unpatchMMU (void) { printf ("Restoreing cached memory regions...\n"); system("/sbin/rmmod mmuhack"); } diff --git a/backends/platform/gp2x/gp2x-mem.h b/backends/platform/gp2x/gp2x-mem.h index 24b2a3f569..aa49444164 100644 --- a/backends/platform/gp2x/gp2x-mem.h +++ b/backends/platform/gp2x/gp2x-mem.h @@ -47,9 +47,6 @@ extern void unpatchMMU (void); #define SYS_CLK_FREQ 7372800 -static unsigned long gp2x_dev[8]={0,0,0,0,0,0,0,0};//, gp2x_ticks_per_second; -static volatile unsigned short *gp2x_ram, *gp2x_memregs; - #ifdef __cplusplus } #endif diff --git a/backends/platform/openpandora/op-main.cpp b/backends/platform/openpandora/op-main.cpp index 4febd404c3..3f4208a95a 100755 --- a/backends/platform/openpandora/op-main.cpp +++ b/backends/platform/openpandora/op-main.cpp @@ -23,6 +23,9 @@ * */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + #include "common/scummsys.h" #include <SDL/SDL.h> diff --git a/backends/platform/ps2/systemps2.cpp b/backends/platform/ps2/systemps2.cpp index d525a35b7d..1b3ae6ba47 100644 --- a/backends/platform/ps2/systemps2.cpp +++ b/backends/platform/ps2/systemps2.cpp @@ -26,6 +26,9 @@ // Disable symbol overrides so that we can use system headers. #define FORBIDDEN_SYMBOL_ALLOW_ALL +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + #include <kernel.h> #include <stdio.h> #include <stdlib.h> @@ -344,7 +347,6 @@ OSystem_PS2::OSystem_PS2(const char *elfPath) { } void OSystem_PS2::init(void) { - //msgPrintf(FOREVER, "got to init! Now restart your console... %d\n", res); sioprintf("Timer...\n"); _scummTimerManager = new DefaultTimerManager(); _scummMixer = new Audio::MixerImpl(this, 48000); diff --git a/backends/platform/psp/audio.cpp b/backends/platform/psp/audio.cpp index b5a72dccd0..d7487b0c1a 100644 --- a/backends/platform/psp/audio.cpp +++ b/backends/platform/psp/audio.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ + * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/backends/platform/psp/osys_psp.cpp $ + * $Id: osys_psp.cpp 46126 2009-11-24 14:18:46Z fingolfin $ * */ diff --git a/backends/platform/psp/audio.h b/backends/platform/psp/audio.h index f5179028dc..ec9801185f 100644 --- a/backends/platform/psp/audio.h +++ b/backends/platform/psp/audio.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ + * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/backends/platform/psp/osys_psp.cpp $ + * $Id: osys_psp.cpp 46126 2009-11-24 14:18:46Z fingolfin $ * */ diff --git a/backends/platform/psp/cursor.cpp b/backends/platform/psp/cursor.cpp index cf879e095a..ae3b8f0050 100644 --- a/backends/platform/psp/cursor.cpp +++ b/backends/platform/psp/cursor.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ + * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/backends/platform/psp/osys_psp.h $ + * $Id: osys_psp.h 46120 2009-11-24 10:33:30Z Bluddy $ * */ diff --git a/backends/platform/psp/default_display_client.h b/backends/platform/psp/default_display_client.h index 2e33632eb1..716e6fcc35 100644 --- a/backends/platform/psp/default_display_client.h +++ b/backends/platform/psp/default_display_client.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ + * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/backends/platform/psp/trace.h $ + * $Id: trace.h 44276 2009-09-23 16:11:23Z joostp $ * */ diff --git a/backends/platform/psp/display_client.cpp b/backends/platform/psp/display_client.cpp index 4310b195dd..9d4f573e28 100644 --- a/backends/platform/psp/display_client.cpp +++ b/backends/platform/psp/display_client.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ + * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/backends/platform/psp/osys_psp.cpp $ + * $Id: osys_psp.cpp 46126 2009-11-24 14:18:46Z fingolfin $ * */ diff --git a/backends/platform/psp/display_manager.cpp b/backends/platform/psp/display_manager.cpp index 7454211da6..2c94882a63 100644 --- a/backends/platform/psp/display_manager.cpp +++ b/backends/platform/psp/display_manager.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ + * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/backends/platform/psp/osys_psp.cpp $ + * $Id: osys_psp.cpp 47541 2010-01-25 01:39:44Z lordhoto $ * */ diff --git a/backends/platform/psp/display_manager.h b/backends/platform/psp/display_manager.h index 5c7d4c799a..4537af0096 100644 --- a/backends/platform/psp/display_manager.h +++ b/backends/platform/psp/display_manager.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ + * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/backends/platform/psp/osys_psp.cpp $ + * $Id: osys_psp.cpp 47541 2010-01-25 01:39:44Z lordhoto $ * */ diff --git a/backends/platform/psp/input.cpp b/backends/platform/psp/input.cpp index 665f41504f..0dad31e5ae 100644 --- a/backends/platform/psp/input.cpp +++ b/backends/platform/psp/input.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ + * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/backends/platform/psp/osys_psp.cpp $ + * $Id: osys_psp.cpp 43618 2009-08-21 22:44:49Z joostp $ * */ diff --git a/backends/platform/psp/psp_main.cpp b/backends/platform/psp/psp_main.cpp index 019f6c12d1..d24c614e33 100644 --- a/backends/platform/psp/psp_main.cpp +++ b/backends/platform/psp/psp_main.cpp @@ -37,6 +37,7 @@ #include <common/system.h> #include <engines/engine.h> #include <base/main.h> +#include <base/plugins.h> #include "backends/platform/psp/powerman.h" #include "backends/platform/psp/thread.h" diff --git a/backends/platform/psp/thread.cpp b/backends/platform/psp/thread.cpp index 3e1303a4e6..f9e497a342 100644 --- a/backends/platform/psp/thread.cpp +++ b/backends/platform/psp/thread.cpp @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ + * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/backends/platform/psp/osys_psp.h $ + * $Id: osys_psp.h 49173 2010-05-24 03:05:17Z bluddy $ * */ diff --git a/backends/platform/psp/thread.h b/backends/platform/psp/thread.h index 1ca6ef5c42..bbad2a9ead 100644 --- a/backends/platform/psp/thread.h +++ b/backends/platform/psp/thread.h @@ -18,8 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ + * $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/backends/platform/psp/portdefs.h $ + * $Id: portdefs.h 38687 2009-02-21 12:08:52Z joostp $ * */ diff --git a/backends/platform/symbian/src/portdefs.h b/backends/platform/symbian/src/portdefs.h index 2a26771a0a..6868faaa89 100644 --- a/backends/platform/symbian/src/portdefs.h +++ b/backends/platform/symbian/src/portdefs.h @@ -45,6 +45,13 @@ // and we _really_ don't wanna link with any other windows LIBC library! #if defined(__GCC32__) + FIXME: If the following macros are ever used, then this will lead + to serious errors, e.g. an almost guaranteed buffer overflow + in Common::String::format(). Do *NOT* re-#define vsnprintf to + vsprintf, it will lead to disaster! + This shouldn't be necessary anyway, since we have + backends/platform/symbian/src/vsnprintf.h + #define snprintf(buf,len,args...) sprintf(buf,args) #define vsnprintf(buf,len,format,valist) vsprintf(buf,format,valist) diff --git a/backends/platform/wii/options.cpp b/backends/platform/wii/options.cpp index 2a47958e3b..ffabc5ae97 100644 --- a/backends/platform/wii/options.cpp +++ b/backends/platform/wii/options.cpp @@ -183,7 +183,7 @@ void WiiOptionsDialog::handleTickle() { break; default: - label = String::printf(_("Network not initialised (%d)"), status); + label = String::format(_("Network not initialised (%d)"), status); break; } diff --git a/backends/platform/wince/CEActionsPocket.cpp b/backends/platform/wince/CEActionsPocket.cpp index 64abd0be3e..99d0be2bdc 100644 --- a/backends/platform/wince/CEActionsPocket.cpp +++ b/backends/platform/wince/CEActionsPocket.cpp @@ -23,21 +23,25 @@ * */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + +#include "backends/platform/wince/wince-sdl.h" #include "CEActionsPocket.h" #include "EventsBuffer.h" #include "gui/message.h" -#include "scumm/scumm.h" #include "common/config-manager.h" #include "gui/KeysDialog.h" #include "common/translation.h" + #ifdef _WIN32_WCE #define KEY_ALL_SKIP 3457 #endif -const String pocketActionNames[] = { +const Common::String pocketActionNames[] = { _s("Pause"), _s("Save"), _s("Quit"), @@ -64,7 +68,7 @@ void CEActionsPocket::init() { } -String CEActionsPocket::actionName(GUI::ActionType action) { +Common::String CEActionsPocket::actionName(GUI::ActionType action) { return _(pocketActionNames[action]); } @@ -72,7 +76,7 @@ int CEActionsPocket::size() { return POCKET_ACTION_LAST; } -String CEActionsPocket::domain() { +Common::String CEActionsPocket::domain() { return ConfMan.kApplicationDomain; } @@ -81,8 +85,7 @@ int CEActionsPocket::version() { } CEActionsPocket::CEActionsPocket(const Common::String &gameid) : -GUI::Actions() -{ +GUI::Actions() { int i; _right_click_needed = false; @@ -114,7 +117,7 @@ void CEActionsPocket::initInstanceMain(OSystem *mainSystem) { } void CEActionsPocket::initInstanceGame() { - String gameid(ConfMan.get("gameid")); + Common::String gameid(ConfMan.get("gameid")); bool is_simon = (strncmp(gameid.c_str(), "simon", 5) == 0); bool is_sword1 = (gameid == "sword1"); bool is_sword2 = (strcmp(gameid.c_str(), "sword2") == 0); diff --git a/backends/platform/wince/CEActionsPocket.h b/backends/platform/wince/CEActionsPocket.h index 0fe29a9e86..72a2064fbf 100644 --- a/backends/platform/wince/CEActionsPocket.h +++ b/backends/platform/wince/CEActionsPocket.h @@ -28,7 +28,7 @@ #include "common/scummsys.h" #include "common/system.h" -#include "wince-sdl.h" +#include "common/str.h" #include "gui/Key.h" #include "gui/Actions.h" @@ -58,33 +58,35 @@ enum pocketActionType { POCKET_ACTION_LAST }; +class OSystem_WINCE3; + class CEActionsPocket : public GUI::Actions { - public: - // Actions - bool perform(GUI::ActionType action, bool pushed = true); - String actionName(GUI::ActionType action); - int size(); +public: + // Actions + bool perform(GUI::ActionType action, bool pushed = true); + Common::String actionName(GUI::ActionType action); + int size(); - static void init(); - void initInstanceMain(OSystem *mainSystem); - void initInstanceGame(); + static void init(); + void initInstanceMain(OSystem *mainSystem); + void initInstanceGame(); - // Action domain - String domain(); - int version(); + // Action domain + Common::String domain(); + int version(); - // Utility - bool needsRightClickMapping(); - bool needsHideToolbarMapping(); - bool needsZoomMapping(); + // Utility + bool needsRightClickMapping(); + bool needsHideToolbarMapping(); + bool needsZoomMapping(); - ~CEActionsPocket(); - private: - CEActionsPocket(const Common::String &gameid); - bool _right_click_needed; - bool _hide_toolbar_needed; - bool _zoom_needed; - OSystem_WINCE3 *_CESystem; - }; + ~CEActionsPocket(); +private: + CEActionsPocket(const Common::String &gameid); + bool _right_click_needed; + bool _hide_toolbar_needed; + bool _zoom_needed; + OSystem_WINCE3 *_CESystem; +}; #endif diff --git a/backends/platform/wince/CEActionsSmartphone.cpp b/backends/platform/wince/CEActionsSmartphone.cpp index af80bd2908..5c7feb4950 100644 --- a/backends/platform/wince/CEActionsSmartphone.cpp +++ b/backends/platform/wince/CEActionsSmartphone.cpp @@ -23,10 +23,14 @@ * */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + +#include "backends/platform/wince/wince-sdl.h" + #include "CEActionsSmartphone.h" #include "EventsBuffer.h" #include "gui/message.h" -#include "scumm/scumm.h" #include "common/config-manager.h" #include "gui/KeysDialog.h" diff --git a/backends/platform/wince/CEActionsSmartphone.h b/backends/platform/wince/CEActionsSmartphone.h index 36797cd2c8..29156bb152 100644 --- a/backends/platform/wince/CEActionsSmartphone.h +++ b/backends/platform/wince/CEActionsSmartphone.h @@ -28,7 +28,7 @@ #include "common/scummsys.h" #include "common/system.h" -#include "wince-sdl.h" +#include "common/str.h" #include "gui/Key.h" #include "gui/Actions.h" @@ -55,24 +55,24 @@ enum smartphoneActionType { class CEActionsSmartphone : public GUI::Actions { - public: - // Actions - bool perform(GUI::ActionType action, bool pushed = true); - String actionName(GUI::ActionType action); - int size(); - static void init(); - void initInstanceMain(OSystem *mainSystem); - void initInstanceGame(); +public: + // Actions + bool perform(GUI::ActionType action, bool pushed = true); + Common::String actionName(GUI::ActionType action); + int size(); + static void init(); + void initInstanceMain(OSystem *mainSystem); + void initInstanceGame(); - // Action domain - String domain(); - int version(); + // Action domain + Common::String domain(); + int version(); - ~CEActionsSmartphone(); - private: - CEActionsSmartphone(); - bool _right_click_needed; - OSystem_WINCE3 *_CESystem; - }; + ~CEActionsSmartphone(); +private: + CEActionsSmartphone(); + bool _right_click_needed; + OSystem_WINCE3 *_CESystem; +}; #endif diff --git a/backends/platform/wince/CEDevice.cpp b/backends/platform/wince/CEDevice.cpp index 98a8fb95f6..08acbbbfcd 100644 --- a/backends/platform/wince/CEDevice.cpp +++ b/backends/platform/wince/CEDevice.cpp @@ -23,11 +23,14 @@ * */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + #include "CEDevice.h" #include <SDL.h> -#include "wince-sdl.h" +#include "backends/platform/wince/wince-sdl.h" static void (WINAPI* _SHIdleTimerReset)(void) = NULL; static HANDLE (WINAPI* _SetPowerRequirement)(PVOID,int,ULONG,PVOID,ULONG) = NULL; diff --git a/backends/platform/wince/CEDevice.h b/backends/platform/wince/CEDevice.h index ca2f908c6d..b2b20d05ce 100644 --- a/backends/platform/wince/CEDevice.h +++ b/backends/platform/wince/CEDevice.h @@ -31,20 +31,20 @@ #include "common/str.h" class CEDevice { - public: - static void init(); - static void end(); - static void wakeUp(); - static bool hasPocketPCResolution(); - static bool hasSquareQVGAResolution(); - static bool hasDesktopResolution(); - static bool hasWideResolution(); - static bool hasSmartphoneResolution(); - static bool isSmartphone(); +public: + static void init(); + static void end(); + static void wakeUp(); + static bool hasPocketPCResolution(); + static bool hasSquareQVGAResolution(); + static bool hasDesktopResolution(); + static bool hasWideResolution(); + static bool hasSmartphoneResolution(); + static bool isSmartphone(); - private: - static DWORD reg_access(TCHAR *key, TCHAR *val, DWORD data); - static void backlight_xchg(); +private: + static DWORD reg_access(TCHAR *key, TCHAR *val, DWORD data); + static void backlight_xchg(); }; #endif diff --git a/backends/platform/wince/CELauncherDialog.cpp b/backends/platform/wince/CELauncherDialog.cpp index 11e4900c2d..66a691f51b 100644 --- a/backends/platform/wince/CELauncherDialog.cpp +++ b/backends/platform/wince/CELauncherDialog.cpp @@ -23,8 +23,10 @@ * */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL -#include "wince-sdl.h" +#include "backends/platform/wince/wince-sdl.h" #include "CELauncherDialog.h" diff --git a/backends/platform/wince/CEScaler.cpp b/backends/platform/wince/CEScaler.cpp index fd47635e05..182a7e0c94 100644 --- a/backends/platform/wince/CEScaler.cpp +++ b/backends/platform/wince/CEScaler.cpp @@ -22,6 +22,7 @@ * $Id$ * */ + #include "graphics/scaler/intern.h" #include "CEScaler.h" diff --git a/backends/platform/wince/CEgui/GUIElement.cpp b/backends/platform/wince/CEgui/GUIElement.cpp index 23e7843de1..7689837e3d 100644 --- a/backends/platform/wince/CEgui/GUIElement.cpp +++ b/backends/platform/wince/CEgui/GUIElement.cpp @@ -23,104 +23,108 @@ * */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + +#include <SDL.h> + #include "Toolbar.h" #include "SDL_ImageResource.h" namespace CEGUI { - GUIElement::GUIElement(int x, int y, int width, int height) : - _background(0), _drawn(false), _visible(true), _x(x), _y(y), _width(width), _height(height) - { - } +GUIElement::GUIElement(int x, int y, int width, int height) : +_background(0), _drawn(false), _visible(true), _x(x), _y(y), _width(width), _height(height) { +} - bool GUIElement::setBackground(WORD backgroundReference) { - _background = new SDL_ImageResource(); - if (!_background->load(backgroundReference)) { - delete _background; - _background = NULL; - return false; - } - if (!_height && !_width) { - _height = _background->height(); - _width = _background->width(); - } - else - if (_background->height() != _height || _background->width() != _width) { - delete _background; - _background = NULL; - return false; - } - return true; +bool GUIElement::setBackground(WORD backgroundReference) { + _background = new SDL_ImageResource(); + if (!_background->load(backgroundReference)) { + delete _background; + _background = NULL; + return false; } - - void GUIElement::move(int x, int y) { - _x = x; - _y = y; + if (!_height && !_width) { + _height = _background->height(); + _width = _background->width(); } + else + if (_background->height() != _height || _background->width() != _width) { + delete _background; + _background = NULL; + return false; + } + return true; +} - bool GUIElement::draw(SDL_Surface *surface) { - if (_background && !_drawn && _visible) { - SDL_Rect rect; - - rect.x = _x; - rect.y = _y; - rect.w = _width; - rect.h = _height; +void GUIElement::move(int x, int y) { + _x = x; + _y = y; +} - SDL_BlitSurface(_background->get(), NULL, surface, &rect); +bool GUIElement::draw(SDL_Surface *surface) { + if (_background && !_drawn && _visible) { + SDL_Rect rect; - _drawn = true; + rect.x = _x; + rect.y = _y; + rect.w = _width; + rect.h = _height; - return true; - } - else - return false; - } + SDL_BlitSurface(_background->get(), NULL, surface, &rect); - bool GUIElement::checkInside(int x, int y) { - if (x >= _x && x <= _x + _width && y >= _y && y <= _y + _height) - return true; - else - return false; - } + _drawn = true; - void GUIElement::setVisible(bool visibility) { - if (visibility && !_visible) - _drawn = false; - _visible = visibility; + return true; } + else + return false; +} - bool GUIElement::visible() { - return _visible; - } +bool GUIElement::checkInside(int x, int y) { + if (x >= _x && x <= _x + _width && y >= _y && y <= _y + _height) + return true; + else + return false; +} - void GUIElement::forceRedraw() { +void GUIElement::setVisible(bool visibility) { + if (visibility && !_visible) _drawn = false; - } + _visible = visibility; +} - bool GUIElement::drawn() { - return _drawn; - } +bool GUIElement::visible() { + return _visible; +} - int GUIElement::x() { - return _x; - } +void GUIElement::forceRedraw() { + _drawn = false; +} - int GUIElement::y() { - return _y; - } +bool GUIElement::drawn() { + return _drawn; +} - int GUIElement::width() { - return _width; - } +int GUIElement::x() { + return _x; +} - int GUIElement::height() { - return _height; - } +int GUIElement::y() { + return _y; +} - GUIElement::~GUIElement() { - delete _background; - } +int GUIElement::width() { + return _width; +} + +int GUIElement::height() { + return _height; +} +GUIElement::~GUIElement() { + delete _background; } + +} // End of namespace CEGUI diff --git a/backends/platform/wince/CEgui/GUIElement.h b/backends/platform/wince/CEgui/GUIElement.h index 7e4572d377..c599ebe9b5 100644 --- a/backends/platform/wince/CEgui/GUIElement.h +++ b/backends/platform/wince/CEgui/GUIElement.h @@ -29,39 +29,40 @@ #include "common/scummsys.h" #include "common/system.h" -#include "SDL.h" - -#include "SDL_ImageResource.h" +struct SDL_Surface; namespace CEGUI { - class GUIElement { - public: - bool setBackground(WORD backgroundReference); - void setVisible(bool visibility); - virtual void forceRedraw(); - virtual bool draw(SDL_Surface *surface); - virtual ~GUIElement(); - void move(int x, int y); - int width(); - int height(); - int x(); - int y(); - virtual bool action(int x, int y, bool pushed) = 0; - bool visible(); - bool drawn(); - protected: - GUIElement(int x = 0, int y = 0, int width = 0, int height = 0); - bool checkInside(int x, int y); - bool _visible; - SDL_ImageResource *_background; - int _x; - int _y; - bool _drawn; - private: - int _width; - int _height; - }; -} +class SDL_ImageResource; + +class GUIElement { +public: + bool setBackground(WORD backgroundReference); + void setVisible(bool visibility); + virtual void forceRedraw(); + virtual bool draw(SDL_Surface *surface); + virtual ~GUIElement(); + void move(int x, int y); + int width(); + int height(); + int x(); + int y(); + virtual bool action(int x, int y, bool pushed) = 0; + bool visible(); + bool drawn(); +protected: + GUIElement(int x = 0, int y = 0, int width = 0, int height = 0); + bool checkInside(int x, int y); + bool _visible; + SDL_ImageResource *_background; + int _x; + int _y; + bool _drawn; +private: + int _width; + int _height; +}; + +} // End of namespace CEGUI #endif diff --git a/backends/platform/wince/CEgui/ItemAction.cpp b/backends/platform/wince/CEgui/ItemAction.cpp index 3808622b2e..55805744e6 100644 --- a/backends/platform/wince/CEgui/ItemAction.cpp +++ b/backends/platform/wince/CEgui/ItemAction.cpp @@ -27,25 +27,25 @@ namespace CEGUI { - ItemAction::ItemAction(WORD reference, GUI::ActionType action) : - PanelItem(reference) { - _action = action; - if (!GUI::Actions::Instance()->isEnabled(_action)) - _visible = false; - } - - - ItemAction::~ItemAction() { - } - - bool ItemAction::action(int x, int y, bool pushed) { - - if (checkInside(x, y) && _visible && pushed) { - GUI::Actions::Instance()->perform(_action, true); - GUI::Actions::Instance()->perform(_action, false); - return true; - } - else - return false; - } +ItemAction::ItemAction(WORD reference, GUI::ActionType action) : +PanelItem(reference) { + _action = action; + if (!GUI::Actions::Instance()->isEnabled(_action)) + _visible = false; } + + +ItemAction::~ItemAction() { +} + +bool ItemAction::action(int x, int y, bool pushed) { + + if (checkInside(x, y) && _visible && pushed) { + GUI::Actions::Instance()->perform(_action, true); + GUI::Actions::Instance()->perform(_action, false); + return true; + } else + return false; +} + +} // End of namespace CEGUI diff --git a/backends/platform/wince/CEgui/ItemAction.h b/backends/platform/wince/CEgui/ItemAction.h index 74ed6bec4d..4f35b3090d 100644 --- a/backends/platform/wince/CEgui/ItemAction.h +++ b/backends/platform/wince/CEgui/ItemAction.h @@ -31,16 +31,18 @@ #include "gui/Actions.h" #include "CEgui/PanelItem.h" + namespace CEGUI { - class ItemAction : public PanelItem { - public: - ItemAction(WORD reference, GUI::ActionType action); - virtual ~ItemAction(); - virtual bool action(int x, int y, bool pushed); - private: - GUI::ActionType _action; - }; -} +class ItemAction : public PanelItem { +public: + ItemAction(WORD reference, GUI::ActionType action); + virtual ~ItemAction(); + virtual bool action(int x, int y, bool pushed); +private: + GUI::ActionType _action; +}; + +} // End of namespace CEGUI #endif diff --git a/backends/platform/wince/CEgui/ItemSwitch.cpp b/backends/platform/wince/CEgui/ItemSwitch.cpp index 8e0121f7c4..d4648f7556 100644 --- a/backends/platform/wince/CEgui/ItemSwitch.cpp +++ b/backends/platform/wince/CEgui/ItemSwitch.cpp @@ -24,71 +24,73 @@ */ #include "ItemSwitch.h" +#include "SDL_ImageResource.h" namespace CEGUI { - void ItemSwitch::init(WORD referenceTrue, WORD referenceFalse) { - _backgroundTrue = _background; - _backgroundFalse = new SDL_ImageResource(); - if (!_backgroundFalse->load(referenceFalse)) { - delete _backgroundFalse; - delete _background; - _background = NULL; - _backgroundFalse = NULL; - } +void ItemSwitch::init(WORD referenceTrue, WORD referenceFalse) { + _backgroundTrue = _background; + _backgroundFalse = new SDL_ImageResource(); + if (!_backgroundFalse->load(referenceFalse)) { + delete _backgroundFalse; + delete _background; + _background = NULL; + _backgroundFalse = NULL; } +} - ItemSwitch::ItemSwitch(WORD referenceTrue, WORD referenceFalse, bool *item) : - PanelItem(referenceTrue) { - init(referenceTrue, referenceFalse); - _item = item; - _itemmax = -1; - if (!*_item) - _background = _backgroundFalse; - } +ItemSwitch::ItemSwitch(WORD referenceTrue, WORD referenceFalse, bool *item) : +PanelItem(referenceTrue) { + init(referenceTrue, referenceFalse); + _item = item; + _itemmax = -1; + if (!*_item) + _background = _backgroundFalse; +} - ItemSwitch::ItemSwitch(WORD referenceTrue, WORD referenceFalse, int *item, int max) : - PanelItem(referenceTrue) { - init(referenceTrue, referenceFalse); - _itemmultiple = item; - _itemmax = max; - if (!*item) - _background = _backgroundFalse; - } +ItemSwitch::ItemSwitch(WORD referenceTrue, WORD referenceFalse, int *item, int max) : +PanelItem(referenceTrue) { + init(referenceTrue, referenceFalse); + _itemmultiple = item; + _itemmax = max; + if (!*item) + _background = _backgroundFalse; +} - ItemSwitch::~ItemSwitch() { - delete _backgroundFalse; - } +ItemSwitch::~ItemSwitch() { + delete _backgroundFalse; +} - bool ItemSwitch::action(int x, int y, bool pushed) { +bool ItemSwitch::action(int x, int y, bool pushed) { - if (checkInside(x, y) && _visible && pushed) { - if (_itemmax <= 0) { - *_item = !*_item; - if (*_item) - _background = _backgroundTrue; - else - _background = _backgroundFalse; + if (checkInside(x, y) && _visible && pushed) { + if (_itemmax <= 0) { + *_item = !*_item; + if (*_item) + _background = _backgroundTrue; + else + _background = _backgroundFalse; - if (_panel) - _panel->forceRedraw(); + if (_panel) + _panel->forceRedraw(); - return true; - } else { - *_itemmultiple = *_itemmultiple + 1; - if (*_itemmultiple > _itemmax) - *_itemmultiple = 0; - if (*_itemmultiple) - _background = _backgroundTrue; - else - _background = _backgroundFalse; + return true; + } else { + *_itemmultiple = *_itemmultiple + 1; + if (*_itemmultiple > _itemmax) + *_itemmultiple = 0; + if (*_itemmultiple) + _background = _backgroundTrue; + else + _background = _backgroundFalse; - if (_panel) - _panel->forceRedraw(); + if (_panel) + _panel->forceRedraw(); - return true; - } - } else - return false; - } + return true; + } + } else + return false; } + +} // End of namespace CEGUI diff --git a/backends/platform/wince/CEgui/ItemSwitch.h b/backends/platform/wince/CEgui/ItemSwitch.h index 8d03ee77cb..1ca6f3c288 100644 --- a/backends/platform/wince/CEgui/ItemSwitch.h +++ b/backends/platform/wince/CEgui/ItemSwitch.h @@ -36,20 +36,23 @@ using GUI::Key; namespace CEGUI { - class ItemSwitch : public PanelItem { - public: - ItemSwitch(WORD referenceTrue, WORD referenceFalse, bool *item); - ItemSwitch(WORD referenceTrue, WORD referenceFalse, int *item, int max); - virtual ~ItemSwitch(); - virtual bool action(int x, int y, bool pushed); - private: - void init(WORD referenceTrue, WORD referenceFalse); - bool *_item; - static bool _itemdummy; - int *_itemmultiple, _itemmax; - SDL_ImageResource *_backgroundTrue; - SDL_ImageResource *_backgroundFalse; - }; -} +class SDL_ImageResource; + +class ItemSwitch : public PanelItem { +public: + ItemSwitch(WORD referenceTrue, WORD referenceFalse, bool *item); + ItemSwitch(WORD referenceTrue, WORD referenceFalse, int *item, int max); + virtual ~ItemSwitch(); + virtual bool action(int x, int y, bool pushed); +private: + void init(WORD referenceTrue, WORD referenceFalse); + bool *_item; + static bool _itemdummy; + int *_itemmultiple, _itemmax; + SDL_ImageResource *_backgroundTrue; + SDL_ImageResource *_backgroundFalse; +}; + +} // End of namespace CEGUI #endif diff --git a/backends/platform/wince/CEgui/Panel.cpp b/backends/platform/wince/CEgui/Panel.cpp index a2d965ca78..dfdd6526be 100644 --- a/backends/platform/wince/CEgui/Panel.cpp +++ b/backends/platform/wince/CEgui/Panel.cpp @@ -27,59 +27,58 @@ namespace CEGUI { - Panel::Panel(int interleave_first, int interleave) : Toolbar() - { - _interleave = interleave; - _currentItem = interleave_first; - } +Panel::Panel(int interleave_first, int interleave) : Toolbar() { + _interleave = interleave; + _currentItem = interleave_first; +} - bool Panel::add(const String &name, const PanelItem *item) { - _itemsMap[name] = (PanelItem*)item; - _itemsMap[name]->move(_currentItem, _y + 10); - _itemsMap[name]->setPanel(this); - _currentItem += _interleave; +bool Panel::add(const String &name, const PanelItem *item) { + _itemsMap[name] = (PanelItem*)item; + _itemsMap[name]->move(_currentItem, _y + 10); + _itemsMap[name]->setPanel(this); + _currentItem += _interleave; - return true; - } + return true; +} - bool Panel::draw(SDL_Surface *surface) { - ItemMap::const_iterator iterator; - if (!_drawn && _visible) { - GUIElement::draw(surface); - for (iterator = _itemsMap.begin(); iterator != _itemsMap.end(); ++iterator) { - ((GUIElement*)(iterator->_value))->draw(surface); - } - return true; +bool Panel::draw(SDL_Surface *surface) { + ItemMap::const_iterator iterator; + if (!_drawn && _visible) { + GUIElement::draw(surface); + for (iterator = _itemsMap.begin(); iterator != _itemsMap.end(); ++iterator) { + ((GUIElement*)(iterator->_value))->draw(surface); } - else - return false; + return true; } + else + return false; +} - void Panel::forceRedraw() { - ItemMap::const_iterator iterator; - GUIElement::forceRedraw(); - for (iterator = _itemsMap.begin(); iterator != _itemsMap.end(); ++iterator) - ((GUIElement*)(iterator->_value))->forceRedraw(); - } +void Panel::forceRedraw() { + ItemMap::const_iterator iterator; + GUIElement::forceRedraw(); + for (iterator = _itemsMap.begin(); iterator != _itemsMap.end(); ++iterator) + ((GUIElement*)(iterator->_value))->forceRedraw(); +} - bool Panel::action(int x, int y, bool pushed) { - ItemMap::const_iterator iterator; - bool result = false; - if (!_visible || !checkInside(x, y)) - return false; +bool Panel::action(int x, int y, bool pushed) { + ItemMap::const_iterator iterator; + bool result = false; + if (!_visible || !checkInside(x, y)) + return false; - for (iterator = _itemsMap.begin(); !result && iterator != _itemsMap.end(); ++iterator) - result = ((GUIElement*)(iterator->_value))->action(x, y, pushed); - return result; - } + for (iterator = _itemsMap.begin(); !result && iterator != _itemsMap.end(); ++iterator) + result = ((GUIElement*)(iterator->_value))->action(x, y, pushed); + return result; +} - void Panel::clear() { - _itemsMap.clear(); - } +void Panel::clear() { + _itemsMap.clear(); +} - Panel::~Panel() { - _itemsMap.clear(); - } +Panel::~Panel() { + _itemsMap.clear(); } +} // End of namespace CEGUI diff --git a/backends/platform/wince/CEgui/Panel.h b/backends/platform/wince/CEgui/Panel.h index 6626e41866..e6b693360d 100644 --- a/backends/platform/wince/CEgui/Panel.h +++ b/backends/platform/wince/CEgui/Panel.h @@ -40,23 +40,24 @@ using Common::HashMap; namespace CEGUI { - class Panel : public Toolbar { - public: - Panel(int interleave_first, int interleave); - virtual bool draw(SDL_Surface *surface); - virtual ~Panel(); - bool add(const String &name, const PanelItem *item); - void clear(); - virtual void forceRedraw(); - virtual bool action(int x, int y, bool pushed); - private: - - typedef HashMap<String, PanelItem*, Common::IgnoreCase_Hash , Common::IgnoreCase_EqualTo> ItemMap; - - ItemMap _itemsMap; - int _interleave; - int _currentItem; - }; -} +class Panel : public Toolbar { +public: + Panel(int interleave_first, int interleave); + virtual bool draw(SDL_Surface *surface); + virtual ~Panel(); + bool add(const String &name, const PanelItem *item); + void clear(); + virtual void forceRedraw(); + virtual bool action(int x, int y, bool pushed); +private: + + typedef HashMap<String, PanelItem*, Common::IgnoreCase_Hash , Common::IgnoreCase_EqualTo> ItemMap; + + ItemMap _itemsMap; + int _interleave; + int _currentItem; +}; + +} // End of namespace CEGUI #endif diff --git a/backends/platform/wince/CEgui/PanelItem.cpp b/backends/platform/wince/CEgui/PanelItem.cpp index 0898839c5d..8c68c79784 100644 --- a/backends/platform/wince/CEgui/PanelItem.cpp +++ b/backends/platform/wince/CEgui/PanelItem.cpp @@ -27,21 +27,21 @@ namespace CEGUI { - PanelItem::PanelItem(WORD reference) : GUIElement() { - setBackground(reference); - _panel = NULL; - } +PanelItem::PanelItem(WORD reference) : GUIElement() { + setBackground(reference); + _panel = NULL; +} - PanelItem::~PanelItem() { - } +PanelItem::~PanelItem() { +} - bool PanelItem::action(int x, int y, bool pushed) { - return false; - } +bool PanelItem::action(int x, int y, bool pushed) { + return false; +} - void PanelItem::setPanel(Panel *panel) { - _panel = panel; - } +void PanelItem::setPanel(Panel *panel) { + _panel = panel; } +} // End of namespace CEGUI diff --git a/backends/platform/wince/CEgui/PanelItem.h b/backends/platform/wince/CEgui/PanelItem.h index 55920c304a..14b62f0f20 100644 --- a/backends/platform/wince/CEgui/PanelItem.h +++ b/backends/platform/wince/CEgui/PanelItem.h @@ -33,18 +33,19 @@ namespace CEGUI { - class Panel; - - class PanelItem : public GUIElement { - friend class Panel; - public: - PanelItem(WORD reference); - virtual ~PanelItem(); - virtual bool action(int x, int y, bool pushed); - protected: - void setPanel(Panel *panel); - Panel *_panel; - }; -} +class Panel; + +class PanelItem : public GUIElement { +friend class Panel; +public: + PanelItem(WORD reference); + virtual ~PanelItem(); + virtual bool action(int x, int y, bool pushed); +protected: + void setPanel(Panel *panel); + Panel *_panel; +}; + +} // End of namespace CEGUI #endif diff --git a/backends/platform/wince/CEgui/PanelKeyboard.cpp b/backends/platform/wince/CEgui/PanelKeyboard.cpp index 369a75cae1..1b2a478746 100644 --- a/backends/platform/wince/CEgui/PanelKeyboard.cpp +++ b/backends/platform/wince/CEgui/PanelKeyboard.cpp @@ -23,77 +23,81 @@ * */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + +#include <SDL.h> + #include "PanelKeyboard.h" namespace CEGUI { - const char KEYBOARD_MAPPING_ALPHA[][14] = { {"abcdefghijklm"}, {"nopqrstuvwxyz"} }; - const char KEYBOARD_MAPPING_NUMERIC[][6] = { {"12345"}, {"67890"} }; - const int KEYBOARD_MAPPING_SPECIAL[][3][2] = { { {1,SDLK_ESCAPE}, {224,SDLK_UP}, {32,SDLK_SPACE} }, - { {224,SDLK_LEFT}, {224,SDLK_DOWN}, {224,SDLK_RIGHT} } }; +const char KEYBOARD_MAPPING_ALPHA[][14] = { {"abcdefghijklm"}, {"nopqrstuvwxyz"} }; +const char KEYBOARD_MAPPING_NUMERIC[][6] = { {"12345"}, {"67890"} }; +const int KEYBOARD_MAPPING_SPECIAL[][3][2] = { { {1,SDLK_ESCAPE}, {224,SDLK_UP}, {32,SDLK_SPACE} }, + { {224,SDLK_LEFT}, {224,SDLK_DOWN}, {224,SDLK_RIGHT} } }; - PanelKeyboard::PanelKeyboard(WORD reference) : Toolbar() { - setBackground(reference); - _state = false; - _lastKey.setKey(0); - } - - - PanelKeyboard::~PanelKeyboard() { - } - - bool PanelKeyboard::action(int x, int y, bool pushed) { - Key key; - - if (checkInside(x, y)) { - int keyAscii = 0; - int keyCode = 0; - if (x < 185) { - // Alpha selection - keyCode = keyAscii = KEYBOARD_MAPPING_ALPHA[y >= _y+20][((x + 10) / 14) - 1]; - } else if (x >= 186 && x <= 255) { - // Numeric selection - keyCode = keyAscii = KEYBOARD_MAPPING_NUMERIC[y >= _y+20][((x - 187 + 10) / 14) - 1]; - } else if (x >= 258 && x <= 300) { - // Special keys - keyAscii = KEYBOARD_MAPPING_SPECIAL[y >= _y+20][((x - 259 + 10) / 14) - 1][0]; - keyCode = KEYBOARD_MAPPING_SPECIAL[y >= _y+20][((x - 259 + 10) / 14) - 1][1]; - } else if (x >= 302 && x <= 316) { - if (y < _y +20) { - // Backspace - keyAscii = VK_BACK; keyCode = keyAscii; - } else { - // Enter - keyAscii = 13; keyCode = 13; - } - } +PanelKeyboard::PanelKeyboard(WORD reference) : Toolbar() { + setBackground(reference); + _state = false; + _lastKey.setKey(0); +} + + +PanelKeyboard::~PanelKeyboard() { +} - if (keyAscii != 0) { - if (_state && pushed && keyCode != _lastKey.keycode()) // if cursor is still down and off the current key - return false; - else if (_state && !pushed && keyCode != _lastKey.keycode()) { // cursor is up but off the current key - keyAscii = _lastKey.ascii(); - keyCode = _lastKey.keycode(); - } - _state = pushed; - _lastKey.setKey(keyAscii, tolower(keyCode)); - - key.setKey(keyAscii, tolower(keyCode)); - return EventsBuffer::simulateKey(&key, pushed); +bool PanelKeyboard::action(int x, int y, bool pushed) { + Key key; + + if (checkInside(x, y)) { + int keyAscii = 0; + int keyCode = 0; + if (x < 185) { + // Alpha selection + keyCode = keyAscii = KEYBOARD_MAPPING_ALPHA[y >= _y+20][((x + 10) / 14) - 1]; + } else if (x >= 186 && x <= 255) { + // Numeric selection + keyCode = keyAscii = KEYBOARD_MAPPING_NUMERIC[y >= _y+20][((x - 187 + 10) / 14) - 1]; + } else if (x >= 258 && x <= 300) { + // Special keys + keyAscii = KEYBOARD_MAPPING_SPECIAL[y >= _y+20][((x - 259 + 10) / 14) - 1][0]; + keyCode = KEYBOARD_MAPPING_SPECIAL[y >= _y+20][((x - 259 + 10) / 14) - 1][1]; + } else if (x >= 302 && x <= 316) { + if (y < _y +20) { + // Backspace + keyAscii = VK_BACK; keyCode = keyAscii; + } else { + // Enter + keyAscii = 13; keyCode = 13; } - else if (_state && !pushed) { // cursor is in some forbidden region and is up - _state = false; - key = _lastKey; - return EventsBuffer::simulateKey(&key, false); - } else - return false; } - else if (_state && !pushed) { // cursor left the keyboard area and is up + + if (keyAscii != 0) { + if (_state && pushed && keyCode != _lastKey.keycode()) // if cursor is still down and off the current key + return false; + else if (_state && !pushed && keyCode != _lastKey.keycode()) { // cursor is up but off the current key + keyAscii = _lastKey.ascii(); + keyCode = _lastKey.keycode(); + } + _state = pushed; + _lastKey.setKey(keyAscii, tolower(keyCode)); + + key.setKey(keyAscii, tolower(keyCode)); + return EventsBuffer::simulateKey(&key, pushed); + } else if (_state && !pushed) { // cursor is in some forbidden region and is up _state = false; key = _lastKey; return EventsBuffer::simulateKey(&key, false); } else return false; - } + } else if (_state && !pushed) { // cursor left the keyboard area and is up + _state = false; + key = _lastKey; + return EventsBuffer::simulateKey(&key, false); + } else + return false; } +} // End of namespace CEGUI + diff --git a/backends/platform/wince/CEgui/PanelKeyboard.h b/backends/platform/wince/CEgui/PanelKeyboard.h index f441e14771..b98e6ff3a8 100644 --- a/backends/platform/wince/CEgui/PanelKeyboard.h +++ b/backends/platform/wince/CEgui/PanelKeyboard.h @@ -37,15 +37,16 @@ using CEKEYS::EventsBuffer; namespace CEGUI { - class PanelKeyboard : public Toolbar { - public: - PanelKeyboard(WORD reference); - virtual ~PanelKeyboard(); - virtual bool action(int x, int y, bool pushed); - private: - bool _state; - Key _lastKey; - }; -} +class PanelKeyboard : public Toolbar { +public: + PanelKeyboard(WORD reference); + virtual ~PanelKeyboard(); + virtual bool action(int x, int y, bool pushed); +private: + bool _state; + Key _lastKey; +}; + +} // End of namespace CEGUI #endif diff --git a/backends/platform/wince/CEgui/SDL_ImageResource.cpp b/backends/platform/wince/CEgui/SDL_ImageResource.cpp index ce6ebd6382..567013b5ff 100644 --- a/backends/platform/wince/CEgui/SDL_ImageResource.cpp +++ b/backends/platform/wince/CEgui/SDL_ImageResource.cpp @@ -23,63 +23,67 @@ * */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + +#include "SDL.h" #include "SDL_ImageResource.h" namespace CEGUI { - SDL_ImageResource::SDL_ImageResource() : - _surface(0) - { - } +SDL_ImageResource::SDL_ImageResource() : + _surface(0) { +} - SDL_Surface* SDL_ImageResource::load(WORD resourceID) { - HRSRC resource; - HGLOBAL resourceGlobal; - LPVOID resourcePointer; - DWORD resourceSize; - SDL_RWops *surfaceData; - HMODULE moduleHandle; +SDL_Surface* SDL_ImageResource::load(WORD resourceID) { + HRSRC resource; + HGLOBAL resourceGlobal; + LPVOID resourcePointer; + DWORD resourceSize; + SDL_RWops *surfaceData; + HMODULE moduleHandle; - moduleHandle = GetModuleHandle(NULL); - resource = FindResource(moduleHandle, MAKEINTRESOURCE(resourceID), TEXT("BINARY")); - if (!resource) - return NULL; - resourceSize = SizeofResource(moduleHandle, resource); - if (!resourceSize) - return NULL; - resourceGlobal = LoadResource(moduleHandle, resource); - if (!resourceGlobal) - return NULL; - resourcePointer = LockResource(resourceGlobal); - if (!resourcePointer) - return NULL; + moduleHandle = GetModuleHandle(NULL); + resource = FindResource(moduleHandle, MAKEINTRESOURCE(resourceID), TEXT("BINARY")); + if (!resource) + return NULL; + resourceSize = SizeofResource(moduleHandle, resource); + if (!resourceSize) + return NULL; + resourceGlobal = LoadResource(moduleHandle, resource); + if (!resourceGlobal) + return NULL; + resourcePointer = LockResource(resourceGlobal); + if (!resourcePointer) + return NULL; - surfaceData = SDL_RWFromMem(resourcePointer, resourceSize); - if (!surfaceData) - return NULL; - _surface = SDL_LoadBMP_RW(surfaceData, 1); + surfaceData = SDL_RWFromMem(resourcePointer, resourceSize); + if (!surfaceData) + return NULL; + _surface = SDL_LoadBMP_RW(surfaceData, 1); - return _surface; - } + return _surface; +} - SDL_Surface* SDL_ImageResource::get() { - return _surface; - } +SDL_Surface* SDL_ImageResource::get() { + return _surface; +} - int SDL_ImageResource::height() { - if (_surface) - return _surface->h; - return 0; - } +int SDL_ImageResource::height() { + if (_surface) + return _surface->h; + return 0; +} - int SDL_ImageResource::width() { - if (_surface) - return _surface->w; - return 0; - } +int SDL_ImageResource::width() { + if (_surface) + return _surface->w; + return 0; +} - SDL_ImageResource::~SDL_ImageResource() { - if (_surface) - SDL_FreeSurface(_surface); - } +SDL_ImageResource::~SDL_ImageResource() { + if (_surface) + SDL_FreeSurface(_surface); } + +} // End of namespace CEGUI diff --git a/backends/platform/wince/CEgui/SDL_ImageResource.h b/backends/platform/wince/CEgui/SDL_ImageResource.h index 454237dd15..5affd5c33c 100644 --- a/backends/platform/wince/CEgui/SDL_ImageResource.h +++ b/backends/platform/wince/CEgui/SDL_ImageResource.h @@ -29,20 +29,22 @@ #include "common/scummsys.h" #include "common/system.h" -#include "SDL.h" +struct SDL_Surface; namespace CEGUI { - class SDL_ImageResource { - public: - SDL_ImageResource(); - SDL_Surface* load(WORD resourceID); - SDL_Surface* get(); - int height(); - int width(); - virtual ~SDL_ImageResource(); - private: - SDL_Surface *_surface; - }; -} + +class SDL_ImageResource { +public: + SDL_ImageResource(); + SDL_Surface* load(WORD resourceID); + SDL_Surface* get(); + int height(); + int width(); + virtual ~SDL_ImageResource(); +private: + SDL_Surface *_surface; +}; + +} // End of namespace CEGUI #endif diff --git a/backends/platform/wince/CEgui/Toolbar.cpp b/backends/platform/wince/CEgui/Toolbar.cpp index 0501249de9..c41a30cb43 100644 --- a/backends/platform/wince/CEgui/Toolbar.cpp +++ b/backends/platform/wince/CEgui/Toolbar.cpp @@ -27,12 +27,12 @@ namespace CEGUI { - // Not to be drawn on game screen ! - Toolbar::Toolbar() : GUIElement(0, 0, 320, 40) - { - } +// Not to be drawn on game screen ! +Toolbar::Toolbar() : GUIElement(0, 0, 320, 40) { +} - Toolbar::~Toolbar() { - } +Toolbar::~Toolbar() { } + +} // End of namespace CEGUI diff --git a/backends/platform/wince/CEgui/Toolbar.h b/backends/platform/wince/CEgui/Toolbar.h index 3c48e6188a..9fdf05ab3f 100644 --- a/backends/platform/wince/CEgui/Toolbar.h +++ b/backends/platform/wince/CEgui/Toolbar.h @@ -27,25 +27,20 @@ #define CEGUI_TOOLBAR_H #include "common/scummsys.h" -#include "common/system.h" - -//#include "common/map.h" -#include "common/str.h" #include "GUIElement.h" - - namespace CEGUI { - class Toolbar : public GUIElement { - public: - virtual ~Toolbar(); - virtual bool action(int x, int y, bool pushed) = 0; - protected: - Toolbar(); +class Toolbar : public GUIElement { +public: + virtual ~Toolbar(); + virtual bool action(int x, int y, bool pushed) = 0; +protected: + Toolbar(); + +}; - }; -} +} // End of namespace CEGUI #endif diff --git a/backends/platform/wince/CEgui/ToolbarHandler.cpp b/backends/platform/wince/CEgui/ToolbarHandler.cpp index 3f93a4720d..f74d24ad25 100644 --- a/backends/platform/wince/CEgui/ToolbarHandler.cpp +++ b/backends/platform/wince/CEgui/ToolbarHandler.cpp @@ -23,106 +23,111 @@ * */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + +#include <SDL.h> + #include "ToolbarHandler.h" namespace CEGUI { - ToolbarHandler::ToolbarHandler(): - _current(""), _active(NULL) { - } - +ToolbarHandler::ToolbarHandler(): +_current(""), _active(NULL) { +} - bool ToolbarHandler::add(const String &name, const Toolbar &toolbar) { - _toolbarMap[name] = (Toolbar*)&toolbar; - if (!_active) { - _active = &((Toolbar&)toolbar); - _current = name; - } +bool ToolbarHandler::add(const String &name, const Toolbar &toolbar) { + _toolbarMap[name] = (Toolbar*)&toolbar; - return true; + if (!_active) { + _active = &((Toolbar&)toolbar); + _current = name; } - String ToolbarHandler::activeName() { - return _current; - } + return true; +} - bool ToolbarHandler::setActive(const String &name) { - if (!_toolbarMap.contains(name)) - return false; - if (_current == name) - return true; - _active->action(0, 0, false); // make sure any items are unpushed when changing toolbars (e.g. forced VK->main panel) - _current = name; - _active = _toolbarMap[name]; - _active->forceRedraw(); +String ToolbarHandler::activeName() { + return _current; +} + +bool ToolbarHandler::setActive(const String &name) { + if (!_toolbarMap.contains(name)) + return false; + if (_current == name) return true; - } + _active->action(0, 0, false); // make sure any items are unpushed when changing toolbars (e.g. forced VK->main panel) + _current = name; + _active = _toolbarMap[name]; + _active->forceRedraw(); + return true; +} - bool ToolbarHandler::action(int x, int y, bool pushed) { - if (_active && _active->visible()) { - // FIXME ! - if (_offset > 240) - return _active->action(x / 2, (y - _offset) / 2, pushed); - else - return _active->action(x, y - _offset, pushed); - } +bool ToolbarHandler::action(int x, int y, bool pushed) { + if (_active && _active->visible()) { + // FIXME ! + if (_offset > 240) + return _active->action(x / 2, (y - _offset) / 2, pushed); else - return false; + return _active->action(x, y - _offset, pushed); } + else + return false; +} - void ToolbarHandler::setVisible(bool visible) { - if (_active) - _active->setVisible(visible); - } +void ToolbarHandler::setVisible(bool visible) { + if (_active) + _active->setVisible(visible); +} - bool ToolbarHandler::visible() { - if (_active) - return _active->visible(); - else - return false; - } +bool ToolbarHandler::visible() { + if (_active) + return _active->visible(); + else + return false; +} - void ToolbarHandler::forceRedraw() { - if (_active) - _active->forceRedraw(); - } +void ToolbarHandler::forceRedraw() { + if (_active) + _active->forceRedraw(); +} - bool ToolbarHandler::drawn() { - if (_active) - return _active->drawn(); - else - return false; - } +bool ToolbarHandler::drawn() { + if (_active) + return _active->drawn(); + else + return false; +} - bool ToolbarHandler::draw(SDL_Surface *surface, SDL_Rect *rect) { - if (_active) { - bool result = _active->draw(surface); - if (result) { - rect->x = _active->x(); - rect->y = _active->y(); - rect->w = _active->width(); - rect->h = _active->height(); - } - return result; +bool ToolbarHandler::draw(SDL_Surface *surface, SDL_Rect *rect) { + if (_active) { + bool result = _active->draw(surface); + if (result) { + rect->x = _active->x(); + rect->y = _active->y(); + rect->w = _active->width(); + rect->h = _active->height(); } - else - return false; - } + return result; + } else + return false; +} - void ToolbarHandler::setOffset(int offset) { - _offset = offset; - } +void ToolbarHandler::setOffset(int offset) { + _offset = offset; +} - int ToolbarHandler::getOffset() { - return _offset; - } +int ToolbarHandler::getOffset() { + return _offset; +} - Toolbar* ToolbarHandler::active() { - return _active; - } +Toolbar* ToolbarHandler::active() { + return _active; +} - ToolbarHandler::~ToolbarHandler() { - _toolbarMap.clear(); - } +ToolbarHandler::~ToolbarHandler() { + _toolbarMap.clear(); } + +} // End of namespace CEGUI diff --git a/backends/platform/wince/CEgui/ToolbarHandler.h b/backends/platform/wince/CEgui/ToolbarHandler.h index 4a79ed1609..e3bf590768 100644 --- a/backends/platform/wince/CEgui/ToolbarHandler.h +++ b/backends/platform/wince/CEgui/ToolbarHandler.h @@ -39,29 +39,30 @@ using Common::HashMap; namespace CEGUI { - class ToolbarHandler { - public: - ToolbarHandler(); - bool add(const String &name, const Toolbar &toolbar); - bool setActive(const String &name); - bool action(int x, int y, bool pushed); - void setVisible(bool visible); - bool visible(); - String activeName(); - void forceRedraw(); - void setOffset(int offset); - int getOffset(); - bool draw(SDL_Surface *surface, SDL_Rect *rect); - bool drawn(); - Toolbar *active(); - virtual ~ToolbarHandler(); - private: +class ToolbarHandler { +public: + ToolbarHandler(); + bool add(const String &name, const Toolbar &toolbar); + bool setActive(const String &name); + bool action(int x, int y, bool pushed); + void setVisible(bool visible); + bool visible(); + String activeName(); + void forceRedraw(); + void setOffset(int offset); + int getOffset(); + bool draw(SDL_Surface *surface, SDL_Rect *rect); + bool drawn(); + Toolbar *active(); + virtual ~ToolbarHandler(); +private: - HashMap<String, Toolbar*, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _toolbarMap; - String _current; - Toolbar *_active; - int _offset; - }; -} + HashMap<String, Toolbar*, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _toolbarMap; + String _current; + Toolbar *_active; + int _offset; +}; + +} // End of namespace CEGUI #endif diff --git a/backends/platform/wince/CEkeys/EventsBuffer.cpp b/backends/platform/wince/CEkeys/EventsBuffer.cpp index f31a77570f..3cdcb44173 100644 --- a/backends/platform/wince/CEkeys/EventsBuffer.cpp +++ b/backends/platform/wince/CEkeys/EventsBuffer.cpp @@ -23,6 +23,11 @@ * */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + +#include <SDL.h> + #include "EventsBuffer.h" namespace CEKEYS { diff --git a/backends/platform/wince/CEkeys/EventsBuffer.h b/backends/platform/wince/CEkeys/EventsBuffer.h index 44e1c66e47..22590db03c 100644 --- a/backends/platform/wince/CEkeys/EventsBuffer.h +++ b/backends/platform/wince/CEkeys/EventsBuffer.h @@ -30,8 +30,6 @@ #include "common/system.h" #include "common/list.h" -#include <SDL.h> - #include "gui/Key.h" namespace CEKEYS { diff --git a/backends/platform/wince/missing/assert.h b/backends/platform/wince/missing/assert.h index 0a9dc23bb8..734b8f9482 100644 --- a/backends/platform/wince/missing/assert.h +++ b/backends/platform/wince/missing/assert.h @@ -3,7 +3,7 @@ // defined in common/util.h void CDECL _declspec(noreturn) error(const char *s, ...); -#define assert(e) ((e) ? 0 : (::error("Assertion failed " #e " (%s, %d)", __FILE__, __LINE__))) +#define assert(e) ((e) ? 0 : (::error("Assertion failed %s (%s, %d)", #e, __FILE__, __LINE__))) #define abort() ::error("Abort (%s, %d)", __FILE__, __LINE__) diff --git a/backends/platform/wince/missing/gcc/assert.h b/backends/platform/wince/missing/gcc/assert.h index 06742532ac..d52adb8c2c 100644 --- a/backends/platform/wince/missing/gcc/assert.h +++ b/backends/platform/wince/missing/gcc/assert.h @@ -3,7 +3,7 @@ // defined in common/util.h void CDECL _declspec(noreturn) error(const char *s, ...); -#define assert(e) ((e) ? (void) 0 : (::error("Assertion failed " #e " (%s, %d)", __FILE__, __LINE__))) +#define assert(e) ((e) ? (void) 0 : (::error("Assertion failed %s (%s, %d)", #e, __FILE__, __LINE__))) #define abort() ::error("Abort (%s, %d)", __FILE__, __LINE__) diff --git a/backends/platform/wince/missing/missing.cpp b/backends/platform/wince/missing/missing.cpp index 532f1d2e89..3233a04aa1 100644 --- a/backends/platform/wince/missing/missing.cpp +++ b/backends/platform/wince/missing/missing.cpp @@ -29,6 +29,8 @@ * by Vasyl Tsvirkunov */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL #include <windows.h> #include <tchar.h> diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index ac9be5df48..3f64cb7d5d 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -23,6 +23,9 @@ * */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + #include "backends/platform/wince/wince-sdl.h" #include "common/config-manager.h" @@ -970,8 +973,9 @@ bool OSystem_WINCE3::getFeatureState(Feature f) { return false; case kFeatureVirtualKeyboard: return (_panelStateForced); + default: + return OSystem_SDL::getFeatureState(f); } - return OSystem_SDL::getFeatureState(f); } void OSystem_WINCE3::check_mappings() { @@ -2053,7 +2057,7 @@ void OSystem_WINCE3::undrawMouse() { if (SDL_LockSurface(_overlayVisible ? _overlayscreen : _screen) == -1) error("SDL_LockSurface failed: %s", SDL_GetError()); - int x, y; + int y; if (!_overlayVisible) { byte *dst, *bak = _mouseBackupOld; @@ -2242,14 +2246,15 @@ static int mapKeyCE(SDLKey key, SDLMod mod, Uint16 unicode, bool unfilter) { if (unfilter) { switch (key) { - case SDLK_ESCAPE: - return SDLK_BACKSPACE; - case SDLK_F8: - return SDLK_ASTERISK; - case SDLK_F9: - return SDLK_HASH; + case SDLK_ESCAPE: + return SDLK_BACKSPACE; + case SDLK_F8: + return SDLK_ASTERISK; + case SDLK_F9: + return SDLK_HASH; + default: + return key; } - return key; } if (key >= SDLK_KP0 && key <= SDLK_KP9) { @@ -2265,7 +2270,6 @@ static int mapKeyCE(SDLKey key, SDLMod mod, Uint16 unicode, bool unfilter) { bool OSystem_WINCE3::pollEvent(Common::Event &event) { SDL_Event ev; ev.type = SDL_NOEVENT; - byte b = 0; DWORD currentTime; bool keyEvent = false; int deltaX, deltaY; |