mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-07-04 18:52:51 +00:00
some guards to make it compile on Android
This commit is contained in:
parent
42d9aa4ba3
commit
bb9e951138
@ -475,7 +475,9 @@ EX fontdata* font_by_name(string fname) {
|
|||||||
fd.use_fontconfig = true;
|
fd.use_fontconfig = true;
|
||||||
#endif
|
#endif
|
||||||
for(int i=0; i<=max_glfont_size; i++) fd.glfont[i] = nullptr;
|
for(int i=0; i<=max_glfont_size; i++) fd.glfont[i] = nullptr;
|
||||||
|
#if CAP_SDLTTF
|
||||||
for(int i=0; i<=max_font_size; i++) fd.font[i] = nullptr;
|
for(int i=0; i<=max_font_size; i++) fd.font[i] = nullptr;
|
||||||
|
#endif
|
||||||
fd.finf = nullptr;
|
fd.finf = nullptr;
|
||||||
}
|
}
|
||||||
return &fd;
|
return &fd;
|
||||||
@ -1479,6 +1481,7 @@ EX int SDL_Init1(Uint32 flags) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if CAP_SDLTTF
|
||||||
EX void set_cfont() {
|
EX void set_cfont() {
|
||||||
int f = font_id;
|
int f = font_id;
|
||||||
int fch = f;
|
int fch = f;
|
||||||
@ -1487,6 +1490,7 @@ EX void set_cfont() {
|
|||||||
cfont = font_by_name(font_filenames[last_font_id = f]);
|
cfont = font_by_name(font_filenames[last_font_id = f]);
|
||||||
cfont_chinese = font_by_name(font_filenames[fch]);
|
cfont_chinese = font_by_name(font_filenames[fch]);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
EX void init_font() {
|
EX void init_font() {
|
||||||
#if CAP_SDLTTF
|
#if CAP_SDLTTF
|
||||||
@ -1515,7 +1519,9 @@ fontdata::~fontdata() {
|
|||||||
|
|
||||||
EX void close_font() {
|
EX void close_font() {
|
||||||
fontdatas.clear();
|
fontdatas.clear();
|
||||||
|
#if CAP_SDLTTF
|
||||||
TTF_Quit();
|
TTF_Quit();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
EX void init_graph() {
|
EX void init_graph() {
|
||||||
|
10
config.cpp
10
config.cpp
@ -1053,6 +1053,7 @@ EX purehookset hooks_configfile;
|
|||||||
|
|
||||||
EX ld mapfontscale = 100;
|
EX ld mapfontscale = 100;
|
||||||
|
|
||||||
|
#if CAP_SDLTTF
|
||||||
EX void font_reaction() {
|
EX void font_reaction() {
|
||||||
if(among(font_id, 5, 6)) {
|
if(among(font_id, 5, 6)) {
|
||||||
int fid = font_id;
|
int fid = font_id;
|
||||||
@ -1062,6 +1063,7 @@ EX void font_reaction() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
EX void initConfig() {
|
EX void initConfig() {
|
||||||
|
|
||||||
@ -1153,11 +1155,13 @@ EX void initConfig() {
|
|||||||
initcs(vid.cs); paramset(vid.cs, "single");
|
initcs(vid.cs); paramset(vid.cs, "single");
|
||||||
param_b(vid.samegender, "princess choice", false);
|
param_b(vid.samegender, "princess choice", false);
|
||||||
param_i(vid.language, "language", -1);
|
param_i(vid.language, "language", -1);
|
||||||
|
#if CAP_SDLTTF
|
||||||
param_enum(font_id, "font_id", 0)
|
param_enum(font_id, "font_id", 0)
|
||||||
->editable(font_names, "select font", 'f')
|
->editable(font_names, "select font", 'f')
|
||||||
->manual_reaction = font_reaction;
|
->manual_reaction = font_reaction;
|
||||||
param_str(font_filenames[5], "ttf_font");
|
param_str(font_filenames[5], "ttf_font");
|
||||||
param_str(font_filenames[6], "otf_font");
|
param_str(font_filenames[6], "otf_font");
|
||||||
|
#endif
|
||||||
param_b(vid.drawmousecircle, "mouse circle", ISMOBILE || ISPANDORA);
|
param_b(vid.drawmousecircle, "mouse circle", ISMOBILE || ISPANDORA);
|
||||||
param_b(vid.revcontrol, "reverse control", false);
|
param_b(vid.revcontrol, "reverse control", false);
|
||||||
#if CAP_AUDIO
|
#if CAP_AUDIO
|
||||||
@ -1405,6 +1409,7 @@ EX void initConfig() {
|
|||||||
-> help("Background particle effects, e.g., in the Blizzard.");
|
-> help("Background particle effects, e.g., in the Blizzard.");
|
||||||
// control
|
// control
|
||||||
|
|
||||||
|
#if CAP_SDL
|
||||||
param_enum(joy_init, "joyinit", jiFast)
|
param_enum(joy_init, "joyinit", jiFast)
|
||||||
->editable({{"off", "do not use joysticks"}, {"fast", "do not wait until the joysticks are initialized"}, {"wait", "wait until the joysticks are initialized"}}, "joystick initialization", 'j');
|
->editable({{"off", "do not use joysticks"}, {"fast", "do not wait until the joysticks are initialized"}, {"wait", "wait until the joysticks are initialized"}}, "joystick initialization", 'j');
|
||||||
param_i(vid.joyvalue, "vid.joyvalue", 4800);
|
param_i(vid.joyvalue, "vid.joyvalue", 4800);
|
||||||
@ -1413,6 +1418,7 @@ EX void initConfig() {
|
|||||||
param_i(vid.joypanthreshold, "vid.joypanthreshold", 2500);
|
param_i(vid.joypanthreshold, "vid.joypanthreshold", 2500);
|
||||||
param_f(vid.joypanspeed, "vid.joypanspeed", ISPANDORA ? 0.0001 : 0);
|
param_f(vid.joypanspeed, "vid.joypanspeed", ISPANDORA ? 0.0001 : 0);
|
||||||
param_b(autojoy, "autojoy");
|
param_b(autojoy, "autojoy");
|
||||||
|
#endif
|
||||||
|
|
||||||
vid.killreduction = 0;
|
vid.killreduction = 0;
|
||||||
|
|
||||||
@ -2493,7 +2499,9 @@ EX void configureInterface() {
|
|||||||
dialog::add_action_push(selectLanguageScreen);
|
dialog::add_action_push(selectLanguageScreen);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if CAP_SDLTTF
|
||||||
add_edit(font_id);
|
add_edit(font_id);
|
||||||
|
#endif
|
||||||
|
|
||||||
dialog::addSelItem(XLAT("player character"), numplayers() > 1 ? "" : csname(vid.cs), 'g');
|
dialog::addSelItem(XLAT("player character"), numplayers() > 1 ? "" : csname(vid.cs), 'g');
|
||||||
dialog::add_action_push(showCustomizeChar);
|
dialog::add_action_push(showCustomizeChar);
|
||||||
@ -4365,6 +4373,7 @@ EX int read_config_args() {
|
|||||||
else return 1;
|
else return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
EX void set_char_by_name(charstyle& cs, const string& s) {
|
EX void set_char_by_name(charstyle& cs, const string& s) {
|
||||||
if(s == "dodek") {
|
if(s == "dodek") {
|
||||||
@ -4418,6 +4427,7 @@ EX void set_char_by_name(charstyle& cs, const string& s) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if CAP_COMMANDLINE
|
||||||
EX int read_param_args() {
|
EX int read_param_args() {
|
||||||
const string& s = arg::args();
|
const string& s = arg::args();
|
||||||
auto pos = s.find("=");
|
auto pos = s.find("=");
|
||||||
|
@ -5655,7 +5655,9 @@ EX void calcparam() {
|
|||||||
ld fov = vid.fov * degree / 2;
|
ld fov = vid.fov * degree / 2;
|
||||||
cd->tanfov = sin(fov) / (cos(fov) + get_stereo_param());
|
cd->tanfov = sin(fov) / (cos(fov) + get_stereo_param());
|
||||||
|
|
||||||
|
#if CAP_SDLTTF
|
||||||
set_cfont();
|
set_cfont();
|
||||||
|
#endif
|
||||||
callhooks(hooks_calcparam);
|
callhooks(hooks_calcparam);
|
||||||
reset_projection();
|
reset_projection();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user