Fix Windows build and premake

This commit is contained in:
eray orçunus 2020-05-11 20:10:01 +03:00
parent 8a4fa58cd4
commit 36e2bc95d3
7 changed files with 20 additions and 12 deletions

View File

@ -90,7 +90,8 @@ workspace "re3"
} }
debugdir (gamepath) debugdir (gamepath)
if (exepath) then if (exepath) then
debugcommand (gamepath .. exepath) -- Used VS variable $(TargetFileName) because it doesn't accept premake tokens. Does debugcommand even work outside VS??
debugcommand (gamepath .. "$(TargetFileName)")
dir, file = exepath:match'(.*/)(.*)' dir, file = exepath:match'(.*/)(.*)'
debugdir (gamepath .. (dir or "")) debugdir (gamepath .. (dir or ""))
end end

View File

@ -1,3 +1,4 @@
#define WITHWINDOWS
#include "common.h" #include "common.h"
#include "crossplatform.h" #include "crossplatform.h"
#include "main.h" #include "main.h"

View File

@ -1,3 +1,4 @@
#define WITHWINDOWS
#include "common.h" #include "common.h"
#include "crossplatform.h" #include "crossplatform.h"

View File

@ -1,6 +1,9 @@
#include "common.h" #include "common.h"
#include "crossplatform.h" #include "crossplatform.h"
// Codes compatible with Windows and Linux
#ifndef _WIN32
// For internal use // For internal use
// wMilliseconds is not needed // wMilliseconds is not needed
void tmToSystemTime(const tm *tm, SYSTEMTIME *out) { void tmToSystemTime(const tm *tm, SYSTEMTIME *out) {
@ -18,6 +21,7 @@ void GetLocalTime_CP(SYSTEMTIME *out) {
tm *localTm = localtime(&timestamp); tm *localTm = localtime(&timestamp);
tmToSystemTime(localTm, out); tmToSystemTime(localTm, out);
} }
#endif
// Compatible with Linux/POSIX and MinGW on Windows // Compatible with Linux/POSIX and MinGW on Windows
#ifndef _WIN32 #ifndef _WIN32
@ -80,6 +84,7 @@ void FileTimeToSystemTime(time_t* writeTime, SYSTEMTIME* out) {
} }
#endif #endif
// Funcs/features from Windows that we need on other platforms
#ifndef _WIN32 #ifndef _WIN32
char *strupr(char *s) { char *strupr(char *s) {
char* tmp = s; char* tmp = s;

View File

@ -82,7 +82,7 @@ RwBool IsForegroundApp();
#endif #endif
// Codes compatible with Windows and Linux // Codes compatible with Windows and Linux
#if !defined _WIN32 #ifndef _WIN32
#define DeleteFile unlink #define DeleteFile unlink
// Needed for save games // Needed for save games
@ -103,7 +103,7 @@ void GetLocalTime_CP(SYSTEMTIME* out);
#endif #endif
// Compatible with Linux/POSIX and MinGW on Windows // Compatible with Linux/POSIX and MinGW on Windows
#if !defined _WIN32 #ifndef _WIN32
#include <iostream> #include <iostream>
#include <dirent.h> #include <dirent.h>
#include <sys/types.h> #include <sys/types.h>

View File

@ -66,7 +66,7 @@ static psGlobalType PsGlobal;
#define JIF(x) if (FAILED(hr=(x))) \ #define JIF(x) if (FAILED(hr=(x))) \
{debug(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) TEXT("\n"), hr); return;} {debug(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) TEXT("\n"), hr); return;}
long _dwMemAvailPhys; unsigned long _dwMemAvailPhys;
RwUInt32 gGameState; RwUInt32 gGameState;
#ifdef _WIN32 #ifdef _WIN32

View File

@ -100,10 +100,10 @@ IVideoWindow *pVW = nil;
IMediaSeeking *pMS = nil; IMediaSeeking *pMS = nil;
DWORD dwDXVersion; DWORD dwDXVersion;
DWORD _dwMemTotalPhys; SIZE_T _dwMemTotalPhys;
DWORD _dwMemAvailPhys; SIZE_T _dwMemAvailPhys;
DWORD _dwMemTotalVirtual; SIZE_T _dwMemTotalVirtual;
DWORD _dwMemAvailVirtual; SIZE_T _dwMemAvailVirtual;
DWORD _dwMemTotalVideo; DWORD _dwMemTotalVideo;
DWORD _dwMemAvailVideo; DWORD _dwMemAvailVideo;
DWORD _dwOperatingSystemVersion; DWORD _dwOperatingSystemVersion;
@ -687,10 +687,10 @@ psInitialise(void)
_GetVideoMemInfo(&_dwMemTotalVideo, &_dwMemAvailVideo); _GetVideoMemInfo(&_dwMemTotalVideo, &_dwMemAvailVideo);
#ifdef FIX_BUGS #ifdef FIX_BUGS
debug("Physical memory size %u\n", _dwMemTotalPhys); debug("Physical memory size %lu\n", _dwMemTotalPhys);
debug("Available physical memory %u\n", _dwMemAvailPhys); debug("Available physical memory %lu\n", _dwMemAvailPhys);
debug("Video memory size %u\n", _dwMemTotalVideo); debug("Video memory size %lu\n", _dwMemTotalVideo);
debug("Available video memory %u\n", _dwMemAvailVideo); debug("Available video memory %lu\n", _dwMemAvailVideo);
#else #else
debug("Physical memory size %d\n", _dwMemTotalPhys); debug("Physical memory size %d\n", _dwMemTotalPhys);
debug("Available physical memory %d\n", _dwMemAvailPhys); debug("Available physical memory %d\n", _dwMemAvailPhys);