mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-26 05:55:15 +00:00
Fix headless server compile (3) (#78)
This commit is contained in:
parent
b972bb1be4
commit
7d82923aa4
2 changed files with 18 additions and 4 deletions
|
@ -86,12 +86,16 @@ u32 djui_hud_get_screen_height(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
f32 djui_hud_get_mouse_x(void) {
|
f32 djui_hud_get_mouse_x(void) {
|
||||||
|
#ifdef HAVE_SDL2
|
||||||
controller_sdl_read_mouse_window();
|
controller_sdl_read_mouse_window();
|
||||||
|
#endif
|
||||||
return mouse_window_x / djui_gfx_get_scale();
|
return mouse_window_x / djui_gfx_get_scale();
|
||||||
}
|
}
|
||||||
|
|
||||||
f32 djui_hud_get_mouse_y(void) {
|
f32 djui_hud_get_mouse_y(void) {
|
||||||
|
#ifdef HAVE_SDL2
|
||||||
controller_sdl_read_mouse_window();
|
controller_sdl_read_mouse_window();
|
||||||
|
#endif
|
||||||
return mouse_window_y / djui_gfx_get_scale();
|
return mouse_window_y / djui_gfx_get_scale();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
#include "PR/gbi.h"
|
#include "PR/gbi.h"
|
||||||
#include "pc/utils/stb_ds.h"
|
#include "pc/utils/stb_ds.h"
|
||||||
#include "pc/debuglog.h"
|
#include "pc/debuglog.h"
|
||||||
|
#ifdef HAVE_SDL2
|
||||||
#include <SDL2/SDL.h>
|
#include <SDL2/SDL.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
struct ProfileCounters {
|
struct ProfileCounters {
|
||||||
const char* key;
|
const char* key;
|
||||||
|
@ -44,8 +46,12 @@ void profiler_start_counter(const char* keyName) {
|
||||||
}
|
}
|
||||||
|
|
||||||
counters = counters;
|
counters = counters;
|
||||||
f64 freq = SDL_GetPerformanceFrequency();
|
f64 freq;
|
||||||
f64 curr = SDL_GetPerformanceCounter();
|
f64 curr;
|
||||||
|
#ifdef HAVE_SDL2
|
||||||
|
freq = SDL_GetPerformanceFrequency();
|
||||||
|
curr = SDL_GetPerformanceCounter();
|
||||||
|
#endif
|
||||||
v->key = keyName;
|
v->key = keyName;
|
||||||
v->start = curr / freq;
|
v->start = curr / freq;
|
||||||
v->indent = sProfileIndent++;
|
v->indent = sProfileIndent++;
|
||||||
|
@ -57,8 +63,12 @@ void profiler_stop_counter(const char* keyName) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
f64 freq = SDL_GetPerformanceFrequency();
|
f64 freq;
|
||||||
f64 curr = SDL_GetPerformanceCounter();
|
f64 curr;
|
||||||
|
#ifdef HAVE_SDL2
|
||||||
|
freq = SDL_GetPerformanceFrequency();
|
||||||
|
curr = SDL_GetPerformanceCounter();
|
||||||
|
#endif
|
||||||
v->end = curr / freq;
|
v->end = curr / freq;
|
||||||
v->sum += v->end - v->start;
|
v->sum += v->end - v->start;
|
||||||
sProfileIndent--;
|
sProfileIndent--;
|
||||||
|
|
Loading…
Reference in a new issue