mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 11:39:19 +02:00
Merge branch 'gfx-work' of https://github.com/Milek7/maszyna into gfx-work
This commit is contained in:
@@ -1638,7 +1638,7 @@ TController::TController(bool AI, TDynamicObject *NewControll, bool InitPsyche,
|
|||||||
if( WriteLogFlag ) {
|
if( WriteLogFlag ) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
CreateDirectory( "physicslog", NULL );
|
CreateDirectory( "physicslog", NULL );
|
||||||
#elif __linux__
|
#elif __unix__
|
||||||
mkdir( "physicslog", 0644 );
|
mkdir( "physicslog", 0644 );
|
||||||
#endif
|
#endif
|
||||||
LogFile.open( std::string( "physicslog/" + VehicleName + ".dat" ),
|
LogFile.open( std::string( "physicslog/" + VehicleName + ".dat" ),
|
||||||
|
|||||||
2
Logs.cpp
2
Logs.cpp
@@ -27,7 +27,7 @@ std::deque<std::string> log_scrollback;
|
|||||||
std::string filename_date() {
|
std::string filename_date() {
|
||||||
::SYSTEMTIME st;
|
::SYSTEMTIME st;
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __unix__
|
||||||
timespec ts;
|
timespec ts;
|
||||||
clock_gettime(CLOCK_REALTIME, &ts);
|
clock_gettime(CLOCK_REALTIME, &ts);
|
||||||
tm *tms = localtime(&ts.tv_sec);
|
tm *tms = localtime(&ts.tv_sec);
|
||||||
|
|||||||
@@ -131,6 +131,11 @@ auto python_taskqueue::init() -> bool {
|
|||||||
Py_SetPythonHome("linuxpython64");
|
Py_SetPythonHome("linuxpython64");
|
||||||
else
|
else
|
||||||
Py_SetPythonHome("linuxpython");
|
Py_SetPythonHome("linuxpython");
|
||||||
|
#elif __APPLE__
|
||||||
|
if (sizeof(void*) == 8)
|
||||||
|
Py_SetPythonHome("macpython64");
|
||||||
|
else
|
||||||
|
Py_SetPythonHome("macpython");
|
||||||
#endif
|
#endif
|
||||||
Py_Initialize();
|
Py_Initialize();
|
||||||
PyEval_InitThreads();
|
PyEval_InitThreads();
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ void UpdateTimers(bool pause)
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
QueryPerformanceFrequency((LARGE_INTEGER *)&fr);
|
QueryPerformanceFrequency((LARGE_INTEGER *)&fr);
|
||||||
QueryPerformanceCounter((LARGE_INTEGER *)&count);
|
QueryPerformanceCounter((LARGE_INTEGER *)&count);
|
||||||
#elif __linux__
|
#elif __unix__
|
||||||
timespec ts;
|
timespec ts;
|
||||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||||
count = (uint64_t)ts.tv_sec * 1000000000 + (uint64_t)ts.tv_nsec;
|
count = (uint64_t)ts.tv_sec * 1000000000 + (uint64_t)ts.tv_nsec;
|
||||||
@@ -85,7 +85,7 @@ void UpdateTimers(bool pause)
|
|||||||
|
|
||||||
oldCount = count;
|
oldCount = count;
|
||||||
// Keep track of the time lapse and frame count
|
// Keep track of the time lapse and frame count
|
||||||
#if __linux__
|
#if __unix__
|
||||||
double fTime = (double)(count / 1000000000);
|
double fTime = (double)(count / 1000000000);
|
||||||
#elif _WIN32_WINNT >= _WIN32_WINNT_VISTA
|
#elif _WIN32_WINNT >= _WIN32_WINNT_VISTA
|
||||||
double fTime = ::GetTickCount64() * 0.001f; // Get current time in seconds
|
double fTime = ::GetTickCount64() * 0.001f; // Get current time in seconds
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ http://mozilla.org/MPL/2.0/.
|
|||||||
#pragma comment (lib, "dbghelp.lib")
|
#pragma comment (lib, "dbghelp.lib")
|
||||||
#pragma comment (lib, "version.lib")
|
#pragma comment (lib, "version.lib")
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __unix__
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -540,7 +540,7 @@ eu07_application::init_files() {
|
|||||||
DeleteFile( "log.txt" );
|
DeleteFile( "log.txt" );
|
||||||
DeleteFile( "errors.txt" );
|
DeleteFile( "errors.txt" );
|
||||||
CreateDirectory( "logs", NULL );
|
CreateDirectory( "logs", NULL );
|
||||||
#elif __linux__
|
#elif __unix__
|
||||||
unlink("log.txt");
|
unlink("log.txt");
|
||||||
unlink("errors.txt");
|
unlink("errors.txt");
|
||||||
mkdir("logs", 0755);
|
mkdir("logs", 0755);
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ void screenshot_manager::screenshot_save_thread( char *img, int w, int h )
|
|||||||
uint64_t perf;
|
uint64_t perf;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
QueryPerformanceCounter((LARGE_INTEGER*)&perf);
|
QueryPerformanceCounter((LARGE_INTEGER*)&perf);
|
||||||
#elif __linux__
|
#elif __unix__
|
||||||
timespec ts;
|
timespec ts;
|
||||||
clock_gettime(CLOCK_REALTIME, &ts);
|
clock_gettime(CLOCK_REALTIME, &ts);
|
||||||
perf = ts.tv_nsec;
|
perf = ts.tv_nsec;
|
||||||
|
|||||||
Reference in New Issue
Block a user