mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 13:29:54 +00:00
a
This commit is contained in:
parent
f610895e86
commit
245b7f7153
11 changed files with 23 additions and 23 deletions
|
|
@ -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 ##
|
||||
|
|
|
|||
|
|
@ -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; \
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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) \
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
#include <set>
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ struct VorbisSource : ALDataSource{
|
|||
} loop;
|
||||
|
||||
struct{
|
||||
unsigned short channels;
|
||||
int channels;
|
||||
int rate;
|
||||
int frameSize;
|
||||
ALenum alFormat;
|
||||
|
|
|
|||
Loading…
Reference in a new issue