From 524c1e881308afb628fa54b11e7a56c61b45b01c Mon Sep 17 00:00:00 2001
From: "p.kosyh"
Date: Mon, 13 Sep 2010 09:17:28 +0000
Subject: [PATCH] wince fixes
---
src/sdl-instead/externals.h | 3 +++
src/sdl-instead/graphics.c | 6 +++---
src/sdl-instead/input.c | 4 ++--
src/sdl-instead/sound.c | 6 +++---
src/sdl-instead/wince.c | 15 ++-------------
src/sdl-instead/wince.h | 9 +++++++++
6 files changed, 22 insertions(+), 21 deletions(-)
create mode 100644 src/sdl-instead/wince.h
diff --git a/src/sdl-instead/externals.h b/src/sdl-instead/externals.h
index fbb87c7..d1d60a3 100644
--- a/src/sdl-instead/externals.h
+++ b/src/sdl-instead/externals.h
@@ -1,3 +1,6 @@
+#ifdef _WIN32_WCE
+#include "wince.h"
+#endif
#include
#include
#include
diff --git a/src/sdl-instead/graphics.c b/src/sdl-instead/graphics.c
index 41bb008..2969c2c 100644
--- a/src/sdl-instead/graphics.c
+++ b/src/sdl-instead/graphics.c
@@ -1,6 +1,3 @@
-#include "externals.h"
-#include "internals.h"
-
#include
#include
#include
@@ -9,6 +6,9 @@
#include "SDL_gfxBlitFunc.h"
#include "SDL_anigif.h"
+#include "externals.h"
+#include "internals.h"
+
#define Surf(p) ((SDL_Surface *)p)
static SDL_Surface *screen = NULL;
diff --git a/src/sdl-instead/input.c b/src/sdl-instead/input.c
index 08f5b67..ac1fbde 100644
--- a/src/sdl-instead/input.c
+++ b/src/sdl-instead/input.c
@@ -1,8 +1,8 @@
+#include
+
#include "externals.h"
#include "internals.h"
-#include
-
static int m_focus = 0;
static int m_minimized = 0;
diff --git a/src/sdl-instead/sound.c b/src/sdl-instead/sound.c
index b9af001..bc68306 100644
--- a/src/sdl-instead/sound.c
+++ b/src/sdl-instead/sound.c
@@ -1,9 +1,9 @@
-#include "externals.h"
-#include "internals.h"
-
#include
#include
+#include "externals.h"
+#include "internals.h"
+
int audio_rate = 22050;
Uint16 audio_format = MIX_DEFAULT_FORMAT;
int audio_channels = 2;
diff --git a/src/sdl-instead/wince.c b/src/sdl-instead/wince.c
index 29ca486..c8520ea 100644
--- a/src/sdl-instead/wince.c
+++ b/src/sdl-instead/wince.c
@@ -28,7 +28,7 @@ char *game_locale(void)
{
char buff[64];
buff[0] = 0;
- if (!GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SISO639LANGNAME,
+ if (!GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_SISO639LANGNAME,
buff,sizeof(buff) - 1))
return NULL;
return strdup(buff);
@@ -42,7 +42,7 @@ static char *game_cp(void)
char cpbuff[64];
char buff[64];
buff[0] = 0;
- if (!GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IDEFAULTANSICODEPAGE,
+ if (!GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_IDEFAULTANSICODEPAGE,
buff,sizeof(buff) - 1))
return NULL;
snprintf(cpbuff, sizeof(cpbuff), "WINDOWS-%s", buff);
@@ -154,21 +154,10 @@ char *home_dir( void )
char *app_dir( void )
{
static char appdir[PATH_MAX]="";
-#ifdef _LOCAL_APPDATA
strcpy(appdir, game_cwd);
strcat(appdir, "/appdata");
if (!access(appdir, W_OK))
return appdir;
-#endif
-
- SHGetFolderPath( NULL,
- CSIDL_FLAG_CREATE | CSIDL_LOCAL_APPDATA,
- NULL,
- 0,
- (LPTSTR)appdir );
- unix_path(appdir);
- strcat(appdir, "/instead");
- return appdir;
}
char *game_cfg_path( void )
diff --git a/src/sdl-instead/wince.h b/src/sdl-instead/wince.h
new file mode 100644
index 0000000..b21579d
--- /dev/null
+++ b/src/sdl-instead/wince.h
@@ -0,0 +1,9 @@
+#ifndef _WINCE_EXTERNAL_H
+#define _WINCE_EXTERNAL_H
+
+#define errno 0
+#define strerror(a) ""
+#define putenv(a) ;
+#define setlocale(a, b) ;
+
+#endif