Skip to content

Commit

Permalink
Contains memory corruption in browser
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGreatRambler committed Dec 21, 2021
1 parent 91ebfc4 commit 441bba2
Show file tree
Hide file tree
Showing 8 changed files with 542 additions and 259 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ifeq ($(PLATFORM),web)

EMS += -s USE_SDL=2 -s USE_ZLIB=1 -s USE_FREETYPE=1 -s USE_LIBPNG=1 -s DISABLE_EXCEPTION_CATCHING=1
CPPFLAGS += -I./third_party/cairo-1.16.0/src -O2 $(EMS)
LDFLAGS += -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s NO_EXIT_RUNTIME=0 -s ASSERTIONS=1 -s ALLOW_MEMORY_GROWTH=1 -s ASYNCIFY -s FORCE_FILESYSTEM=1 -o bin/index.html --shell-file shell_minimal.html $(PRELOADED_FILES) $(EMS) -L./third_party/cairo-1.16.0/src/.libs -lcairo -L./third_party/pixman-0.40.0/pixman/.libs -lpixman-1
LDFLAGS += -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s NO_EXIT_RUNTIME=0 -s ASSERTIONS=1 -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_STACK=10000000 -s ASYNCIFY -s FORCE_FILESYSTEM=1 -o bin/index.html --shell-file shell_minimal.html $(PRELOADED_FILES) $(EMS) -L./third_party/cairo-1.16.0/src/.libs -lcairo -L./third_party/pixman-0.40.0/pixman/.libs -lpixman-1
else
CPPFLAGS += $(shell pkg-config --cflags sdl2 glew glfw3 zlib cairo freetype2) -Wno-cast-function-type
LDFLAGS := -lpthread -lopengl32 $(shell pkg-config --libs --static sdl2 glew glfw3 zlib cairo freetype2) -liconv -mconsole -fPIC -static -static-libgcc -static-libstdc++
Expand All @@ -59,6 +59,9 @@ CPPFLAGS ?= $(INC_FLAGS) -MMD -MP

$(BUILD_DIR)/$(TARGET_EXEC): $(OBJS)
$(CXX) $(OBJS) -o $@ $(LDFLAGS)
ifeq ($(PLATFORM),web)
cp js/FileSaver.min.js bin
endif

# assembly
$(BUILD_DIR)/%.s.o: %.s
Expand Down
3 changes: 3 additions & 0 deletions js/FileSaver.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion shell_minimal.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
<title>Dear ImGui Emscripten example</title>
<title>Toost | Super Mario Maker 2 Level Viewer</title>
<style>
body {
margin: 0;
Expand Down Expand Up @@ -74,6 +74,7 @@
return originalCanvasGetContext.call(this, contextType, contextAttributes);
};
</script>
<script src="FileSaver.min.js"></script>
{{{ SCRIPT }}}
</body>

Expand Down
Loading

0 comments on commit 441bba2

Please sign in to comment.