Skip to content

Commit

Permalink
Added platform_sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
Cakez77 committed Oct 19, 2023
1 parent 0e4ef7f commit 9aa7bd6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/linux_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,5 +380,7 @@ void platform_update_audio(float dt)
soundState->playingSounds.clear();
}



void platform_sleep(unsigned int ms)
{
sleep(ms);
}
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ void reload_game_dll()

while(!copy_file(gameDLLName, gameLoadDLLName, &transientStorage))
{
Sleep(10);
platform_sleep(10);
}
SM_TRACE("Copied %s", gameDLLName);

Expand Down
3 changes: 2 additions & 1 deletion src/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ void* platform_load_dynamic_library(char* dll);
void* platform_load_dynamic_function(void* dll, char* funName);
bool platform_free_dynamic_library(void* dll);
bool platform_init_audio();
void platform_update_audio(float dt);
void platform_update_audio(float dt);
void platform_sleep(unsigned int ms);
5 changes: 5 additions & 0 deletions src/win32_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,4 +660,9 @@ void platform_update_audio(float dt)
}

soundState->playingSounds.count = 0;
}

void platform_sleep(unsigned int ms)
{
Sleep(ms);
}

0 comments on commit 9aa7bd6

Please sign in to comment.