mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-01-22 09:01:57 -05:00
webclient: Reduce initial stack size in makefile compiled builds
This commit is contained in:
parent
3abe11b093
commit
8d62f710fc
4 changed files with 53 additions and 13 deletions
2
Makefile
2
Makefile
|
@ -40,7 +40,7 @@ ifeq ($(PLAT),web)
|
|||
CC = emcc
|
||||
OEXT = .html
|
||||
CFLAGS = -g
|
||||
LDFLAGS = -g -s WASM=1 -s NO_EXIT_RUNTIME=1 -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_STACK=1Mb --js-library $(SOURCE_DIR)/interop_web.js
|
||||
LDFLAGS = -g -s WASM=1 -s NO_EXIT_RUNTIME=1 -s ABORTING_MALLOC=0 -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_STACK=256Kb --js-library $(SOURCE_DIR)/interop_web.js
|
||||
BUILD_DIR = build-web
|
||||
endif
|
||||
|
||||
|
|
|
@ -51,7 +51,8 @@ enum InputButtons {
|
|||
|
||||
CCKEY_VOLUME_MUTE, CCKEY_VOLUME_UP, CCKEY_VOLUME_DOWN, CCKEY_SLEEP,
|
||||
CCKEY_MEDIA_NEXT, CCKEY_MEDIA_PREV, CCKEY_MEDIA_PLAY, CCKEY_MEDIA_STOP,
|
||||
CCKEY_BROWSER_PREV, CCKEY_BROWSER_NEXT, CCKEY_BROWSER_REFRESH, CCKEY_BROWSER_STOP, CCKEY_BROWSER_SEARCH, CCKEY_BROWSER_FAVORITES, CCKEY_BROWSER_HOME,
|
||||
CCKEY_BROWSER_PREV, CCKEY_BROWSER_NEXT, CCKEY_BROWSER_REFRESH, CCKEY_BROWSER_STOP,
|
||||
CCKEY_BROWSER_SEARCH, CCKEY_BROWSER_FAVORITES, CCKEY_BROWSER_HOME,
|
||||
CCKEY_LAUNCH_MAIL, CCKEY_LAUNCH_MEDIA, CCKEY_LAUNCH_APP1, CCKEY_LAUNCH_CALC,
|
||||
|
||||
CCPAD_1, CCPAD_2, CCPAD_3, CCPAD_4, /* Primary buttons (e.g. A, B, X, Y) */
|
||||
|
|
|
@ -553,7 +553,8 @@ cc_result SSL_Read(void* ctx_, cc_uint8* data, cc_uint32 count, cc_uint32* read)
|
|||
err = br_ssl_engine_last_error(&ctx->sc.eng);
|
||||
if (err == 0 && br_ssl_engine_current_state(&ctx->sc.eng) == BR_SSL_CLOSED)
|
||||
return SSL_ERR_CONTEXT_DEAD;
|
||||
return SSL_ERROR_SHIFT + err;
|
||||
|
||||
return SSL_ERROR_SHIFT | (err & 0xFFFF);
|
||||
}
|
||||
|
||||
br_sslio_flush(&ctx->ioc);
|
||||
|
@ -568,7 +569,9 @@ cc_result SSL_WriteAll(void* ctx_, const cc_uint8* data, cc_uint32 count) {
|
|||
|
||||
if (res < 0) {
|
||||
if (ctx->writeError) return ctx->writeError;
|
||||
return SSL_ERROR_SHIFT + br_ssl_engine_last_error(&ctx->sc.eng);
|
||||
|
||||
int err = br_ssl_engine_last_error(&ctx->sc.eng);
|
||||
return SSL_ERROR_SHIFT | (err & 0xFFFF);
|
||||
}
|
||||
|
||||
br_sslio_flush(&ctx->ioc);
|
||||
|
|
|
@ -137,6 +137,51 @@ void Window_RequestClose(void) {
|
|||
}
|
||||
|
||||
|
||||
/*########################################################################################################################*
|
||||
*--------------------------------------------------Keyboard processing----------------------------------------------------*
|
||||
*#########################################################################################################################*/
|
||||
static const cc_uint8 key_map[] = {
|
||||
/* 00 */ 0, 0, 0, 0, 'A', 'B', 'C', 'D',
|
||||
/* 08 */ 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
|
||||
/* 10 */ 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
|
||||
/* 18 */ 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2',
|
||||
/* 20 */ '3', '4', '5', '6', '7', '8', '9', '0',
|
||||
/* 28 */ CCKEY_ENTER, CCKEY_ESCAPE, CCKEY_BACKSPACE, CCKEY_TAB, CCKEY_SPACE, CCKEY_MINUS, CCKEY_EQUALS, CCKEY_LBRACKET,
|
||||
/* 30 */ CCKEY_RBRACKET, CCKEY_BACKSLASH, 0, CCKEY_SEMICOLON, CCKEY_QUOTE, CCKEY_TILDE, CCKEY_COMMA, CCKEY_PERIOD,
|
||||
/* 38 */ CCKEY_SLASH, CCKEY_CAPSLOCK, CCKEY_F1, CCKEY_F2, CCKEY_F3, CCKEY_F4, CCKEY_F5, CCKEY_F6,
|
||||
/* 40 */ CCKEY_F7, CCKEY_F8, CCKEY_F9, CCKEY_F10, CCKEY_F11, CCKEY_F12, CCKEY_PRINTSCREEN, CCKEY_SCROLLLOCK,
|
||||
/* 48 */ CCKEY_PAUSE, CCKEY_INSERT, CCKEY_HOME, CCKEY_PAGEUP, CCKEY_DELETE, CCKEY_END, CCKEY_PAGEDOWN, CCKEY_RIGHT,
|
||||
/* 50 */ CCKEY_LEFT, CCKEY_DOWN, CCKEY_UP, CCKEY_NUMLOCK, CCKEY_KP_DIVIDE, CCKEY_KP_MULTIPLY, CCKEY_KP_MINUS, CCKEY_KP_PLUS,
|
||||
/* 58 */ CCKEY_KP_ENTER, CCKEY_KP1, CCKEY_KP2, CCKEY_KP3, CCKEY_KP4, CCKEY_KP5, CCKEY_KP6, CCKEY_KP7,
|
||||
/* 60 */ CCKEY_KP8, CCKEY_KP9, CCKEY_KP0, CCKEY_KP_DECIMAL, 0, CCKEY_SLEEP, CCKEY_LAUNCH_APP1, 0,
|
||||
/* 68 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 70 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 78 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 80 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 88 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 90 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 98 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* A0 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* A8 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* B0 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* B8 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* C0 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* C8 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* D0 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* D8 */ 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* E0 */ CCKEY_LCTRL, CCKEY_LSHIFT, CCKEY_LALT, 0, CCKEY_RCTRL, CCKEY_RSHIFT, CCKEY_RALT, 0,
|
||||
};
|
||||
|
||||
static void ProcessKeyboardInput(void) {
|
||||
if (!kbdSupported) return;
|
||||
|
||||
PS2KbdRawKey key;
|
||||
if (PS2KbdReadRaw(&key) <= 0) return;
|
||||
|
||||
Platform_Log1("%i", &key.key);
|
||||
}
|
||||
|
||||
|
||||
/*########################################################################################################################*
|
||||
*----------------------------------------------------Input processing-----------------------------------------------------*
|
||||
*#########################################################################################################################*/
|
||||
|
@ -163,15 +208,6 @@ static void ProcessMouseInput(float delta) {
|
|||
mData.x * scale, mData.y * scale);
|
||||
}
|
||||
|
||||
static void ProcessKeyboardInput(void) {
|
||||
if (!kbdSupported) return;
|
||||
|
||||
PS2KbdRawKey key;
|
||||
if (PS2KbdReadRaw(&key) <= 0) return;
|
||||
|
||||
Platform_Log1("%i", &key.key);
|
||||
}
|
||||
|
||||
void Window_ProcessEvents(float delta) {
|
||||
ProcessMouseInput(delta);
|
||||
ProcessKeyboardInput();
|
||||
|
|
Loading…
Reference in a new issue