We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 773622a commit 2152c23Copy full SHA for 2152c23
src/Common/FSMacros.hpp
@@ -1,5 +1,13 @@
1
#pragma once
2
3
+#if defined(LINUX)
4
+#define _DELIMITER '/' //for looking
5
+#define DELIMITER "/" // for insert
6
+#elif defined(WINDOWS)
7
+#define _DELIMITER '\\' //for looking
8
+#define DELIMITER "\\" // for insert
9
+#endif
10
+
11
// game path definition
12
#define _game_data_ "$game_data$"
13
#define _game_textures_ "$game_textures$"
src/Common/PlatformLinux.inl
@@ -87,13 +87,29 @@ inline void Sleep(int ms)
87
usleep(ms * 1000);
88
}
89
90
+ #include <libgen.h>
91
inline void _splitpath (
92
const char* path, // Path Input
93
char* drive, // Drive : Output
94
char* dir, // Directory : Output
95
char* fname, // Filename : Output
96
char* ext // Extension : Output
-){}
97
+){
98
+ if(drive)
99
+ strcpy(drive, "");
100
101
+ if(dir)
102
+ strcpy(dir, dirname(path));
103
104
+ if(fname)
105
+ strcpy(fname, basename(path));
106
+}
107
108
+#include <iostream>
109
+inline void OutputDebugString(char *str) // for linux debugger
110
+{
111
+ std::cerr << str;
112
113
114
inline unsigned long GetLastError()
115
{
src/xrCore/LocatorAPI_defs.cpp
@@ -48,8 +48,15 @@ FS_Path::FS_Path(LPCSTR _Root, LPCSTR _Add, LPCSTR _DefExt, LPCSTR _FilterCaptio
48
xr_strcpy(temp, sizeof(temp), _Root);
49
if (_Add)
50
xr_strcat(temp, _Add);
51
- if (temp[0] && temp[xr_strlen(temp) - 1] != '\\')
52
- xr_strcat(temp, "\\");
+ char *ptr = strchr(temp, '\\');
53
+ while (ptr) {
54
+ *ptr = '/';
55
+ ptr = strchr(ptr, '\\');
56
+ }
57
58
+ if (temp[0] && temp[xr_strlen(temp) - 1] != _DELIMITER)
59
+ xr_strcat(temp, DELIMITER);
60
m_Path = xr_strlwr(xr_strdup(temp));
61
m_DefExt = _DefExt ? xr_strlwr(xr_strdup(_DefExt)) : 0;
62
m_FilterCaption = _FilterCaption ? xr_strlwr(xr_strdup(_FilterCaption)) : 0;
src/xrCore/_math.cpp
@@ -326,14 +326,16 @@ void _initialize_cpu()
326
327
string256 features;
328
xr_strcpy(features, sizeof(features), "RDTSC");
329
+ if (SDL_HasAltiVec()) xr_strcat(features, ", AltiVec");
330
if (SDL_HasMMX()) xr_strcat(features, ", MMX");
331
if (SDL_Has3DNow()) xr_strcat(features, ", 3DNow!");
332
if (SDL_HasSSE()) xr_strcat(features, ", SSE");
333
if (SDL_HasSSE2()) xr_strcat(features, ", SSE2");
334
if (SDL_HasSSE3()) xr_strcat(features, ", SSE3");
- if (SDL_HasRDTSC()) xr_strcat(features, ", RDTSC");
335
if (SDL_HasSSE41()) xr_strcat(features, ", SSE4.1");
336
if (SDL_HasSSE42()) xr_strcat(features, ", SSE4.2");
337
+ if (SDL_HasAVX()) xr_strcat(features, ", AVX");
338
+ if (SDL_HasAVX2()) xr_strcat(features, ", AVX2");
339
340
Msg("* CPU features: %s", features);
341
Msg("* CPU cores/threads: %d/%d", std::thread::hardware_concurrency(), SDL_GetCPUCount());
src/xrCore/log.cpp
@@ -44,7 +44,7 @@ void AddOne(const char* split)
44
45
logCS.Enter();
46
47
-#ifdef DEBUG
+#if defined(DEBUG) || defined(LINUX)
OutputDebugString(split);
OutputDebugString("\n");
#endif
0 commit comments