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:
André Vicente Milack 2020-09-30 00:55:53 -03:00
parent b24dd1bde4
commit 05d47d6388
16 changed files with 48 additions and 71 deletions

View File

@ -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;

View File

@ -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)

View File

@ -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

View File

@ -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;

View File

@ -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];

View File

@ -13,7 +13,7 @@
#include <AL/alext.h>
#include <AL/efx.h>
#ifdef _WINDOWS
#ifdef _WIN32
#include <minmax.h>
#endif

View File

@ -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)

View File

@ -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"

View File

@ -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] =

View File

@ -3,7 +3,7 @@
#include "SYSTEM.H"
#include "TEXTURE.H"
#include <string.h>
#include <STRINGS.H>
extern TEXTURE_DETAILS digit_texture;

View File

@ -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>

View File

@ -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"

View 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

View File

@ -16,6 +16,8 @@ workspace "REDRIVER2"
configurations { "Debug", "Release" }
defines { VERSION }
filter "system:Windows or linux"
defines { "USE_32_BIT_ADDR", "PGXP" }
filter "configurations:Debug"
@ -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" }
filter "system:Windows"
includedirs {
SDL2_DIR.."/include",
GLEW_DIR.."/include",
OPENAL_DIR.."/include",
}
filter "system:Windows"
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",
}
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",

View File

@ -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

View File

@ -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"