Porting to WASM

This commit is contained in:
Krzosa Karol
2025-11-24 22:59:11 +01:00
parent 166f06d1fb
commit 56cdb9557d
19 changed files with 414 additions and 654 deletions

View File

@@ -14,7 +14,7 @@ void AddText(String string) {
event.kind = EVENT_TEXT_INPUT;
event.xwindow = 1280;
event.ywindow = 720;
event.text = Copy(Perm, string).data;
event.text = Copy(SysAllocator, string).data;
Add(&EventPlayback, event);
}
@@ -26,7 +26,7 @@ void Wait(mco_coro *co) {
void PlayTestOpen(mco_coro *co) {
// Open file, move a little, then open again and verify the caret didn't move
String basic_env_cpp = Format(Perm, "%.*s/basic_env/basic_env.cpp", FmtString(TestDir));
String basic_env_cpp = Format(SysAllocator, "%.*s/basic_env/basic_env.cpp", FmtString(TestDir));
AddCtrlPress(SDLK_P);
Add(&EventPlayback, {EVENT_KEY_PRESS, SDLK_UP, 1280, 720});
@@ -69,7 +69,7 @@ void PlayTestOpen(mco_coro *co) {
buffer_len = main.buffer->len;
}
AddText(Format(Perm, "%.*s:20", FmtString(basic_env_cpp)));
AddText(Format(SysAllocator, "%.*s:20", FmtString(basic_env_cpp)));
AddCtrlPress(SDLK_Q);
Wait(co);
@@ -98,7 +98,7 @@ void PlayTestOpen(mco_coro *co) {
}
void Test(mco_coro *co) {
WorkDir = Format(Perm, "%.*s/basic_env", FmtString(TestDir));
WorkDir = Format(SysAllocator, "%.*s/basic_env", FmtString(TestDir));
PlayTestOpen(co);
@@ -110,7 +110,7 @@ void InitTests() {
StyleWaitForEvents = false;
{
String file = __FILE__;
file = NormalizePath(Perm, file);
file = NormalizePath(SysAllocator, file);
file = ChopLastSlash(file);
TestDir = file;
}