Skip to content

Commit

Permalink
Turns out GetSystemWindowsDirectory doesn't exist in old mingw, but G…
Browse files Browse the repository at this point in the history
…etWindowsDirectory does. So use that instead.
  • Loading branch information
UnknownShadow200 committed Apr 5, 2019
1 parent b34c4da commit 024e756
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
6 changes: 6 additions & 0 deletions src/Http.c
Expand Up @@ -740,7 +740,13 @@ static void Http_WorkerLoop(void) {
/*########################################################################################################################*
*----------------------------------------------------Http public api------------------------------------------------------*
*#########################################################################################################################*/
#ifdef CC_BUILD_WEB
/* Access to XMLHttpRequest at 'http://static.classicube.net' from origin 'http://www.classicube.net' has been blocked by CORS policy: */
/* No 'Access-Control-Allow-Origin' header is present on the requested resource. */
const static String skinServer = String_FromConst("http://classicube.net/static/skins/");
#else
const static String skinServer = String_FromConst("http://static.classicube.net/skins/");
#endif

void Http_AsyncGetSkin(const String* id, const String* skinName) {
String url; char urlBuffer[STRING_SIZE];
Expand Down
10 changes: 6 additions & 4 deletions src/InputHandler.c
Expand Up @@ -199,9 +199,6 @@ static bool InputHandler_HandleCoreKey(Key key) {
} else {
InputHandler_CycleDistanceForwards(viewDists, count);
}
} else if ((key == KEY_ESCAPE || key == KEY_PAUSE) && !active->HandlesAllInput) {
Gui_FreeActive();
Gui_SetActive(PauseScreen_MakeInstance());
} else if (key == KeyBinds[KEYBIND_INVENTORY] && active == Gui_HUD) {
Gui_FreeActive();
Gui_SetActive(InventoryScreen_MakeInstance());
Expand Down Expand Up @@ -464,7 +461,12 @@ static void InputHandler_KeyDown(void* obj, int key, bool was) {
Window_Close(); return;
} else if (key == KeyBinds[KEYBIND_SCREENSHOT] && !was) {
Game_ScreenshotRequested = true; return;
} else if (Elem_HandlesKeyDown(active, key, was)) { return; }
} else if (Elem_HandlesKeyDown(active, key, was)) {
return;
} else if ((key == KEY_ESCAPE || key == KEY_PAUSE) && !active->HandlesAllInput) {
Gui_FreeActive();
Gui_SetActive(PauseScreen_MakeInstance()); return;
}

/* These should not be triggered multiple times when holding down */
if (was) return;
Expand Down
2 changes: 1 addition & 1 deletion src/Platform.c
Expand Up @@ -1249,7 +1249,7 @@ static void Font_Init(void) {
String dirs[1];
String_InitArray(dirs[0], winFolder);

UINT winLen = GetSystemWindowsDirectory(winTmp, FILENAME_SIZE);
UINT winLen = GetWindowsDirectory(winTmp, FILENAME_SIZE);
if (winLen) {
Platform_DecodeString(&dirs[0], winTmp, winLen);
} else {
Expand Down
3 changes: 1 addition & 2 deletions src/Window.c
Expand Up @@ -2561,8 +2561,6 @@ static void Window_CorrectFocus(void) {
/* Browser also only allows pointer locks requests in response to user input */
EmscriptenPointerlockChangeEvent status;
status.isActive = false;
return;

emscripten_get_pointerlock_status(&status);
if (win_rawMouse && !status.isActive) Window_EnableRawMouse();
}
Expand Down Expand Up @@ -2837,6 +2835,7 @@ void Window_Close(void) {
Window_DisableRawMouse();

Window_SetSize(0, 0);
Window_UnhookEvents();
Event_RaiseVoid(&WindowEvents.Destroyed);
}

Expand Down

0 comments on commit 024e756

Please sign in to comment.