AAAAAAAAAAAAA
This commit is contained in:
parent
80b3e83d4d
commit
8892592ae9
7 changed files with 9 additions and 17 deletions
|
|
@ -1,5 +1,3 @@
|
|||
#+build !wasm32, !wasm64p32
|
||||
|
||||
package main
|
||||
|
||||
import game ".."
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ windows_library_dest="windows"
|
|||
darwin_library_dest="darwin"
|
||||
wasm_library_dest="wasm"
|
||||
|
||||
config_flags="\
|
||||
CONFIG_FLAGS="\
|
||||
-DSUPPORT_MODULE_RSHAPES=1 \
|
||||
-DSUPPORT_MODULE_RTEXTURES=1 \
|
||||
-DSUPPORT_MODULE_RTEXT=1 \
|
||||
|
|
@ -78,10 +78,10 @@ config_flags="\
|
|||
|
||||
if [[ -v 1 ]]; then
|
||||
if [ "$1" = "DEBUG" ]; then
|
||||
MFLAGS="RAYLIB_BUILD_MODE=DEBUG"
|
||||
MAKE_FLAGS="RAYLIB_BUILD_MODE=DEBUG"
|
||||
CFLAGS="-g"
|
||||
elif [ "$1" = "RELEASE" ]; then
|
||||
MFLAGS="RAYLIB_BUILD_MODE=RELEASE"
|
||||
MAKE_FLAGS="RAYLIB_BUILD_MODE=RELEASE"
|
||||
CFLAGS="-Os"
|
||||
else
|
||||
echo "Usage: <script> <DEBUG/RELEASE>"
|
||||
|
|
@ -101,7 +101,7 @@ source $emsdk_env
|
|||
|
||||
pushd raylib/src
|
||||
echo "Compiling raylib static library for linux"
|
||||
make --silent RAYLIB_CONFIG_FLAGS="$config_flags" $MFLAGS PLATFORM_OS=LINUX
|
||||
make --silent RAYLIB_CONFIG_FLAGS="$CONFIG_FLAGS" $MAKE_FLAGS PLATFORM_OS=LINUX -B
|
||||
mv libraylib.a "../../${linux_library_dest}"
|
||||
make --silent clean
|
||||
|
||||
|
|
@ -111,7 +111,7 @@ make --silent clean
|
|||
# make --silent clean
|
||||
|
||||
echo "Compiling raylib static library for web"
|
||||
make --silent RAYLIB_CONFIG_FLAGS="$config_flags" $MFLAGS PLATFORM=PLATFORM_WEB
|
||||
make --silent RAYLIB_CONFIG_FLAGS="$CONFIG_FLAGS" $MAKE_FLAGS PLATFORM=PLATFORM_WEB -B
|
||||
mv libraylib.web.a libraylib.a
|
||||
mv libraylib.a "../../${wasm_library_dest}"
|
||||
make --silent clean
|
||||
|
|
@ -124,7 +124,7 @@ ar rcs ../${linux_library_dest}/libraygui.a raygui.o
|
|||
rm raygui.o
|
||||
|
||||
echo "Compiling raygui static library for web"
|
||||
emcc -c -Os -x c -DRAYGUI_IMPLEMENTATION -DPLATFORM_WEB -I../raylib/src raygui.h -o raygui_wasm.o
|
||||
emcc $CFLAGS -c -x c -DRAYGUI_IMPLEMENTATION -DPLATFORM_WEB -I../raylib/src raygui.h -o raygui_wasm.o
|
||||
emar rcs ../${wasm_library_dest}/libraygui.a raygui_wasm.o
|
||||
rm raygui_wasm.o
|
||||
popd
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ shutdown :: proc() {
|
|||
|
||||
should_run :: proc() -> bool {
|
||||
when ODIN_OS != .JS {
|
||||
if program.window_should_close {
|
||||
if rl.WindowShouldClose() {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -510,9 +510,6 @@ program_update :: proc() {
|
|||
}
|
||||
}
|
||||
}
|
||||
if rl.WindowShouldClose() {
|
||||
program.window_should_close = true
|
||||
}
|
||||
case .Dialog:
|
||||
ui_overlay_elements = program_build_dialog_ui(&program.ui_overlay_context, program.dialog_type)
|
||||
if program.ui_overlay_queue_focus_first {
|
||||
|
|
@ -552,9 +549,6 @@ program_update :: proc() {
|
|||
program.animation.matrix_count = program.matrix_count
|
||||
program.state = .Normal
|
||||
}
|
||||
if rl.WindowShouldClose() {
|
||||
program.state = .Normal
|
||||
}
|
||||
}
|
||||
|
||||
clear(&program.mouse_draggables)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// Implementations of `read_entire_file` and `write_entire_file` using the libc
|
||||
// stuff emscripten exposes. You can read the files that get bundled by
|
||||
// `--preload-file assets` in `build_web` script.
|
||||
|
||||
#+build wasm32, wasm64p32
|
||||
|
||||
package game
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import "core:fmt"
|
|||
context.allocator = emscripten_allocator()
|
||||
runtime.init_global_temporary_allocator(1*mem.Megabyte)
|
||||
|
||||
// TODO (synthas): Do this if it works nicely
|
||||
// Since we now use js_wasm32 we should be able to remove this and use
|
||||
// context.logger = log.create_console_logger(). However, that one produces
|
||||
// extra newlines on web. So it's a bug in that core lib.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue