Some changes idk

This commit is contained in:
DepressedTWM 2026-08-07 00:24:32 +04:00
parent e83fd8aef3
commit 29ffde9935
14 changed files with 72 additions and 55 deletions

17
.gitignore vendored
View file

@ -6,25 +6,20 @@
*.app *.app
*.bmp *.bmp
*.lproj *.lproj
*.tmp *.tmp
*.vcxproj *.vcxproj
*.filters *.filters
*.sln *.sln
*.user *.user
*.tlog *.tlog
.vs/ .vs/
bin/ bin/
lib/ lib/
*.dir/ *.dir/
x64/ x64/
Makefile* Makefile*
/oneshot /oneshot
/steamshim_parent/steamshim /steamshim_parent/steamshim
__pycache__ __pycache__
/build* /build*
/dist /dist
@ -32,13 +27,11 @@ __pycache__
/release /release
steamshim_parent/build/ steamshim_parent/build/
*.out *.out
object_script.* object_script.*
rpgscript.bat rpgscript.bat
rpgscript - mklang.bat rpgscript - mklang.bat
*.pot *.pot
xScripts.rxdata xScripts.rxdata
.qmake.stash .qmake.stash
CMakeCache.txt CMakeCache.txt
CMakeFiles/ CMakeFiles/
@ -48,16 +41,10 @@ conaninfo\.txt
conanbuildinfo\.txt conanbuildinfo\.txt
conan_imports_manifest\.txt conan_imports_manifest\.txt
package/ package/
oclint/ oclint/
steamworks/ steamworks/
build/ build/
.vscode .vscode
test.sh
test2.sh
/compile_commands.json /compile_commands.json
/.cache /.cache
*.lock.json

View file

@ -19,6 +19,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD 23)
if(STATIC) if(STATIC)
add_compile_options(-static-libgcc -static-libstdc++)
set(ZLIB_USE_STATIC_LIBS ON) set(ZLIB_USE_STATIC_LIBS ON)
set(OPENSSL_USE_STATIC_LIBS ON) set(OPENSSL_USE_STATIC_LIBS ON)
endif() endif()
@ -185,8 +186,6 @@ endif()
source_group("MKXP Source" FILES ${MAIN_SOURCE} ${MAIN_HEADERS}) source_group("MKXP Source" FILES ${MAIN_SOURCE} ${MAIN_HEADERS})
## Setup embedded source ##
set(EMBEDDED_INPUT set(EMBEDDED_INPUT
shader/common.h shader/common.h
shader/transSimple.frag shader/transSimple.frag
@ -340,29 +339,6 @@ else()
if(LINUX) if(LINUX)
add_compile_options(-fno-plt) add_compile_options(-fno-plt)
endif() endif()
if(CPU_ARCH MATCHES "x86")
add_compile_options(
-mnoreturn-no-callee-saved-registers
-mrelax-cmpxchg-loop)
elseif(CPU_ARCH MATCHES "arm64")
# TODO: check is it really usefull:3
add_compile_options(
-mlow-precision-recip-sqrt
-mlow-precision-sqrt
-mlow-precision-div
)
elseif(CPU_ARCH MATCHES "ia-64")
# In theory it must make game work better on IA-64?
add_compile_options(
-minline-float-divide-min-latency
-minline-float-divide-max-throughput
-minline-int-divide-min-latency
-minline-int-divide-max-throughput
-minline-sqrt-min-latency
-minline-sqrt-max-throughput
)
endif()
endif() endif()
if(ANDROID) if(ANDROID)

View file

@ -532,8 +532,6 @@ static void mriBindingExecute(){
* stdio streams on some platforms (eg. Windows) */ * stdio streams on some platforms (eg. Windows) */
int argc = 0; int argc = 0;
char **argv = 0; char **argv = 0;
char options_argv1[] = "oneshot", options_argv2[] = "-ev";
char* options_argv[] = {options_argv1, options_argv2, NULL};
ruby_sysinit(&argc, &argv); ruby_sysinit(&argc, &argv);
RUBY_INIT_STACK; RUBY_INIT_STACK;
ruby_init(); ruby_init();

View file

@ -44,3 +44,6 @@ Added CMake option to build engine with OpenGL ES2 instead Desktop GL(why not?)
Added setting that disable some puzzles(For Wayland users) Added setting that disable some puzzles(For Wayland users)
PreloadScripts moved to modloader PreloadScripts moved to modloader
Deleted Battletest and RPGMaker debug code Deleted Battletest and RPGMaker debug code
glstate Alpha calculation fix backported from MKXP
Added VALUE support in debugwriter.h
When STATIC build option is enabled, enable static libc++ and libgcc

View file

@ -25,6 +25,9 @@
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
#include <vector> #include <vector>
#include <ruby.h>
#undef vsnprintf
#undef snprintf
#ifdef __ANDROID__ #ifdef __ANDROID__
#include <android/SDL_log.h> #include <android/SDL_log.h>
@ -32,8 +35,6 @@
#include <emscripten/console.h> #include <emscripten/console.h>
#endif #endif
/* A cheap replacement for qDebug() */
class Debug{ class Debug{
public: public:
Debug(){ Debug(){
@ -56,6 +57,12 @@ public:
return *this; return *this;
} }
template<typename T>
Debug &operator<<(const VALUE &v){
buf << rb_inspect(v);
return *this;
}
~Debug(){ ~Debug(){
#ifdef __ANDROID__ #ifdef __ANDROID__
__android_log_write(ANDROID_LOG_DEBUG, "sunshine", buf.str().c_str()); __android_log_write(ANDROID_LOG_DEBUG, "sunshine", buf.str().c_str());

View file

@ -77,10 +77,9 @@ void GLBlendMode::apply(const BlendType &value){
break; break;
case BlendSubstraction : case BlendSubstraction :
// FIXME Alpha calculation is untested
gl.BlendEquation(GL_FUNC_REVERSE_SUBTRACT); gl.BlendEquation(GL_FUNC_REVERSE_SUBTRACT);
gl.BlendFuncSeparate(GL_SRC_ALPHA, GL_ONE, gl.BlendFuncSeparate(GL_SRC_ALPHA, GL_ONE,
GL_ONE, GL_ONE); GL_ZERO, GL_ONE);
break; break;
case BlendMultiply : case BlendMultiply :

View file

@ -67,9 +67,7 @@ struct Quad{
vert[i].color = c; vert[i].color = c;
} }
Quad() Quad() : vbo(VBO::gen()), vboDirty(true){
: vbo(VBO::gen()),
vboDirty(true){
GLMeta::vaoFillInVertexData<Vertex>(vao); GLMeta::vaoFillInVertexData<Vertex>(vao);
vao.vbo = vbo; vao.vbo = vbo;
vao.ibo = shState->globalIBO().ibo; vao.ibo = shState->globalIBO().ibo;

View file

@ -0,0 +1,8 @@
set(CUSTOM_FLAGS
-mprefer-short-insn-regs
-mcmove
)
string(JOIN " " CUSTOM_FLAGS_STR ${CUSTOM_FLAGS})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CUSTOM_FLAGS_STR}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CUSTOM_FLAGS_STR}")

8
toolchain/arch/arc.cmake Normal file
View file

@ -0,0 +1,8 @@
set(CUSTOM_FLAGS
-mcase-vector-pcrel
-mcompact-casesi
)
string(JOIN " " CUSTOM_FLAGS_STR ${CUSTOM_FLAGS})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CUSTOM_FLAGS_STR}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CUSTOM_FLAGS_STR}")

View file

@ -0,0 +1,9 @@
set(CUSTOM_FLAGS
-mlow-precision-recip-sqrt
-mlow-precision-sqrt
-mlow-precision-div
)
string(JOIN " " CUSTOM_FLAGS_STR ${CUSTOM_FLAGS})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CUSTOM_FLAGS_STR}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CUSTOM_FLAGS_STR}")

View file

@ -0,0 +1,10 @@
set(CUSTOM_FLAGS
-mdsp
-medsp
-mvdsp
-msmart
)
string(JOIN " " CUSTOM_FLAGS_STR ${CUSTOM_FLAGS})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CUSTOM_FLAGS_STR}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CUSTOM_FLAGS_STR}")

View file

@ -0,0 +1,12 @@
set(CUSTOM_FLAGS
-minline-float-divide-min-latency
-minline-float-divide-max-throughput
-minline-int-divide-min-latency
-minline-int-divide-max-throughput
-minline-sqrt-min-latency
-minline-sqrt-max-throughput
)
string(JOIN " " CUSTOM_FLAGS_STR ${CUSTOM_FLAGS})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CUSTOM_FLAGS_STR}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CUSTOM_FLAGS_STR}")

8
toolchain/arch/x86.cmake Normal file
View file

@ -0,0 +1,8 @@
set(CUSTOM_FLAGS
-mnoreturn-no-callee-saved-registers
-mrelax-cmpxchg-loop
)
string(JOIN " " CUSTOM_FLAGS_STR ${CUSTOM_FLAGS})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CUSTOM_FLAGS_STR}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CUSTOM_FLAGS_STR}")

View file

@ -1,6 +0,0 @@
cmake_minimum_required(VERSION 3.16)
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR x86_64)
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
set(CMAKE_SYSROOT /usr/x86_64-w64-mingw32)