Skip to content

Commit

Permalink
WINTERMUTE: Remove a few of the __WIN32__ macros.
Browse files Browse the repository at this point in the history
  • Loading branch information
somaen committed May 11, 2012
1 parent 7b3ec47 commit b3b8777
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 71 deletions.
23 changes: 0 additions & 23 deletions engines/wintermute/BFileManager.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -50,30 +50,7 @@
#include "common/system.h" #include "common/system.h"
#include "common/fs.h" #include "common/fs.h"
#include "common/file.h" #include "common/file.h"
/*
#ifdef __WIN32__
# include <direct.h>
#else
# include <unistd.h>
#endif
*/
/*#ifdef __APPLE__
# include <CoreFoundation/CoreFoundation.h>
#endif*/

/*
#if _DEBUG
#pragma comment(lib, "zlib_d.lib")
#else
#pragma comment(lib, "zlib.lib")
#endif


extern "C"
{
#include "zlib.h"
}
*/
namespace WinterMute { namespace WinterMute {


////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
Expand Down
13 changes: 1 addition & 12 deletions engines/wintermute/BGame.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1796,15 +1796,8 @@ HRESULT CBGame::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *ThisS
// OpenDocument // OpenDocument
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "OpenDocument") == 0) { else if (strcmp(Name, "OpenDocument") == 0) {
#ifdef __WIN32__
Stack->CorrectParams(1);
if (!_renderer->_windowed) CBPlatform::ShowWindow(_renderer->_window, SW_MINIMIZE);
HINSTANCE i = CBPlatform::ShellExecute(_renderer->_window, "open", Stack->Pop()->GetString(), NULL, NULL, SW_MAXIMIZE);
Stack->PushBool((int)i > 32);
#else
Stack->CorrectParams(0); Stack->CorrectParams(0);
Stack->PushNULL(); Stack->PushNULL();
#endif
return S_OK; return S_OK;
} }


Expand Down Expand Up @@ -4421,11 +4414,7 @@ bool CBGame::IsDoubleClick(int buttonIndex) {
int maxMoveX = 4; int maxMoveX = 4;
int maxMoveY = 4; int maxMoveY = 4;


#if __WIN32__ #if __IPHONEOS__
maxDoubleCLickTime = GetDoubleClickTime();
maxMoveX = GetSystemMetrics(SM_CXDOUBLECLK);
maxMoveY = GetSystemMetrics(SM_CYDOUBLECLK);
#elif __IPHONEOS__
maxMoveX = 16; maxMoveX = 16;
maxMoveY = 16; maxMoveY = 16;
#endif #endif
Expand Down
34 changes: 3 additions & 31 deletions engines/wintermute/PlatformSDL.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ int CBPlatform::Initialize(CBGame *inGame, int argc, char *argv[]) {
delete Game; delete Game;
Game = NULL; Game = NULL;


#ifdef __WIN32__ warning("Some of the essential files are missing. Please reinstall.");
::MessageBox(NULL, "Some of the essential files are missing. Please reinstall.", NULL, MB_OK | MB_ICONERROR);
#endif
return 2; return 2;
} }


Expand Down Expand Up @@ -325,18 +323,16 @@ int CBPlatform::SDLEventWatcher(void *userdata, Common::Event *event) {
// Win32 API bindings // Win32 API bindings
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
HINSTANCE CBPlatform::ShellExecute(HWND hwnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, INT nShowCmd) { HINSTANCE CBPlatform::ShellExecute(HWND hwnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, INT nShowCmd) {
#ifdef __WIN32__
return ::ShellExecute(hwnd, lpOperation, lpFile, lpParameters, lpDirectory, nShowCmd);
#else
return NULL; return NULL;
#endif
} }


////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
void CBPlatform::OutputDebugString(LPCSTR lpOutputString) { void CBPlatform::OutputDebugString(LPCSTR lpOutputString) {
/*
#ifdef __WIN32__ #ifdef __WIN32__
::OutputDebugString(lpOutputString); ::OutputDebugString(lpOutputString);
#endif #endif
*/
} }




Expand Down Expand Up @@ -373,11 +369,7 @@ BOOL CBPlatform::SetCursorPos(int X, int Y) {


////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
BOOL CBPlatform::ShowWindow(HWND hWnd, int nCmdShow) { BOOL CBPlatform::ShowWindow(HWND hWnd, int nCmdShow) {
#ifdef __WIN32__
return ::ShowWindow(hWnd, nCmdShow);
#else
return FALSE; return FALSE;
#endif
} }


////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
Expand All @@ -400,29 +392,17 @@ bool CBPlatform::CopyFile(const char *from, const char *to, bool failIfExists) {


////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
HWND CBPlatform::SetCapture(HWND hWnd) { HWND CBPlatform::SetCapture(HWND hWnd) {
#ifdef __WIN32__
return ::SetCapture(hWnd);
#else
return NULL; return NULL;
#endif
} }


////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
BOOL CBPlatform::ReleaseCapture() { BOOL CBPlatform::ReleaseCapture() {
#ifdef __WIN32__
return ::ReleaseCapture();
#else
return FALSE; return FALSE;
#endif
} }


////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
BOOL CBPlatform::SetForegroundWindow(HWND hWnd) { BOOL CBPlatform::SetForegroundWindow(HWND hWnd) {
#ifdef __WIN32__
return ::SetForegroundWindow(hWnd);
#else
return FALSE; return FALSE;
#endif
} }


////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -539,20 +519,12 @@ AnsiString CBPlatform::GetPlatformName() {


////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
int scumm_stricmp(const char *str1, const char *str2) { int scumm_stricmp(const char *str1, const char *str2) {
#ifdef __WIN32__
return ::stricmp(str1, str2);
#else
return ::strcasecmp(str1, str2); return ::strcasecmp(str1, str2);
#endif
} }


////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
int scumm_strnicmp(const char *str1, const char *str2, size_t maxCount) { int scumm_strnicmp(const char *str1, const char *str2, size_t maxCount) {
#ifdef __WIN32__
return ::strnicmp(str1, str2, maxCount);
#else
return ::strncasecmp(str1, str2, maxCount); return ::strncasecmp(str1, str2, maxCount);
#endif
} }




Expand Down
7 changes: 4 additions & 3 deletions engines/wintermute/scriptables/ScEngine.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ IMPLEMENT_PERSISTENT(CScEngine, true)
CScEngine::CScEngine(CBGame *inGame): CBBase(inGame) { CScEngine::CScEngine(CBGame *inGame): CBBase(inGame) {
Game->LOG(0, "Initializing scripting engine..."); Game->LOG(0, "Initializing scripting engine...");



/*
#ifdef __WIN32__ #ifdef __WIN32__
char CompilerPath[MAX_PATH]; char CompilerPath[MAX_PATH];
strcpy(CompilerPath, COMPILER_DLL); strcpy(CompilerPath, COMPILER_DLL);
Expand Down Expand Up @@ -88,14 +88,15 @@ CScEngine::CScEngine(CBGame *inGame): CBBase(inGame) {
c.Dll_LoadFile = LoadFile; c.Dll_LoadFile = LoadFile;
ExtSetCallbacks(&c, Game); ExtSetCallbacks(&c, Game);
*/ */

/*
_compilerAvailable = true; _compilerAvailable = true;
} }
} else _compilerAvailable = false; } else _compilerAvailable = false;
#else #else
*/
_compilerAvailable = false; _compilerAvailable = false;
_compilerDLL = NULL; _compilerDLL = NULL;
#endif //#endif




if (_compilerAvailable) Game->LOG(0, " Script compiler bound successfuly"); if (_compilerAvailable) Game->LOG(0, " Script compiler bound successfuly");
Expand Down
4 changes: 2 additions & 2 deletions engines/wintermute/wintypes.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ typedef int BOOL;
#define D3DCOLGetG(rgb) ((byte )(((WORD)(rgb)) >> 8)) #define D3DCOLGetG(rgb) ((byte )(((WORD)(rgb)) >> 8))
#define D3DCOLGetR(rgb) ((byte )((rgb)>>16)) #define D3DCOLGetR(rgb) ((byte )((rgb)>>16))
#define D3DCOLGetA(rgb) ((byte )((rgb)>>24)) #define D3DCOLGetA(rgb) ((byte )((rgb)>>24))

/*
#ifndef MAX #ifndef MAX
#define MAX(a,b) (((a) > (b)) ? (a) : (b)) #define MAX(a,b) (((a) > (b)) ? (a) : (b))
#endif #endif
#ifndef MIN #ifndef MIN
#define MIN(a,b) (((a) < (b)) ? (a) : (b)) #define MIN(a,b) (((a) < (b)) ? (a) : (b))
#endif #endif

*/
#define CONST const #define CONST const


#define MAX_PATH 512 #define MAX_PATH 512
Expand Down

0 comments on commit b3b8777

Please sign in to comment.