2020-01-23 12:13:20 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 2010 EDuke32 developers and contributors
|
|
|
|
Modified by Raze developers and contributors
|
|
|
|
|
|
|
|
This file was part of EDuke32.
|
|
|
|
|
|
|
|
EDuke32 is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License version 2
|
|
|
|
as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#include "ns.h" // Must come before everything else!
|
|
|
|
|
|
|
|
#include "ns.h"
|
|
|
|
|
|
|
|
#include "build.h"
|
|
|
|
|
|
|
|
#include "names2.h"
|
|
|
|
#include "panel.h"
|
|
|
|
#include "game.h"
|
|
|
|
#include "mytypes.h"
|
|
|
|
|
|
|
|
#include "gamecontrol.h"
|
|
|
|
#include "gstrings.h"
|
|
|
|
|
2020-05-25 15:11:32 +00:00
|
|
|
#include "v_text.h"
|
|
|
|
#include "printf.h"
|
2020-01-23 12:13:20 +00:00
|
|
|
|
2020-08-05 15:07:19 +00:00
|
|
|
#include "misc.h"
|
2020-01-23 12:13:20 +00:00
|
|
|
#include "menus.h"
|
|
|
|
#include "mapinfo.h"
|
2020-08-12 22:04:55 +00:00
|
|
|
#include "jsector.h"
|
2020-08-16 12:54:33 +00:00
|
|
|
#include "network.h"
|
2020-08-16 20:45:19 +00:00
|
|
|
#include "gamestate.h"
|
2021-02-16 10:36:08 +00:00
|
|
|
#include "gamefuncs.h"
|
2020-08-29 15:49:15 +00:00
|
|
|
#include "player.h"
|
2020-01-23 12:13:20 +00:00
|
|
|
|
|
|
|
BEGIN_SW_NS
|
|
|
|
|
2020-11-29 11:23:31 +00:00
|
|
|
void GameInterface::WarpToCoords(int x, int y, int z, int ang, int horz)
|
2020-07-11 13:09:39 +00:00
|
|
|
{
|
2020-11-29 11:23:31 +00:00
|
|
|
Player->oposx = Player->posx = x;
|
|
|
|
Player->oposy = Player->posy = y;
|
|
|
|
Player->oposz = Player->posz = z;
|
2020-07-11 13:09:39 +00:00
|
|
|
|
2020-11-29 11:23:31 +00:00
|
|
|
if (ang != INT_MIN)
|
2020-08-04 12:33:17 +00:00
|
|
|
{
|
2020-11-29 11:23:31 +00:00
|
|
|
Player->angle.oang = Player->angle.ang = buildang(ang);
|
2020-08-04 12:33:17 +00:00
|
|
|
}
|
|
|
|
|
2020-11-29 11:23:31 +00:00
|
|
|
if (horz != INT_MIN)
|
2020-08-04 12:33:17 +00:00
|
|
|
{
|
2020-11-29 11:23:31 +00:00
|
|
|
Player->horizon.ohoriz = Player->horizon.horiz = buildhoriz(horz);
|
2020-08-04 12:33:17 +00:00
|
|
|
}
|
2020-07-11 13:09:39 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 22:04:55 +00:00
|
|
|
static int osdcmd_mirror(CCmdFuncPtr parm)
|
|
|
|
{
|
|
|
|
char base[80];
|
|
|
|
int16_t op1 = 0;
|
|
|
|
|
|
|
|
if (parm->numparms < 1)
|
|
|
|
{
|
|
|
|
return CCMD_SHOWHELP;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (op1 < 0 || op1 > 9)
|
|
|
|
{
|
|
|
|
Printf("Mirror number is out of range!");
|
|
|
|
return CCMD_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
Printf("camera is the ST1 sprite used as the view spot");
|
|
|
|
Printf("camspite is the SpriteNum of the drawtotile tile in editart");
|
|
|
|
Printf("camspic is the tile number of the drawtotile in editart");
|
|
|
|
Printf("iscamera is whether or not this mirror is a camera type");
|
|
|
|
Printf(" ");
|
|
|
|
Printf("mirror[%d].mirrorwall = %d", op1, mirror[op1].mirrorwall);
|
|
|
|
Printf("mirror[%d].mirrorsector = %d", op1, mirror[op1].mirrorsector);
|
2021-11-02 17:40:03 +00:00
|
|
|
Printf("mirror[%d].camera = %d", op1, mirror[op1].cameraActor->GetIndex());
|
|
|
|
Printf("mirror[%d].camsprite = %d", op1, mirror[op1].camspriteActor->GetIndex());
|
2020-08-12 22:04:55 +00:00
|
|
|
Printf("mirror[%d].campic = %d", op1, mirror[op1].campic);
|
|
|
|
Printf("mirror[%d].iscamera = %d", op1, mirror[op1].ismagic);
|
|
|
|
return CCMD_OK;
|
|
|
|
}
|
|
|
|
|
2020-11-29 11:23:31 +00:00
|
|
|
void GameInterface::ToggleThirdPerson()
|
2020-08-29 15:49:15 +00:00
|
|
|
{
|
2020-11-29 11:23:31 +00:00
|
|
|
if (gamestate != GS_LEVEL) return;
|
2020-08-29 15:49:15 +00:00
|
|
|
auto pp = &Player[myconnectindex];
|
2021-02-16 10:36:08 +00:00
|
|
|
if (TEST(pp->Flags, PF_VIEW_FROM_OUTSIDE))
|
2020-08-29 15:49:15 +00:00
|
|
|
{
|
2021-02-16 10:36:08 +00:00
|
|
|
RESET(pp->Flags, PF_VIEW_FROM_OUTSIDE);
|
2020-08-29 15:49:15 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-02-16 10:36:08 +00:00
|
|
|
SET(pp->Flags, PF_VIEW_FROM_OUTSIDE);
|
|
|
|
cameradist = 0;
|
2020-08-29 15:49:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-29 11:23:31 +00:00
|
|
|
void GameInterface::SwitchCoopView()
|
2020-08-29 15:49:15 +00:00
|
|
|
{
|
2020-11-29 11:23:31 +00:00
|
|
|
if (gamestate != GS_LEVEL) return;
|
2020-08-29 15:49:15 +00:00
|
|
|
if (gNet.MultiGameType == MULTI_GAME_COOPERATIVE)
|
|
|
|
{
|
|
|
|
screenpeek = connectpoint2[screenpeek];
|
|
|
|
|
|
|
|
if (screenpeek < 0)
|
|
|
|
screenpeek = connecthead;
|
|
|
|
|
|
|
|
if (screenpeek == myconnectindex)
|
|
|
|
{
|
|
|
|
// JBF: figure out what's going on here
|
|
|
|
auto pp = &Player[myconnectindex];
|
|
|
|
DoPlayerDivePalette(pp); // Check Dive again
|
|
|
|
DoPlayerNightVisionPalette(pp); // Check Night Vision again
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
PLAYERp tp = Player + screenpeek;
|
|
|
|
DoPlayerDivePalette(tp);
|
|
|
|
DoPlayerNightVisionPalette(tp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-08-12 22:04:55 +00:00
|
|
|
|
2020-01-23 12:13:20 +00:00
|
|
|
int32_t registerosdcommands(void)
|
|
|
|
{
|
2020-08-29 15:49:15 +00:00
|
|
|
C_RegisterFunction("mirror_debug", "mirror [mirrornum]: print mirror debug info", osdcmd_mirror);
|
2020-01-23 12:13:20 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
END_SW_NS
|