1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-28 01:04:50 +01:00

use SDL2's platform defines to normalise platform guards

This commit is contained in:
IntelOrca
2016-01-13 22:37:13 +00:00
parent e68ae821db
commit cdee534eb1
21 changed files with 83 additions and 65 deletions

View File

@@ -18,13 +18,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#if defined(__linux__)
#include "../common.h"
#ifdef __LINUX__
#include "platform.h"
#include <dlfcn.h>
#include <stdlib.h>
#include <fontconfig/fontconfig.h>
#include "../util/util.h"
#include "fontconfig/fontconfig.h"
#include "platform.h"
// See http://syprog.blogspot.ru/2011/12/listing-loaded-shared-objects-in-linux.html
struct lmap {

View File

@@ -21,20 +21,21 @@
#ifndef _PLATFORM_H_
#define _PLATFORM_H_
#ifdef _WIN32
#include "../common.h"
#ifdef __WINDOWS__
#define HAVE_MATH_H
#endif // _WIN32
#endif // __WINDOWS__
#include <SDL.h>
#include "../common.h"
#include "../drawing/font.h"
#ifndef MAX_PATH
#define MAX_PATH 260
#endif
#if defined(__APPLE__) && defined(__MACH__)
#ifdef __MACOSX__
#define KEYBOARD_PRIMARY_MODIFIER KMOD_GUI
#else
#define KEYBOARD_PRIMARY_MODIFIER KMOD_CTRL
@@ -171,7 +172,7 @@ bool platform_check_steam_overlay_attached();
datetime64 platform_get_datetime_now_utc();
// Windows specific definitions
#ifdef _WIN32
#ifdef __WINDOWS__
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
@@ -179,6 +180,6 @@ datetime64 platform_get_datetime_now_utc();
int windows_get_registry_install_info(rct2_install_info *installInfo, char *source, char *font, uint8 charset);
HWND windows_get_window_handle();
#endif // _WIN32
#endif // __WINDOWS__
#endif

View File

@@ -902,7 +902,7 @@ void platform_set_cursor(char cursor)
static void platform_load_cursors()
{
RCT2_GLOBAL(0x14241BC, uint32) = 2;
#ifdef _WIN32
#ifdef __WINDOWS__
HINSTANCE hInst = RCT2_GLOBAL(RCT2_ADDRESS_HINSTANCE, HINSTANCE);
RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_ARROW, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x74));
RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_BLANK, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0xA1));
@@ -933,7 +933,7 @@ static void platform_load_cursors()
RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_HAND_CLOSED, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0xA5));
#else
STUB();
#endif // _WIN32
#endif // __WINDOWS__
_cursors[0] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_ARROW);
_cursors[1] = SDL_CreateCursor(blank_cursor_data, blank_cursor_mask, 32, 32, BLANK_CURSOR_HOTX, BLANK_CURSOR_HOTY);

View File

@@ -18,7 +18,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#ifdef _WIN32
#include "../common.h"
#ifdef __WINDOWS__
#include <windows.h>
#include <psapi.h>