mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-20 12:31:14 +00:00
Merge branch 'master' into hitlag-retry
This commit is contained in:
commit
88be417717
21 changed files with 4283 additions and 4230 deletions
|
|
@ -170,6 +170,7 @@ set(SRB2_CORE_GAME_SOURCES
|
|||
k_botsearch.c
|
||||
k_respawn.c
|
||||
k_grandprix.c
|
||||
k_hud.c
|
||||
|
||||
p_local.h
|
||||
p_maputl.h
|
||||
|
|
@ -192,6 +193,7 @@ set(SRB2_CORE_GAME_SOURCES
|
|||
k_bot.h
|
||||
k_respawn.h
|
||||
k_grandprix.h
|
||||
k_hud.h
|
||||
)
|
||||
|
||||
if(NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
||||
|
|
|
|||
|
|
@ -564,10 +564,11 @@ OBJS:=$(i_main_o) \
|
|||
$(OBJDIR)/k_waypoint.o\
|
||||
$(OBJDIR)/k_pathfind.o\
|
||||
$(OBJDIR)/k_bheap.o \
|
||||
$(OBJDIR)/k_bot.o \
|
||||
$(OBJDIR)/k_botitem.o \
|
||||
$(OBJDIR)/k_botsearch.o \
|
||||
$(OBJDIR)/k_bot.o \
|
||||
$(OBJDIR)/k_botitem.o\
|
||||
$(OBJDIR)/k_botsearch.o\
|
||||
$(OBJDIR)/k_grandprix.o\
|
||||
$(OBJDIR)/k_hud.o \
|
||||
$(i_cdmus_o) \
|
||||
$(i_net_o) \
|
||||
$(i_system_o) \
|
||||
|
|
|
|||
|
|
@ -2106,8 +2106,6 @@ void SendWeaponPref(void)
|
|||
XBOXSTATIC UINT8 buf[1];
|
||||
|
||||
buf[0] = 0;
|
||||
if (cv_flipcam.value)
|
||||
buf[0] |= 1;
|
||||
SendNetXCmd(XD_WEAPONPREF, buf, 1);
|
||||
}
|
||||
|
||||
|
|
@ -2116,8 +2114,6 @@ void SendWeaponPref2(void)
|
|||
XBOXSTATIC UINT8 buf[1];
|
||||
|
||||
buf[0] = 0;
|
||||
if (cv_flipcam2.value)
|
||||
buf[0] |= 1;
|
||||
SendNetXCmd2(XD_WEAPONPREF, buf, 1);
|
||||
}
|
||||
|
||||
|
|
@ -2126,8 +2122,6 @@ void SendWeaponPref3(void)
|
|||
XBOXSTATIC UINT8 buf[1];
|
||||
|
||||
buf[0] = 0;
|
||||
if (cv_flipcam3.value)
|
||||
buf[0] |= 1;
|
||||
SendNetXCmd3(XD_WEAPONPREF, buf, 1);
|
||||
}
|
||||
|
||||
|
|
@ -2136,18 +2130,12 @@ void SendWeaponPref4(void)
|
|||
XBOXSTATIC UINT8 buf[1];
|
||||
|
||||
buf[0] = 0;
|
||||
if (cv_flipcam4.value)
|
||||
buf[0] |= 1;
|
||||
SendNetXCmd4(XD_WEAPONPREF, buf, 1);
|
||||
}
|
||||
|
||||
static void Got_WeaponPref(UINT8 **cp,INT32 playernum)
|
||||
{
|
||||
UINT8 prefs = READUINT8(*cp);
|
||||
|
||||
players[playernum].pflags &= ~(PF_FLIPCAM);
|
||||
if (prefs & 1)
|
||||
players[playernum].pflags |= PF_FLIPCAM;
|
||||
/*UINT8 prefs = */READUINT8(*cp); // Read it still to avoid instant desyncs in netgames.
|
||||
}
|
||||
|
||||
static void Got_PowerLevel(UINT8 **cp,INT32 playernum)
|
||||
|
|
|
|||
|
|
@ -297,6 +297,7 @@ typedef enum
|
|||
k_boostpower, // Base boost value, for offroad
|
||||
k_speedboost, // Boost value smoothing for max speed
|
||||
k_accelboost, // Boost value smoothing for acceleration
|
||||
k_handleboost, // Boost value smoothing for handling
|
||||
k_draftpower, // Drafting power (from 0 to FRACUNIT), doubles your top speed & acceleration at max
|
||||
k_draftleeway, // Leniency timer before removing draft power
|
||||
k_lastdraft, // Last player being drafted
|
||||
|
|
|
|||
|
|
@ -8846,6 +8846,7 @@ static const char *const KARTSTUFF_LIST[] = {
|
|||
"BOOSTPOWER",
|
||||
"SPEEDBOOST",
|
||||
"ACCELBOOST",
|
||||
"HANDLEBOOST",
|
||||
"DRAFTPOWER",
|
||||
"DRAFTLEEWAY",
|
||||
"LASTDRAFT",
|
||||
|
|
@ -9387,7 +9388,7 @@ struct {
|
|||
{"V_WRAPY",V_WRAPY},
|
||||
{"V_NOSCALESTART",V_NOSCALESTART},
|
||||
{"V_SPLITSCREEN",V_SPLITSCREEN},
|
||||
{"V_HORZSCREEN",V_HORZSCREEN},
|
||||
{"V_SLIDEIN",V_SLIDEIN},
|
||||
|
||||
{"V_PARAMMASK",V_PARAMMASK},
|
||||
{"V_SCALEPATCHMASK",V_SCALEPATCHMASK},
|
||||
|
|
|
|||
|
|
@ -1510,7 +1510,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
INT32 player_invert = invertmouse ? -1 : 1;
|
||||
INT32 screen_invert =
|
||||
(player->mo && (player->mo->eflags & MFE_VERTICALFLIP)
|
||||
&& (!thiscam->chase || player->pflags & PF_FLIPCAM)) //because chasecam's not inverted
|
||||
&& (!thiscam->chase)) //because chasecam's not inverted
|
||||
? -1 : 1; // set to -1 or 1 to multiply
|
||||
|
||||
// mouse look stuff (mouse look is not the same as mouse aim)
|
||||
|
|
@ -2599,7 +2599,7 @@ void G_PlayerReborn(INT32 player)
|
|||
jointime = players[player].jointime;
|
||||
splitscreenindex = players[player].splitscreenindex;
|
||||
spectator = players[player].spectator;
|
||||
pflags = (players[player].pflags & (PF_TIMEOVER|PF_FLIPCAM|PF_TAGIT|PF_TAGGED|PF_WANTSTOJOIN));
|
||||
pflags = (players[player].pflags & (PF_TIMEOVER|PF_TAGIT|PF_TAGGED|PF_WANTSTOJOIN));
|
||||
|
||||
// As long as we're not in multiplayer, carry over cheatcodes from map to map
|
||||
if (!(netgame || multiplayer))
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#include "../z_zone.h"
|
||||
#include "../v_video.h"
|
||||
#include "../st_stuff.h"
|
||||
#include "../k_hud.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include "../i_video.h" // for rendermode != render_glide
|
||||
|
|
@ -194,12 +195,6 @@ void HWR_DrawFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
|
|||
cy -= offsety;
|
||||
}
|
||||
|
||||
if (option & V_SPLITSCREEN)
|
||||
cy += FIXED_TO_FLOAT((BASEVIDHEIGHT/2)<<FRACBITS);
|
||||
|
||||
if (option & V_HORZSCREEN)
|
||||
cx += FIXED_TO_FLOAT((BASEVIDWIDTH/2)<<FRACBITS);
|
||||
|
||||
if (!(option & V_NOSCALESTART))
|
||||
{
|
||||
cx = cx * dupx;
|
||||
|
|
@ -207,35 +202,12 @@ void HWR_DrawFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale,
|
|||
|
||||
if (!(option & V_SCALEPATCHMASK))
|
||||
{
|
||||
// if it's meant to cover the whole screen, black out the rest
|
||||
// cx and cy are possibly *slightly* off from float maths
|
||||
// This is done before here compared to software because we directly alter cx and cy to centre
|
||||
if (cx >= -0.1f && cx <= 0.1f && SHORT(gpatch->width) == BASEVIDWIDTH && cy >= -0.1f && cy <= 0.1f && SHORT(gpatch->height) == BASEVIDHEIGHT)
|
||||
{
|
||||
// Need to temporarily cache the real patch to get the colour of the top left pixel
|
||||
patch_t *realpatch = W_CacheLumpNumPwad(gpatch->wadnum, gpatch->lumpnum, PU_STATIC);
|
||||
const column_t *column = (const column_t *)((const UINT8 *)(realpatch) + LONG((realpatch)->columnofs[0]));
|
||||
const UINT8 *source = (const UINT8 *)(column) + 3;
|
||||
HWR_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (column->topdelta == 0xff ? 31 : source[0]));
|
||||
Z_Free(realpatch);
|
||||
}
|
||||
// centre screen
|
||||
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dupx) > 1.0E-36f)
|
||||
{
|
||||
if (option & V_SNAPTORIGHT)
|
||||
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
|
||||
else if (!(option & V_SNAPTOLEFT))
|
||||
cx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx))/2;
|
||||
}
|
||||
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dupy) > 1.0E-36f)
|
||||
{
|
||||
if ((option & (V_SPLITSCREEN|V_SNAPTOBOTTOM)) == (V_SPLITSCREEN|V_SNAPTOBOTTOM))
|
||||
cy += ((float)vid.height/2 - ((float)BASEVIDHEIGHT/2 * dupy));
|
||||
else if (option & V_SNAPTOBOTTOM)
|
||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
|
||||
else if (!(option & V_SNAPTOTOP))
|
||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy))/2;
|
||||
}
|
||||
INT32 intx, inty;
|
||||
intx = (INT32)cx;
|
||||
inty = (INT32)cy;
|
||||
K_AdjustXYWithSnap(&intx, &inty, option, dupx, dupy);
|
||||
cx = (float)intx;
|
||||
cy = (float)inty;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -377,7 +349,7 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal
|
|||
}
|
||||
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dupy) > 1.0E-36f)
|
||||
{
|
||||
if ((option & (V_SPLITSCREEN|V_SNAPTOBOTTOM)) == (V_SPLITSCREEN|V_SNAPTOBOTTOM))
|
||||
if ((option & V_SNAPTOBOTTOM) == V_SNAPTOBOTTOM)
|
||||
cy += ((float)vid.height/2 - ((float)BASEVIDHEIGHT/2 * dupy));
|
||||
else if (option & V_SNAPTOBOTTOM)
|
||||
cy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
|
||||
|
|
@ -872,6 +844,7 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32
|
|||
if (!(options & V_NOSCALESTART))
|
||||
{
|
||||
float dupx = (float)vid.dupx, dupy = (float)vid.dupy;
|
||||
INT32 intx, inty;
|
||||
|
||||
if (x == 0 && y == 0 && w == BASEVIDWIDTH && h == BASEVIDHEIGHT)
|
||||
{
|
||||
|
|
@ -890,26 +863,11 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32
|
|||
fw *= dupx;
|
||||
fh *= dupy;
|
||||
|
||||
if (fabsf((float)vid.width - ((float)BASEVIDWIDTH * dupx)) > 1.0E-36f)
|
||||
{
|
||||
if (options & V_SNAPTORIGHT)
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
|
||||
else if (!(options & V_SNAPTOLEFT))
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 2;
|
||||
}
|
||||
if (fabsf((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) > 1.0E-36f)
|
||||
{
|
||||
// same thing here
|
||||
if (options & V_SNAPTOBOTTOM)
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
|
||||
else if (!(options & V_SNAPTOTOP))
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 2;
|
||||
}
|
||||
if (options & V_SPLITSCREEN)
|
||||
fy += ((float)BASEVIDHEIGHT * dupy)/2;
|
||||
if (options & V_HORZSCREEN)
|
||||
fx += ((float)BASEVIDWIDTH * dupx)/2;
|
||||
|
||||
intx = (INT32)fx;
|
||||
inty = (INT32)fy;
|
||||
K_AdjustXYWithSnap(&intx, &inty, options, dupx, dupy);
|
||||
fx = (float)intx;
|
||||
fy = (float)inty;
|
||||
}
|
||||
|
||||
if (fx >= vid.width || fy >= vid.height)
|
||||
|
|
@ -980,6 +938,7 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
|
|||
if (!(color & V_NOSCALESTART))
|
||||
{
|
||||
float dupx = (float)vid.dupx, dupy = (float)vid.dupy;
|
||||
INT32 intx, inty;
|
||||
|
||||
if (x == 0 && y == 0 && w == BASEVIDWIDTH && h == BASEVIDHEIGHT)
|
||||
{
|
||||
|
|
@ -998,26 +957,11 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
|
|||
fw *= dupx;
|
||||
fh *= dupy;
|
||||
|
||||
if (fabsf((float)vid.width - (float)BASEVIDWIDTH * dupx) > 1.0E-36f)
|
||||
{
|
||||
if (color & V_SNAPTORIGHT)
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
|
||||
else if (!(color & V_SNAPTOLEFT))
|
||||
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 2;
|
||||
}
|
||||
if (fabsf((float)vid.height - (float)BASEVIDHEIGHT * dupy) > 1.0E-36f)
|
||||
{
|
||||
// same thing here
|
||||
if (color & V_SNAPTOBOTTOM)
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
|
||||
else if (!(color & V_SNAPTOTOP))
|
||||
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 2;
|
||||
}
|
||||
if (color & V_SPLITSCREEN)
|
||||
fy += ((float)BASEVIDHEIGHT * dupy)/2;
|
||||
if (color & V_HORZSCREEN)
|
||||
fx += ((float)BASEVIDWIDTH * dupx)/2;
|
||||
|
||||
intx = (INT32)fx;
|
||||
inty = (INT32)fy;
|
||||
K_AdjustXYWithSnap(&intx, &inty, color, dupx, dupy);
|
||||
fx = (float)intx;
|
||||
fy = (float)inty;
|
||||
}
|
||||
|
||||
if (fx >= vid.width || fy >= vid.height)
|
||||
|
|
|
|||
|
|
@ -2366,11 +2366,17 @@ void
|
|||
HU_drawMiniPing (INT32 x, INT32 y, UINT32 ping, INT32 flags)
|
||||
{
|
||||
patch_t *patch;
|
||||
INT32 w = BASEVIDWIDTH;
|
||||
|
||||
if (r_splitscreen > 1)
|
||||
{
|
||||
w /= 2;
|
||||
}
|
||||
|
||||
patch = mping[Ping_gfx_num(ping)];
|
||||
|
||||
if (( flags & V_SNAPTORIGHT ))
|
||||
x += ( BASEVIDWIDTH - SHORT (patch->width) );
|
||||
x += ( w - SHORT (patch->width) );
|
||||
|
||||
V_DrawScaledPatch(x, y, flags, patch);
|
||||
}
|
||||
|
|
|
|||
4122
src/k_hud.c
Normal file
4122
src/k_hud.c
Normal file
File diff suppressed because it is too large
Load diff
28
src/k_hud.h
Normal file
28
src/k_hud.h
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// SONIC ROBO BLAST 2 KART
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2018-2020 by Kart Krew
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
// See the 'LICENSE' file for more details.
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file k_hud.h
|
||||
/// \brief HUD drawing functions exclusive to Kart
|
||||
|
||||
#include "doomtype.h"
|
||||
#include "doomstat.h"
|
||||
|
||||
#ifndef __K_HUD__
|
||||
#define __K_HUD__
|
||||
|
||||
#define RINGANIM_NUMFRAMES 10
|
||||
#define RINGANIM_DELAYMAX 5
|
||||
|
||||
void K_AdjustXYWithSnap(INT32 *x, INT32 *y, UINT32 options, INT32 dupx, INT32 dupy);
|
||||
const char *K_GetItemPatch(UINT8 item, boolean tiny);
|
||||
void K_LoadKartHUDGraphics(void);
|
||||
void K_drawKartHUD(void);
|
||||
void K_drawKartFreePlay(UINT32 flashtime);
|
||||
void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, UINT8 mode);
|
||||
|
||||
#endif
|
||||
4030
src/k_kart.c
4030
src/k_kart.c
File diff suppressed because it is too large
Load diff
|
|
@ -23,6 +23,8 @@ fixed_t K_GetKartGameSpeedScalar(SINT8 value);
|
|||
|
||||
extern consvar_t *KartItemCVars[NUMKARTRESULTS-1];
|
||||
|
||||
UINT8 K_FindUseodds(player_t *player, fixed_t mashed, UINT32 pdis, UINT8 bestbumper, boolean spbrush);
|
||||
INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed, boolean spbrush, boolean bot, boolean rival);
|
||||
INT32 K_GetShieldFromItem(INT32 item);
|
||||
fixed_t K_GetMobjWeight(mobj_t *mobj, mobj_t *against);
|
||||
void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid);
|
||||
|
|
@ -92,12 +94,5 @@ void K_PlayPainSound(mobj_t *source);
|
|||
void K_PlayHitEmSound(mobj_t *source);
|
||||
void K_PlayPowerGloatSound(mobj_t *source);
|
||||
|
||||
const char *K_GetItemPatch(UINT8 item, boolean tiny);
|
||||
INT32 K_calcSplitFlags(INT32 snapflags);
|
||||
void K_LoadKartHUDGraphics(void);
|
||||
void K_drawKartHUD(void);
|
||||
void K_drawKartFreePlay(UINT32 flashtime);
|
||||
void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, UINT8 mode);
|
||||
|
||||
// =========================================================================
|
||||
#endif // __K_KART__
|
||||
|
|
|
|||
|
|
@ -34,9 +34,15 @@ fixed_t K_RespawnOffset(player_t *player, boolean flip)
|
|||
|
||||
if (flip == true)
|
||||
{
|
||||
player->mo->flags2 |= MF2_OBJECTFLIP;
|
||||
// Lat 24/7/20: Okay so before we even think about applying this flag, check if the sector we're in doesn't already have reverse gravity for that.
|
||||
// Otherwise, we would reverse the reverse gravity and cancel it out. Yes, this is absolutely fucking dumb.
|
||||
// I'm honestly not sure if this flag is even necessary anymore but we'll keep it just in case.
|
||||
|
||||
if (P_GetMobjGravity(player->mo) < 0)
|
||||
player->mo->flags2 |= MF2_OBJECTFLIP;
|
||||
|
||||
player->mo->eflags |= MFE_VERTICALFLIP;
|
||||
z -= (128 * mapobjectscale) - (player->mo->height);
|
||||
z -= ((128 * mapobjectscale) + (player->mo->height));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -75,7 +81,7 @@ static void K_RespawnAtWaypoint(player_t *player, waypoint_t *waypoint)
|
|||
player->respawn.pointx = waypoint->mobj->x;
|
||||
player->respawn.pointy = waypoint->mobj->y;
|
||||
player->respawn.pointz = waypoint->mobj->z;
|
||||
player->respawn.flip = (waypoint->mobj->flags2 & MF2_OBJECTFLIP);
|
||||
player->respawn.flip = (waypoint->mobj->flags2 & MF2_OBJECTFLIP) ? true : false; // K_RespawnOffset wants a boolean!
|
||||
player->respawn.pointz += K_RespawnOffset(player, player->respawn.flip);
|
||||
}
|
||||
|
||||
|
|
@ -309,7 +315,7 @@ static void K_MovePlayerToRespawnPoint(player_t *player)
|
|||
// Reduce by the amount we needed to get to this waypoint
|
||||
stepamt -= dist;
|
||||
|
||||
// We've reached the destination point,
|
||||
// We've reached the destination point,
|
||||
P_UnsetThingPosition(player->mo);
|
||||
player->mo->x = dest.x;
|
||||
player->mo->y = dest.y;
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include "k_kart.h" // SRB2Kart
|
||||
#include "k_battle.h"
|
||||
#include "k_color.h"
|
||||
#include "k_hud.h"
|
||||
#include "d_netcmd.h" // IsPlayerAdmin
|
||||
|
||||
#include "lua_script.h"
|
||||
|
|
|
|||
|
|
@ -56,7 +56,8 @@
|
|||
#include "byteptr.h"
|
||||
#include "st_stuff.h"
|
||||
#include "i_sound.h"
|
||||
#include "k_kart.h" // SRB2kart
|
||||
#include "k_hud.h" // SRB2kart
|
||||
#include "k_kart.h" // KartItemCVars
|
||||
#include "k_pwrlv.h"
|
||||
#include "d_player.h" // KITEM_ constants
|
||||
#include "k_color.h"
|
||||
|
|
|
|||
24
src/p_mobj.c
24
src/p_mobj.c
|
|
@ -1168,26 +1168,6 @@ static void P_PlayerFlip(mobj_t *mo)
|
|||
if (mo->tracer)
|
||||
mo->tracer->eflags ^= MFE_VERTICALFLIP;
|
||||
}
|
||||
else if (mo->player->pflags & PF_FLIPCAM)
|
||||
{
|
||||
UINT8 i;
|
||||
|
||||
mo->player->aiming = InvAngle(mo->player->aiming);
|
||||
|
||||
for (i = 0; i <= r_splitscreen; i++)
|
||||
{
|
||||
if (mo->player-players == displayplayers[i])
|
||||
{
|
||||
localaiming[i] = mo->player->aiming;
|
||||
if (camera[i].chase) {
|
||||
camera[i].aiming = InvAngle(camera[i].aiming);
|
||||
camera[i].z = mo->z - camera[i].z + mo->z;
|
||||
if (mo->eflags & MFE_VERTICALFLIP)
|
||||
camera[i].z += FixedMul(20*FRACUNIT, mo->scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
|
@ -3584,8 +3564,6 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
|
|||
|
||||
if (encoremode)
|
||||
postimg = postimg_mirror;
|
||||
else if (player->pflags & PF_FLIPCAM && !(player->pflags & PF_NIGHTSMODE) && player->mo->eflags & MFE_VERTICALFLIP)
|
||||
postimg = postimg_flip;
|
||||
else if (player->awayviewtics && player->awayviewmobj && !P_MobjWasRemoved(player->awayviewmobj)) // Camera must obviously exist
|
||||
{
|
||||
camera_t dummycam;
|
||||
|
|
@ -7027,8 +7005,6 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
if (mobj->target->eflags & MFE_VERTICALFLIP)
|
||||
{
|
||||
mobj->z = mobj->target->z - FixedMul(16*FRACUNIT, mobj->target->scale) - mobj->height;
|
||||
if (mobj->target->player->pflags & PF_FLIPCAM)
|
||||
mobj->eflags |= MFE_VERTICALFLIP;
|
||||
}
|
||||
else
|
||||
mobj->z = mobj->target->z + (mobj->target->height) + FixedMul(8*FRACUNIT, mobj->target->scale); // Adjust height for height changes
|
||||
|
|
|
|||
33
src/r_main.c
33
src/r_main.c
|
|
@ -151,10 +151,6 @@ static void ChaseCam_OnChange(void);
|
|||
static void ChaseCam2_OnChange(void);
|
||||
static void ChaseCam3_OnChange(void);
|
||||
static void ChaseCam4_OnChange(void);
|
||||
static void FlipCam_OnChange(void);
|
||||
static void FlipCam2_OnChange(void);
|
||||
static void FlipCam3_OnChange(void);
|
||||
static void FlipCam4_OnChange(void);
|
||||
void SendWeaponPref(void);
|
||||
void SendWeaponPref2(void);
|
||||
void SendWeaponPref3(void);
|
||||
|
|
@ -165,10 +161,6 @@ consvar_t cv_chasecam = {"chasecam", "On", CV_CALL, CV_OnOff, ChaseCam_OnChange,
|
|||
consvar_t cv_chasecam2 = {"chasecam2", "On", CV_CALL, CV_OnOff, ChaseCam2_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_chasecam3 = {"chasecam3", "On", CV_CALL, CV_OnOff, ChaseCam3_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_chasecam4 = {"chasecam4", "On", CV_CALL, CV_OnOff, ChaseCam4_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_flipcam = {"flipcam", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_flipcam2 = {"flipcam2", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam2_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_flipcam3 = {"flipcam3", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam3_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_flipcam4 = {"flipcam4", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam4_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_shadow = {"shadow", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_skybox = {"skybox", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
|
@ -283,26 +275,6 @@ static void ChaseCam4_OnChange(void)
|
|||
CV_SetValue(&cv_analog4, 1);*/
|
||||
}
|
||||
|
||||
static void FlipCam_OnChange(void)
|
||||
{
|
||||
SendWeaponPref();
|
||||
}
|
||||
|
||||
static void FlipCam2_OnChange(void)
|
||||
{
|
||||
SendWeaponPref2();
|
||||
}
|
||||
|
||||
static void FlipCam3_OnChange(void)
|
||||
{
|
||||
SendWeaponPref3();
|
||||
}
|
||||
|
||||
static void FlipCam4_OnChange(void)
|
||||
{
|
||||
SendWeaponPref4();
|
||||
}
|
||||
|
||||
//
|
||||
// R_PointOnSide
|
||||
// Traverse BSP (sub) tree,
|
||||
|
|
@ -1488,11 +1460,6 @@ void R_RegisterEngineStuff(void)
|
|||
CV_RegisterVar(&cv_soniccd);
|
||||
CV_RegisterVar(&cv_allowmlook);
|
||||
CV_RegisterVar(&cv_homremoval);
|
||||
CV_RegisterVar(&cv_flipcam);
|
||||
CV_RegisterVar(&cv_flipcam2);
|
||||
CV_RegisterVar(&cv_flipcam3);
|
||||
CV_RegisterVar(&cv_flipcam4);
|
||||
|
||||
// Enough for dedicated server
|
||||
if (dedicated)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -75,7 +75,6 @@ boolean R_DoCulling(line_t *cullheight, line_t *viewcullheight, fixed_t vz, fixe
|
|||
extern consvar_t cv_showhud, cv_translucenthud;
|
||||
extern consvar_t cv_homremoval;
|
||||
extern consvar_t cv_chasecam, cv_chasecam2, cv_chasecam3, cv_chasecam4;
|
||||
extern consvar_t cv_flipcam, cv_flipcam2, cv_flipcam3, cv_flipcam4;
|
||||
extern consvar_t cv_shadow;
|
||||
extern consvar_t /*cv_precipdensity,*/ cv_drawdist, /*cv_drawdist_nights,*/ cv_drawdist_precip;
|
||||
extern consvar_t cv_fov;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
#include "m_menu.h"
|
||||
#include "m_cheat.h"
|
||||
#include "p_setup.h" // NiGHTS grading
|
||||
#include "k_kart.h" // SRB2kart
|
||||
#include "k_hud.h" // SRB2kart
|
||||
|
||||
//random index
|
||||
#include "m_random.h"
|
||||
|
|
@ -699,7 +699,7 @@ static inline void ST_drawRings(void) // SRB2kart - unused.
|
|||
/*
|
||||
static void ST_drawLives(void) // SRB2kart - unused.
|
||||
{
|
||||
const INT32 v_splitflag = (splitscreen && stplyr == &players[displayplayers[0]] ? V_SPLITSCREEN : 0);
|
||||
const INT32 v_splitflag = V_SPLITSCREEN;
|
||||
|
||||
if (!stplyr->skincolor)
|
||||
return; // Just joined a server, skin isn't loaded yet!
|
||||
|
|
@ -1920,11 +1920,11 @@ static void ST_overlayDrawer(void)
|
|||
|
||||
INT32 y = (stplyr == &players[displayplayers[0]]) ? 4 : BASEVIDHEIGHT/2-12;
|
||||
sprintf(name, "VIEWPOINT: %s", player_names[stplyr-players]);
|
||||
V_DrawRightAlignedThinString(BASEVIDWIDTH-40, y, V_HUDTRANSHALF|V_ALLOWLOWERCASE|K_calcSplitFlags(V_SNAPTOTOP|V_SNAPTOBOTTOM|V_SNAPTORIGHT), name);
|
||||
V_DrawRightAlignedThinString(BASEVIDWIDTH-40, y, V_HUDTRANSHALF|V_ALLOWLOWERCASE|V_SNAPTOTOP|V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_SPLITSCREEN, name);
|
||||
}
|
||||
else if (r_splitscreen)
|
||||
{
|
||||
V_DrawCenteredThinString((vid.width/vid.dupx)/4, BASEVIDHEIGHT/2 - 12, V_HUDTRANSHALF|V_ALLOWLOWERCASE|K_calcSplitFlags(V_SNAPTOBOTTOM|V_SNAPTOLEFT), player_names[stplyr-players]);
|
||||
V_DrawCenteredThinString((vid.width/vid.dupx)/4, BASEVIDHEIGHT/2 - 12, V_HUDTRANSHALF|V_ALLOWLOWERCASE|V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_SPLITSCREEN, player_names[stplyr-players]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2000,16 +2000,15 @@ static void ST_overlayDrawer(void)
|
|||
// SRB2kart: changed positions & text
|
||||
if (r_splitscreen)
|
||||
{
|
||||
INT32 splitflags = K_calcSplitFlags(0);
|
||||
V_DrawThinString(2, (BASEVIDHEIGHT/2)-20, V_YELLOWMAP|V_HUDTRANSHALF|splitflags, M_GetText("- SPECTATING -"));
|
||||
V_DrawThinString(2, (BASEVIDHEIGHT/2)-10, V_HUDTRANSHALF|splitflags, itemtxt);
|
||||
V_DrawThinString(2, (BASEVIDHEIGHT/2)-20, V_YELLOWMAP|V_HUDTRANSHALF|V_SPLITSCREEN, M_GetText("- SPECTATING -"));
|
||||
V_DrawThinString(2, (BASEVIDHEIGHT/2)-10, V_HUDTRANSHALF|V_SPLITSCREEN, itemtxt);
|
||||
}
|
||||
else
|
||||
{
|
||||
V_DrawString(2, BASEVIDHEIGHT-40, V_HUDTRANSHALF|V_YELLOWMAP, M_GetText("- SPECTATING -"));
|
||||
V_DrawString(2, BASEVIDHEIGHT-30, V_HUDTRANSHALF, itemtxt);
|
||||
V_DrawString(2, BASEVIDHEIGHT-20, V_HUDTRANSHALF, M_GetText("Accelerate - Float"));
|
||||
V_DrawString(2, BASEVIDHEIGHT-10, V_HUDTRANSHALF, M_GetText("Brake - Sink"));
|
||||
V_DrawString(2, BASEVIDHEIGHT-40, V_HUDTRANSHALF|V_SPLITSCREEN|V_YELLOWMAP, M_GetText("- SPECTATING -"));
|
||||
V_DrawString(2, BASEVIDHEIGHT-30, V_HUDTRANSHALF|V_SPLITSCREEN, itemtxt);
|
||||
V_DrawString(2, BASEVIDHEIGHT-20, V_HUDTRANSHALF|V_SPLITSCREEN, M_GetText("Accelerate - Float"));
|
||||
V_DrawString(2, BASEVIDHEIGHT-10, V_HUDTRANSHALF|V_SPLITSCREEN, M_GetText("Brake - Sink"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@
|
|||
#include "m_random.h"
|
||||
#include "doomstat.h"
|
||||
|
||||
#include "k_hud.h"
|
||||
|
||||
#ifdef HWRENDER
|
||||
#include "hardware/hw_main.h"
|
||||
#endif
|
||||
|
|
@ -608,12 +610,6 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t
|
|||
y -= offsety;
|
||||
}
|
||||
|
||||
if (scrn & V_SPLITSCREEN)
|
||||
y += (BASEVIDHEIGHT/2)<<FRACBITS;
|
||||
|
||||
if (scrn & V_HORZSCREEN)
|
||||
x += (BASEVIDWIDTH/2)<<FRACBITS;
|
||||
|
||||
desttop = screens[scrn&V_PARAMMASK];
|
||||
|
||||
if (!desttop)
|
||||
|
|
@ -637,38 +633,7 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t
|
|||
// Center it if necessary
|
||||
if (!(scrn & V_SCALEPATCHMASK))
|
||||
{
|
||||
// if it's meant to cover the whole screen, black out the rest
|
||||
// BAD, BAD, BAD, FUCK OFF, STOP, EW, AAAAAAA
|
||||
// This does NOT account for transparent pixels
|
||||
/*if (x == 0 && FixedMul(SHORT(patch->width)<<FRACBITS, pscale)>>FRACBITS == BASEVIDWIDTH
|
||||
&& y == 0 && FixedMul(SHORT(patch->height)<<FRACBITS, pscale)>>FRACBITS == BASEVIDHEIGHT)
|
||||
{
|
||||
column = (const column_t *)((const UINT8 *)(patch) + LONG(patch->columnofs[0]));
|
||||
source = (const UINT8 *)(column) + 3;
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (column->topdelta == 0xff ? 31 : source[0]));
|
||||
}*/
|
||||
|
||||
if (vid.width != BASEVIDWIDTH * dupx)
|
||||
{
|
||||
// dupx adjustments pretend that screen width is BASEVIDWIDTH * dupx,
|
||||
// so center this imaginary screen
|
||||
if ((scrn & (V_HORZSCREEN|V_SNAPTOLEFT)) == (V_HORZSCREEN|V_SNAPTOLEFT))
|
||||
x += (vid.width/2 - (BASEVIDWIDTH/2 * dupx));
|
||||
else if (scrn & V_SNAPTORIGHT)
|
||||
x += (vid.width - (BASEVIDWIDTH * dupx));
|
||||
else if (!(scrn & V_SNAPTOLEFT))
|
||||
x += (vid.width - (BASEVIDWIDTH * dupx)) / 2;
|
||||
}
|
||||
if (vid.height != BASEVIDHEIGHT * dupy)
|
||||
{
|
||||
// same thing here
|
||||
if ((scrn & (V_SPLITSCREEN|V_SNAPTOTOP)) == (V_SPLITSCREEN|V_SNAPTOTOP))
|
||||
y += (vid.height/2 - (BASEVIDHEIGHT/2 * dupy));
|
||||
else if (scrn & V_SNAPTOBOTTOM)
|
||||
y += (vid.height - (BASEVIDHEIGHT * dupy));
|
||||
else if (!(scrn & V_SNAPTOTOP))
|
||||
y += (vid.height - (BASEVIDHEIGHT * dupy)) / 2;
|
||||
}
|
||||
K_AdjustXYWithSnap(&x, &y, scrn, dupx, dupy);
|
||||
}
|
||||
|
||||
desttop += (y*vid.width) + x;
|
||||
|
|
@ -923,31 +888,12 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c)
|
|||
h *= dupy;
|
||||
|
||||
// Center it if necessary
|
||||
if (vid.width != BASEVIDWIDTH * dupx)
|
||||
{
|
||||
// dupx adjustments pretend that screen width is BASEVIDWIDTH * dupx,
|
||||
// so center this imaginary screen
|
||||
if (c & V_SNAPTORIGHT)
|
||||
x += (vid.width - (BASEVIDWIDTH * dupx));
|
||||
else if (!(c & V_SNAPTOLEFT))
|
||||
x += (vid.width - (BASEVIDWIDTH * dupx)) / 2;
|
||||
}
|
||||
if (vid.height != BASEVIDHEIGHT * dupy)
|
||||
{
|
||||
// same thing here
|
||||
if (c & V_SNAPTOBOTTOM)
|
||||
y += (vid.height - (BASEVIDHEIGHT * dupy));
|
||||
else if (!(c & V_SNAPTOTOP))
|
||||
y += (vid.height - (BASEVIDHEIGHT * dupy)) / 2;
|
||||
}
|
||||
if (c & V_SPLITSCREEN)
|
||||
y += (BASEVIDHEIGHT * dupy)/2;
|
||||
if (c & V_HORZSCREEN)
|
||||
x += (BASEVIDWIDTH * dupx)/2;
|
||||
K_AdjustXYWithSnap(&x, &y, c, dupx, dupy);
|
||||
}
|
||||
|
||||
if (x >= vid.width || y >= vid.height)
|
||||
return; // off the screen
|
||||
|
||||
if (x < 0)
|
||||
{
|
||||
w += x;
|
||||
|
|
@ -1151,27 +1097,7 @@ void V_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 c)
|
|||
wh *= dupx;
|
||||
|
||||
// Center it if necessary
|
||||
if (vid.width != BASEVIDWIDTH * dupx)
|
||||
{
|
||||
// dupx adjustments pretend that screen width is BASEVIDWIDTH * dupx,
|
||||
// so center this imaginary screen
|
||||
if (c & V_SNAPTORIGHT)
|
||||
x += (vid.width - (BASEVIDWIDTH * dupx));
|
||||
else if (!(c & V_SNAPTOLEFT))
|
||||
x += (vid.width - (BASEVIDWIDTH * dupx)) / 2;
|
||||
}
|
||||
if (vid.height != BASEVIDHEIGHT * dupy)
|
||||
{
|
||||
// same thing here
|
||||
if (c & V_SNAPTOBOTTOM)
|
||||
y += (vid.height - (BASEVIDHEIGHT * dupy));
|
||||
else if (!(c & V_SNAPTOTOP))
|
||||
y += (vid.height - (BASEVIDHEIGHT * dupy)) / 2;
|
||||
}
|
||||
if (c & V_SPLITSCREEN)
|
||||
y += (BASEVIDHEIGHT * dupy)/2;
|
||||
if (c & V_HORZSCREEN)
|
||||
x += (BASEVIDWIDTH * dupx)/2;
|
||||
K_AdjustXYWithSnap(&x, &y, c, dupx, dupy);
|
||||
}
|
||||
|
||||
if (x >= vid.width || y >= vid.height)
|
||||
|
|
|
|||
|
|
@ -129,9 +129,9 @@ extern UINT8 hudtrans;
|
|||
#define V_WRAPX 0x08000000 // Don't clamp texture on X (for HW mode)
|
||||
#define V_WRAPY 0x10000000 // Don't clamp texture on Y (for HW mode)
|
||||
|
||||
#define V_NOSCALESTART 0x20000000 // don't scale x, y, start coords
|
||||
#define V_SPLITSCREEN 0x40000000
|
||||
#define V_HORZSCREEN 0x80000000
|
||||
#define V_NOSCALESTART 0x20000000 // don't scale x, y, start coords
|
||||
#define V_SPLITSCREEN 0x40000000 // Add half of screen width or height automatically depending on player number
|
||||
#define V_SLIDEIN 0x80000000 // Slide in from the sides on level load, depending on snap flags
|
||||
|
||||
// defines for old functions
|
||||
#define V_DrawPatch(x,y,s,p) V_DrawFixedPatch((x)<<FRACBITS, (y)<<FRACBITS, FRACUNIT, s|V_NOSCALESTART|V_NOSCALEPATCH, p, NULL)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue