summaryrefslogtreecommitdiff
path: root/src/win32.cpp
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-01-21 14:32:40 +0000
committertruelight <truelight@openttd.org>2007-01-21 14:32:40 +0000
commit6a145e06c3bb4d0a9b2991dc09f41ed097684c85 (patch)
tree0c0dd92d945ce238ed04b15a93044472b412cabc /src/win32.cpp
parent79dfc6226186bfe5535c1672d9ef733eaf555d63 (diff)
downloadopenttd-6a145e06c3bb4d0a9b2991dc09f41ed097684c85.tar.xz
(svn r8309) [WinCE] -Fix: WinCE doesn't know resolution changing
-Fix: WinCE doesn't know GetKeyboardState -Fix: made a replacement of GetCurrentDirectory, where CurDir is assumed to be the dir the executable is located (esoftinteractive.com) -Fix: the GCC compiler is more happy if the WinMain is called that -Fix: a really old typo (missing ')') ;) -Fix: GdiFlush() isn't supported on WinCE
Diffstat (limited to 'src/win32.cpp')
-rw-r--r--src/win32.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/win32.cpp b/src/win32.cpp
index 018d5c8c2..da129e0d9 100644
--- a/src/win32.cpp
+++ b/src/win32.cpp
@@ -60,7 +60,7 @@ bool LoadLibraryList(Function proc[], const char *dll)
while (*dll++ != '\0');
if (*dll == '\0') break;
#if defined(WINCE)
- p = GetProcAddress(lib, MB_TO_WIDE(dll);
+ p = GetProcAddress(lib, MB_TO_WIDE(dll));
#else
p = GetProcAddress(lib, dll);
#endif
@@ -866,7 +866,12 @@ void ShowInfo(const char *str)
int _set_error_mode(int);
#endif
-int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
+#if defined(WINCE)
+int APIENTRY WinMain
+#else
+int APIENTRY _tWinMain
+#endif
+ (HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPTSTR lpCmdLine, int nCmdShow)
{
int argc;
@@ -912,6 +917,22 @@ int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
return 0;
}
+#if defined(WINCE)
+void GetCurrentDirectoryW(int length, wchar_t *path)
+{
+ wchar_t *pDest = NULL;
+ /* Get the name of this module */
+ GetModuleFileName(NULL, path, length);
+
+ /* Remove the executable name, this we call CurrentDir */
+ pDest = wcsrchr(path, '\\');
+ if (pDest != NULL) {
+ int result = pDest - path + 1;
+ path[result] = '\0';
+ }
+}
+#endif
+
void DeterminePaths(void)
{
char *s, *cfg;