mirror of https://github.com/bjornbytes/lovr.git
Fix prototypes;
This commit is contained in:
parent
6a030ef4f2
commit
ad4978f692
|
@ -63,15 +63,15 @@ struct gpu_stream {
|
|||
VkCommandBuffer commands;
|
||||
};
|
||||
|
||||
size_t gpu_sizeof_buffer() { return sizeof(gpu_buffer); }
|
||||
size_t gpu_sizeof_texture() { return sizeof(gpu_texture); }
|
||||
size_t gpu_sizeof_sampler() { return sizeof(gpu_sampler); }
|
||||
size_t gpu_sizeof_layout() { return sizeof(gpu_layout); }
|
||||
size_t gpu_sizeof_shader() { return sizeof(gpu_shader); }
|
||||
size_t gpu_sizeof_bundle_pool() { return sizeof(gpu_bundle_pool); }
|
||||
size_t gpu_sizeof_bundle() { return sizeof(gpu_bundle); }
|
||||
size_t gpu_sizeof_pipeline() { return sizeof(gpu_pipeline); }
|
||||
size_t gpu_sizeof_tally() { return sizeof(gpu_tally); }
|
||||
size_t gpu_sizeof_buffer(void) { return sizeof(gpu_buffer); }
|
||||
size_t gpu_sizeof_texture(void) { return sizeof(gpu_texture); }
|
||||
size_t gpu_sizeof_sampler(void) { return sizeof(gpu_sampler); }
|
||||
size_t gpu_sizeof_layout(void) { return sizeof(gpu_layout); }
|
||||
size_t gpu_sizeof_shader(void) { return sizeof(gpu_shader); }
|
||||
size_t gpu_sizeof_bundle_pool(void) { return sizeof(gpu_bundle_pool); }
|
||||
size_t gpu_sizeof_bundle(void) { return sizeof(gpu_bundle); }
|
||||
size_t gpu_sizeof_pipeline(void) { return sizeof(gpu_pipeline); }
|
||||
size_t gpu_sizeof_tally(void) { return sizeof(gpu_tally); }
|
||||
|
||||
// Internals
|
||||
|
||||
|
@ -760,7 +760,7 @@ void gpu_texture_destroy(gpu_texture* texture) {
|
|||
gpu_release(state.memory + texture->memory);
|
||||
}
|
||||
|
||||
gpu_texture* gpu_surface_acquire() {
|
||||
gpu_texture* gpu_surface_acquire(void) {
|
||||
if (!state.surface.valid) {
|
||||
return NULL;
|
||||
}
|
||||
|
@ -2466,7 +2466,7 @@ void gpu_destroy(void) {
|
|||
memset(&state, 0, sizeof(state));
|
||||
}
|
||||
|
||||
uint32_t gpu_begin() {
|
||||
uint32_t gpu_begin(void) {
|
||||
gpu_wait_tick(++state.tick[CPU] - COUNTOF(state.ticks));
|
||||
gpu_tick* tick = &state.ticks[state.tick[CPU] & TICK_MASK];
|
||||
VK(vkResetFences(state.device, 1, &tick->fence), "Fence reset failed") return 0;
|
||||
|
@ -2501,7 +2501,7 @@ void gpu_submit(gpu_stream** streams, uint32_t count) {
|
|||
state.surface.semaphore = VK_NULL_HANDLE;
|
||||
}
|
||||
|
||||
void gpu_present() {
|
||||
void gpu_present(void) {
|
||||
VkSemaphore semaphore = state.ticks[state.tick[CPU] & TICK_MASK].semaphores[1];
|
||||
|
||||
VkSubmitInfo submit = {
|
||||
|
@ -2547,19 +2547,19 @@ bool gpu_wait_tick(uint32_t tick) {
|
|||
}
|
||||
}
|
||||
|
||||
void gpu_wait_idle() {
|
||||
void gpu_wait_idle(void) {
|
||||
vkDeviceWaitIdle(state.device);
|
||||
}
|
||||
|
||||
uintptr_t gpu_vk_get_instance() {
|
||||
uintptr_t gpu_vk_get_instance(void) {
|
||||
return (uintptr_t) state.instance;
|
||||
}
|
||||
|
||||
uintptr_t gpu_vk_get_physical_device() {
|
||||
uintptr_t gpu_vk_get_physical_device(void) {
|
||||
return (uintptr_t) state.adapter;
|
||||
}
|
||||
|
||||
uintptr_t gpu_vk_get_device() {
|
||||
uintptr_t gpu_vk_get_device(void) {
|
||||
return (uintptr_t) state.device;
|
||||
}
|
||||
|
||||
|
|
|
@ -174,7 +174,7 @@ bool lovrFilesystemInit(const char* archive) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void lovrFilesystemDestroy() {
|
||||
void lovrFilesystemDestroy(void) {
|
||||
if (!state.initialized) return;
|
||||
for (size_t i = 0; i < state.archives.length; i++) {
|
||||
Archive* archive = &state.archives.data[i];
|
||||
|
@ -184,11 +184,11 @@ void lovrFilesystemDestroy() {
|
|||
memset(&state, 0, sizeof(state));
|
||||
}
|
||||
|
||||
const char* lovrFilesystemGetSource() {
|
||||
const char* lovrFilesystemGetSource(void) {
|
||||
return state.source;
|
||||
}
|
||||
|
||||
bool lovrFilesystemIsFused() {
|
||||
bool lovrFilesystemIsFused(void) {
|
||||
return state.fused;
|
||||
}
|
||||
|
||||
|
@ -309,7 +309,7 @@ void lovrFilesystemGetDirectoryItems(const char* path, void (*callback)(void* co
|
|||
|
||||
// Writing
|
||||
|
||||
const char* lovrFilesystemGetIdentity() {
|
||||
const char* lovrFilesystemGetIdentity(void) {
|
||||
return state.identity[0] == '\0' ? NULL : state.identity;
|
||||
}
|
||||
|
||||
|
@ -361,7 +361,7 @@ bool lovrFilesystemSetIdentity(const char* identity, bool precedence) {
|
|||
return true;
|
||||
}
|
||||
|
||||
const char* lovrFilesystemGetSaveDirectory() {
|
||||
const char* lovrFilesystemGetSaveDirectory(void) {
|
||||
return state.savePath;
|
||||
}
|
||||
|
||||
|
@ -428,7 +428,7 @@ size_t lovrFilesystemGetWorkingDirectory(char* buffer, size_t size) {
|
|||
return os_get_working_directory(buffer, size);
|
||||
}
|
||||
|
||||
const char* lovrFilesystemGetRequirePath() {
|
||||
const char* lovrFilesystemGetRequirePath(void) {
|
||||
return state.requirePath;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ bool lovrHeadsetInit(HeadsetConfig* config) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void lovrHeadsetDestroy() {
|
||||
void lovrHeadsetDestroy(void) {
|
||||
if (!initialized) return;
|
||||
initialized = false;
|
||||
if (lovrHeadsetInterface) {
|
||||
|
|
|
@ -109,7 +109,7 @@ static void onInfoMessage(int num, const char* format, va_list args) {
|
|||
|
||||
static bool initialized = false;
|
||||
|
||||
bool lovrPhysicsInit() {
|
||||
bool lovrPhysicsInit(void) {
|
||||
if (initialized) return false;
|
||||
dInitODE();
|
||||
dSetErrorHandler(onErrorMessage);
|
||||
|
@ -118,7 +118,7 @@ bool lovrPhysicsInit() {
|
|||
return initialized = true;
|
||||
}
|
||||
|
||||
void lovrPhysicsDestroy() {
|
||||
void lovrPhysicsDestroy(void) {
|
||||
if (!initialized) return;
|
||||
dCloseODE();
|
||||
initialized = false;
|
||||
|
|
|
@ -69,7 +69,7 @@ static void onQuit(void) {
|
|||
});
|
||||
}
|
||||
|
||||
bool lovrSystemInit() {
|
||||
bool lovrSystemInit(void) {
|
||||
if (state.initialized) return false;
|
||||
os_on_key(onKey);
|
||||
os_on_text(onText);
|
||||
|
@ -89,11 +89,11 @@ void lovrSystemDestroy() {
|
|||
memset(&state, 0, sizeof(state));
|
||||
}
|
||||
|
||||
const char* lovrSystemGetOS() {
|
||||
const char* lovrSystemGetOS(void) {
|
||||
return os_get_name();
|
||||
}
|
||||
|
||||
uint32_t lovrSystemGetCoreCount() {
|
||||
uint32_t lovrSystemGetCoreCount(void) {
|
||||
return os_get_core_count();
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ void lovrSystemOpenWindow(os_window_config* window) {
|
|||
os_on_quit(onQuit);
|
||||
}
|
||||
|
||||
bool lovrSystemIsWindowOpen() {
|
||||
bool lovrSystemIsWindowOpen(void) {
|
||||
return os_window_is_open();
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,7 @@ void lovrSystemGetWindowSize(uint32_t* width, uint32_t* height) {
|
|||
os_window_get_size(width, height);
|
||||
}
|
||||
|
||||
float lovrSystemGetWindowDensity() {
|
||||
float lovrSystemGetWindowDensity(void) {
|
||||
return os_window_get_pixel_density();
|
||||
}
|
||||
|
||||
|
|
|
@ -36,14 +36,14 @@ static struct {
|
|||
map_t channels;
|
||||
} state;
|
||||
|
||||
bool lovrThreadModuleInit() {
|
||||
bool lovrThreadModuleInit(void) {
|
||||
if (state.initialized) return false;
|
||||
mtx_init(&state.channelLock, mtx_plain);
|
||||
map_init(&state.channels, 0);
|
||||
return state.initialized = true;
|
||||
}
|
||||
|
||||
void lovrThreadModuleDestroy() {
|
||||
void lovrThreadModuleDestroy(void) {
|
||||
if (!state.initialized) return;
|
||||
for (size_t i = 0; i < state.channels.size; i++) {
|
||||
if (state.channels.values[i] != MAP_NIL) {
|
||||
|
|
|
@ -13,27 +13,27 @@ static struct {
|
|||
double tickBuffer[TICK_SAMPLES];
|
||||
} state;
|
||||
|
||||
bool lovrTimerInit() {
|
||||
bool lovrTimerInit(void) {
|
||||
if (state.initialized) return false;
|
||||
state.initialized = true;
|
||||
state.epoch = os_get_time();
|
||||
return true;
|
||||
}
|
||||
|
||||
void lovrTimerDestroy() {
|
||||
void lovrTimerDestroy(void) {
|
||||
if (!state.initialized) return;
|
||||
memset(&state, 0, sizeof(state));
|
||||
}
|
||||
|
||||
double lovrTimerGetDelta() {
|
||||
double lovrTimerGetDelta(void) {
|
||||
return state.dt;
|
||||
}
|
||||
|
||||
double lovrTimerGetTime() {
|
||||
double lovrTimerGetTime(void) {
|
||||
return os_get_time() - state.epoch;
|
||||
}
|
||||
|
||||
double lovrTimerStep() {
|
||||
double lovrTimerStep(void) {
|
||||
state.lastTime = state.time;
|
||||
state.time = os_get_time();
|
||||
state.dt = state.time - state.lastTime;
|
||||
|
@ -46,11 +46,11 @@ double lovrTimerStep() {
|
|||
return state.dt;
|
||||
}
|
||||
|
||||
double lovrTimerGetAverageDelta() {
|
||||
double lovrTimerGetAverageDelta(void) {
|
||||
return state.tickSum / TICK_SAMPLES;
|
||||
}
|
||||
|
||||
int lovrTimerGetFPS() {
|
||||
int lovrTimerGetFPS(void) {
|
||||
return (int) (1 / (state.tickSum / TICK_SAMPLES) + .5);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue