mirror of
https://github.com/OpenDriver2/REDRIVER2.git
synced 2024-11-22 10:22:48 +01:00
Make changes suggested in PR review
- Fix suggested settings on premake5.lua - Fix SDL2 includes - Fix typo on STRINGS.H include from PSY-Q - Remove inserted _WINDOWS - Move platform-related macro declarations to GAME/PLATFORM.H
This commit is contained in:
parent
b24dd1bde4
commit
05d47d6388
@ -30,12 +30,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(_WINDOWS) || defined(__MINGW32__) || defined (__ANDROID__)
|
||||
#include <SDL.h>
|
||||
#elif defined(__APPLE__) || defined(__linux__) || defined(__EMSCRIPTEN__)
|
||||
#include <SDL2/SDL.h>
|
||||
#endif
|
||||
|
||||
SDL_Window* g_window = NULL;
|
||||
TextureID vramTexture;
|
||||
|
@ -1,12 +1,7 @@
|
||||
#ifndef EMULATOR_GLOBALS_H
|
||||
#define EMULATOR_GLOBALS_H
|
||||
|
||||
#if defined(_WINDOWS) || defined(__MINGW32__) || defined (__ANDROID__)
|
||||
#include <SDL_gamecontroller.h>
|
||||
#elif defined(__APPLE__) || defined(__linux__) || defined(__EMSCRIPTEN__)
|
||||
#include <SDL2/SDL_gamecontroller.h>
|
||||
#endif
|
||||
|
||||
#include <EMULATOR.H>
|
||||
|
||||
#if defined(D3D9)
|
||||
|
@ -59,18 +59,16 @@
|
||||
#if defined(__APPLE__)
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL2/SDL_opengl.h>
|
||||
#elif defined(_WINDOWS) || defined(__MINGW32__) || defined (__ANDROID__)
|
||||
#include <SDL.h>
|
||||
#elif defined(__linux__) || defined(__EMSCRIPTEN__)
|
||||
#elif defined(__EMSCRIPTEN__)
|
||||
#include <SDL2/SDL.h>
|
||||
#elif (defined(_WINDOWS) || defined(__MINGW32__) || defined(__linux__)) && !defined(__ANDROID__)
|
||||
#include <SDL.h>
|
||||
#elif defined (__ANDROID__)
|
||||
#include <SDL.h>
|
||||
#endif
|
||||
|
||||
#if defined (OGL)
|
||||
#if defined(_WINDOWS) || defined(__MINGW32__) || defined (__ANDROID__)
|
||||
#include <SDL_opengl.h>
|
||||
#elif defined(__APPLE__) || defined(__linux__) || defined(__EMSCRIPTEN__)
|
||||
#include <SDL2/SDL_opengl.h>
|
||||
#endif
|
||||
#include <SDL_opengl.h>///@FIXME see mac!
|
||||
#elif defined (OGLES)
|
||||
#include <SDL_syswm.h>
|
||||
#if OGLES_VERSION == 2
|
||||
|
@ -7,11 +7,7 @@
|
||||
#include <d3d9.h>
|
||||
#endif
|
||||
|
||||
#if defined(_WINDOWS) || defined(__MINGW32__) || defined (__ANDROID__)
|
||||
#include <SDL_timer.h>
|
||||
#elif defined(__APPLE__) || defined(__linux__) || defined(__EMSCRIPTEN__)
|
||||
#include <SDL2/SDL_timer.h>
|
||||
#endif
|
||||
|
||||
void(*vsync_callback)(void) = NULL;
|
||||
|
||||
|
@ -2,11 +2,7 @@
|
||||
|
||||
#include "EMULATOR.H"
|
||||
|
||||
#if defined(_WINDOWS) || defined(__MINGW32__) || defined (__ANDROID__)
|
||||
#include <SDL.h>
|
||||
#elif defined(__APPLE__) || defined(__linux__) || defined(__EMSCRIPTEN__)
|
||||
#include <SDL2/SDL.h>
|
||||
#endif
|
||||
|
||||
SDL_GameController* padHandle[MAX_CONTROLLERS];
|
||||
unsigned char* padData[MAX_CONTROLLERS];
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include <AL/alext.h>
|
||||
#include <AL/efx.h>
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#ifdef _WIN32
|
||||
#include <minmax.h>
|
||||
#endif
|
||||
|
||||
|
@ -19,12 +19,7 @@
|
||||
#ifndef PSX
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#include <direct.h>
|
||||
#elif defined (__unix__)
|
||||
#include <sys/stat.h>
|
||||
#define _mkdir(str) mkdir(str, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)
|
||||
#endif
|
||||
#include <PLATFORM.H>
|
||||
|
||||
// [A]
|
||||
void ShowSavingWaitMessage(char *message, int height)
|
||||
|
@ -72,9 +72,7 @@
|
||||
#include <stdlib.h>
|
||||
#include "STRINGS.H"
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define _stricmp(s1, s2) strcasecmp(s1, s2)
|
||||
#endif
|
||||
#include <PLATFORM.H>
|
||||
|
||||
#include "../FRONTEND/FEMAIN.H"
|
||||
|
||||
|
@ -30,11 +30,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#ifndef PSX
|
||||
#if defined(_WINDOWS) || defined(__MINGW32__) || defined (__ANDROID__)
|
||||
#include <SDL.h>
|
||||
#elif defined(__APPLE__) || defined(__linux__) || defined(__EMSCRIPTEN__)
|
||||
#include <SDL2/SDL.h>
|
||||
#endif
|
||||
#endif // PSX
|
||||
|
||||
char* MissionName[37] =
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "SYSTEM.H"
|
||||
#include "TEXTURE.H"
|
||||
|
||||
#include <string.h>
|
||||
#include <STRINGS.H>
|
||||
|
||||
extern TEXTURE_DETAILS digit_texture;
|
||||
|
||||
|
@ -1,11 +1,7 @@
|
||||
#include "DRIVER2.H"
|
||||
|
||||
#ifndef PSX
|
||||
#if defined(_WINDOWS) || defined(__MINGW32__) || defined (__ANDROID__)
|
||||
#include <SDL.h>
|
||||
#elif defined(__APPLE__) || defined(__linux__) || defined(__EMSCRIPTEN__)
|
||||
#include <SDL2/SDL.h>
|
||||
#endif
|
||||
#endif // !PSX
|
||||
|
||||
#include <STRINGS.H>
|
||||
|
@ -1,11 +1,7 @@
|
||||
#include "DRIVER2.H"
|
||||
|
||||
#ifndef PSX
|
||||
#if defined(_WINDOWS) || defined(__MINGW32__) || defined (__ANDROID__)
|
||||
#include <SDL.h>
|
||||
#elif defined(__APPLE__) || defined(__linux__) || defined(__EMSCRIPTEN__)
|
||||
#include <SDL2/SDL.h>
|
||||
#endif
|
||||
#endif // !PSX
|
||||
|
||||
#include "LIBETC.H"
|
||||
|
16
src_rebuild/GAME/PLATFORM.H
Normal file
16
src_rebuild/GAME/PLATFORM.H
Normal file
@ -0,0 +1,16 @@
|
||||
#ifndef PLATFORM_H
|
||||
#define PLATFORM_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <direct.h>
|
||||
#elif defined (__unix__)
|
||||
#include <sys/stat.h>
|
||||
#define _mkdir(str) mkdir(str, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
#include <string.h>
|
||||
#define _stricmp(s1, s2) strcasecmp(s1, s2)
|
||||
#endif
|
||||
|
||||
#endif // PLATFORM_H
|
@ -16,7 +16,9 @@ workspace "REDRIVER2"
|
||||
configurations { "Debug", "Release" }
|
||||
|
||||
defines { VERSION }
|
||||
defines { "USE_32_BIT_ADDR", "PGXP" }
|
||||
|
||||
filter "system:Windows or linux"
|
||||
defines { "USE_32_BIT_ADDR", "PGXP" }
|
||||
|
||||
filter "configurations:Debug"
|
||||
defines {
|
||||
@ -29,7 +31,7 @@ workspace "REDRIVER2"
|
||||
"NDEBUG",
|
||||
}
|
||||
|
||||
if _TARGET_OS == "Windows" then
|
||||
if _TARGET_OS == "windows" then
|
||||
dofile("premake_libjpeg.lua")
|
||||
end
|
||||
|
||||
@ -57,13 +59,13 @@ project "PSX"
|
||||
|
||||
defines { "OGL", "GLEW" }
|
||||
|
||||
includedirs {
|
||||
SDL2_DIR.."/include",
|
||||
GLEW_DIR.."/include",
|
||||
OPENAL_DIR.."/include",
|
||||
}
|
||||
|
||||
filter "system:Windows"
|
||||
includedirs {
|
||||
SDL2_DIR.."/include",
|
||||
GLEW_DIR.."/include",
|
||||
OPENAL_DIR.."/include",
|
||||
}
|
||||
|
||||
links {
|
||||
"opengl32",
|
||||
"glew32",
|
||||
@ -82,6 +84,10 @@ project "PSX"
|
||||
"-Wno-narrowing"
|
||||
}
|
||||
|
||||
includedirs {
|
||||
"/usr/include/SDL2"
|
||||
}
|
||||
|
||||
links {
|
||||
"GL",
|
||||
"GLEW",
|
||||
@ -105,7 +111,6 @@ project "REDRIVER2"
|
||||
}
|
||||
|
||||
defines { GAME_REGION }
|
||||
defines { "OGL", "GLEW" }
|
||||
|
||||
files {
|
||||
"GAME/**.H",
|
||||
@ -116,10 +121,12 @@ project "REDRIVER2"
|
||||
"DebugOverlay.cpp",
|
||||
}
|
||||
|
||||
links { "PSX", "jpeg" }
|
||||
filter "system:Windows or linux"
|
||||
defines { "OGL", "GLEW" }
|
||||
dependson { "PSX" }
|
||||
links { "PSX", "jpeg" }
|
||||
|
||||
filter "system:Windows"
|
||||
dependson { "PSX" }
|
||||
files {
|
||||
"Windows/resource.h",
|
||||
"Windows/Resource.rc",
|
||||
@ -139,9 +146,12 @@ project "REDRIVER2"
|
||||
|
||||
filter "system:linux"
|
||||
buildoptions { "-Wno-narrowing", "-fpermissive" }
|
||||
|
||||
cppdialect "C++11"
|
||||
|
||||
includedirs {
|
||||
"/usr/include/SDL2"
|
||||
}
|
||||
|
||||
links {
|
||||
"GL",
|
||||
"GLEW",
|
||||
|
@ -10,11 +10,7 @@
|
||||
#include "EMULATOR.H"
|
||||
#include "EMULATOR_PRIVATE.H"
|
||||
|
||||
#if defined(_WINDOWS) || defined(__MINGW32__) || defined (__ANDROID__)
|
||||
#include <SDL_scancode.h>
|
||||
#elif defined(__APPLE__) || defined(__linux__) || defined(__EMSCRIPTEN__)
|
||||
#include <SDL2/SDL_scancode.h>
|
||||
#endif
|
||||
|
||||
// eq engine console output
|
||||
typedef enum
|
||||
|
@ -7,13 +7,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(_WINDOWS) || defined(__MINGW32__) || defined (__ANDROID__)
|
||||
#include <SDL.h>
|
||||
#elif defined(__APPLE__) || defined(__linux__) || defined(__EMSCRIPTEN__)
|
||||
#include <SDL2/SDL.h>
|
||||
#endif
|
||||
|
||||
#include <AL/al.h>
|
||||
|
||||
extern "C"
|
||||
|
Loading…
Reference in New Issue
Block a user