fix manabatery, fix timer clock skew, check queue when mouse move, wasd control

This commit is contained in:
Ondrej Novak 2025-02-23 14:00:55 +01:00
parent 05a2803b2b
commit 56cac26206
17 changed files with 102 additions and 60 deletions

View file

@ -7,7 +7,10 @@
#include "error.h"
#include "platform.h"
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
static std::uint32_t gtick = get_game_tick_count();
@ -15,13 +18,19 @@ void send_log_impl(const char *format, ...) {
va_list args;
int task = q_current_task();
char buff2[1000];
va_start(args, format);
char buff[1000];
va_start(args, format);
auto reltik = get_game_tick_count() - gtick;
double sec = reltik * 0.001;
std::cerr << sec << "[" << task << "]";
vsnprintf(buff2,1000,format, args);
std::cerr << buff2 << std::endl;
va_end(args);
snprintf(buff, sizeof(buff), "%f [%d] %s\r\n", sec, task, buff2);
#ifdef _WIN32
OutputDebugStringA(buff);
#else
std::cerr << buff;
#endif
}