2017-08-03 22:51:40 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the planetblupi source code
|
|
|
|
* Copyright (C) 1997, Daniel Roux & EPSITEC SA
|
|
|
|
* Copyright (C) 2017, Mathieu Schroeter
|
|
|
|
* http://epsitec.ch; http://www.blupi.org; http://github.com/blupi-games
|
|
|
|
*
|
|
|
|
* 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 3 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, see http://gnu.org/licenses
|
|
|
|
*/
|
2017-02-12 14:36:34 +01:00
|
|
|
|
2017-01-23 00:20:27 +01:00
|
|
|
#pragma once
|
|
|
|
|
2017-02-10 23:03:33 +01:00
|
|
|
#include <SDL2/SDL.h>
|
2017-02-05 18:43:10 +01:00
|
|
|
#include <libintl.h>
|
2017-08-26 22:40:59 +02:00
|
|
|
#include <string>
|
2017-01-23 00:20:27 +01:00
|
|
|
|
2017-08-11 14:38:05 +02:00
|
|
|
#include "config.h"
|
|
|
|
|
2017-08-04 00:21:47 +02:00
|
|
|
extern SDL_Window * g_window;
|
|
|
|
extern SDL_Renderer * g_renderer;
|
|
|
|
extern bool g_bFullScreen;
|
2017-08-14 22:22:30 +02:00
|
|
|
extern bool g_restoreBugs;
|
2017-12-10 15:29:46 +01:00
|
|
|
extern bool g_restoreMidi;
|
2017-08-15 17:55:30 +02:00
|
|
|
extern bool g_enableRecorder;
|
2017-08-26 22:40:59 +02:00
|
|
|
extern std::string g_playRecord;
|
2017-02-10 00:14:28 +01:00
|
|
|
|
2017-08-21 22:08:25 +02:00
|
|
|
struct Point {
|
2017-08-04 00:21:47 +02:00
|
|
|
Sint32 x;
|
|
|
|
Sint32 y;
|
2017-02-10 00:14:28 +01:00
|
|
|
};
|
|
|
|
|
2017-08-21 22:08:25 +02:00
|
|
|
struct Rect {
|
2017-08-04 00:21:47 +02:00
|
|
|
Sint32 left;
|
|
|
|
Sint32 top;
|
|
|
|
Sint32 right;
|
|
|
|
Sint32 bottom;
|
2017-02-10 00:14:28 +01:00
|
|
|
};
|
|
|
|
|
2017-08-21 22:08:25 +02:00
|
|
|
typedef Uint32 ColorRef;
|
2017-02-10 00:14:28 +01:00
|
|
|
|
|
|
|
#if defined(_WIN64)
|
2017-12-01 13:52:36 +01:00
|
|
|
typedef unsigned __int64 WParam;
|
|
|
|
typedef __int64 LParam;
|
2017-02-10 00:14:28 +01:00
|
|
|
#else
|
2017-12-01 13:52:36 +01:00
|
|
|
typedef Uint32 WParam;
|
|
|
|
typedef Sint32 LParam;
|
2017-02-10 00:14:28 +01:00
|
|
|
#endif
|
|
|
|
|
2017-08-21 22:14:00 +02:00
|
|
|
#undef LOWORD
|
|
|
|
#undef HIWORD
|
2017-08-04 00:21:47 +02:00
|
|
|
#define LOWORD(l) ((Uint16) (((Uint32) (l)) & 0xffff))
|
2017-02-12 14:36:34 +01:00
|
|
|
#define HIWORD(l) ((Uint16) ((((Uint32) (l)) >> 16) & 0xffff))
|
2017-02-10 00:14:28 +01:00
|
|
|
|
2017-08-11 14:38:05 +02:00
|
|
|
#define PB_STRINGIFY(s) #s
|
|
|
|
#define PB_TOSTRING(s) PB_STRINGIFY (s)
|
2017-08-13 16:36:35 +02:00
|
|
|
#define PB_VERSION_INT(a, b, c) (a << 16 | b << 8 | c)
|
2017-08-11 14:38:05 +02:00
|
|
|
#define PB_VERSION_DOT(a, b, c) a##.##b##.##c
|
|
|
|
#define PB_VERSION(a, b, c) PB_VERSION_DOT (a, b, c)
|
|
|
|
#define PLANETBLUPI_VERSION \
|
|
|
|
PB_VERSION (PB_VERSION_MAJOR, PB_VERSION_MINOR, PB_VERSION_PATCH)
|
2017-08-13 16:36:35 +02:00
|
|
|
#define PLANETBLUPI_VERSION_INT \
|
|
|
|
PB_VERSION_INT (PB_VERSION_MAJOR, PB_VERSION_MINOR, PB_VERSION_PATCH)
|
2017-08-11 14:38:05 +02:00
|
|
|
#define PLANETBLUPI_VERSION_STR PB_TOSTRING (PLANETBLUPI_VERSION)
|
|
|
|
|
2017-02-15 17:33:03 +01:00
|
|
|
#ifdef _WIN32
|
|
|
|
#define countof(a) _countof (a)
|
|
|
|
#else /* _WIN32 */
|
|
|
|
#define countof(a) (sizeof (a) / sizeof (*a))
|
|
|
|
#endif /* !_WIN32 */
|
|
|
|
|
2017-08-04 00:21:47 +02:00
|
|
|
// clang-format off
|
2017-02-12 14:36:34 +01:00
|
|
|
#define VK_END 0x23
|
|
|
|
#define VK_LEFT 0x25
|
|
|
|
#define VK_UP 0x26
|
|
|
|
#define VK_RIGHT 0x27
|
|
|
|
#define VK_DOWN 0x28
|
|
|
|
|
2017-08-07 18:33:26 +02:00
|
|
|
#define EV_KEYDOWN 0x0100
|
|
|
|
#define EV_KEYUP 0x0101
|
|
|
|
#define EV_MOUSEMOVE 0x0200
|
|
|
|
#define EV_LBUTTONDOWN 0x0201
|
|
|
|
#define EV_LBUTTONUP 0x0202
|
|
|
|
#define EV_RBUTTONDOWN 0x0204
|
|
|
|
#define EV_RBUTTONUP 0x0205
|
2017-08-04 00:21:47 +02:00
|
|
|
// clang-format on
|