From 245b7f7153d8a4cb32d516b35df96a1d9e07e91c Mon Sep 17 00:00:00 2001 From: ZakatTeamI2P Date: Wed, 20 May 2026 18:33:29 +0400 Subject: [PATCH] a --- CMakeLists.txt | 2 +- binding-mri/audio-binding.cpp | 8 ++++---- src/audio.cpp | 8 ++++---- src/audio.h | 8 ++++---- src/config.cpp | 2 +- src/config.h | 4 ++-- src/etc.cpp | 2 +- src/etc.h | 2 +- src/tileatlas.cpp | 4 ++-- src/tilemap.cpp | 4 ++-- src/vorbissource.cpp | 2 +- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f710cf..8ec10c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ else() if (MSVC) add_compile_options(/O2 /fp:fast /GL /GF /GA) else() - add_compile_options(-O3 -ffast-math -flto) + add_compile_options() endif() endif() ## Setup main source ## diff --git a/binding-mri/audio-binding.cpp b/binding-mri/audio-binding.cpp index 13ea544..b743c71 100644 --- a/binding-mri/audio-binding.cpp +++ b/binding-mri/audio-binding.cpp @@ -29,8 +29,8 @@ { \ RB_UNUSED_PARAM; \ const char *filename; \ - unsigned short volume = 100; \ - unsigned short pitch = 100; \ + int volume = 100; \ + int pitch = 100; \ double pos = 0.0; \ if (rgssVer >= 3) \ rb_get_args(argc, argv, "z|iif", &filename, &volume, &pitch, &pos RB_ARG_END); \ @@ -56,8 +56,8 @@ { \ RB_UNUSED_PARAM; \ const char *filename; \ - unsigned short volume = 100; \ - unsigned short pitch = 100; \ + int volume = 100; \ + int pitch = 100; \ rb_get_args(argc, argv, "z|ii", &filename, &volume, &pitch RB_ARG_END); \ GUARD_EXC( shState->audio().entity##Play(filename, volume, pitch); ) \ return Qnil; \ diff --git a/src/audio.cpp b/src/audio.cpp index 1965978..2898a72 100644 --- a/src/audio.cpp +++ b/src/audio.cpp @@ -232,7 +232,7 @@ Audio::Audio(RGSSThreadData &rtData) {} -void Audio::bgmPlay(const char *filename, short volume, short pitch, float pos){ +void Audio::bgmPlay(const char *filename, int volume, int pitch, float pos){ p->current_bgm_volume = volume; p->bgm.play(filename, (volume*p->bgm_volume)/100, pitch, pos); } @@ -246,7 +246,7 @@ void Audio::bgmFade(int time){ } -void Audio::bgsPlay(const char *filename, short volume, short pitch, float pos){ +void Audio::bgsPlay(const char *filename, int volume, int pitch, float pos){ p->current_bgs_volume = volume; p->bgs.play(filename, (volume*p->sfx_volume)/100, pitch, pos); } @@ -260,7 +260,7 @@ void Audio::bgsFade(int time){ } -void Audio::mePlay(const char *filename, short volume, short pitch){ +void Audio::mePlay(const char *filename, int volume, int pitch){ p->current_me_volume = volume; p->me.play(filename, (volume*p->bgm_volume)/100, pitch); } @@ -274,7 +274,7 @@ void Audio::meFade(int time){ } -void Audio::sePlay(const char *filename, short volume, short pitch){ +void Audio::sePlay(const char *filename, int volume, int pitch){ p->se.play(filename, (volume*p->sfx_volume)/100, pitch); } diff --git a/src/audio.h b/src/audio.h index 96c2bde..6d4f4d2 100644 --- a/src/audio.h +++ b/src/audio.h @@ -39,19 +39,19 @@ struct RGSSThreadData; class Audio{ public: - void bgmPlay(const char *filename, short volume = 100, short pitch = 100, float pos = 0); + void bgmPlay(const char *filename, int volume = 100, int pitch = 100, float pos = 0); void bgmStop(); void bgmFade(int time); - void bgsPlay(const char *filename, short volume = 100, short pitch = 100, float pos = 0); + void bgsPlay(const char *filename,int volume = 100, int pitch = 100, float pos = 0); void bgsStop(); void bgsFade(int time); - void mePlay(const char *filename, short volume = 100, short pitch = 100); + void mePlay(const char *filename, int volume = 100, int pitch = 100); void meStop(); void meFade(int time); - void sePlay(const char *filename, short volume = 100, short pitch = 100); + void sePlay(const char *filename, int volume = 100, int pitch = 100); void seStop(); float bgmPos(); diff --git a/src/config.cpp b/src/config.cpp index d85963a..e5b4ab3 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -66,7 +66,7 @@ namespace po = boost::program_options; Config::Config() {} -void Config::read(short argc, char *argv[]){ +void Config::read(int argc, char *argv[]){ #define PO_DESC_ALL \ PO_DESC(debugMode, bool, false) \ PO_DESC(screenMode, bool, false) \ diff --git a/src/config.h b/src/config.h index 230ad8c..e08db1f 100644 --- a/src/config.h +++ b/src/config.h @@ -27,7 +27,7 @@ #include struct Config{ - unsigned char rgssVersion; + unsigned short rgssVersion; bool debugMode; bool screenMode; @@ -89,7 +89,7 @@ struct Config{ Config(); - void read(short argc, char *argv[]); + void read(int argc, char *argv[]); }; #endif // CONFIG_H diff --git a/src/etc.cpp b/src/etc.cpp index 647f2b1..b0e4f93 100644 --- a/src/etc.cpp +++ b/src/etc.cpp @@ -101,7 +101,7 @@ void Color::serialize(char *buffer) const{ writeDouble(&buffer, alpha); } -Color *Color::deserialize(const char *data, short len){ +Color *Color::deserialize(const char *data, int len){ if (len != 32) throw Exception(Exception::ArgumentError, "Color: Serialized data invalid"); diff --git a/src/etc.h b/src/etc.h index b17c57c..fc769cd 100644 --- a/src/etc.h +++ b/src/etc.h @@ -66,7 +66,7 @@ struct Color : public Serializable{ /* Serializable */ int serialSize() const; void serialize(char *buffer) const; - static Color *deserialize(const char *data, short len); + static Color *deserialize(const char *data, int len); /* Internal */ void updateInternal(); diff --git a/src/tileatlas.cpp b/src/tileatlas.cpp index f44b36a..b3521d0 100644 --- a/src/tileatlas.cpp +++ b/src/tileatlas.cpp @@ -44,8 +44,8 @@ static const int atAreaH = 128*7 + atBuffer; /* Autotile area */ static const int atArea = atAreaW * atAreaH; -static const unsigned short tilesetW = 256; -static const unsigned short tsLaneW = tilesetW / 2; +static const int tilesetW = 256; +static const int tsLaneW = tilesetW / 2; static int freeArea(int width, int height){ return width * height - atArea; diff --git a/src/tilemap.cpp b/src/tilemap.cpp index 65a406f..6f8ba1c 100644 --- a/src/tilemap.cpp +++ b/src/tilemap.cpp @@ -64,8 +64,8 @@ static const int atAreaH = autotileH * autotileCount; static const int tsLaneW = tilesetW / 2; /* Map viewport size */ //TODO: разные значения под разные разрешения экрана для оптимизации -static const char viewpW = 42; -static const char viewpH = 26; +static const int viewpW = 42; +static const int viewpH = 26; static const size_t zlayersMax = viewpH + 5; diff --git a/src/vorbissource.cpp b/src/vorbissource.cpp index b10f743..ba01638 100644 --- a/src/vorbissource.cpp +++ b/src/vorbissource.cpp @@ -62,7 +62,7 @@ struct VorbisSource : ALDataSource{ } loop; struct{ - unsigned short channels; + int channels; int rate; int frameSize; ALenum alFormat;