From 43e97395b5255c4b44bba72b3ed82a855c3dbc22 Mon Sep 17 00:00:00 2001 From: Pawel Kolodziejski Date: Mon, 21 Sep 2020 07:56:28 +0200 Subject: [PATCH] ICB: Cleanup macros --- engines/icb/cluster_manager_pc.cpp | 1 - engines/icb/common/px_types.h | 12 ++----- engines/icb/common/px_windows.h | 52 ------------------------------ engines/icb/debug.cpp | 2 -- engines/icb/debug_pc.cpp | 2 -- engines/icb/direct_input.cpp | 3 +- engines/icb/function.cpp | 4 --- engines/icb/game_script.cpp | 1 - engines/icb/keyboard.cpp | 2 +- engines/icb/keyboard.h | 2 +- engines/icb/movie_pc.cpp | 1 - engines/icb/options_manager_pc.cpp | 1 - engines/icb/p4.cpp | 1 - engines/icb/p4.h | 2 +- engines/icb/p4_generic.h | 1 - engines/icb/p4_pc.cpp | 7 ++-- engines/icb/sound/sound_common.cpp | 2 +- engines/icb/surface_manager.cpp | 3 -- engines/icb/zsupport.cpp | 1 - 19 files changed, 10 insertions(+), 90 deletions(-) delete mode 100644 engines/icb/common/px_windows.h diff --git a/engines/icb/cluster_manager_pc.cpp b/engines/icb/cluster_manager_pc.cpp index ff5381eee61..c3d1fefa796 100644 --- a/engines/icb/cluster_manager_pc.cpp +++ b/engines/icb/cluster_manager_pc.cpp @@ -31,7 +31,6 @@ #endif #include "engines/icb/common/px_rccommon.h" -#include "engines/icb/common/px_windows.h" #include "engines/icb/common/px_string.h" #include "engines/icb/res_man_pc.h" #include "debug_pc.h" diff --git a/engines/icb/common/px_types.h b/engines/icb/common/px_types.h index e71085d3a20..7fdc957f8c6 100644 --- a/engines/icb/common/px_types.h +++ b/engines/icb/common/px_types.h @@ -30,16 +30,6 @@ namespace ICB { -#ifndef PX_WINDOWS_H_INCLUDED - -#ifndef _WIN32 -typedef void *HWND; -typedef int HRESULT; -typedef uint32 DWORD; -#endif - -#endif - typedef struct { int32 left; int32 top; @@ -47,6 +37,8 @@ typedef struct { int32 bottom; } LRECT; +#define _MAX_PATH 260 + } // End of namespace ICB #endif diff --git a/engines/icb/common/px_windows.h b/engines/icb/common/px_windows.h deleted file mode 100644 index 122fcbf44b7..00000000000 --- a/engines/icb/common/px_windows.h +++ /dev/null @@ -1,52 +0,0 @@ -/* ResidualVM - A 3D game interpreter - * - * ResidualVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the AUTHORS - * file distributed with this source distribution. - * - * Additional copyright for this file: - * Copyright (C) 1999-2000 Revolution Software Ltd. - * This code is based on source code created by Revolution Software, - * used with permission. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef PX_WINDOWS_H_INCLUDED -#define PX_WINDOWS_H_INCLUDED - -#ifdef _WIN32 -#include -#else - -namespace ICB { - -// define some windows.h compatibility types - -#define MAX_PATH (260) -#define _MAX_PATH MAX_PATH - -typedef signed int LONG; -typedef int BOOL; -typedef void *PVOID; -typedef PVOID HANDLE; -typedef HANDLE HWND; - -} // End of namespace ICB - -#endif - -#endif // PX_WINDOWS_H_INCLUDED diff --git a/engines/icb/debug.cpp b/engines/icb/debug.cpp index 0cb08ba9d12..6637014a34f 100644 --- a/engines/icb/debug.cpp +++ b/engines/icb/debug.cpp @@ -25,8 +25,6 @@ * */ -#include "engines/icb/common/px_windows.h" - #include "p4.h" #include "p4_generic.h" diff --git a/engines/icb/debug_pc.cpp b/engines/icb/debug_pc.cpp index 7fba4f466f0..af4ae3aed2a 100644 --- a/engines/icb/debug_pc.cpp +++ b/engines/icb/debug_pc.cpp @@ -25,8 +25,6 @@ * */ -#include "engines/icb/common/px_windows.h" - #include "engines/icb/common/px_rccommon.h" #include "engines/icb/common/px_common.h" #include "p4_generic.h" diff --git a/engines/icb/direct_input.cpp b/engines/icb/direct_input.cpp index d73afc16615..eae71d0693e 100644 --- a/engines/icb/direct_input.cpp +++ b/engines/icb/direct_input.cpp @@ -26,7 +26,6 @@ */ #include "engines/icb/common/px_rccommon.h" -#include "engines/icb/common/px_windows.h" #if defined (SDL_BACKEND) #include @@ -236,7 +235,7 @@ int NTJoystickHandler::GetJoystick(int joynum, JoyInfo *joypos) { NTJoystickHandler ntJoystick; -BOOL PollNTJoystick() { +bool PollNTJoystick() { ntJoystick.UpdateJoystick(); // State structre diff --git a/engines/icb/function.cpp b/engines/icb/function.cpp index 5c2829c12bd..497de0bfa47 100644 --- a/engines/icb/function.cpp +++ b/engines/icb/function.cpp @@ -25,10 +25,6 @@ * */ -#ifdef _PC -#include "engines/icb/common/px_windows.h" -#endif - #include "engines/icb/common/px_common.h" #include "engines/icb/common/ptr_util.h" diff --git a/engines/icb/game_script.cpp b/engines/icb/game_script.cpp index 20cf9a13d51..8a336bcc3c3 100644 --- a/engines/icb/game_script.cpp +++ b/engines/icb/game_script.cpp @@ -25,7 +25,6 @@ * */ -#include "engines/icb/common/px_windows.h" #include "res_man.h" #include "game_script.h" #include "debug.h" diff --git a/engines/icb/keyboard.cpp b/engines/icb/keyboard.cpp index ff003682080..5f49ba680df 100644 --- a/engines/icb/keyboard.cpp +++ b/engines/icb/keyboard.cpp @@ -53,7 +53,7 @@ void Clear_key_buffer() { keyPointer = 0; } -BOOL KeyWaiting() { +bool KeyWaiting() { if (keyBacklog) return (true); else diff --git a/engines/icb/keyboard.h b/engines/icb/keyboard.h index 3bcba0691d9..8620d22be35 100644 --- a/engines/icb/keyboard.h +++ b/engines/icb/keyboard.h @@ -40,7 +40,7 @@ typedef struct { void WriteKey(char key); // Adds a keypress to the buffer -extern BOOL KeyWaiting(); +extern bool KeyWaiting(); extern int32 ReadKey(char *key); extern void GetKeyStatus(_drvKeyStatus *s); diff --git a/engines/icb/movie_pc.cpp b/engines/icb/movie_pc.cpp index 5683f51ee1e..c703a6bd382 100644 --- a/engines/icb/movie_pc.cpp +++ b/engines/icb/movie_pc.cpp @@ -26,7 +26,6 @@ */ #include "engines/icb/common/px_rccommon.h" -#include "engines/icb/common/px_windows.h" #include "movie_pc.h" #include "direct_input.h" #include "engines/icb/sound/music_manager.h" diff --git a/engines/icb/options_manager_pc.cpp b/engines/icb/options_manager_pc.cpp index 7085a79942c..20272290165 100644 --- a/engines/icb/options_manager_pc.cpp +++ b/engines/icb/options_manager_pc.cpp @@ -32,7 +32,6 @@ #include #include "engines/icb/common/px_rccommon.h" -#include "engines/icb/common/px_windows.h" #include "engines/icb/icb.h" #include "options_manager_pc.h" diff --git a/engines/icb/p4.cpp b/engines/icb/p4.cpp index 5ab8f4464dd..b0622bf458a 100644 --- a/engines/icb/p4.cpp +++ b/engines/icb/p4.cpp @@ -29,7 +29,6 @@ #define FORBIDDEN_SYMBOL_EXCEPTION_localtime #define FORBIDDEN_SYMBOL_EXCEPTION_mkdir -#include "engines/icb/common/px_windows.h" #include #ifdef _WIN32 diff --git a/engines/icb/p4.h b/engines/icb/p4.h index c14007fd394..f1c93ebcaec 100644 --- a/engines/icb/p4.h +++ b/engines/icb/p4.h @@ -63,7 +63,7 @@ extern uint32 sys_font_hash; // Res_open will compute the hash value and sto #define RESOURCE_IS_COMPRESSED 1 #if _PC -extern BOOL gRegainedFocus; // Set when we regain the focus. Cleared by the graphics reloading functions +extern bool gRegainedFocus; // Set when we regain the focus. Cleared by the graphics reloading functions } // End of namespace ICB (To avoid including inside the namespace diff --git a/engines/icb/p4_generic.h b/engines/icb/p4_generic.h index 3004983a434..ba2a90983bc 100644 --- a/engines/icb/p4_generic.h +++ b/engines/icb/p4_generic.h @@ -29,7 +29,6 @@ #define INCLUDED_P4_GENERIC_H #include "engines/icb/common/px_rccommon.h" -#include "engines/icb/common/px_windows.h" #include "p4.h" diff --git a/engines/icb/p4_pc.cpp b/engines/icb/p4_pc.cpp index ae2d04c0acb..a7c0ada590d 100644 --- a/engines/icb/p4_pc.cpp +++ b/engines/icb/p4_pc.cpp @@ -25,7 +25,6 @@ * */ -#include "engines/icb/common/px_windows.h" #ifdef _WIN32 #include // _getcwd() #else @@ -53,8 +52,8 @@ namespace ICB { -BOOL gRegainedFocus = false; -BOOL gotTheFocus = false; +bool gRegainedFocus = false; +bool gotTheFocus = false; pxString font_cluster = FONT_CLUSTER_PATH; @@ -632,7 +631,7 @@ void _stub::Fix_time() { int WhichCD(const char * /* mission */) { return 1; } -BOOL HasMMXTechnology() { return true; } +bool HasMMXTechnology() { return true; } void _mission::LoadPlatformSpecific(Common::SeekableReadStream * /* fh */) { // No PC specific stuff in here (at the moment) diff --git a/engines/icb/sound/sound_common.cpp b/engines/icb/sound/sound_common.cpp index 939b831154c..e015c3e3efc 100644 --- a/engines/icb/sound/sound_common.cpp +++ b/engines/icb/sound/sound_common.cpp @@ -42,7 +42,7 @@ bool8 openWav(Common::SeekableReadStream *stream, _wavHeader &header, uint32 &le // TODO: fopen must happen before int bytesRead; char buff[1024]; - BOOL bMore = true; + bool bMore = true; // Read the wave header if (stream->read(&header, sizeof(_wavHeader)) != sizeof(_wavHeader)) diff --git a/engines/icb/surface_manager.cpp b/engines/icb/surface_manager.cpp index 726e7c644a5..a7cc532582f 100644 --- a/engines/icb/surface_manager.cpp +++ b/engines/icb/surface_manager.cpp @@ -455,9 +455,6 @@ void _surface_manager::Kill_surface(uint32 s_id) { } uint8 *_surface_manager::Lock_surface(uint32 s_id) { -#if 0 - HRESULT hr; -#endif _surface *pSurface = m_Surfaces[s_id]; if (pSurface->m_locked) diff --git a/engines/icb/zsupport.cpp b/engines/icb/zsupport.cpp index da6393755aa..32b4c23a901 100644 --- a/engines/icb/zsupport.cpp +++ b/engines/icb/zsupport.cpp @@ -26,7 +26,6 @@ */ #include "engines/icb/common/px_common.h" -#include "engines/icb/common/px_windows.h" #include #include "engines/icb/p4.h" #include "engines/icb/zsupport.h"