From 8eafee0636394dc628d79d4f6c95c712c7f0b127 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Mon, 13 Aug 2012 18:25:32 +0000 Subject: [PATCH] Resurrect fake multiplayer mode a little (no bots). Just enough so that Bloodclaw's splitscreen mod can be played. git-svn-id: https://svn.eduke32.com/eduke32@2879 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/game.c | 36 ++++++++++++++++++++++++++----- polymer/eduke32/source/game.h | 1 + polymer/eduke32/source/gameexec.c | 3 +++ polymer/eduke32/source/premap.c | 5 ++++- 4 files changed, 39 insertions(+), 6 deletions(-) diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index ed7588408..1a5f5c724 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -96,6 +96,7 @@ static int32_t g_noMusic = 0; static const char *CommandMap = NULL; static const char *CommandName = NULL; int32_t g_forceWeaponChoice = 0; +int32_t g_fakeMultiMode = 0; char boardfilename[BMAX_PATH] = {0}, currentboardfilename[BMAX_PATH] = {0}; @@ -4796,7 +4797,8 @@ int32_t A_Spawn(int32_t j, int32_t pn) case APLAYER__STATIC: sp->xrepeat = sp->yrepeat = 0; sp->cstat = 32768; - if ((!g_netServer && ud.multimode < 2) || ((GametypeFlags[ud.coop] & GAMETYPE_COOPSPAWN)/GAMETYPE_COOPSPAWN) != sp->lotag) + if ((!g_netServer && ud.multimode < 2) || + ((GametypeFlags[ud.coop] & GAMETYPE_COOPSPAWN)/GAMETYPE_COOPSPAWN) != sp->lotag) changespritestat(i,STAT_MISC); else changespritestat(i,STAT_PLAYER); @@ -8968,9 +8970,18 @@ static void G_CheckCommandLine(int32_t argc, const char **argv) } break; case 'q': - initprintf("Fake multiplayer mode.\n"); - if (*(++c) == 0) ud.multimode = 1; - else ud.multimode = Batoi(c)%17; + if (*(++c) == 0) + { + ud.multimode = 1; + initprintf("Fake multiplayer mode: expected number after -q, falling back to 1 player.\n"); + } + else + { + ud.multimode = Batoi(c)%17; + initprintf("Fake multiplayer mode: %d players.\n", ud.multimode); + + g_fakeMultiMode = 1; + } ud.m_coop = ud.coop = 0; ud.m_marker = ud.marker = 1; ud.m_respawn_monsters = ud.respawn_monsters = 1; @@ -10188,7 +10199,22 @@ int32_t app_main(int32_t argc, const char **argv) } numplayers = 1; - connectpoint2[0] = -1; + + if (!g_fakeMultiMode) + { + connectpoint2[0] = -1; + } + else + { + playerswhenstarted = ud.multimode; + + for (i=0; ishade = 0; s->xrepeat = 42; s->yrepeat = 36; - s->cstat = j < numplayers ? 1+256 : 32768; + if (!g_fakeMultiMode) + s->cstat = j < numplayers ? 1+256 : 32768; + else + s->cstat = 1+256; s->xoffset = 0; s->clipdist = 64;