mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 06:13:45 -07:00
cleanup _MSC_VER usage
This commit is contained in:
parent
dc6dee0467
commit
6d2fd046bf
10 changed files with 18 additions and 18 deletions
|
@ -10,7 +10,7 @@
|
|||
#include "ZFile.h"
|
||||
#include "ZTexture.h"
|
||||
|
||||
#if !defined(_MSC_VER) && !defined(__CYGWIN__)
|
||||
#ifdef __linux__
|
||||
#include <csignal>
|
||||
#include <cstdlib>
|
||||
#include <ctime>
|
||||
|
@ -58,7 +58,7 @@ int ExtractFunc(int workerID, int fileListSize, std::string fileListItem, ZFileM
|
|||
|
||||
volatile int numWorkersLeft = 0;
|
||||
|
||||
#if !defined(_MSC_VER) && !defined(__CYGWIN__)
|
||||
#ifdef __linux__
|
||||
#define ARRAY_COUNT(arr) (sizeof(arr) / sizeof(arr[0]))
|
||||
void ErrorHandler(int sig)
|
||||
{
|
||||
|
@ -216,7 +216,7 @@ int main(int argc, char* argv[])
|
|||
}
|
||||
else if (arg == "-eh") // Enable Error Handler
|
||||
{
|
||||
#if !defined(_MSC_VER) && !defined(__CYGWIN__)
|
||||
#ifdef __linux__
|
||||
signal(SIGSEGV, ErrorHandler);
|
||||
signal(SIGABRT, ErrorHandler);
|
||||
#else
|
||||
|
|
|
@ -144,7 +144,7 @@ namespace Ship {
|
|||
|
||||
bool Archive::AddFile(const std::string& path, uintptr_t fileData, DWORD dwFileSize) {
|
||||
HANDLE hFile;
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
SYSTEMTIME sysTime;
|
||||
GetSystemTime(&sysTime);
|
||||
FILETIME t;
|
||||
|
@ -310,12 +310,12 @@ namespace Ship {
|
|||
|
||||
bool Archive::LoadMainMPQ(bool enableWriting, bool genCRCMap) {
|
||||
HANDLE mpqHandle = NULL;
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
std::wstring wfullPath = std::filesystem::absolute(MainPath).wstring();
|
||||
#endif
|
||||
std::string fullPath = std::filesystem::absolute(MainPath).string();
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
if (!SFileOpenArchive(wfullPath.c_str(), 0, enableWriting ? 0 : MPQ_OPEN_READ_ONLY, &mpqHandle)) {
|
||||
#else
|
||||
if (!SFileOpenArchive(fullPath.c_str(), 0, enableWriting ? 0 : MPQ_OPEN_READ_ONLY, &mpqHandle)) {
|
||||
|
@ -353,7 +353,7 @@ namespace Ship {
|
|||
|
||||
std::wstring wPath = std::filesystem::absolute(path).wstring();
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
if (!SFileOpenArchive(wPath.c_str(), 0, MPQ_OPEN_READ_ONLY, &patchHandle)) {
|
||||
#else
|
||||
if (!SFileOpenArchive(fullPath.c_str(), 0, MPQ_OPEN_READ_ONLY, &patchHandle)) {
|
||||
|
@ -361,7 +361,7 @@ namespace Ship {
|
|||
SPDLOG_ERROR("({}) Failed to open patch mpq file {} while applying to {}.", GetLastError(), path.c_str(), MainPath.c_str());
|
||||
return false;
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
if (!SFileOpenPatchArchive(mainMPQ, wPath.c_str(), "", 0)) {
|
||||
#else
|
||||
if (!SFileOpenPatchArchive(mainMPQ, fullPath.c_str(), "", 0)) {
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace Ship {
|
|||
|
||||
if (!ResMan->DidLoadSuccessfully())
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
MessageBox(NULL, L"Main OTR file not found!", L"Uh oh", MB_OK);
|
||||
#else
|
||||
SPDLOG_ERROR("Main OTR file not found!");
|
||||
|
|
|
@ -210,7 +210,7 @@ static map<int, FBInfo> framebuffers;
|
|||
static set<pair<float, float>> get_pixel_depth_pending;
|
||||
static map<pair<float, float>, uint16_t> get_pixel_depth_cached;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
// TODO: Properly implement for MSVC
|
||||
static unsigned long get_time(void)
|
||||
{
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include "gfx_window_manager_api.h"
|
||||
#include "gfx_screen_config.h"
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
#include <WTypesbase.h>
|
||||
#endif
|
||||
#include <time.h>
|
||||
|
|
|
@ -243,7 +243,7 @@ namespace Ship {
|
|||
|
||||
std::shared_ptr<ResourcePromise> ResourceMgr::LoadResourceAsync(std::string FilePath) {
|
||||
// todo: what?
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
StringHelper::ReplaceOriginal(FilePath, "/", "\\");
|
||||
#else
|
||||
StringHelper::ReplaceOriginal(FilePath, "\\", "/");
|
||||
|
|
|
@ -674,7 +674,7 @@ namespace SohImGui {
|
|||
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0, 0, 0, 0));
|
||||
ImGui::Begin("Debug Stats", nullptr, ImGuiWindowFlags_None);
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
ImGui::Text("Platform: Windows");
|
||||
#else
|
||||
ImGui::Text("Platform: Linux");
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "Blob.h"
|
||||
#include "Matrix.h"
|
||||
#include "AudioPlayer.h"
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
#include "WasapiAudioPlayer.h"
|
||||
#else
|
||||
#include "SDLAudioPlayer.h"
|
||||
|
@ -401,7 +401,7 @@ namespace Ship {
|
|||
}
|
||||
|
||||
void Window::SetAudioPlayer() {
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
APlayer = std::make_shared<WasapiAudioPlayer>();
|
||||
#else
|
||||
APlayer = std::make_shared<SDLAudioPlayer>();
|
||||
|
|
|
@ -23,7 +23,7 @@ void SetWindowManager(struct GfxWindowManagerAPI** WmApi, struct GfxRenderingAPI
|
|||
#ifdef ENABLE_OPENGL
|
||||
*RenderingApi = &gfx_opengl_api;
|
||||
#if defined(__linux__)
|
||||
// MERGETODO:
|
||||
// LINUX_TODO:
|
||||
// *WmApi = &gfx_glx;
|
||||
*WmApi = &gfx_sdl;
|
||||
#else
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include "Enhancements/gameconsole.h"
|
||||
#include <ultra64/gbi.h>
|
||||
#include <Animation.h>
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#else
|
||||
#include <time.h>
|
||||
|
@ -77,7 +77,7 @@ extern "C" void InitOTR() {
|
|||
Debug_Init();
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef _WIN32
|
||||
extern "C" uint64_t GetFrequency() {
|
||||
LARGE_INTEGER nFreq;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue