multi:: split-screen mode is now an option

This commit is contained in:
Zeno Rogue 2022-03-27 09:02:06 +02:00
parent bcc7c9c646
commit 08cfed6658
2 changed files with 7 additions and 1 deletions

View File

@ -1497,6 +1497,7 @@ EX int calcfps() {
EX namespace subscreens {
EX vector<display_data> player_displays;
/** 'in' is on if we are currently working on a single display */
EX bool in;
EX int current_player;
@ -1528,7 +1529,7 @@ EX namespace subscreens {
EX bool split(reaction_t what) {
using namespace racing;
if(in) return false;
if(!racing::on && !(shmup::on && GDIM == 3)) return false;
if(!multi::split_screen) return false;
if(!player_displays.empty()) {
in = true;
int& p = current_player;

View File

@ -28,6 +28,8 @@ EX namespace multi {
EX config scfg;
EX charstyle scs[MAXPLAYER];
EX bool split_screen;
EX int players = 1;
EX cellwalker player[MAXPLAYER];
EX vector<int> revive_queue; // queue for revival
@ -519,6 +521,7 @@ EX void showConfigureMultiplayer() {
dialog::addSelItem(XLAT("keyboard & joysticks"), "", 'k');
dialog::add_action(multi::configure);
add_edit(split_screen);
}
else dialog::addBreak(200);
@ -690,6 +693,8 @@ EX void initConfig() {
#if CAP_CONFIG
addsaver(multi::players, "mode-number of players");
param_b(multi::split_screen, "splitscreen", false)
->editable("split screen mode", 's');
addsaver(alwaysuse, "use configured keys");
// unfortunately we cannot use key names here because SDL is not yet initialized
for(int i=0; i<512; i++)