Cleanup and add extras

This commit is contained in:
Varun Patil 2020-10-19 00:52:59 +05:30
parent 7e3006c10e
commit fd2ba6c852
8 changed files with 1541 additions and 31 deletions

10
.gitignore vendored
View File

@ -4,13 +4,23 @@
*.vert.xxd *.vert.xxd
*.frag.xxd *.frag.xxd
*.ttf.xxd *.ttf.xxd
*.png.xxd
*.h.xxd
Makefile Makefile
mkxp mkxp
mkxp.wasm
mkxp.html
mkxp.js
xxd+ xxd+
/build /build
/deps
/CMakeFiles
CMakeCache.txt
cmake_install.cmake
# Codeblocks # Codeblocks
mkxp.layout mkxp.layout

View File

@ -379,15 +379,11 @@ if(APPLE)
endif() endif()
link_directories( link_directories(
../libsigc++-2.10.3/sigc++/.libs deps/libsigc++/sigc++/.libs
../pixman-0.40.0/pixman/.libs deps/pixman/pixman/.libs
../physfs-3.0.2 deps/physfs
../ruby deps/mruby/build/wasm32-unknown-gnu/lib
#../mruby/build/host/lib
../mruby/build/x86_64-pc-linux-gnu/lib
libs
#../SDL_sound/.libs
${SDL2_LIBRARY_DIRS} ${SDL2_LIBRARY_DIRS}
) )
@ -405,34 +401,18 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE
target_include_directories(${PROJECT_NAME} PRIVATE target_include_directories(${PROJECT_NAME} PRIVATE
src src
windows windows
../libsigc++-2.10.3 deps/libsigc++
../pixman-0.40.0/pixman deps/pixman/pixman
../physfs-3.0.2/src deps/physfs/src
../mruby/include deps/mruby/include
#../SDL_sound
${SDL2_INCLUDE_DIRS} ${SDL2_INCLUDE_DIRS}
#${VORBISFILE_INCLUDE_DIRS}
${FLUID_INCLUDE_DIRS} ${FLUID_INCLUDE_DIRS}
${OPENAL_INCLUDE_DIR} ${OPENAL_INCLUDE_DIR}
) )
target_link_libraries(${PROJECT_NAME} target_link_libraries(${PROJECT_NAME}
#ruby-static.a sigc-2.0.a physfs.a pixman-1.a mruby.a
sigc-2.0.a physfs.a pixman-1.a
#sigc-2.0.x86.a physfs.x86.a SDL_sound.x86.a pixman-1.x86.a
mruby.a
#SDL_sound.a
#ruby-static.x86.a
#crypt
#dl
#pthread
#rt
${SDL2_LIBRARIES} ${SDL2_LIBRARIES}
${SDL2_IMAGE_LIBRARIES} ${SDL2_IMAGE_LIBRARIES}
@ -462,7 +442,6 @@ set_target_properties(
PROPERTIES PROPERTIES
OUTPUT_NAME "mkxp" OUTPUT_NAME "mkxp"
SUFFIX ".html" SUFFIX ".html"
# SUFFIX ".out"
) )
PostBuildMacBundle(${PROJECT_NAME} "" "${PLATFORM_COPY_LIBS}") PostBuildMacBundle(${PROJECT_NAME} "" "${PLATFORM_COPY_LIBS}")

20
extra/build_config.rb Normal file
View File

@ -0,0 +1,20 @@
MRuby::Build.new do |conf|
toolchain :gcc
conf.gembox 'default'
end
MRuby::CrossBuild.new('wasm32-unknown-gnu') do |conf|
toolchain :clang
conf.gembox 'default'
conf.gem :github => 'take-cheeze/mruby-marshal'
conf.gem :github => 'monochromegane/mruby-time-strftime'
conf.gem :core => 'mruby-eval'
conf.cc.command = 'emcc'
conf.cc.flags = %W(-O3 -g0)
conf.cxx.command = 'em++'
conf.cxx.flags = %W(-O3 -g0)
conf.linker.command = 'emcc'
conf.archiver.command = 'emar'
end

View File

@ -7,7 +7,13 @@ do
filename="${file%.*}" filename="${file%.*}"
fl="$(echo "$filename" | tr '[:upper:]' '[:lower:]')" fl="$(echo "$filename" | tr '[:upper:]' '[:lower:]')"
if [ -f $file ]
then
md5=`md5sum "${file}" | awk '{ print $1 }'` md5=`md5sum "${file}" | awk '{ print $1 }'`
else
md5=''
fi
echo "\"$fl\": \"${file}?h=${md5}\"," >> mapping.js echo "\"$fl\": \"${file}?h=${md5}\"," >> mapping.js

1476
extra/rgss.rb Normal file

File diff suppressed because it is too large Load Diff

19
extra/vm.c.patch Normal file
View File

@ -0,0 +1,19 @@
--- src/vm.c 2020-10-18 23:00:12.865875587 +0530
+++ src/vm.c 2020-10-18 23:06:10.887618558 +0530
@@ -2262,13 +2262,15 @@
switch (TYPES2(mrb_type(regs[a]),mrb_type(regs[a+1]))) {
case TYPES2(MRB_TT_FIXNUM,MRB_TT_FIXNUM):
#ifdef MRB_WITHOUT_FLOAT
+#else
{
mrb_int x = mrb_fixnum(regs[a]);
mrb_int y = mrb_fixnum(regs[a+1]);
SET_INT_VALUE(regs[a], y ? x / y : 0);
}
+ NEXT;
break;
-#else
+
x = (mrb_float)mrb_fixnum(regs[a]);
y = (mrb_float)mrb_fixnum(regs[a+1]);
break;