mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-24 17:52:29 +00:00
- got rid of the last tilenum uses in Duke.
This meant refactoring the crosshair drawer to work on a named texture called "CROSSHAIR" and hard coding the magic numbers for spawndebris.
This commit is contained in:
parent
bb08a118d9
commit
44f4104eda
32 changed files with 17 additions and 44 deletions
|
@ -1422,17 +1422,17 @@ void ST_LoadCrosshair(int num, bool alwaysload);
|
|||
CVAR(Int, crosshair, 0, CVAR_ARCHIVE)
|
||||
|
||||
|
||||
void DrawCrosshair(int deftile, int health, double xdelta, double ydelta, double scale, DAngle angle, PalEntry color)
|
||||
void DrawCrosshair(int health, double xdelta, double ydelta, double scale, DAngle angle, PalEntry color)
|
||||
{
|
||||
if (automapMode == am_off && cl_crosshair)
|
||||
{
|
||||
if (deftile < MAXTILES && crosshair == 0)
|
||||
if (crosshair == 0)
|
||||
{
|
||||
auto tile = tileGetTexture(deftile);
|
||||
if (tile)
|
||||
auto tex = TexMan.FindGameTexture("CROSSHAIR", ETextureType::Any);
|
||||
if (tex && tex->isValid())
|
||||
{
|
||||
double crosshair_scale = crosshairscale > 0.0f ? crosshairscale * scale : 1.;
|
||||
DrawTexture(twod, tile, 160 + xdelta, 100 + ydelta, DTA_Color, color, DTA_Rotate, angle.Degrees(),
|
||||
DrawTexture(twod, tex, 160 + xdelta, 100 + ydelta, DTA_Color, color, DTA_Rotate, angle.Degrees(),
|
||||
DTA_FullscreenScale, FSMode_Fit320x200, DTA_ScaleX, crosshair_scale, DTA_ScaleY, crosshair_scale, DTA_CenterOffsetRel, true,
|
||||
DTA_ViewportX, viewport3d.Left(), DTA_ViewportY, viewport3d.Top(), DTA_ViewportWidth, viewport3d.Width(), DTA_ViewportHeight, viewport3d.Height(), TAG_DONE);
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ void CONFIG_ReadCombatMacros();
|
|||
int GameMain();
|
||||
int GetAutomapZoom(int gZoom);
|
||||
|
||||
void DrawCrosshair(int deftile, int health, double xdelta, double ydelta, double scale, DAngle angle, PalEntry color = 0xffffffff);
|
||||
void DrawCrosshair(int health, double xdelta, double ydelta, double scale, DAngle angle, PalEntry color = 0xffffffff);
|
||||
void updatePauseStatus();
|
||||
void DeferredStartGame(MapRecord* map, int skill, bool nostopsound = false);
|
||||
void ChangeLevel(MapRecord* map, int skill, bool bossexit = false);
|
||||
|
|
|
@ -4,7 +4,7 @@ x(BackTile, 253)
|
|||
x(Monolithscreen, 2050)
|
||||
x(GTIScreen, 2052)
|
||||
|
||||
x(CrosshairTile, 2319)
|
||||
x(Crosshair, 2319)
|
||||
x(LoadScreen, 2049)
|
||||
x(LoadScreenWideBack, 9216)
|
||||
x(LoadScreenWideLeft, 9217)
|
||||
|
|
|
@ -704,7 +704,7 @@ void viewDrawScreen(bool sceneonly)
|
|||
|
||||
if (sceneonly) return;
|
||||
auto offsets = pPlayer->Angles.getCrosshairOffsets(interpfrac);
|
||||
DrawCrosshair(kCrosshairTile, pPlayer->actor->xspr.health >> 4, offsets.first.X, offsets.first.Y, 2, offsets.second);
|
||||
DrawCrosshair(pPlayer->actor->xspr.health >> 4, offsets.first.X, offsets.first.Y, 2, offsets.second);
|
||||
#if 0 // This currently does not work. May have to be redone as a hardware effect.
|
||||
if (v4 && gNetPlayers > 1)
|
||||
{
|
||||
|
|
|
@ -36,7 +36,6 @@ This file contains parts of DukeGDX by Alexander Makarov-[M210] (m210-2007@mail.
|
|||
|
||||
#include "ns.h"
|
||||
#include "global.h"
|
||||
#include "names_d.h"
|
||||
#include "serializer.h"
|
||||
#include "dukeactor.h"
|
||||
#include "texturemanager.h"
|
||||
|
|
|
@ -27,7 +27,6 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
|
|||
//-------------------------------------------------------------------------
|
||||
#include "ns.h"
|
||||
#include "global.h"
|
||||
#include "names_r.h"
|
||||
#include "serializer.h"
|
||||
#include "savegamehelp.h"
|
||||
#include "dukeactor.h"
|
||||
|
|
|
@ -28,7 +28,6 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
|
|||
|
||||
#include "ns.h"
|
||||
#include "global.h"
|
||||
#include "names_r.h"
|
||||
#include "mapinfo.h"
|
||||
#include "dukeactor.h"
|
||||
|
||||
|
|
|
@ -36,7 +36,6 @@ source as it is released.
|
|||
#include "ns.h"
|
||||
#include "global.h"
|
||||
#include "prediction.h"
|
||||
#include "names_d.h"
|
||||
#include "dukeactor.h"
|
||||
#include "gamefuncs.h"
|
||||
#include "models/modeldata.h"
|
||||
|
|
|
@ -29,7 +29,6 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
|
|||
|
||||
#include "ns.h"
|
||||
#include "global.h"
|
||||
#include "names_r.h"
|
||||
#include "prediction.h"
|
||||
#include "dukeactor.h"
|
||||
#include "gamefuncs.h"
|
||||
|
|
|
@ -28,7 +28,6 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
|
|||
|
||||
#include "ns.h"
|
||||
#include "global.h"
|
||||
#include "names_r.h"
|
||||
#include "dukeactor.h"
|
||||
#include "buildtiles.h"
|
||||
#include "texturemanager.h"
|
||||
|
|
|
@ -25,6 +25,8 @@ enum
|
|||
FOF = 13,
|
||||
MIRROR_DUKE = 560,
|
||||
MIRROR_RR = 1089,
|
||||
SCRAP_DUKE = 2390,
|
||||
SCRAP_RR = 1595,
|
||||
|
||||
// hack alert! CYCLER is free for use here as all items of this type get destroyed right on map spawn and this value never gets checked anywhere else.
|
||||
// This avoids overallocation of empty tile slots as a high value slightly below the tile limit would do.
|
||||
|
|
|
@ -123,7 +123,4 @@ void SetDispatcher()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
int TILE_CROSSHAIR;
|
||||
|
||||
END_DUKE_NS
|
||||
|
|
|
@ -34,7 +34,6 @@ source as it is released.
|
|||
|
||||
#include "ns.h"
|
||||
#include "global.h"
|
||||
#include "names_d.h"
|
||||
|
||||
BEGIN_DUKE_NS
|
||||
|
||||
|
@ -55,10 +54,6 @@ void initactorflags_d()
|
|||
gs.weaponsandammosprites[12] = DukeRPGAmmoClass;
|
||||
gs.weaponsandammosprites[13] = DukeFreezeSpriteClass;
|
||||
gs.weaponsandammosprites[14] = DukeFreezeAmmoClass;
|
||||
gs.firstdebris = DTILE_SCRAP6;
|
||||
|
||||
TILE_CROSSHAIR = DTILE_CROSSHAIR;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ Prepared for public release, 03/21/2003 - Charlie Wiederhold, 3D Realms
|
|||
|
||||
#include "ns.h"
|
||||
#include "global.h"
|
||||
#include "names_r.h"
|
||||
|
||||
BEGIN_DUKE_NS
|
||||
|
||||
|
@ -50,9 +49,6 @@ void initactorflags_r()
|
|||
gs.weaponsandammosprites[13] = RedneckTitgunClass;
|
||||
gs.weaponsandammosprites[14] = RedneckTitAmmoClass;
|
||||
|
||||
TILE_CROSSHAIR = RTILE_CROSSHAIR;
|
||||
|
||||
gs.firstdebris = RTILE_SCRAP6;
|
||||
gs.gutsscale = 0.125;
|
||||
}
|
||||
|
||||
|
|
|
@ -286,7 +286,7 @@ void drawoverlays(double interpfrac)
|
|||
if (ps[myconnectindex].newOwner == nullptr && ud.cameraactor == nullptr)
|
||||
{
|
||||
auto offsets = pp->Angles.getCrosshairOffsets(interpfrac);
|
||||
DrawCrosshair(TILE_CROSSHAIR, ps[screenpeek].last_extra, offsets.first.X, offsets.first.Y + (pp->over_shoulder_on ? 2.5 : 0), isRR() ? 0.5 : 1, offsets.second);
|
||||
DrawCrosshair(ps[screenpeek].last_extra, offsets.first.X, offsets.first.Y + (pp->over_shoulder_on ? 2.5 : 0), isRR() ? 0.5 : 1, offsets.second);
|
||||
}
|
||||
|
||||
if (paused == 2)
|
||||
|
|
|
@ -1920,7 +1920,7 @@ int ParseState::parse(void)
|
|||
break;
|
||||
case concmd_debris:
|
||||
insptr++;
|
||||
spawndebris(g_ac, *insptr - gs.firstdebris, *(insptr + 1));
|
||||
spawndebris(g_ac, *insptr - (isRR() ? SCRAP_RR : SCRAP_DUKE), *(insptr + 1)); // must subtract the index of the first scrap tile.
|
||||
insptr += 2;
|
||||
break;
|
||||
case concmd_count:
|
||||
|
|
|
@ -41,7 +41,6 @@ source as it is released.
|
|||
#include "mapinfo.h"
|
||||
|
||||
// This currently only works for WW2GI.
|
||||
#include "names_d.h"
|
||||
|
||||
BEGIN_DUKE_NS
|
||||
|
||||
|
|
|
@ -38,8 +38,7 @@ struct DukeGameInfo
|
|||
int lasermode;
|
||||
int freezerhurtowner;
|
||||
int impact_damage;
|
||||
int firstdebris;
|
||||
|
||||
|
||||
ActorInfo actorinfo[MAXTILES];
|
||||
int16_t max_ammo_amount[MAX_WEAPONS];
|
||||
PClassActor* weaponsandammosprites[15];
|
||||
|
|
|
@ -34,7 +34,6 @@ source as it is released.
|
|||
|
||||
#include "ns.h"
|
||||
#include "global.h"
|
||||
#include "names_d.h"
|
||||
#include "dukeactor.h"
|
||||
#include "buildtiles.h"
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
|
|||
|
||||
#include "ns.h"
|
||||
#include "global.h"
|
||||
#include "names_r.h"
|
||||
#include "dukeactor.h"
|
||||
|
||||
BEGIN_DUKE_NS
|
||||
|
|
|
@ -36,7 +36,6 @@ source as it is released.
|
|||
#include "ns.h"
|
||||
#include "global.h"
|
||||
#include "gamevar.h"
|
||||
#include "names_d.h"
|
||||
#include "dukeactor.h"
|
||||
|
||||
BEGIN_DUKE_NS
|
||||
|
|
|
@ -28,7 +28,6 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
|
|||
|
||||
#include "ns.h"
|
||||
#include "global.h"
|
||||
#include "names_r.h"
|
||||
#include "mapinfo.h"
|
||||
#include "dukeactor.h"
|
||||
|
||||
|
|
|
@ -36,7 +36,6 @@ source as it is released.
|
|||
#include "ns.h"
|
||||
#include "global.h"
|
||||
#include "gamevar.h"
|
||||
#include "names_d.h"
|
||||
#include "dukeactor.h"
|
||||
|
||||
BEGIN_DUKE_NS
|
||||
|
|
|
@ -35,7 +35,6 @@ source as it is released.
|
|||
#include "ns.h"
|
||||
#include "global.h"
|
||||
#include "build.h"
|
||||
#include "names_d.h"
|
||||
#include "dukeactor.h"
|
||||
#include "precache.h"
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
|
|||
|
||||
#include "ns.h"
|
||||
#include "global.h"
|
||||
#include "names_r.h"
|
||||
#include "mapinfo.h"
|
||||
#include "dukeactor.h"
|
||||
#include "precache.h"
|
||||
|
|
|
@ -35,7 +35,6 @@ source as it is released.
|
|||
#include "ns.h"
|
||||
#include "global.h"
|
||||
#include "sounds.h"
|
||||
#include "names_d.h"
|
||||
#include "mapinfo.h"
|
||||
#include "dukeactor.h"
|
||||
#include "secrets.h"
|
||||
|
|
|
@ -29,7 +29,6 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
|
|||
#include "ns.h"
|
||||
#include "global.h"
|
||||
#include "sounds.h"
|
||||
#include "names_r.h"
|
||||
#include "mapinfo.h"
|
||||
#include "dukeactor.h"
|
||||
#include "secrets.h"
|
||||
|
|
|
@ -43,7 +43,6 @@ source as it is released.
|
|||
#include "mapinfo.h"
|
||||
#include "raze_sound.h"
|
||||
#include "gamestate.h"
|
||||
#include "names_d.h"
|
||||
#include "i_music.h"
|
||||
#include "vm.h"
|
||||
#include "s_music.h"
|
||||
|
|
|
@ -80,7 +80,7 @@ void GameInterface::Render()
|
|||
{
|
||||
DrawStatusBar();
|
||||
auto offsets = PlayerList[nLocalPlayer].Angles.getCrosshairOffsets(interpfrac);
|
||||
DrawCrosshair(kCrosshairTile, PlayerList[nLocalPlayer].nHealth >> 3, offsets.first.X, offsets.first.Y, 1, offsets.second);
|
||||
DrawCrosshair(PlayerList[nLocalPlayer].nHealth >> 3, offsets.first.X, offsets.first.Y, 1, offsets.second);
|
||||
|
||||
if (paused && !M_Active())
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@ x(AmmoSpriteGrenade, 878)
|
|||
x(AmmoSpriteFuel, 879)
|
||||
x(AmmoSpriteM60_1, 881)
|
||||
x(WeaponSpriteCobra, 899)
|
||||
x(CrosshairTile, 1579)
|
||||
x(Crosshair, 1579)
|
||||
x(SkullJaw, 3437)
|
||||
x(PowerslaveLogo, 3442)
|
||||
x(AmmoSpriteCobra, 3457)
|
||||
|
|
|
@ -1014,7 +1014,7 @@ void PrintSpriteInfo(PLAYER* pp)
|
|||
static void DrawCrosshair(PLAYER* pp, const double interpfrac)
|
||||
{
|
||||
auto offsets = pp->Angles.getCrosshairOffsets(interpfrac);
|
||||
::DrawCrosshair(2326, pp->actor->user.Health, offsets.first.X, offsets.first.Y + ((pp->Flags & PF_VIEW_FROM_OUTSIDE) ? 5 : 0), 2, offsets.second, shadeToLight(10));
|
||||
::DrawCrosshair(pp->actor->user.Health, offsets.first.X, offsets.first.Y + ((pp->Flags & PF_VIEW_FROM_OUTSIDE) ? 5 : 0), 2, offsets.second, shadeToLight(10));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
|
@ -280,6 +280,7 @@ x(COMPASS_MID_TIC2, 2391)
|
|||
x(FAF_PORTAL, 341)
|
||||
x(FAF_PORTAL2, 342)
|
||||
x(SYBEXSCREEN, 5261)
|
||||
x(CROSSHAIR, 2326)
|
||||
|
||||
// stuff bunnies like
|
||||
x(DARKGRASS, 153)
|
||||
|
|
Loading…
Reference in a new issue