- moved Duke/RR's tile name list to raze.pk3, now that internally it is not used anymore.

This way it can later also be used by editors.
This commit is contained in:
Christoph Oelckers 2023-01-01 13:58:54 +01:00
parent 44f4104eda
commit 6fd4368592
10 changed files with 2729 additions and 2836 deletions

View file

@ -214,6 +214,24 @@ void TilesetBuildInfo::MakeCanvas(int tilenum, int width, int height)
tile[tilenum].tileimage = nullptr;
}
void LoadAliases(int firsttileid, int maxarttile)
{
int lump, lastlump = 0;
while ((lump = fileSystem.FindLump("TEXNAMES", &lastlump, false)) != -1)
{
FScanner sc;
sc.OpenLumpNum(lump);
while (sc.GetNumber())
{
int tile = sc.Number;
if (tile < 0 || tile > maxarttile) tile = maxarttile;
sc.MustGetStringName("=");
sc.MustGetString();
TexMan.AddAlias(sc.String, FSetTextureID(firsttileid + tile));
}
}
}
//==========================================================================
//
//
@ -317,6 +335,8 @@ void ConstructTileset()
texExtInfo[i + firstarttile] = info.tile[i].extinfo;
}
LoadAliases(firstarttile, maxarttile);
for (auto& a : info.aliases)
{
TexMan.AddAlias(a.first.GetChars(), min(maxarttile, a.second) + firstarttile);

View file

@ -9,29 +9,22 @@ constexpr int REALGAMETICSPERSEC = 30; // The number of game state updates per s
constexpr int TICSPERFRAME = (TICRATE / REALGAMETICSPERSEC); // (This used to be TICRATE/GAMETICSPERSEC, which was 120/26 = 4.615~ truncated to 4 by integer division.)
// tile names which are identical for all games.
enum
// the few remaining tile numbers we still need, mainly for the init code.
enum EFixedTiles
{
SECTOREFFECTOR = 1,
ACTIVATOR = 2,
TOUCHPLATE = 3,
ACTIVATORLOCKED = 4,
MUSICANDSFX = 5,
LOCATORS = 6,
CYCLER = 7,
MASTERSWITCH = 8,
RESPAWN = 9,
GPSPEED = 10,
FOF = 13,
MIRROR_DUKE = 560,
MIRROR_RR = 1089,
SCRAP_DUKE = 2390,
SCRAP_RR = 1595,
VIEWSCREEN_DUKE = 502,
VIEWSCREEN_RR = 1055,
BOWLINGLANE = 2025,
// 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.
// Once we can do texture management without tile numbers this can be done as a regular texture without a valid tile index.
TILE_VIEWSCR = CYCLER
TILE_VIEWSCR = 7
};

View file

@ -275,35 +275,8 @@ static void setupbackdrop()
}
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
#define x(a, b) registerName(#a, b);
#define y(a, b) registerName(#a, b);
static void SetTileNames(TilesetBuildInfo& info)
{
auto registerName = [&](const char* name, int index)
{
info.addName(name, index);
};
if (!isRR())
{
#include "namelist_d.h"
}
else
{
#include "namelist_r.h"
}
}
#undef x
#undef y
void GameInterface::SetupSpecialTextures(TilesetBuildInfo& info)
{
SetTileNames(info);
// set up all special tiles here, before we fully hook up with the texture manager.
info.Delete(FOF); // portal marker
@ -311,17 +284,17 @@ void GameInterface::SetupSpecialTextures(TilesetBuildInfo& info)
if (!isRR())
{
info.Delete(MIRROR_DUKE); // the mirror tile.
viewscreen = info.tile[502].tileimage;
viewscreen = info.tile[VIEWSCREEN_DUKE].tileimage;
}
else
{
info.Delete(MIRROR_RR); // the mirror tile.
info.Delete(0); // RR uses this as an empty texture
info.MakeWritable(2025); // bowling lane pin displays
info.MakeWritable(2026);
info.MakeWritable(2027);
info.MakeWritable(2028);
viewscreen = info.tile[1055].tileimage;
info.MakeWritable(BOWLINGLANE); // bowling lane pin displays
info.MakeWritable(BOWLINGLANE + 1);
info.MakeWritable(BOWLINGLANE + 2);
info.MakeWritable(BOWLINGLANE + 3);
viewscreen = info.tile[VIEWSCREEN_RR].tileimage;
}
info.MakeCanvas(TILE_VIEWSCR, viewscreen? viewscreen->GetWidth() : 128, viewscreen? viewscreen->GetHeight() : 128);
}

View file

@ -1064,7 +1064,7 @@ void displayweapon_d(int snum, double interpfrac)
offsets.Y += 16;
hud_drawpal(210 + offsets.X, 261 + offsets.Y, "FLAMETHROWERLOW", -32, o, pal, angle);
hud_drawpal(210 + offsets.X, 261 + offsets.Y, "FLAMETHROWERFIRE", -32, o, pal, angle);
hud_drawpal(210 + offsets.X, 235 + offsets.Y, cat[cat_frames[*kb % 6]], -32, o, pal, angle);
}
};

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,38 +0,0 @@
//-------------------------------------------------------------------------
/*
Copyright (C) 1996, 2003 - 3D Realms Entertainment
This file is part of Duke Nukem 3D version 1.5 - Atomic Edition
Duke Nukem 3D is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Original Source: 1996 - Todd Replogle
Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
*/
//-------------------------------------------------------------------------
#pragma once
BEGIN_DUKE_NS
#define x(a, b) DTILE_##a = b,
#define y(a, b) DTILE_##a = b,
enum
{
#include "namelist_d.h"
};
#undef x
END_DUKE_NS

View file

@ -1,43 +0,0 @@
//-------------------------------------------------------------------------
/*
Copyright (C) 1996, 2003 - 3D Realms Entertainment
Copyright (C) 2017-2019 Nuke.YKT
This file is part of Duke Nukem 3D version 1.5 - Atomic Edition
Duke Nukem 3D is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Original Source: 1996 - Todd Replogle
Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
*/
//-------------------------------------------------------------------------
#pragma once
BEGIN_DUKE_NS
#define x(a, b) RTILE_##a = b,
#define y(a, b) RTILE_##a = b,
enum
{
#include "namelist_r.h"
};
#undef x
#undef y
END_DUKE_NS

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff