Skip to content

Commit

Permalink
Begin requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanaobrien committed Jan 9, 2025
1 parent cf011a6 commit 1808cf6
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 37 deletions.
2 changes: 1 addition & 1 deletion emscripten/build_emscripten.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ emcmake cmake ../ \
-DICU_DT_LIBRARY_RELEASE="$ICU_ROOT/stubdata/libicudata.so" \
-DLIBZIP_LIBRARIES="$(pwd)/ext/libzip/build/lib/libzip.a" \
-DEMSCRIPTEN_FLAGS="-s USE_SDL=2 -s USE_BZIP2=1 -s USE_LIBPNG=1 -pthread -O3" \
-DEMSCRIPTEN_LDFLAGS="-Wno-pthreads-mem-growth -s ASYNCIFY -s FULL_ES3 -s SAFE_HEAP=0 -s ALLOW_MEMORY_GROWTH=1 -s MAXIMUM_MEMORY=4GB -s INITIAL_MEMORY=2GB -s MAX_WEBGL_VERSION=2 -s PTHREAD_POOL_SIZE=120 -pthread -sEXPORTED_RUNTIME_METHODS=FS,callMain,UTF8ToString,stringToNewUTF8 -lidbfs.js --use-preload-plugins -s MODULARIZE=1 -s 'EXPORT_NAME=\"OPENRCT2_WEB\"'"
-DEMSCRIPTEN_LDFLAGS="-Wno-pthreads-mem-growth -s ASYNCIFY -s FULL_ES3 -s SAFE_HEAP=0 -s ALLOW_MEMORY_GROWTH=1 -s MAXIMUM_MEMORY=4GB -s INITIAL_MEMORY=2GB -s MAX_WEBGL_VERSION=2 -s PTHREAD_POOL_SIZE=120 -pthread -s EXPORTED_RUNTIME_METHODS=FS,callMain,UTF8ToString,stringToNewUTF8 -lidbfs.js --use-preload-plugins -s MODULARIZE=1 -s 'EXPORT_NAME=\"OPENRCT2_WEB\"'"

emmake make -j$(nproc)

Expand Down
16 changes: 1 addition & 15 deletions src/openrct2-ui/TextComposition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,21 +174,7 @@ void TextComposition::HandleMessage(const SDL_Event* e)
case SDLK_c:
if ((modifier & KEYBOARD_PRIMARY_MODIFIER) && _session.Length)
{
#ifndef __EMSCRIPTEN__
SDL_SetClipboardText(_session.Buffer->c_str());
#else
MAIN_THREAD_EM_ASM(
{
try
{
navigator.clipboard.writeText(UTF8ToString($0));
}
catch (e)
{
};
},
_session.Buffer->c_str());
#endif
OpenRCT2::GetContext()->GetUiContext()->SetClipboardText(_session.Buffer->c_str());
ContextShowError(STR_COPY_INPUT_TO_CLIPBOARD, STR_NONE, {});
}
break;
Expand Down
3 changes: 1 addition & 2 deletions src/openrct2-ui/UiContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -733,8 +733,7 @@ class UiContext final : public IUiContext
{
return -1;
};
},
gVersionInfoFull)
})
== 0);
#endif
}
Expand Down
2 changes: 0 additions & 2 deletions src/openrct2-ui/UiStringIds.h
Original file line number Diff line number Diff line change
Expand Up @@ -1115,10 +1115,8 @@ namespace OpenRCT2
STR_DRAWING_ENGINE_TIP = 5876,
STR_EARLY_COMPLETION_TIP = 6227,
STR_EDIT_ASSET_PACKS_BUTTON = 6640,
#ifdef __EMSCRIPTEN__
STR_EXPORT_EMSCRIPTEN = 6713,
STR_IMPORT_EMSCRIPTEN = 6714,
#endif
STR_EDIT_THEMES_BUTTON = 5153,
STR_EDIT_THEMES_BUTTON_TIP = 5837,
STR_EFFECTS_GROUP = 6256,
Expand Down
17 changes: 1 addition & 16 deletions src/openrct2-ui/windows/About.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,22 +123,7 @@ namespace OpenRCT2::Ui::Windows
ContextOpenWindowView(WV_NEW_VERSION_INFO);
break;
case WIDX_COPY_BUILD_INFO:
#ifndef __EMSCRIPTEN__
SDL_SetClipboardText(gVersionInfoFull);
#else
MAIN_THREAD_EM_ASM(
{
try
{
navigator.clipboard.writeText(UTF8ToString($0));
}
catch (e)
{
// Ignore
};
},
gVersionInfoFull);
#endif
OpenRCT2::GetContext()->GetUiContext()->SetClipboardText(gVersionInfoFull);
break;
case WIDX_CONTRIBUTORS_BUTTON:
ContextOpenWindowView(WV_CONTRIBUTORS);
Expand Down
1 change: 0 additions & 1 deletion src/openrct2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ if (CMAKE_SYSTEM_NAME MATCHES "Emscripten")
set(USE_FLAGS "${EMSCRIPTEN_FLAGS}")
set(SHARED_FLAGS "-fexceptions")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${USE_FLAGS} ${SHARED_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${USE_FLAGS} ${SHARED_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${EMSCRIPTEN_LDFLAGS} --bind ${SHARED_FLAGS}")
find_package(SpeexDSP REQUIRED)
if (NOT DISABLE_VORBIS)
Expand Down

0 comments on commit 1808cf6

Please sign in to comment.