2008-01-11 22:38:10 +00:00
|
|
|
/*
|
|
|
|
** Enhanced heads up 'overlay' for fullscreen
|
|
|
|
**
|
|
|
|
**---------------------------------------------------------------------------
|
|
|
|
** Copyright 2003-2008 Christoph Oelckers
|
|
|
|
** All rights reserved.
|
|
|
|
**
|
|
|
|
** Redistribution and use in source and binary forms, with or without
|
|
|
|
** modification, are permitted provided that the following conditions
|
|
|
|
** are met:
|
|
|
|
**
|
|
|
|
** 1. Redistributions of source code must retain the above copyright
|
|
|
|
** notice, this list of conditions and the following disclaimer.
|
|
|
|
** 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
** notice, this list of conditions and the following disclaimer in the
|
|
|
|
** documentation and/or other materials provided with the distribution.
|
|
|
|
** 3. The name of the author may not be used to endorse or promote products
|
|
|
|
** derived from this software without specific prior written permission.
|
|
|
|
**
|
|
|
|
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
**---------------------------------------------------------------------------
|
|
|
|
**
|
|
|
|
*/
|
|
|
|
|
|
|
|
// NOTE: Some stuff in here might seem a little redundant but I wanted this
|
|
|
|
// to be as true as possible to my original intent which means that it
|
|
|
|
// only uses that code from ZDoom's status bar that is the same as any
|
|
|
|
// copy would be.
|
|
|
|
|
|
|
|
#include "doomtype.h"
|
|
|
|
#include "v_video.h"
|
|
|
|
#include "gi.h"
|
|
|
|
#include "c_cvars.h"
|
|
|
|
#include "w_wad.h"
|
|
|
|
#include "a_keys.h"
|
|
|
|
#include "sbar.h"
|
|
|
|
#include "sc_man.h"
|
|
|
|
#include "templates.h"
|
|
|
|
#include "p_local.h"
|
2008-09-14 23:54:38 +00:00
|
|
|
#include "doomstat.h"
|
|
|
|
#include "g_level.h"
|
|
|
|
|
2013-02-19 02:58:03 +00:00
|
|
|
#include <time.h>
|
|
|
|
|
2008-01-11 22:38:10 +00:00
|
|
|
|
|
|
|
#define HUMETA_AltIcon 0x10f000
|
|
|
|
|
|
|
|
EXTERN_CVAR(Bool,am_follow)
|
|
|
|
EXTERN_CVAR (Int, con_scaletext)
|
|
|
|
EXTERN_CVAR (Bool, idmypos)
|
|
|
|
|
|
|
|
EXTERN_CVAR (Bool, am_showtime)
|
|
|
|
EXTERN_CVAR (Bool, am_showtotaltime)
|
|
|
|
|
|
|
|
CVAR(Int,hud_althudscale, 2, CVAR_ARCHIVE) // Scale the hud to 640x400?
|
|
|
|
CVAR(Bool,hud_althud, false, CVAR_ARCHIVE) // Enable/Disable the alternate HUD
|
|
|
|
|
|
|
|
// These are intentionally not the same as in the automap!
|
|
|
|
CVAR (Bool, hud_showsecrets, true,CVAR_ARCHIVE); // Show secrets on HUD
|
|
|
|
CVAR (Bool, hud_showmonsters, true,CVAR_ARCHIVE); // Show monster stats on HUD
|
|
|
|
CVAR (Bool, hud_showitems, false,CVAR_ARCHIVE); // Show item stats on HUD
|
|
|
|
CVAR (Bool, hud_showstats, false, CVAR_ARCHIVE); // for stamina and accuracy.
|
2010-01-30 09:17:44 +00:00
|
|
|
CVAR (Bool, hud_showscore, false, CVAR_ARCHIVE); // for user maintained score
|
2013-02-19 02:58:03 +00:00
|
|
|
CVAR (Int , hud_showtime, 0, CVAR_ARCHIVE); // Show time on HUD
|
|
|
|
CVAR (Int , hud_timecolor, CR_GOLD,CVAR_ARCHIVE); // Color of in-game time on HUD
|
2008-01-11 22:38:10 +00:00
|
|
|
|
|
|
|
CVAR (Int, hud_ammo_red, 25, CVAR_ARCHIVE) // ammo percent less than which status is red
|
|
|
|
CVAR (Int, hud_ammo_yellow, 50, CVAR_ARCHIVE) // ammo percent less is yellow more green
|
|
|
|
CVAR (Int, hud_health_red, 25, CVAR_ARCHIVE) // health amount less than which status is red
|
|
|
|
CVAR (Int, hud_health_yellow, 50, CVAR_ARCHIVE) // health amount less than which status is yellow
|
|
|
|
CVAR (Int, hud_health_green, 100, CVAR_ARCHIVE) // health amount above is blue, below is green
|
|
|
|
CVAR (Int, hud_armor_red, 25, CVAR_ARCHIVE) // armor amount less than which status is red
|
|
|
|
CVAR (Int, hud_armor_yellow, 50, CVAR_ARCHIVE) // armor amount less than which status is yellow
|
|
|
|
CVAR (Int, hud_armor_green, 100, CVAR_ARCHIVE) // armor amount above is blue, below is green
|
|
|
|
|
2012-12-22 22:37:58 +00:00
|
|
|
CVAR (Bool, hud_berserk_health, true, CVAR_ARCHIVE); // when found berserk pack instead of health box
|
|
|
|
|
2008-01-11 22:38:10 +00:00
|
|
|
CVAR (Int, hudcolor_titl, CR_YELLOW, CVAR_ARCHIVE) // color of automap title
|
|
|
|
CVAR (Int, hudcolor_time, CR_RED, CVAR_ARCHIVE) // color of level/hub time
|
|
|
|
CVAR (Int, hudcolor_ltim, CR_ORANGE, CVAR_ARCHIVE) // color of single level time
|
|
|
|
CVAR (Int, hudcolor_ttim, CR_GOLD, CVAR_ARCHIVE) // color of total time
|
|
|
|
CVAR (Int, hudcolor_xyco, CR_GREEN, CVAR_ARCHIVE) // color of coordinates
|
|
|
|
|
2012-12-22 22:37:58 +00:00
|
|
|
CVAR (Int, hudcolor_statnames, CR_RED, CVAR_ARCHIVE) // For the letters before the stats
|
2008-01-11 22:38:10 +00:00
|
|
|
CVAR (Int, hudcolor_stats, CR_GREEN, CVAR_ARCHIVE) // For the stats values themselves
|
|
|
|
|
|
|
|
|
|
|
|
CVAR(Bool, map_point_coordinates, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) // show player or map coordinates?
|
|
|
|
|
|
|
|
static FFont * HudFont; // The font for the health and armor display
|
|
|
|
static FFont * IndexFont; // The font for the inventory indices
|
|
|
|
|
|
|
|
// Icons
|
|
|
|
static FTexture * healthpic; // Health icon
|
2012-12-22 22:37:58 +00:00
|
|
|
static FTexture * berserkpic; // Berserk icon (Doom only)
|
2008-01-11 22:38:10 +00:00
|
|
|
static FTexture * fragpic; // Frags icon
|
|
|
|
static FTexture * invgems[4]; // Inventory arrows
|
|
|
|
|
|
|
|
static int hudwidth, hudheight; // current width/height for HUD display
|
2010-01-30 09:17:44 +00:00
|
|
|
static int statspace;
|
2008-01-11 22:38:10 +00:00
|
|
|
|
|
|
|
void AM_GetPosition(fixed_t & x, fixed_t & y);
|
|
|
|
|
2008-06-15 18:36:26 +00:00
|
|
|
|
|
|
|
FTextureID GetHUDIcon(const PClass *cls)
|
|
|
|
{
|
|
|
|
FTextureID tex;
|
|
|
|
tex.texnum = cls->Meta.GetMetaInt(HUMETA_AltIcon, 0);
|
|
|
|
return tex;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetHUDIcon(PClass *cls, FTextureID tex)
|
|
|
|
{
|
|
|
|
cls->Meta.SetMetaInt(HUMETA_AltIcon, tex.GetIndex());
|
|
|
|
}
|
|
|
|
|
2008-01-11 22:38:10 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// Draws an image into a box with its bottom center at the bottom
|
|
|
|
// center of the box. The image is scaled down if it doesn't fit
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
static void DrawImageToBox(FTexture * tex, int x, int y, int w, int h, int trans=0xc000)
|
|
|
|
{
|
2010-10-16 16:21:19 +00:00
|
|
|
double scale1, scale2;
|
2008-01-11 22:38:10 +00:00
|
|
|
|
|
|
|
if (tex)
|
|
|
|
{
|
|
|
|
int texwidth=tex->GetWidth();
|
|
|
|
int texheight=tex->GetHeight();
|
|
|
|
|
2010-10-16 16:21:19 +00:00
|
|
|
if (w<texwidth) scale1=(double)w/texwidth;
|
2008-01-11 22:38:10 +00:00
|
|
|
else scale1=1.0f;
|
2010-10-16 16:21:19 +00:00
|
|
|
if (h<texheight) scale2=(double)h/texheight;
|
2008-01-11 22:38:10 +00:00
|
|
|
else scale2=1.0f;
|
|
|
|
if (scale2<scale1) scale1=scale2;
|
|
|
|
|
|
|
|
x+=w>>1;
|
|
|
|
y+=h;
|
|
|
|
|
|
|
|
w=(int)(texwidth*scale1);
|
|
|
|
h=(int)(texheight*scale1);
|
|
|
|
|
|
|
|
screen->DrawTexture(tex, x, y,
|
|
|
|
DTA_KeepRatio, true,
|
|
|
|
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, trans,
|
|
|
|
DTA_DestWidth, w, DTA_DestHeight, h, DTA_CenterBottomOffset, 1, TAG_DONE);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// Draws a text but uses a fixed width for all characters
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2008-11-27 17:43:36 +00:00
|
|
|
static void DrawHudText(FFont *font, int color, char * text, int x, int y, int trans=0xc000)
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
2010-01-02 11:38:27 +00:00
|
|
|
int zerowidth;
|
|
|
|
FTexture *tex_zero = font->GetChar('0', &zerowidth);
|
2008-01-11 22:38:10 +00:00
|
|
|
|
|
|
|
x+=zerowidth/2;
|
|
|
|
for(int i=0;text[i];i++)
|
|
|
|
{
|
2010-01-02 11:38:27 +00:00
|
|
|
int width;
|
|
|
|
FTexture *texc = font->GetChar(text[i], &width);
|
2010-03-02 01:59:16 +00:00
|
|
|
if (texc != NULL)
|
|
|
|
{
|
2010-10-16 16:21:19 +00:00
|
|
|
double offset = texc->GetScaledTopOffsetDouble()
|
|
|
|
- tex_zero->GetScaledTopOffsetDouble()
|
|
|
|
+ tex_zero->GetScaledHeightDouble();
|
|
|
|
|
2010-03-02 01:59:16 +00:00
|
|
|
screen->DrawChar(font, color, x, y, text[i],
|
|
|
|
DTA_KeepRatio, true,
|
|
|
|
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, trans,
|
2010-10-16 16:21:19 +00:00
|
|
|
DTA_LeftOffset, width/2, DTA_TopOffsetF, offset,
|
2010-03-02 01:59:16 +00:00
|
|
|
/*DTA_CenterBottomOffset, 1,*/ TAG_DONE);
|
|
|
|
}
|
|
|
|
x += zerowidth;
|
2008-01-11 22:38:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
2010-03-02 01:59:16 +00:00
|
|
|
// Draws a number with a fixed width for all digits
|
2008-01-11 22:38:10 +00:00
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2008-11-27 17:43:36 +00:00
|
|
|
static void DrawHudNumber(FFont *font, int color, int num, int x, int y, int trans=0xc000)
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
|
|
|
char text[15];
|
|
|
|
|
About a week's worth of changes here. As a heads-up, I wouldn't be
surprised if this doesn't build in Linux right now. The CMakeLists.txt
were checked with MinGW and NMake, but how they fair under Linux is an
unknown to me at this time.
- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
This is so that I can use a series of mysnprintf() calls and advance the
pointer for each one. Once the pointer goes beyond the end of the buffer,
the count will go negative, but since it's an unsigned type it will be
seen as excessively huge instead. This should not be a problem, as there's
no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
name when given a Hexen map number. This was fine with the old scanner
code, but only a happy coincidence prevents it from crashing with the new
code
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
is probably broken until I get around to booting into Linux again. Niceties
provided over the existing Makefiles they're replacing:
* All command-line builds can use the same build system, rather than having
a separate one for MinGW and another for Linux.
* Microsoft's NMake tool is supported as a target.
* Progress meters.
* Parallel makes work from a fresh checkout without needing to be primed
first with a single-threaded make.
* Porting to other architectures should be simplified, whenever that day
comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
itself instead of generating an external makefile to do it, since I couldn't
figure out how to generate a makefile with an external tool and include it
with a CMake-generated makefile. Where makewad used a master list of files
to generate the package file, zipdir just zips the entire contents of one or
more directories.
- Added the gdtoa package from netlib's fp library so that ZDoom's printf-style
formatting can be entirely independant of the CRT.
SVN r1082 (trunk)
2008-07-23 04:57:26 +00:00
|
|
|
mysnprintf(text, countof(text), "%d", num);
|
2008-11-27 17:43:36 +00:00
|
|
|
DrawHudText(font, color, text, x, y, trans);
|
2008-01-11 22:38:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// draw the status (number of kills etc)
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
2010-01-30 09:17:44 +00:00
|
|
|
static void DrawStatLine(int x, int &y, const char *prefix, const char *string)
|
|
|
|
{
|
|
|
|
y -= SmallFont->GetHeight()-1;
|
|
|
|
screen->DrawText(SmallFont, hudcolor_statnames, x, y, prefix,
|
|
|
|
DTA_KeepRatio, true,
|
|
|
|
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, 0xc000, TAG_DONE);
|
|
|
|
|
|
|
|
screen->DrawText(SmallFont, hudcolor_stats, x+statspace, y, string,
|
|
|
|
DTA_KeepRatio, true,
|
|
|
|
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, 0xc000, TAG_DONE);
|
|
|
|
}
|
|
|
|
|
2008-01-11 22:38:10 +00:00
|
|
|
static void DrawStatus(player_t * CPlayer, int x, int y)
|
|
|
|
{
|
|
|
|
char tempstr[50];
|
2010-01-30 09:17:44 +00:00
|
|
|
|
|
|
|
if (hud_showscore)
|
|
|
|
{
|
|
|
|
mysnprintf(tempstr, countof(tempstr), "%i ", CPlayer->mo->Score);
|
|
|
|
DrawStatLine(x, y, "Sc:", tempstr);
|
|
|
|
}
|
2008-01-11 22:38:10 +00:00
|
|
|
|
|
|
|
if (hud_showstats)
|
|
|
|
{
|
2012-03-11 09:08:35 +00:00
|
|
|
mysnprintf(tempstr, countof(tempstr), "%i ", CPlayer->mo->accuracy);
|
2010-01-30 09:17:44 +00:00
|
|
|
DrawStatLine(x, y, "Ac:", tempstr);
|
2012-03-11 09:08:35 +00:00
|
|
|
mysnprintf(tempstr, countof(tempstr), "%i ", CPlayer->mo->stamina);
|
2010-01-30 09:17:44 +00:00
|
|
|
DrawStatLine(x, y, "St:", tempstr);
|
2008-01-11 22:38:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!deathmatch)
|
|
|
|
{
|
|
|
|
// FIXME: ZDoom doesn't preserve the player's stat counters across hubs so this doesn't
|
|
|
|
// work in cooperative hub games
|
|
|
|
if (hud_showsecrets)
|
|
|
|
{
|
About a week's worth of changes here. As a heads-up, I wouldn't be
surprised if this doesn't build in Linux right now. The CMakeLists.txt
were checked with MinGW and NMake, but how they fair under Linux is an
unknown to me at this time.
- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
This is so that I can use a series of mysnprintf() calls and advance the
pointer for each one. Once the pointer goes beyond the end of the buffer,
the count will go negative, but since it's an unsigned type it will be
seen as excessively huge instead. This should not be a problem, as there's
no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
name when given a Hexen map number. This was fine with the old scanner
code, but only a happy coincidence prevents it from crashing with the new
code
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
is probably broken until I get around to booting into Linux again. Niceties
provided over the existing Makefiles they're replacing:
* All command-line builds can use the same build system, rather than having
a separate one for MinGW and another for Linux.
* Microsoft's NMake tool is supported as a target.
* Progress meters.
* Parallel makes work from a fresh checkout without needing to be primed
first with a single-threaded make.
* Porting to other architectures should be simplified, whenever that day
comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
itself instead of generating an external makefile to do it, since I couldn't
figure out how to generate a makefile with an external tool and include it
with a CMake-generated makefile. Where makewad used a master list of files
to generate the package file, zipdir just zips the entire contents of one or
more directories.
- Added the gdtoa package from netlib's fp library so that ZDoom's printf-style
formatting can be entirely independant of the CRT.
SVN r1082 (trunk)
2008-07-23 04:57:26 +00:00
|
|
|
mysnprintf(tempstr, countof(tempstr), "%i/%i ", multiplayer? CPlayer->secretcount : level.found_secrets, level.total_secrets);
|
2010-01-30 09:17:44 +00:00
|
|
|
DrawStatLine(x, y, "S:", tempstr);
|
2008-01-11 22:38:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (hud_showitems)
|
|
|
|
{
|
About a week's worth of changes here. As a heads-up, I wouldn't be
surprised if this doesn't build in Linux right now. The CMakeLists.txt
were checked with MinGW and NMake, but how they fair under Linux is an
unknown to me at this time.
- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
This is so that I can use a series of mysnprintf() calls and advance the
pointer for each one. Once the pointer goes beyond the end of the buffer,
the count will go negative, but since it's an unsigned type it will be
seen as excessively huge instead. This should not be a problem, as there's
no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
name when given a Hexen map number. This was fine with the old scanner
code, but only a happy coincidence prevents it from crashing with the new
code
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
is probably broken until I get around to booting into Linux again. Niceties
provided over the existing Makefiles they're replacing:
* All command-line builds can use the same build system, rather than having
a separate one for MinGW and another for Linux.
* Microsoft's NMake tool is supported as a target.
* Progress meters.
* Parallel makes work from a fresh checkout without needing to be primed
first with a single-threaded make.
* Porting to other architectures should be simplified, whenever that day
comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
itself instead of generating an external makefile to do it, since I couldn't
figure out how to generate a makefile with an external tool and include it
with a CMake-generated makefile. Where makewad used a master list of files
to generate the package file, zipdir just zips the entire contents of one or
more directories.
- Added the gdtoa package from netlib's fp library so that ZDoom's printf-style
formatting can be entirely independant of the CRT.
SVN r1082 (trunk)
2008-07-23 04:57:26 +00:00
|
|
|
mysnprintf(tempstr, countof(tempstr), "%i/%i ", multiplayer? CPlayer->itemcount : level.found_items, level.total_items);
|
2010-01-30 09:17:44 +00:00
|
|
|
DrawStatLine(x, y, "I:", tempstr);
|
2008-01-11 22:38:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (hud_showmonsters)
|
|
|
|
{
|
About a week's worth of changes here. As a heads-up, I wouldn't be
surprised if this doesn't build in Linux right now. The CMakeLists.txt
were checked with MinGW and NMake, but how they fair under Linux is an
unknown to me at this time.
- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
This is so that I can use a series of mysnprintf() calls and advance the
pointer for each one. Once the pointer goes beyond the end of the buffer,
the count will go negative, but since it's an unsigned type it will be
seen as excessively huge instead. This should not be a problem, as there's
no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
name when given a Hexen map number. This was fine with the old scanner
code, but only a happy coincidence prevents it from crashing with the new
code
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
is probably broken until I get around to booting into Linux again. Niceties
provided over the existing Makefiles they're replacing:
* All command-line builds can use the same build system, rather than having
a separate one for MinGW and another for Linux.
* Microsoft's NMake tool is supported as a target.
* Progress meters.
* Parallel makes work from a fresh checkout without needing to be primed
first with a single-threaded make.
* Porting to other architectures should be simplified, whenever that day
comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
itself instead of generating an external makefile to do it, since I couldn't
figure out how to generate a makefile with an external tool and include it
with a CMake-generated makefile. Where makewad used a master list of files
to generate the package file, zipdir just zips the entire contents of one or
more directories.
- Added the gdtoa package from netlib's fp library so that ZDoom's printf-style
formatting can be entirely independant of the CRT.
SVN r1082 (trunk)
2008-07-23 04:57:26 +00:00
|
|
|
mysnprintf(tempstr, countof(tempstr), "%i/%i ", multiplayer? CPlayer->killcount : level.killed_monsters, level.total_monsters);
|
2010-01-30 09:17:44 +00:00
|
|
|
DrawStatLine(x, y, "K:", tempstr);
|
2008-01-11 22:38:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// draw health
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
2012-12-22 22:37:58 +00:00
|
|
|
static void DrawHealth(player_t *CPlayer, int x, int y)
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
2012-12-22 22:37:58 +00:00
|
|
|
int health = CPlayer->health;
|
|
|
|
|
2008-01-11 22:38:10 +00:00
|
|
|
// decide on the color first
|
|
|
|
int fontcolor =
|
|
|
|
health < hud_health_red ? CR_RED :
|
|
|
|
health < hud_health_yellow ? CR_GOLD :
|
|
|
|
health <= hud_health_green ? CR_GREEN :
|
|
|
|
CR_BLUE;
|
2012-12-22 22:37:58 +00:00
|
|
|
|
|
|
|
const bool haveBerserk = hud_berserk_health
|
|
|
|
&& NULL != berserkpic
|
|
|
|
&& NULL != CPlayer->mo->FindInventory< APowerStrength >();
|
|
|
|
|
|
|
|
DrawImageToBox(haveBerserk ? berserkpic : healthpic, x, y, 31, 17);
|
2008-11-27 17:43:36 +00:00
|
|
|
DrawHudNumber(HudFont, fontcolor, health, x + 33, y + 17);
|
2008-01-11 22:38:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// Draw Armor.
|
2010-12-20 10:07:44 +00:00
|
|
|
// very similar to drawhealth, but adapted to handle Hexen armor too
|
2008-01-11 22:38:10 +00:00
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
2010-12-20 10:07:44 +00:00
|
|
|
static void DrawArmor(ABasicArmor * barmor, AHexenArmor * harmor, int x, int y)
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
2010-12-20 10:07:44 +00:00
|
|
|
int ap = 0;
|
|
|
|
int bestslot = 4;
|
|
|
|
|
|
|
|
if (harmor)
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
2010-12-20 10:07:44 +00:00
|
|
|
int ac = (harmor->Slots[0] + harmor->Slots[1] + harmor->Slots[2] + harmor->Slots[3] + harmor->Slots[4]);
|
|
|
|
ac >>= FRACBITS;
|
|
|
|
ap += ac;
|
|
|
|
|
|
|
|
if (ac)
|
|
|
|
{
|
|
|
|
// Find the part of armor that protects the most
|
|
|
|
bestslot = 0;
|
|
|
|
for (int i = 1; i < 4; ++i)
|
|
|
|
{
|
|
|
|
if (harmor->Slots[i] > harmor->Slots[bestslot])
|
|
|
|
{
|
|
|
|
bestslot = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (barmor)
|
|
|
|
{
|
|
|
|
ap += barmor->Amount;
|
|
|
|
}
|
2008-01-11 22:38:10 +00:00
|
|
|
|
2010-12-20 10:07:44 +00:00
|
|
|
if (ap)
|
|
|
|
{
|
2008-01-11 22:38:10 +00:00
|
|
|
// decide on color
|
|
|
|
int fontcolor =
|
|
|
|
ap < hud_armor_red ? CR_RED :
|
|
|
|
ap < hud_armor_yellow ? CR_GOLD :
|
|
|
|
ap <= hud_armor_green ? CR_GREEN :
|
|
|
|
CR_BLUE;
|
|
|
|
|
|
|
|
|
2010-12-20 10:07:44 +00:00
|
|
|
// Use the sprite of one of the predefined Hexen armor bonuses.
|
|
|
|
// This is not a very generic approach, but it is not possible
|
|
|
|
// to truly create new types of Hexen armor bonus items anyway.
|
|
|
|
if (harmor && bestslot < 4)
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
2010-12-20 10:07:44 +00:00
|
|
|
char icon[] = "AR_1A0";
|
|
|
|
switch (bestslot)
|
|
|
|
{
|
|
|
|
case 1: icon[3] = '2'; break;
|
|
|
|
case 2: icon[3] = '3'; break;
|
|
|
|
case 3: icon[3] = '4'; break;
|
|
|
|
default: break;
|
|
|
|
}
|
|
|
|
DrawImageToBox(TexMan.FindTexture(icon, FTexture::TEX_Sprite), x, y, 31, 17);
|
2008-01-11 22:38:10 +00:00
|
|
|
}
|
2010-12-20 10:07:44 +00:00
|
|
|
else if (barmor) DrawImageToBox(TexMan[barmor->Icon], x, y, 31, 17);
|
|
|
|
DrawHudNumber(HudFont, fontcolor, ap, x + 33, y + 17);
|
2008-01-11 22:38:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// KEYS
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// create a sorted list of the defined keys so
|
|
|
|
// this doesn't have to be done each frame
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
static TArray<const PClass*> KeyTypes, UnassignedKeyTypes;
|
|
|
|
|
|
|
|
static int STACK_ARGS ktcmp(const void * a, const void * b)
|
|
|
|
{
|
|
|
|
AKey * key1 = (AKey*)GetDefaultByType ( *(const PClass**)a );
|
|
|
|
AKey * key2 = (AKey*)GetDefaultByType ( *(const PClass**)b );
|
|
|
|
return key1->KeyNumber - key2->KeyNumber;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void SetKeyTypes()
|
|
|
|
{
|
|
|
|
for(unsigned int i=0;i<PClass::m_Types.Size();i++)
|
|
|
|
{
|
|
|
|
const PClass * ti = PClass::m_Types[i];
|
|
|
|
|
|
|
|
if (ti->IsDescendantOf(RUNTIME_CLASS(AKey)))
|
|
|
|
{
|
|
|
|
AKey * key = (AKey*)GetDefaultByType(ti);
|
|
|
|
|
2008-06-15 18:36:26 +00:00
|
|
|
if (key->Icon.isValid() && key->KeyNumber>0)
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
|
|
|
KeyTypes.Push(ti);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
UnassignedKeyTypes.Push(ti);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (KeyTypes.Size())
|
|
|
|
{
|
|
|
|
qsort(&KeyTypes[0], KeyTypes.Size(), sizeof(KeyTypes[0]), ktcmp);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Don't leave the list empty
|
|
|
|
const PClass * ti = RUNTIME_CLASS(AKey);
|
|
|
|
KeyTypes.Push(ti);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// Draw one key
|
|
|
|
//
|
|
|
|
// Regarding key icons, Doom's are too small, Heretic doesn't have any,
|
|
|
|
// for Hexen the in-game sprites look better and for Strife it doesn't matter
|
|
|
|
// so always use the spawn state's sprite instead of the icon here unless an
|
|
|
|
// override is specified in ALTHUDCF.
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void DrawOneKey(int xo, int & x, int & y, int & c, AInventory * inv)
|
|
|
|
{
|
2008-06-15 18:36:26 +00:00
|
|
|
FTextureID icon = FNullTextureID();
|
|
|
|
FTextureID AltIcon = GetHUDIcon(inv->GetClass());
|
2008-01-11 22:38:10 +00:00
|
|
|
|
2008-06-15 18:36:26 +00:00
|
|
|
if (!AltIcon.Exists()) return;
|
2008-01-11 22:38:10 +00:00
|
|
|
|
2008-06-15 18:36:26 +00:00
|
|
|
if (AltIcon.isValid())
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
|
|
|
icon = AltIcon;
|
|
|
|
}
|
2008-08-10 14:19:47 +00:00
|
|
|
else if (inv->SpawnState && inv->SpawnState->sprite!=0)
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
|
|
|
FState * state = inv->SpawnState;
|
2008-08-10 14:19:47 +00:00
|
|
|
if (state && (unsigned)state->sprite < (unsigned)sprites.Size ())
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
2008-08-10 14:19:47 +00:00
|
|
|
spritedef_t * sprdef = &sprites[state->sprite];
|
2008-01-11 22:38:10 +00:00
|
|
|
spriteframe_t * sprframe = &SpriteFrames[sprdef->spriteframes + state->GetFrame()];
|
|
|
|
icon = sprframe->Texture[0];
|
|
|
|
}
|
|
|
|
}
|
2008-06-15 18:36:26 +00:00
|
|
|
if (icon.isNull()) icon = inv->Icon;
|
2008-01-11 22:38:10 +00:00
|
|
|
|
2008-06-15 18:36:26 +00:00
|
|
|
if (icon.isValid())
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
|
|
|
x -= 9;
|
|
|
|
DrawImageToBox(TexMan[icon], x, y, 8, 10);
|
|
|
|
c++;
|
|
|
|
if (c>=10)
|
|
|
|
{
|
|
|
|
x=xo;
|
|
|
|
y-=11;
|
|
|
|
c=0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// Draw all keys
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
static int DrawKeys(player_t * CPlayer, int x, int y)
|
|
|
|
{
|
|
|
|
int yo=y;
|
|
|
|
int xo=x;
|
|
|
|
int i;
|
|
|
|
int c=0;
|
|
|
|
AInventory * inv;
|
|
|
|
|
|
|
|
if (!deathmatch)
|
|
|
|
{
|
|
|
|
if (KeyTypes.Size()==0) SetKeyTypes();
|
|
|
|
|
|
|
|
// First all keys that are assigned to locks (in reverse order of definition)
|
|
|
|
for(i=KeyTypes.Size()-1;i>=0;i--)
|
|
|
|
{
|
2008-01-12 17:35:32 +00:00
|
|
|
if ((inv=CPlayer->mo->FindInventory(KeyTypes[i])))
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
|
|
|
DrawOneKey(xo, x, y, c, inv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// And now the rest
|
|
|
|
for(i=UnassignedKeyTypes.Size()-1;i>=0;i--)
|
|
|
|
{
|
2008-01-12 17:35:32 +00:00
|
|
|
if ((inv=CPlayer->mo->FindInventory(UnassignedKeyTypes[i])))
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
|
|
|
DrawOneKey(xo, x, y, c, inv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (x==xo && y!=yo) y+=11;
|
|
|
|
return y-11;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// Drawing Ammo
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
static TArray<const PClass *> orderedammos;
|
|
|
|
|
|
|
|
static void AddAmmoToList(AWeapon * weapdef)
|
|
|
|
{
|
|
|
|
|
|
|
|
for(int i=0; i<2;i++)
|
|
|
|
{
|
|
|
|
const PClass * ti = i==0? weapdef->AmmoType1 : weapdef->AmmoType2;
|
|
|
|
if (ti)
|
|
|
|
{
|
|
|
|
AAmmo * ammodef=(AAmmo*)GetDefaultByType(ti);
|
|
|
|
|
|
|
|
if (ammodef && !(ammodef->ItemFlags&IF_INVBAR))
|
|
|
|
{
|
|
|
|
unsigned int j;
|
|
|
|
|
|
|
|
for(j=0;j<orderedammos.Size();j++)
|
|
|
|
{
|
|
|
|
if (ti == orderedammos[j]) break;
|
|
|
|
}
|
|
|
|
if (j==orderedammos.Size()) orderedammos.Push(ti);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-02-20 22:28:48 +00:00
|
|
|
static int DrawAmmo(player_t *CPlayer, int x, int y)
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
int i,j,k;
|
|
|
|
char buf[256];
|
2009-02-20 22:28:48 +00:00
|
|
|
AInventory *inv;
|
2008-01-11 22:38:10 +00:00
|
|
|
|
2009-02-20 22:28:48 +00:00
|
|
|
AWeapon *wi=CPlayer->ReadyWeapon;
|
2008-01-11 22:38:10 +00:00
|
|
|
|
|
|
|
orderedammos.Clear();
|
|
|
|
|
|
|
|
// Order ammo by use of weapons in the weapon slots
|
|
|
|
// Do not check for actual presence in the inventory!
|
|
|
|
// We want to show all ammo types that can be used by
|
|
|
|
// the weapons in the weapon slots.
|
2009-02-20 22:28:48 +00:00
|
|
|
for (k = 0; k < NUM_WEAPON_SLOTS; k++) for(j = 0; j < CPlayer->weapons.Slots[k].Size(); j++)
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
2009-02-20 22:28:48 +00:00
|
|
|
const PClass *weap = CPlayer->weapons.Slots[k].GetWeapon(j);
|
2008-01-11 22:38:10 +00:00
|
|
|
|
|
|
|
if (weap) AddAmmoToList((AWeapon*)GetDefaultByType(weap));
|
|
|
|
}
|
|
|
|
|
|
|
|
// Now check for the remaining weapons that are in the inventory but not in the weapon slots
|
|
|
|
for(inv=CPlayer->mo->Inventory;inv;inv=inv->Inventory)
|
|
|
|
{
|
|
|
|
if (inv->IsKindOf(RUNTIME_CLASS(AWeapon)))
|
|
|
|
{
|
|
|
|
AddAmmoToList((AWeapon*)inv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ok, we got all ammo types. Now draw the list back to front (bottom to top)
|
|
|
|
|
2008-11-27 17:43:36 +00:00
|
|
|
int def_width = ConFont->StringWidth("000/000");
|
2008-01-11 22:38:10 +00:00
|
|
|
x-=def_width;
|
2008-11-27 17:43:36 +00:00
|
|
|
int yadd = ConFont->GetHeight();
|
2008-01-11 22:38:10 +00:00
|
|
|
|
|
|
|
for(i=orderedammos.Size()-1;i>=0;i--)
|
|
|
|
{
|
|
|
|
|
|
|
|
const PClass * type = orderedammos[i];
|
|
|
|
AAmmo * ammoitem = (AAmmo*)CPlayer->mo->FindInventory(type);
|
|
|
|
|
|
|
|
AAmmo * inv = ammoitem? ammoitem : (AAmmo*)GetDefaultByType(orderedammos[i]);
|
2008-06-15 18:36:26 +00:00
|
|
|
FTextureID AltIcon = GetHUDIcon(type);
|
|
|
|
FTextureID icon = !AltIcon.isNull()? AltIcon : inv->Icon;
|
|
|
|
if (!icon.isValid()) continue;
|
2008-01-11 22:38:10 +00:00
|
|
|
|
|
|
|
int trans= (wi && (type==wi->AmmoType1 || type==wi->AmmoType2)) ? 0xc000:0x6000;
|
|
|
|
|
|
|
|
int maxammo = inv->MaxAmount;
|
|
|
|
int ammo = ammoitem? ammoitem->Amount : 0;
|
|
|
|
|
About a week's worth of changes here. As a heads-up, I wouldn't be
surprised if this doesn't build in Linux right now. The CMakeLists.txt
were checked with MinGW and NMake, but how they fair under Linux is an
unknown to me at this time.
- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
This is so that I can use a series of mysnprintf() calls and advance the
pointer for each one. Once the pointer goes beyond the end of the buffer,
the count will go negative, but since it's an unsigned type it will be
seen as excessively huge instead. This should not be a problem, as there's
no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
name when given a Hexen map number. This was fine with the old scanner
code, but only a happy coincidence prevents it from crashing with the new
code
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
is probably broken until I get around to booting into Linux again. Niceties
provided over the existing Makefiles they're replacing:
* All command-line builds can use the same build system, rather than having
a separate one for MinGW and another for Linux.
* Microsoft's NMake tool is supported as a target.
* Progress meters.
* Parallel makes work from a fresh checkout without needing to be primed
first with a single-threaded make.
* Porting to other architectures should be simplified, whenever that day
comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
itself instead of generating an external makefile to do it, since I couldn't
figure out how to generate a makefile with an external tool and include it
with a CMake-generated makefile. Where makewad used a master list of files
to generate the package file, zipdir just zips the entire contents of one or
more directories.
- Added the gdtoa package from netlib's fp library so that ZDoom's printf-style
formatting can be entirely independant of the CRT.
SVN r1082 (trunk)
2008-07-23 04:57:26 +00:00
|
|
|
mysnprintf(buf, countof(buf), "%3d/%3d", ammo, maxammo);
|
2008-01-11 22:38:10 +00:00
|
|
|
|
|
|
|
int tex_width= clamp<int>(ConFont->StringWidth(buf)-def_width, 0, 1000);
|
|
|
|
|
|
|
|
int fontcolor=( !maxammo ? CR_GRAY :
|
|
|
|
ammo < ( (maxammo * hud_ammo_red) / 100) ? CR_RED :
|
|
|
|
ammo < ( (maxammo * hud_ammo_yellow) / 100) ? CR_GOLD : CR_GREEN );
|
|
|
|
|
2008-11-27 17:43:36 +00:00
|
|
|
DrawHudText(ConFont, fontcolor, buf, x-tex_width, y+yadd, trans);
|
2008-01-11 22:38:10 +00:00
|
|
|
DrawImageToBox(TexMan[icon], x-20, y, 16, 8, trans);
|
|
|
|
y-=10;
|
|
|
|
}
|
|
|
|
return y;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// Weapons List
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2012-04-22 09:41:06 +00:00
|
|
|
FTextureID GetWeaponIcon(AWeapon *weapon) // This function is also used by SBARINFO
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
2012-04-22 09:41:06 +00:00
|
|
|
FTextureID AltIcon = GetHUDIcon(weapon->GetClass());
|
2008-01-11 22:38:10 +00:00
|
|
|
FState * state=NULL, *ReadyState;
|
|
|
|
|
2012-04-22 09:41:06 +00:00
|
|
|
FTextureID picnum = !AltIcon.isNull()? AltIcon : weapon->Icon;
|
2008-01-11 22:38:10 +00:00
|
|
|
|
2008-06-15 18:36:26 +00:00
|
|
|
if (picnum.isNull())
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
2008-08-10 14:19:47 +00:00
|
|
|
if (weapon->SpawnState && weapon->SpawnState->sprite!=0)
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
|
|
|
state = weapon->SpawnState;
|
|
|
|
}
|
|
|
|
// no spawn state - now try the ready state
|
2008-08-10 14:19:47 +00:00
|
|
|
else if ((ReadyState = weapon->FindState(NAME_Ready)) && ReadyState->sprite!=0)
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
|
|
|
state = ReadyState;
|
|
|
|
}
|
2012-04-22 09:41:06 +00:00
|
|
|
if (state && (unsigned)state->sprite < (unsigned)sprites.Size ())
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
2008-08-10 14:19:47 +00:00
|
|
|
spritedef_t * sprdef = &sprites[state->sprite];
|
2008-01-11 22:38:10 +00:00
|
|
|
spriteframe_t * sprframe = &SpriteFrames[sprdef->spriteframes + state->GetFrame()];
|
|
|
|
|
|
|
|
picnum = sprframe->Texture[0];
|
|
|
|
}
|
|
|
|
}
|
2012-04-22 09:41:06 +00:00
|
|
|
return picnum;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void DrawOneWeapon(player_t * CPlayer, int x, int & y, AWeapon * weapon)
|
|
|
|
{
|
|
|
|
int trans;
|
|
|
|
|
|
|
|
// Powered up weapons and inherited sister weapons are not displayed.
|
|
|
|
if (weapon->WeaponFlags & WIF_POWERED_UP) return;
|
|
|
|
if (weapon->SisterWeapon && weapon->IsKindOf(RUNTIME_TYPE(weapon->SisterWeapon))) return;
|
|
|
|
|
|
|
|
trans=0x6666;
|
|
|
|
if (CPlayer->ReadyWeapon)
|
|
|
|
{
|
|
|
|
if (weapon==CPlayer->ReadyWeapon || weapon==CPlayer->ReadyWeapon->SisterWeapon) trans=0xd999;
|
|
|
|
}
|
|
|
|
|
|
|
|
FTextureID picnum = GetWeaponIcon(weapon);
|
2008-01-11 22:38:10 +00:00
|
|
|
|
2008-06-15 18:36:26 +00:00
|
|
|
if (picnum.isValid())
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
|
|
|
FTexture * tex = TexMan[picnum];
|
|
|
|
int w = tex->GetWidth();
|
|
|
|
int h = tex->GetHeight();
|
|
|
|
int rh;
|
|
|
|
if (w>h) rh=8;
|
|
|
|
else rh=16,y-=8; // don't draw tall sprites too small!
|
|
|
|
DrawImageToBox(tex, x-24, y, 20, rh, trans);
|
|
|
|
y-=10;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void DrawWeapons(player_t * CPlayer, int x, int y)
|
|
|
|
{
|
|
|
|
int k,j;
|
|
|
|
AInventory * inv;
|
|
|
|
|
|
|
|
// First draw all weapons in the inventory that are not assigned to a weapon slot
|
|
|
|
for(inv=CPlayer->mo->Inventory;inv;inv=inv->Inventory)
|
|
|
|
{
|
2009-02-20 22:28:48 +00:00
|
|
|
if (inv->IsKindOf(RUNTIME_CLASS(AWeapon)) &&
|
|
|
|
!CPlayer->weapons.LocateWeapon(RUNTIME_TYPE(inv), NULL, NULL))
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
|
|
|
DrawOneWeapon(CPlayer, x, y, static_cast<AWeapon*>(inv));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// And now everything in the weapon slots back to front
|
2009-02-20 22:28:48 +00:00
|
|
|
for (k = NUM_WEAPON_SLOTS - 1; k >= 0; k--) for(j = CPlayer->weapons.Slots[k].Size() - 1; j >= 0; j--)
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
2009-02-20 22:28:48 +00:00
|
|
|
const PClass *weap = CPlayer->weapons.Slots[k].GetWeapon(j);
|
2008-01-11 22:38:10 +00:00
|
|
|
if (weap)
|
|
|
|
{
|
|
|
|
inv=CPlayer->mo->FindInventory(weap);
|
|
|
|
if (inv)
|
|
|
|
{
|
|
|
|
DrawOneWeapon(CPlayer, x, y, static_cast<AWeapon*>(inv));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// Draw the Inventory
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void DrawInventory(player_t * CPlayer, int x,int y)
|
|
|
|
{
|
|
|
|
AInventory * rover;
|
|
|
|
int numitems = (hudwidth - 2*x) / 32;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
CPlayer->mo->InvFirst = rover = StatusBar->ValidateInvFirst(numitems);
|
|
|
|
if (rover!=NULL)
|
|
|
|
{
|
|
|
|
if(rover->PrevInv())
|
|
|
|
{
|
|
|
|
screen->DrawTexture(invgems[!!(level.time&4)], x-10, y,
|
|
|
|
DTA_KeepRatio, true,
|
|
|
|
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, 0x6666, TAG_DONE);
|
|
|
|
}
|
|
|
|
|
|
|
|
for(i=0;i<numitems && rover;rover=rover->NextInv())
|
|
|
|
{
|
|
|
|
if (rover->Amount>0)
|
|
|
|
{
|
2008-06-15 18:36:26 +00:00
|
|
|
FTextureID AltIcon = GetHUDIcon(rover->GetClass());
|
2008-01-11 22:38:10 +00:00
|
|
|
|
2008-06-15 18:36:26 +00:00
|
|
|
if (AltIcon.Exists() && (rover->Icon.isValid() || AltIcon.isValid()) )
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
|
|
|
int trans = rover==CPlayer->mo->InvSel ? FRACUNIT : 0x6666;
|
|
|
|
|
2008-06-15 18:36:26 +00:00
|
|
|
DrawImageToBox(TexMan[AltIcon.isValid()? AltIcon : rover->Icon], x, y, 19, 25, trans);
|
2008-01-11 22:38:10 +00:00
|
|
|
if (rover->Amount>1)
|
|
|
|
{
|
|
|
|
char buffer[10];
|
|
|
|
int xx;
|
About a week's worth of changes here. As a heads-up, I wouldn't be
surprised if this doesn't build in Linux right now. The CMakeLists.txt
were checked with MinGW and NMake, but how they fair under Linux is an
unknown to me at this time.
- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
This is so that I can use a series of mysnprintf() calls and advance the
pointer for each one. Once the pointer goes beyond the end of the buffer,
the count will go negative, but since it's an unsigned type it will be
seen as excessively huge instead. This should not be a problem, as there's
no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
name when given a Hexen map number. This was fine with the old scanner
code, but only a happy coincidence prevents it from crashing with the new
code
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
is probably broken until I get around to booting into Linux again. Niceties
provided over the existing Makefiles they're replacing:
* All command-line builds can use the same build system, rather than having
a separate one for MinGW and another for Linux.
* Microsoft's NMake tool is supported as a target.
* Progress meters.
* Parallel makes work from a fresh checkout without needing to be primed
first with a single-threaded make.
* Porting to other architectures should be simplified, whenever that day
comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
itself instead of generating an external makefile to do it, since I couldn't
figure out how to generate a makefile with an external tool and include it
with a CMake-generated makefile. Where makewad used a master list of files
to generate the package file, zipdir just zips the entire contents of one or
more directories.
- Added the gdtoa package from netlib's fp library so that ZDoom's printf-style
formatting can be entirely independant of the CRT.
SVN r1082 (trunk)
2008-07-23 04:57:26 +00:00
|
|
|
mysnprintf(buffer, countof(buffer), "%d", rover->Amount);
|
2008-01-11 22:38:10 +00:00
|
|
|
if (rover->Amount>=1000) xx = 32 - IndexFont->StringWidth(buffer);
|
|
|
|
else xx = 22;
|
|
|
|
|
2008-11-27 17:43:36 +00:00
|
|
|
screen->DrawText(IndexFont, CR_GOLD, x+xx, y+20, buffer,
|
2008-01-11 22:38:10 +00:00
|
|
|
DTA_KeepRatio, true,
|
|
|
|
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, trans, TAG_DONE);
|
|
|
|
}
|
|
|
|
|
|
|
|
x+=32;
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(rover)
|
|
|
|
{
|
|
|
|
screen->DrawTexture(invgems[2 + !!(level.time&4)], x-10, y,
|
|
|
|
DTA_KeepRatio, true,
|
|
|
|
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, 0x6666, TAG_DONE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// Draw the Frags
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void DrawFrags(player_t * CPlayer, int x, int y)
|
|
|
|
{
|
|
|
|
DrawImageToBox(fragpic, x, y, 31, 17);
|
2008-11-27 17:43:36 +00:00
|
|
|
DrawHudNumber(HudFont, CR_GRAY, CPlayer->fragcount, x + 33, y + 17);
|
2008-01-11 22:38:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// PROC DrawCoordinates
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void DrawCoordinates(player_t * CPlayer)
|
|
|
|
{
|
|
|
|
fixed_t x;
|
|
|
|
fixed_t y;
|
|
|
|
fixed_t z;
|
|
|
|
char coordstr[18];
|
2008-11-27 17:43:36 +00:00
|
|
|
int h = SmallFont->GetHeight()+1;
|
2008-01-11 22:38:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
if (!map_point_coordinates || !automapactive)
|
|
|
|
{
|
|
|
|
x=CPlayer->mo->x;
|
|
|
|
y=CPlayer->mo->y;
|
|
|
|
z=CPlayer->mo->z;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
AM_GetPosition(x,y);
|
|
|
|
z = P_PointInSector(x, y)->floorplane.ZatPoint(x, y);
|
|
|
|
}
|
|
|
|
|
2008-06-10 09:16:01 +00:00
|
|
|
int vwidth = con_scaletext==0? SCREENWIDTH : SCREENWIDTH/2;
|
|
|
|
int vheight = con_scaletext==0? SCREENHEIGHT : SCREENHEIGHT/2;
|
|
|
|
int xpos = vwidth - SmallFont->StringWidth("X: -00000")-6;
|
2008-01-11 22:38:10 +00:00
|
|
|
int ypos = 18;
|
|
|
|
|
About a week's worth of changes here. As a heads-up, I wouldn't be
surprised if this doesn't build in Linux right now. The CMakeLists.txt
were checked with MinGW and NMake, but how they fair under Linux is an
unknown to me at this time.
- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
This is so that I can use a series of mysnprintf() calls and advance the
pointer for each one. Once the pointer goes beyond the end of the buffer,
the count will go negative, but since it's an unsigned type it will be
seen as excessively huge instead. This should not be a problem, as there's
no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
name when given a Hexen map number. This was fine with the old scanner
code, but only a happy coincidence prevents it from crashing with the new
code
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
is probably broken until I get around to booting into Linux again. Niceties
provided over the existing Makefiles they're replacing:
* All command-line builds can use the same build system, rather than having
a separate one for MinGW and another for Linux.
* Microsoft's NMake tool is supported as a target.
* Progress meters.
* Parallel makes work from a fresh checkout without needing to be primed
first with a single-threaded make.
* Porting to other architectures should be simplified, whenever that day
comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
itself instead of generating an external makefile to do it, since I couldn't
figure out how to generate a makefile with an external tool and include it
with a CMake-generated makefile. Where makewad used a master list of files
to generate the package file, zipdir just zips the entire contents of one or
more directories.
- Added the gdtoa package from netlib's fp library so that ZDoom's printf-style
formatting can be entirely independant of the CRT.
SVN r1082 (trunk)
2008-07-23 04:57:26 +00:00
|
|
|
mysnprintf(coordstr, countof(coordstr), "X: %d", x>>FRACBITS);
|
2008-11-27 17:43:36 +00:00
|
|
|
screen->DrawText(SmallFont, hudcolor_xyco, xpos, ypos, coordstr,
|
2008-01-11 22:38:10 +00:00
|
|
|
DTA_KeepRatio, true,
|
|
|
|
DTA_VirtualWidth, vwidth, DTA_VirtualHeight, vheight, TAG_DONE);
|
|
|
|
|
About a week's worth of changes here. As a heads-up, I wouldn't be
surprised if this doesn't build in Linux right now. The CMakeLists.txt
were checked with MinGW and NMake, but how they fair under Linux is an
unknown to me at this time.
- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
This is so that I can use a series of mysnprintf() calls and advance the
pointer for each one. Once the pointer goes beyond the end of the buffer,
the count will go negative, but since it's an unsigned type it will be
seen as excessively huge instead. This should not be a problem, as there's
no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
name when given a Hexen map number. This was fine with the old scanner
code, but only a happy coincidence prevents it from crashing with the new
code
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
is probably broken until I get around to booting into Linux again. Niceties
provided over the existing Makefiles they're replacing:
* All command-line builds can use the same build system, rather than having
a separate one for MinGW and another for Linux.
* Microsoft's NMake tool is supported as a target.
* Progress meters.
* Parallel makes work from a fresh checkout without needing to be primed
first with a single-threaded make.
* Porting to other architectures should be simplified, whenever that day
comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
itself instead of generating an external makefile to do it, since I couldn't
figure out how to generate a makefile with an external tool and include it
with a CMake-generated makefile. Where makewad used a master list of files
to generate the package file, zipdir just zips the entire contents of one or
more directories.
- Added the gdtoa package from netlib's fp library so that ZDoom's printf-style
formatting can be entirely independant of the CRT.
SVN r1082 (trunk)
2008-07-23 04:57:26 +00:00
|
|
|
mysnprintf(coordstr, countof(coordstr), "Y: %d", y>>FRACBITS);
|
2008-11-27 17:43:36 +00:00
|
|
|
screen->DrawText(SmallFont, hudcolor_xyco, xpos, ypos+h, coordstr,
|
2008-01-11 22:38:10 +00:00
|
|
|
DTA_KeepRatio, true,
|
|
|
|
DTA_VirtualWidth, vwidth, DTA_VirtualHeight, vheight, TAG_DONE);
|
|
|
|
|
About a week's worth of changes here. As a heads-up, I wouldn't be
surprised if this doesn't build in Linux right now. The CMakeLists.txt
were checked with MinGW and NMake, but how they fair under Linux is an
unknown to me at this time.
- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
This is so that I can use a series of mysnprintf() calls and advance the
pointer for each one. Once the pointer goes beyond the end of the buffer,
the count will go negative, but since it's an unsigned type it will be
seen as excessively huge instead. This should not be a problem, as there's
no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
name when given a Hexen map number. This was fine with the old scanner
code, but only a happy coincidence prevents it from crashing with the new
code
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
is probably broken until I get around to booting into Linux again. Niceties
provided over the existing Makefiles they're replacing:
* All command-line builds can use the same build system, rather than having
a separate one for MinGW and another for Linux.
* Microsoft's NMake tool is supported as a target.
* Progress meters.
* Parallel makes work from a fresh checkout without needing to be primed
first with a single-threaded make.
* Porting to other architectures should be simplified, whenever that day
comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
itself instead of generating an external makefile to do it, since I couldn't
figure out how to generate a makefile with an external tool and include it
with a CMake-generated makefile. Where makewad used a master list of files
to generate the package file, zipdir just zips the entire contents of one or
more directories.
- Added the gdtoa package from netlib's fp library so that ZDoom's printf-style
formatting can be entirely independant of the CRT.
SVN r1082 (trunk)
2008-07-23 04:57:26 +00:00
|
|
|
mysnprintf(coordstr, countof(coordstr), "Z: %d", z>>FRACBITS);
|
2008-11-27 17:43:36 +00:00
|
|
|
screen->DrawText(SmallFont, hudcolor_xyco, xpos, ypos+2*h, coordstr,
|
2008-01-11 22:38:10 +00:00
|
|
|
DTA_KeepRatio, true,
|
|
|
|
DTA_VirtualWidth, vwidth, DTA_VirtualHeight, vheight, TAG_DONE);
|
|
|
|
}
|
|
|
|
|
2013-02-19 02:58:03 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// Draw in-game time
|
|
|
|
//
|
|
|
|
// Check AltHUDTime option value in wadsrc/static/menudef.txt
|
|
|
|
// for meaning of all display modes
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void DrawTime()
|
|
|
|
{
|
|
|
|
if (hud_showtime <= 0 || hud_showtime > 9)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
int hours = 0;
|
|
|
|
int minutes = 0;
|
|
|
|
int seconds = 0;
|
|
|
|
|
|
|
|
if (hud_showtime < 8)
|
|
|
|
{
|
|
|
|
const int timeTicks =
|
|
|
|
hud_showtime < 4
|
|
|
|
? level.maptime
|
|
|
|
: (hud_showtime < 6
|
|
|
|
? level.time
|
|
|
|
: level.totaltime);
|
|
|
|
const int timeSeconds = timeTicks / TICRATE;
|
|
|
|
|
|
|
|
hours = timeSeconds / 3600;
|
|
|
|
minutes = (timeSeconds % 3600) / 60;
|
|
|
|
seconds = timeSeconds % 60;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
time_t now;
|
|
|
|
time(&now);
|
|
|
|
|
|
|
|
struct tm* timeinfo = localtime(&now);
|
|
|
|
|
|
|
|
if (NULL != timeinfo)
|
|
|
|
{
|
|
|
|
hours = timeinfo->tm_hour;
|
|
|
|
minutes = timeinfo->tm_min;
|
|
|
|
seconds = timeinfo->tm_sec;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const bool showMillis = 1 == hud_showtime;
|
|
|
|
const bool showSeconds = showMillis || (0 == hud_showtime % 2);
|
|
|
|
|
|
|
|
char timeString[sizeof "HH:MM:SS.MMM"];
|
|
|
|
|
|
|
|
if (showMillis)
|
|
|
|
{
|
|
|
|
const int millis = (level.time % TICRATE) * (1000 / TICRATE);
|
|
|
|
|
|
|
|
mysnprintf(timeString, sizeof(timeString), "%02i:%02i:%02i.%03i", hours, minutes, seconds, millis);
|
|
|
|
}
|
|
|
|
else if (showSeconds)
|
|
|
|
{
|
|
|
|
mysnprintf(timeString, sizeof(timeString), "%02i:%02i:%02i", hours, minutes, seconds);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mysnprintf(timeString, sizeof(timeString), "%02i:%02i", hours, minutes);
|
|
|
|
}
|
|
|
|
|
|
|
|
const int characterCount = static_cast<int>( sizeof "HH:MM" - 1
|
|
|
|
+ (showSeconds ? sizeof ":SS" - 1 : 0)
|
|
|
|
+ (showMillis ? sizeof ".MMM" - 1 : 0) );
|
|
|
|
const int width = SmallFont->GetCharWidth('0') * characterCount + 2; // small offset from screen's border
|
|
|
|
const int height = SmallFont->GetHeight();
|
|
|
|
|
|
|
|
DrawHudText(SmallFont, hud_timecolor, timeString, hudwidth - width, height, FRACUNIT);
|
|
|
|
}
|
|
|
|
|
2008-01-11 22:38:10 +00:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// draw the overlay
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void DrawHUD()
|
|
|
|
{
|
|
|
|
player_t * CPlayer = StatusBar->CPlayer;
|
|
|
|
|
|
|
|
players[consoleplayer].inventorytics = 0;
|
|
|
|
if (hud_althudscale && SCREENWIDTH>640)
|
|
|
|
{
|
|
|
|
hudwidth=SCREENWIDTH/2;
|
|
|
|
if (hud_althudscale == 2)
|
|
|
|
{
|
|
|
|
// Optionally just double the pixels to reduce scaling artifacts.
|
|
|
|
hudheight=SCREENHEIGHT/2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (WidescreenRatio == 4)
|
|
|
|
{
|
|
|
|
hudheight = hudwidth * 30 / BaseRatioSizes[WidescreenRatio][3]; // BaseRatioSizes is inverted for this mode
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
hudheight = hudwidth * 30 / (48*48/BaseRatioSizes[WidescreenRatio][3]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
hudwidth=SCREENWIDTH;
|
|
|
|
hudheight=SCREENHEIGHT;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!automapactive)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
// No HUD in the title level!
|
|
|
|
if (gamestate == GS_TITLELEVEL || !CPlayer) return;
|
|
|
|
|
|
|
|
if (!deathmatch) DrawStatus(CPlayer, 5, hudheight-50);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
DrawStatus(CPlayer, 5, hudheight-75);
|
|
|
|
DrawFrags(CPlayer, 5, hudheight-70);
|
|
|
|
}
|
2012-12-22 22:37:58 +00:00
|
|
|
DrawHealth(CPlayer, 5, hudheight-45);
|
2010-12-20 10:07:44 +00:00
|
|
|
DrawArmor(CPlayer->mo->FindInventory<ABasicArmor>(),
|
|
|
|
CPlayer->mo->FindInventory<AHexenArmor>(), 5, hudheight-20);
|
2008-01-11 22:38:10 +00:00
|
|
|
i=DrawKeys(CPlayer, hudwidth-4, hudheight-10);
|
|
|
|
i=DrawAmmo(CPlayer, hudwidth-5, i);
|
|
|
|
DrawWeapons(CPlayer, hudwidth-5, i);
|
|
|
|
DrawInventory(CPlayer, 144, hudheight-28);
|
|
|
|
if (CPlayer->camera && CPlayer->camera->player)
|
|
|
|
{
|
|
|
|
StatusBar->DrawCrosshair();
|
|
|
|
}
|
|
|
|
if (idmypos) DrawCoordinates(CPlayer);
|
2013-02-19 02:58:03 +00:00
|
|
|
|
|
|
|
DrawTime();
|
2008-01-11 22:38:10 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-10-24 07:31:39 +00:00
|
|
|
FString mapname;
|
2008-01-11 22:38:10 +00:00
|
|
|
char printstr[256];
|
|
|
|
int seconds;
|
|
|
|
int length=8*SmallFont->GetCharWidth('0');
|
|
|
|
int fonth=SmallFont->GetHeight()+1;
|
|
|
|
int bottom=hudheight-1;
|
|
|
|
|
|
|
|
if (am_showtotaltime)
|
|
|
|
{
|
|
|
|
seconds = level.totaltime / TICRATE;
|
About a week's worth of changes here. As a heads-up, I wouldn't be
surprised if this doesn't build in Linux right now. The CMakeLists.txt
were checked with MinGW and NMake, but how they fair under Linux is an
unknown to me at this time.
- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
This is so that I can use a series of mysnprintf() calls and advance the
pointer for each one. Once the pointer goes beyond the end of the buffer,
the count will go negative, but since it's an unsigned type it will be
seen as excessively huge instead. This should not be a problem, as there's
no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
name when given a Hexen map number. This was fine with the old scanner
code, but only a happy coincidence prevents it from crashing with the new
code
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
is probably broken until I get around to booting into Linux again. Niceties
provided over the existing Makefiles they're replacing:
* All command-line builds can use the same build system, rather than having
a separate one for MinGW and another for Linux.
* Microsoft's NMake tool is supported as a target.
* Progress meters.
* Parallel makes work from a fresh checkout without needing to be primed
first with a single-threaded make.
* Porting to other architectures should be simplified, whenever that day
comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
itself instead of generating an external makefile to do it, since I couldn't
figure out how to generate a makefile with an external tool and include it
with a CMake-generated makefile. Where makewad used a master list of files
to generate the package file, zipdir just zips the entire contents of one or
more directories.
- Added the gdtoa package from netlib's fp library so that ZDoom's printf-style
formatting can be entirely independant of the CRT.
SVN r1082 (trunk)
2008-07-23 04:57:26 +00:00
|
|
|
mysnprintf(printstr, countof(printstr), "%02i:%02i:%02i", seconds/3600, (seconds%3600)/60, seconds%60);
|
2008-11-27 17:43:36 +00:00
|
|
|
DrawHudText(SmallFont, hudcolor_ttim, printstr, hudwidth-length, bottom, FRACUNIT);
|
2008-01-11 22:38:10 +00:00
|
|
|
bottom -= fonth;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (am_showtime)
|
|
|
|
{
|
|
|
|
if (level.clusterflags&CLUSTER_HUB)
|
|
|
|
{
|
2013-01-26 03:21:09 +00:00
|
|
|
seconds = level.time /TICRATE;
|
About a week's worth of changes here. As a heads-up, I wouldn't be
surprised if this doesn't build in Linux right now. The CMakeLists.txt
were checked with MinGW and NMake, but how they fair under Linux is an
unknown to me at this time.
- Converted most sprintf (and all wsprintf) calls to either mysnprintf or
FStrings, depending on the situation.
- Changed the strings in the wbstartstruct to be FStrings.
- Changed myvsnprintf() to output nothing if count is greater than INT_MAX.
This is so that I can use a series of mysnprintf() calls and advance the
pointer for each one. Once the pointer goes beyond the end of the buffer,
the count will go negative, but since it's an unsigned type it will be
seen as excessively huge instead. This should not be a problem, as there's
no reason for ZDoom to be using text buffers larger than 2 GB anywhere.
- Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig().
- Changed CalcMapName() to return an FString instead of a pointer to a static
buffer.
- Changed startmap in d_main.cpp into an FString.
- Changed CheckWarpTransMap() to take an FString& as the first argument.
- Changed d_mapname in g_level.cpp into an FString.
- Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an
FString.
- Fixed: The MAPINFO parser wrote into the string buffer to construct a map
name when given a Hexen map number. This was fine with the old scanner
code, but only a happy coincidence prevents it from crashing with the new
code
- Added the 'B' conversion specifier to StringFormat::VWorker() for printing
binary numbers.
- Added CMake support for building with MinGW, MSYS, and NMake. Linux support
is probably broken until I get around to booting into Linux again. Niceties
provided over the existing Makefiles they're replacing:
* All command-line builds can use the same build system, rather than having
a separate one for MinGW and another for Linux.
* Microsoft's NMake tool is supported as a target.
* Progress meters.
* Parallel makes work from a fresh checkout without needing to be primed
first with a single-threaded make.
* Porting to other architectures should be simplified, whenever that day
comes.
- Replaced the makewad tool with zipdir. This handles the dependency tracking
itself instead of generating an external makefile to do it, since I couldn't
figure out how to generate a makefile with an external tool and include it
with a CMake-generated makefile. Where makewad used a master list of files
to generate the package file, zipdir just zips the entire contents of one or
more directories.
- Added the gdtoa package from netlib's fp library so that ZDoom's printf-style
formatting can be entirely independant of the CRT.
SVN r1082 (trunk)
2008-07-23 04:57:26 +00:00
|
|
|
mysnprintf(printstr, countof(printstr), "%02i:%02i:%02i", seconds/3600, (seconds%3600)/60, seconds%60);
|
2013-01-26 03:21:09 +00:00
|
|
|
DrawHudText(SmallFont, hudcolor_time, printstr, hudwidth-length, bottom, FRACUNIT);
|
|
|
|
bottom -= fonth;
|
2008-01-11 22:38:10 +00:00
|
|
|
}
|
2013-01-26 03:21:09 +00:00
|
|
|
|
|
|
|
// Single level time for hubs
|
|
|
|
seconds= level.maptime /TICRATE;
|
|
|
|
mysnprintf(printstr, countof(printstr), "%02i:%02i:%02i", seconds/3600, (seconds%3600)/60, seconds%60);
|
|
|
|
DrawHudText(SmallFont, hudcolor_ltim, printstr, hudwidth-length, bottom, FRACUNIT);
|
2008-01-11 22:38:10 +00:00
|
|
|
}
|
|
|
|
|
2010-10-24 07:31:39 +00:00
|
|
|
ST_FormatMapName(mapname);
|
|
|
|
screen->DrawText(SmallFont, hudcolor_titl, 1, hudheight-fonth-1, mapname,
|
2008-01-11 22:38:10 +00:00
|
|
|
DTA_KeepRatio, true,
|
|
|
|
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, TAG_DONE);
|
|
|
|
|
|
|
|
DrawCoordinates(CPlayer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Initialize the fonts and other data
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void HUD_InitHud()
|
|
|
|
{
|
|
|
|
switch (gameinfo.gametype)
|
|
|
|
{
|
|
|
|
case GAME_Heretic:
|
|
|
|
case GAME_Hexen:
|
2008-01-26 23:20:34 +00:00
|
|
|
healthpic = TexMan.FindTexture("ARTIPTN2");
|
2008-01-11 22:38:10 +00:00
|
|
|
HudFont=FFont::FindFont("HUDFONT_RAVEN");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GAME_Strife:
|
2008-01-26 23:20:34 +00:00
|
|
|
healthpic = TexMan.FindTexture("I_MDKT");
|
2008-01-11 22:38:10 +00:00
|
|
|
HudFont=BigFont; // Strife doesn't have anything nice so use the standard font
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2008-01-26 23:20:34 +00:00
|
|
|
healthpic = TexMan.FindTexture("MEDIA0");
|
2012-12-22 22:37:58 +00:00
|
|
|
berserkpic = TexMan.FindTexture("PSTRA0");
|
2008-01-11 22:38:10 +00:00
|
|
|
HudFont=FFont::FindFont("HUDFONT_DOOM");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
IndexFont = V_GetFont("INDEXFONT");
|
|
|
|
|
|
|
|
if (HudFont == NULL) HudFont = BigFont;
|
|
|
|
if (IndexFont == NULL) IndexFont = ConFont; // Emergency fallback
|
|
|
|
|
2008-01-26 23:20:34 +00:00
|
|
|
invgems[0] = TexMan.FindTexture("INVGEML1");
|
|
|
|
invgems[1] = TexMan.FindTexture("INVGEML2");
|
|
|
|
invgems[2] = TexMan.FindTexture("INVGEMR1");
|
|
|
|
invgems[3] = TexMan.FindTexture("INVGEMR2");
|
2008-01-11 22:38:10 +00:00
|
|
|
|
2008-01-26 23:20:34 +00:00
|
|
|
fragpic = TexMan.FindTexture("HU_FRAGS"); // Sadly, I don't have anything usable for this. :(
|
2008-01-11 22:38:10 +00:00
|
|
|
|
|
|
|
KeyTypes.Clear();
|
|
|
|
UnassignedKeyTypes.Clear();
|
|
|
|
|
2010-01-30 09:17:44 +00:00
|
|
|
statspace = SmallFont->StringWidth("Ac:");
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-01-11 22:38:10 +00:00
|
|
|
// Now read custom icon overrides
|
|
|
|
int lump, lastlump = 0;
|
|
|
|
|
|
|
|
while ((lump = Wads.FindLump ("ALTHUDCF", &lastlump)) != -1)
|
|
|
|
{
|
2008-04-03 03:19:21 +00:00
|
|
|
FScanner sc(lump);
|
- Updated lempar.c to v1.31.
- Added .txt files to the list of types (wad, zip, and pk3) that can be
loaded without listing them after -file.
- Fonts that are created by the ACS setfont command to wrap a texture now
support animated textures.
- FON2 fonts can now use their full palette for CR_UNTRANSLATED when drawn
with the hardware 2D path instead of being restricted to the game palette.
- Fixed: Toggling vid_vsync would reset the displayed fullscreen gamma to 1
on a Radeon 9000.
- Added back the off-by-one palette handling, but in a much more limited
scope than before. The skipped entry is assumed to always be at 248, and
it is assumed that all Shader Model 1.4 cards suffer from this. That's
because all SM1.4 cards are based on variants of the ATI R200 core, and the
RV250 in a Radeon 9000 craps up like this. I see no reason to assume that
other flavors of the R200 are any different. (Interesting note: With the
Radeon 9000, D3DTADDRESS_CLAMP is an invalid address mode when using the
debug Direct3D 9 runtime, but it works perfectly fine with the retail
Direct3D 9 runtime.) (Insight: The R200 probably uses bytes for all its
math inside pixel shaders. That would explain perfectly why I can't use
constants greater than 1 with PS1.4 and why it can't do an exact mapping to
every entry in the color palette.
- Fixed: The software shaded drawer did not work for 2D, because its selected
"color"map was replaced with the identitymap before being used.
- Fixed: I cannot use Printf to output messages before the framebuffer was
completely setup, meaning that Shader Model 1.4 cards could not change
resolution.
- I have decided to let remap palettes specify variable alpha values for
their colors. D3DFB no longer forces them to 255.
- Updated re2c to version 0.12.3.
- Fixed: A_Wander used threshold as a timer, when it should have used
reactiontime.
- Fixed: A_CustomRailgun would not fire at all for actors without a target
when the aim parameter was disabled.
- Made the warp command work in multiplayer, again courtesy of Karate Chris.
- Fixed: Trying to spawn a bot while not in a game made for a crashing time.
(Patch courtesy of Karate Chris.)
- Removed some floating point math from hu_scores.cpp that somebody's GCC
gave warnings for (not mine, though).
- Fixed: The SBarInfo drawbar command crashed if the sprite image was
unavailable.
- Fixed: FString::operator=(const char *) did not release its old buffer when
being assigned to the null string.
- The scanner no longer has an upper limit on the length of strings it
accepts, though short strings will be faster than long ones.
- Moved all the text scanning functions into a class. Mainly, this means that
multiple script scanner states can be stored without being forced to do so
recursively. I think I might be taking advantage of that in the near
future. Possibly. Maybe.
- Removed some potential buffer overflows from the decal parser.
- Applied Blzut3's SBARINFO update #9:
* Fixed: When using even length values in drawnumber it would cap to a 98
value instead of a 99 as intended.
* The SBarInfo parser can now accept negatives for coordinates. This
doesn't allow much right now, but later I plan to add better fullscreen
hud support in which the negatives will be more useful. This also cleans
up the source a bit since all calls for (x, y) coordinates are with the
function getCoordinates().
- Added support for stencilling actors.
- Added support for non-black colors specified with DTA_ColorOverlay to the
software renderer.
- Fixed: The inverse, gold, red, and green fixed colormaps each allocated
space for 32 different colormaps, even though each only used the first one.
- Added two new blending flags to make reverse subtract blending more useful:
STYLEF_InvertSource and STYLEF_InvertOverlay. These invert the color that
gets blended with the background, since that seems like a good idea for
reverse subtraction. They also work with the other two blending operations.
- Added subtract and reverse subtract blending operations to the renderer.
Since the ERenderStyle enumeration was getting rather unwieldy, I converted
it into a new FRenderStyle structure that lets each parameter of the
blending equation be set separately. This simplified the set up for the
blend quite a bit, and it means a number of new combinations are available
by setting the parameters properly.
SVN r710 (trunk)
2008-01-25 23:57:44 +00:00
|
|
|
while (sc.GetString())
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
- Updated lempar.c to v1.31.
- Added .txt files to the list of types (wad, zip, and pk3) that can be
loaded without listing them after -file.
- Fonts that are created by the ACS setfont command to wrap a texture now
support animated textures.
- FON2 fonts can now use their full palette for CR_UNTRANSLATED when drawn
with the hardware 2D path instead of being restricted to the game palette.
- Fixed: Toggling vid_vsync would reset the displayed fullscreen gamma to 1
on a Radeon 9000.
- Added back the off-by-one palette handling, but in a much more limited
scope than before. The skipped entry is assumed to always be at 248, and
it is assumed that all Shader Model 1.4 cards suffer from this. That's
because all SM1.4 cards are based on variants of the ATI R200 core, and the
RV250 in a Radeon 9000 craps up like this. I see no reason to assume that
other flavors of the R200 are any different. (Interesting note: With the
Radeon 9000, D3DTADDRESS_CLAMP is an invalid address mode when using the
debug Direct3D 9 runtime, but it works perfectly fine with the retail
Direct3D 9 runtime.) (Insight: The R200 probably uses bytes for all its
math inside pixel shaders. That would explain perfectly why I can't use
constants greater than 1 with PS1.4 and why it can't do an exact mapping to
every entry in the color palette.
- Fixed: The software shaded drawer did not work for 2D, because its selected
"color"map was replaced with the identitymap before being used.
- Fixed: I cannot use Printf to output messages before the framebuffer was
completely setup, meaning that Shader Model 1.4 cards could not change
resolution.
- I have decided to let remap palettes specify variable alpha values for
their colors. D3DFB no longer forces them to 255.
- Updated re2c to version 0.12.3.
- Fixed: A_Wander used threshold as a timer, when it should have used
reactiontime.
- Fixed: A_CustomRailgun would not fire at all for actors without a target
when the aim parameter was disabled.
- Made the warp command work in multiplayer, again courtesy of Karate Chris.
- Fixed: Trying to spawn a bot while not in a game made for a crashing time.
(Patch courtesy of Karate Chris.)
- Removed some floating point math from hu_scores.cpp that somebody's GCC
gave warnings for (not mine, though).
- Fixed: The SBarInfo drawbar command crashed if the sprite image was
unavailable.
- Fixed: FString::operator=(const char *) did not release its old buffer when
being assigned to the null string.
- The scanner no longer has an upper limit on the length of strings it
accepts, though short strings will be faster than long ones.
- Moved all the text scanning functions into a class. Mainly, this means that
multiple script scanner states can be stored without being forced to do so
recursively. I think I might be taking advantage of that in the near
future. Possibly. Maybe.
- Removed some potential buffer overflows from the decal parser.
- Applied Blzut3's SBARINFO update #9:
* Fixed: When using even length values in drawnumber it would cap to a 98
value instead of a 99 as intended.
* The SBarInfo parser can now accept negatives for coordinates. This
doesn't allow much right now, but later I plan to add better fullscreen
hud support in which the negatives will be more useful. This also cleans
up the source a bit since all calls for (x, y) coordinates are with the
function getCoordinates().
- Added support for stencilling actors.
- Added support for non-black colors specified with DTA_ColorOverlay to the
software renderer.
- Fixed: The inverse, gold, red, and green fixed colormaps each allocated
space for 32 different colormaps, even though each only used the first one.
- Added two new blending flags to make reverse subtract blending more useful:
STYLEF_InvertSource and STYLEF_InvertOverlay. These invert the color that
gets blended with the background, since that seems like a good idea for
reverse subtraction. They also work with the other two blending operations.
- Added subtract and reverse subtract blending operations to the renderer.
Since the ERenderStyle enumeration was getting rather unwieldy, I converted
it into a new FRenderStyle structure that lets each parameter of the
blending equation be set separately. This simplified the set up for the
blend quite a bit, and it means a number of new combinations are available
by setting the parameters properly.
SVN r710 (trunk)
2008-01-25 23:57:44 +00:00
|
|
|
if (sc.Compare("Health"))
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
- Updated lempar.c to v1.31.
- Added .txt files to the list of types (wad, zip, and pk3) that can be
loaded without listing them after -file.
- Fonts that are created by the ACS setfont command to wrap a texture now
support animated textures.
- FON2 fonts can now use their full palette for CR_UNTRANSLATED when drawn
with the hardware 2D path instead of being restricted to the game palette.
- Fixed: Toggling vid_vsync would reset the displayed fullscreen gamma to 1
on a Radeon 9000.
- Added back the off-by-one palette handling, but in a much more limited
scope than before. The skipped entry is assumed to always be at 248, and
it is assumed that all Shader Model 1.4 cards suffer from this. That's
because all SM1.4 cards are based on variants of the ATI R200 core, and the
RV250 in a Radeon 9000 craps up like this. I see no reason to assume that
other flavors of the R200 are any different. (Interesting note: With the
Radeon 9000, D3DTADDRESS_CLAMP is an invalid address mode when using the
debug Direct3D 9 runtime, but it works perfectly fine with the retail
Direct3D 9 runtime.) (Insight: The R200 probably uses bytes for all its
math inside pixel shaders. That would explain perfectly why I can't use
constants greater than 1 with PS1.4 and why it can't do an exact mapping to
every entry in the color palette.
- Fixed: The software shaded drawer did not work for 2D, because its selected
"color"map was replaced with the identitymap before being used.
- Fixed: I cannot use Printf to output messages before the framebuffer was
completely setup, meaning that Shader Model 1.4 cards could not change
resolution.
- I have decided to let remap palettes specify variable alpha values for
their colors. D3DFB no longer forces them to 255.
- Updated re2c to version 0.12.3.
- Fixed: A_Wander used threshold as a timer, when it should have used
reactiontime.
- Fixed: A_CustomRailgun would not fire at all for actors without a target
when the aim parameter was disabled.
- Made the warp command work in multiplayer, again courtesy of Karate Chris.
- Fixed: Trying to spawn a bot while not in a game made for a crashing time.
(Patch courtesy of Karate Chris.)
- Removed some floating point math from hu_scores.cpp that somebody's GCC
gave warnings for (not mine, though).
- Fixed: The SBarInfo drawbar command crashed if the sprite image was
unavailable.
- Fixed: FString::operator=(const char *) did not release its old buffer when
being assigned to the null string.
- The scanner no longer has an upper limit on the length of strings it
accepts, though short strings will be faster than long ones.
- Moved all the text scanning functions into a class. Mainly, this means that
multiple script scanner states can be stored without being forced to do so
recursively. I think I might be taking advantage of that in the near
future. Possibly. Maybe.
- Removed some potential buffer overflows from the decal parser.
- Applied Blzut3's SBARINFO update #9:
* Fixed: When using even length values in drawnumber it would cap to a 98
value instead of a 99 as intended.
* The SBarInfo parser can now accept negatives for coordinates. This
doesn't allow much right now, but later I plan to add better fullscreen
hud support in which the negatives will be more useful. This also cleans
up the source a bit since all calls for (x, y) coordinates are with the
function getCoordinates().
- Added support for stencilling actors.
- Added support for non-black colors specified with DTA_ColorOverlay to the
software renderer.
- Fixed: The inverse, gold, red, and green fixed colormaps each allocated
space for 32 different colormaps, even though each only used the first one.
- Added two new blending flags to make reverse subtract blending more useful:
STYLEF_InvertSource and STYLEF_InvertOverlay. These invert the color that
gets blended with the background, since that seems like a good idea for
reverse subtraction. They also work with the other two blending operations.
- Added subtract and reverse subtract blending operations to the renderer.
Since the ERenderStyle enumeration was getting rather unwieldy, I converted
it into a new FRenderStyle structure that lets each parameter of the
blending equation be set separately. This simplified the set up for the
blend quite a bit, and it means a number of new combinations are available
by setting the parameters properly.
SVN r710 (trunk)
2008-01-25 23:57:44 +00:00
|
|
|
sc.MustGetString();
|
2008-06-15 18:36:26 +00:00
|
|
|
FTextureID tex = TexMan.CheckForTexture(sc.String, FTexture::TEX_MiscPatch);
|
|
|
|
if (tex.isValid()) healthpic = TexMan[tex];
|
2008-01-11 22:38:10 +00:00
|
|
|
}
|
2012-12-22 22:37:58 +00:00
|
|
|
else if (sc.Compare("Berserk"))
|
|
|
|
{
|
|
|
|
sc.MustGetString();
|
|
|
|
FTextureID tex = TexMan.CheckForTexture(sc.String, FTexture::TEX_MiscPatch);
|
|
|
|
if (tex.isValid()) berserkpic = TexMan[tex];
|
|
|
|
}
|
2008-01-11 22:38:10 +00:00
|
|
|
else
|
|
|
|
{
|
- Updated lempar.c to v1.31.
- Added .txt files to the list of types (wad, zip, and pk3) that can be
loaded without listing them after -file.
- Fonts that are created by the ACS setfont command to wrap a texture now
support animated textures.
- FON2 fonts can now use their full palette for CR_UNTRANSLATED when drawn
with the hardware 2D path instead of being restricted to the game palette.
- Fixed: Toggling vid_vsync would reset the displayed fullscreen gamma to 1
on a Radeon 9000.
- Added back the off-by-one palette handling, but in a much more limited
scope than before. The skipped entry is assumed to always be at 248, and
it is assumed that all Shader Model 1.4 cards suffer from this. That's
because all SM1.4 cards are based on variants of the ATI R200 core, and the
RV250 in a Radeon 9000 craps up like this. I see no reason to assume that
other flavors of the R200 are any different. (Interesting note: With the
Radeon 9000, D3DTADDRESS_CLAMP is an invalid address mode when using the
debug Direct3D 9 runtime, but it works perfectly fine with the retail
Direct3D 9 runtime.) (Insight: The R200 probably uses bytes for all its
math inside pixel shaders. That would explain perfectly why I can't use
constants greater than 1 with PS1.4 and why it can't do an exact mapping to
every entry in the color palette.
- Fixed: The software shaded drawer did not work for 2D, because its selected
"color"map was replaced with the identitymap before being used.
- Fixed: I cannot use Printf to output messages before the framebuffer was
completely setup, meaning that Shader Model 1.4 cards could not change
resolution.
- I have decided to let remap palettes specify variable alpha values for
their colors. D3DFB no longer forces them to 255.
- Updated re2c to version 0.12.3.
- Fixed: A_Wander used threshold as a timer, when it should have used
reactiontime.
- Fixed: A_CustomRailgun would not fire at all for actors without a target
when the aim parameter was disabled.
- Made the warp command work in multiplayer, again courtesy of Karate Chris.
- Fixed: Trying to spawn a bot while not in a game made for a crashing time.
(Patch courtesy of Karate Chris.)
- Removed some floating point math from hu_scores.cpp that somebody's GCC
gave warnings for (not mine, though).
- Fixed: The SBarInfo drawbar command crashed if the sprite image was
unavailable.
- Fixed: FString::operator=(const char *) did not release its old buffer when
being assigned to the null string.
- The scanner no longer has an upper limit on the length of strings it
accepts, though short strings will be faster than long ones.
- Moved all the text scanning functions into a class. Mainly, this means that
multiple script scanner states can be stored without being forced to do so
recursively. I think I might be taking advantage of that in the near
future. Possibly. Maybe.
- Removed some potential buffer overflows from the decal parser.
- Applied Blzut3's SBARINFO update #9:
* Fixed: When using even length values in drawnumber it would cap to a 98
value instead of a 99 as intended.
* The SBarInfo parser can now accept negatives for coordinates. This
doesn't allow much right now, but later I plan to add better fullscreen
hud support in which the negatives will be more useful. This also cleans
up the source a bit since all calls for (x, y) coordinates are with the
function getCoordinates().
- Added support for stencilling actors.
- Added support for non-black colors specified with DTA_ColorOverlay to the
software renderer.
- Fixed: The inverse, gold, red, and green fixed colormaps each allocated
space for 32 different colormaps, even though each only used the first one.
- Added two new blending flags to make reverse subtract blending more useful:
STYLEF_InvertSource and STYLEF_InvertOverlay. These invert the color that
gets blended with the background, since that seems like a good idea for
reverse subtraction. They also work with the other two blending operations.
- Added subtract and reverse subtract blending operations to the renderer.
Since the ERenderStyle enumeration was getting rather unwieldy, I converted
it into a new FRenderStyle structure that lets each parameter of the
blending equation be set separately. This simplified the set up for the
blend quite a bit, and it means a number of new combinations are available
by setting the parameters properly.
SVN r710 (trunk)
2008-01-25 23:57:44 +00:00
|
|
|
const PClass * ti = PClass::FindClass(sc.String);
|
2008-01-11 22:38:10 +00:00
|
|
|
if (!ti)
|
|
|
|
{
|
- Updated lempar.c to v1.31.
- Added .txt files to the list of types (wad, zip, and pk3) that can be
loaded without listing them after -file.
- Fonts that are created by the ACS setfont command to wrap a texture now
support animated textures.
- FON2 fonts can now use their full palette for CR_UNTRANSLATED when drawn
with the hardware 2D path instead of being restricted to the game palette.
- Fixed: Toggling vid_vsync would reset the displayed fullscreen gamma to 1
on a Radeon 9000.
- Added back the off-by-one palette handling, but in a much more limited
scope than before. The skipped entry is assumed to always be at 248, and
it is assumed that all Shader Model 1.4 cards suffer from this. That's
because all SM1.4 cards are based on variants of the ATI R200 core, and the
RV250 in a Radeon 9000 craps up like this. I see no reason to assume that
other flavors of the R200 are any different. (Interesting note: With the
Radeon 9000, D3DTADDRESS_CLAMP is an invalid address mode when using the
debug Direct3D 9 runtime, but it works perfectly fine with the retail
Direct3D 9 runtime.) (Insight: The R200 probably uses bytes for all its
math inside pixel shaders. That would explain perfectly why I can't use
constants greater than 1 with PS1.4 and why it can't do an exact mapping to
every entry in the color palette.
- Fixed: The software shaded drawer did not work for 2D, because its selected
"color"map was replaced with the identitymap before being used.
- Fixed: I cannot use Printf to output messages before the framebuffer was
completely setup, meaning that Shader Model 1.4 cards could not change
resolution.
- I have decided to let remap palettes specify variable alpha values for
their colors. D3DFB no longer forces them to 255.
- Updated re2c to version 0.12.3.
- Fixed: A_Wander used threshold as a timer, when it should have used
reactiontime.
- Fixed: A_CustomRailgun would not fire at all for actors without a target
when the aim parameter was disabled.
- Made the warp command work in multiplayer, again courtesy of Karate Chris.
- Fixed: Trying to spawn a bot while not in a game made for a crashing time.
(Patch courtesy of Karate Chris.)
- Removed some floating point math from hu_scores.cpp that somebody's GCC
gave warnings for (not mine, though).
- Fixed: The SBarInfo drawbar command crashed if the sprite image was
unavailable.
- Fixed: FString::operator=(const char *) did not release its old buffer when
being assigned to the null string.
- The scanner no longer has an upper limit on the length of strings it
accepts, though short strings will be faster than long ones.
- Moved all the text scanning functions into a class. Mainly, this means that
multiple script scanner states can be stored without being forced to do so
recursively. I think I might be taking advantage of that in the near
future. Possibly. Maybe.
- Removed some potential buffer overflows from the decal parser.
- Applied Blzut3's SBARINFO update #9:
* Fixed: When using even length values in drawnumber it would cap to a 98
value instead of a 99 as intended.
* The SBarInfo parser can now accept negatives for coordinates. This
doesn't allow much right now, but later I plan to add better fullscreen
hud support in which the negatives will be more useful. This also cleans
up the source a bit since all calls for (x, y) coordinates are with the
function getCoordinates().
- Added support for stencilling actors.
- Added support for non-black colors specified with DTA_ColorOverlay to the
software renderer.
- Fixed: The inverse, gold, red, and green fixed colormaps each allocated
space for 32 different colormaps, even though each only used the first one.
- Added two new blending flags to make reverse subtract blending more useful:
STYLEF_InvertSource and STYLEF_InvertOverlay. These invert the color that
gets blended with the background, since that seems like a good idea for
reverse subtraction. They also work with the other two blending operations.
- Added subtract and reverse subtract blending operations to the renderer.
Since the ERenderStyle enumeration was getting rather unwieldy, I converted
it into a new FRenderStyle structure that lets each parameter of the
blending equation be set separately. This simplified the set up for the
blend quite a bit, and it means a number of new combinations are available
by setting the parameters properly.
SVN r710 (trunk)
2008-01-25 23:57:44 +00:00
|
|
|
Printf("Unknown item class '%s' in ALTHUDCF\n", sc.String);
|
2008-01-11 22:38:10 +00:00
|
|
|
}
|
|
|
|
else if (!ti->IsDescendantOf(RUNTIME_CLASS(AInventory)))
|
|
|
|
{
|
- Updated lempar.c to v1.31.
- Added .txt files to the list of types (wad, zip, and pk3) that can be
loaded without listing them after -file.
- Fonts that are created by the ACS setfont command to wrap a texture now
support animated textures.
- FON2 fonts can now use their full palette for CR_UNTRANSLATED when drawn
with the hardware 2D path instead of being restricted to the game palette.
- Fixed: Toggling vid_vsync would reset the displayed fullscreen gamma to 1
on a Radeon 9000.
- Added back the off-by-one palette handling, but in a much more limited
scope than before. The skipped entry is assumed to always be at 248, and
it is assumed that all Shader Model 1.4 cards suffer from this. That's
because all SM1.4 cards are based on variants of the ATI R200 core, and the
RV250 in a Radeon 9000 craps up like this. I see no reason to assume that
other flavors of the R200 are any different. (Interesting note: With the
Radeon 9000, D3DTADDRESS_CLAMP is an invalid address mode when using the
debug Direct3D 9 runtime, but it works perfectly fine with the retail
Direct3D 9 runtime.) (Insight: The R200 probably uses bytes for all its
math inside pixel shaders. That would explain perfectly why I can't use
constants greater than 1 with PS1.4 and why it can't do an exact mapping to
every entry in the color palette.
- Fixed: The software shaded drawer did not work for 2D, because its selected
"color"map was replaced with the identitymap before being used.
- Fixed: I cannot use Printf to output messages before the framebuffer was
completely setup, meaning that Shader Model 1.4 cards could not change
resolution.
- I have decided to let remap palettes specify variable alpha values for
their colors. D3DFB no longer forces them to 255.
- Updated re2c to version 0.12.3.
- Fixed: A_Wander used threshold as a timer, when it should have used
reactiontime.
- Fixed: A_CustomRailgun would not fire at all for actors without a target
when the aim parameter was disabled.
- Made the warp command work in multiplayer, again courtesy of Karate Chris.
- Fixed: Trying to spawn a bot while not in a game made for a crashing time.
(Patch courtesy of Karate Chris.)
- Removed some floating point math from hu_scores.cpp that somebody's GCC
gave warnings for (not mine, though).
- Fixed: The SBarInfo drawbar command crashed if the sprite image was
unavailable.
- Fixed: FString::operator=(const char *) did not release its old buffer when
being assigned to the null string.
- The scanner no longer has an upper limit on the length of strings it
accepts, though short strings will be faster than long ones.
- Moved all the text scanning functions into a class. Mainly, this means that
multiple script scanner states can be stored without being forced to do so
recursively. I think I might be taking advantage of that in the near
future. Possibly. Maybe.
- Removed some potential buffer overflows from the decal parser.
- Applied Blzut3's SBARINFO update #9:
* Fixed: When using even length values in drawnumber it would cap to a 98
value instead of a 99 as intended.
* The SBarInfo parser can now accept negatives for coordinates. This
doesn't allow much right now, but later I plan to add better fullscreen
hud support in which the negatives will be more useful. This also cleans
up the source a bit since all calls for (x, y) coordinates are with the
function getCoordinates().
- Added support for stencilling actors.
- Added support for non-black colors specified with DTA_ColorOverlay to the
software renderer.
- Fixed: The inverse, gold, red, and green fixed colormaps each allocated
space for 32 different colormaps, even though each only used the first one.
- Added two new blending flags to make reverse subtract blending more useful:
STYLEF_InvertSource and STYLEF_InvertOverlay. These invert the color that
gets blended with the background, since that seems like a good idea for
reverse subtraction. They also work with the other two blending operations.
- Added subtract and reverse subtract blending operations to the renderer.
Since the ERenderStyle enumeration was getting rather unwieldy, I converted
it into a new FRenderStyle structure that lets each parameter of the
blending equation be set separately. This simplified the set up for the
blend quite a bit, and it means a number of new combinations are available
by setting the parameters properly.
SVN r710 (trunk)
2008-01-25 23:57:44 +00:00
|
|
|
Printf("Invalid item class '%s' in ALTHUDCF\n", sc.String);
|
2008-01-11 22:38:10 +00:00
|
|
|
ti=NULL;
|
|
|
|
}
|
- Updated lempar.c to v1.31.
- Added .txt files to the list of types (wad, zip, and pk3) that can be
loaded without listing them after -file.
- Fonts that are created by the ACS setfont command to wrap a texture now
support animated textures.
- FON2 fonts can now use their full palette for CR_UNTRANSLATED when drawn
with the hardware 2D path instead of being restricted to the game palette.
- Fixed: Toggling vid_vsync would reset the displayed fullscreen gamma to 1
on a Radeon 9000.
- Added back the off-by-one palette handling, but in a much more limited
scope than before. The skipped entry is assumed to always be at 248, and
it is assumed that all Shader Model 1.4 cards suffer from this. That's
because all SM1.4 cards are based on variants of the ATI R200 core, and the
RV250 in a Radeon 9000 craps up like this. I see no reason to assume that
other flavors of the R200 are any different. (Interesting note: With the
Radeon 9000, D3DTADDRESS_CLAMP is an invalid address mode when using the
debug Direct3D 9 runtime, but it works perfectly fine with the retail
Direct3D 9 runtime.) (Insight: The R200 probably uses bytes for all its
math inside pixel shaders. That would explain perfectly why I can't use
constants greater than 1 with PS1.4 and why it can't do an exact mapping to
every entry in the color palette.
- Fixed: The software shaded drawer did not work for 2D, because its selected
"color"map was replaced with the identitymap before being used.
- Fixed: I cannot use Printf to output messages before the framebuffer was
completely setup, meaning that Shader Model 1.4 cards could not change
resolution.
- I have decided to let remap palettes specify variable alpha values for
their colors. D3DFB no longer forces them to 255.
- Updated re2c to version 0.12.3.
- Fixed: A_Wander used threshold as a timer, when it should have used
reactiontime.
- Fixed: A_CustomRailgun would not fire at all for actors without a target
when the aim parameter was disabled.
- Made the warp command work in multiplayer, again courtesy of Karate Chris.
- Fixed: Trying to spawn a bot while not in a game made for a crashing time.
(Patch courtesy of Karate Chris.)
- Removed some floating point math from hu_scores.cpp that somebody's GCC
gave warnings for (not mine, though).
- Fixed: The SBarInfo drawbar command crashed if the sprite image was
unavailable.
- Fixed: FString::operator=(const char *) did not release its old buffer when
being assigned to the null string.
- The scanner no longer has an upper limit on the length of strings it
accepts, though short strings will be faster than long ones.
- Moved all the text scanning functions into a class. Mainly, this means that
multiple script scanner states can be stored without being forced to do so
recursively. I think I might be taking advantage of that in the near
future. Possibly. Maybe.
- Removed some potential buffer overflows from the decal parser.
- Applied Blzut3's SBARINFO update #9:
* Fixed: When using even length values in drawnumber it would cap to a 98
value instead of a 99 as intended.
* The SBarInfo parser can now accept negatives for coordinates. This
doesn't allow much right now, but later I plan to add better fullscreen
hud support in which the negatives will be more useful. This also cleans
up the source a bit since all calls for (x, y) coordinates are with the
function getCoordinates().
- Added support for stencilling actors.
- Added support for non-black colors specified with DTA_ColorOverlay to the
software renderer.
- Fixed: The inverse, gold, red, and green fixed colormaps each allocated
space for 32 different colormaps, even though each only used the first one.
- Added two new blending flags to make reverse subtract blending more useful:
STYLEF_InvertSource and STYLEF_InvertOverlay. These invert the color that
gets blended with the background, since that seems like a good idea for
reverse subtraction. They also work with the other two blending operations.
- Added subtract and reverse subtract blending operations to the renderer.
Since the ERenderStyle enumeration was getting rather unwieldy, I converted
it into a new FRenderStyle structure that lets each parameter of the
blending equation be set separately. This simplified the set up for the
blend quite a bit, and it means a number of new combinations are available
by setting the parameters properly.
SVN r710 (trunk)
2008-01-25 23:57:44 +00:00
|
|
|
sc.MustGetString();
|
2008-06-15 18:36:26 +00:00
|
|
|
FTextureID tex;
|
2008-01-11 22:38:10 +00:00
|
|
|
|
- Updated lempar.c to v1.31.
- Added .txt files to the list of types (wad, zip, and pk3) that can be
loaded without listing them after -file.
- Fonts that are created by the ACS setfont command to wrap a texture now
support animated textures.
- FON2 fonts can now use their full palette for CR_UNTRANSLATED when drawn
with the hardware 2D path instead of being restricted to the game palette.
- Fixed: Toggling vid_vsync would reset the displayed fullscreen gamma to 1
on a Radeon 9000.
- Added back the off-by-one palette handling, but in a much more limited
scope than before. The skipped entry is assumed to always be at 248, and
it is assumed that all Shader Model 1.4 cards suffer from this. That's
because all SM1.4 cards are based on variants of the ATI R200 core, and the
RV250 in a Radeon 9000 craps up like this. I see no reason to assume that
other flavors of the R200 are any different. (Interesting note: With the
Radeon 9000, D3DTADDRESS_CLAMP is an invalid address mode when using the
debug Direct3D 9 runtime, but it works perfectly fine with the retail
Direct3D 9 runtime.) (Insight: The R200 probably uses bytes for all its
math inside pixel shaders. That would explain perfectly why I can't use
constants greater than 1 with PS1.4 and why it can't do an exact mapping to
every entry in the color palette.
- Fixed: The software shaded drawer did not work for 2D, because its selected
"color"map was replaced with the identitymap before being used.
- Fixed: I cannot use Printf to output messages before the framebuffer was
completely setup, meaning that Shader Model 1.4 cards could not change
resolution.
- I have decided to let remap palettes specify variable alpha values for
their colors. D3DFB no longer forces them to 255.
- Updated re2c to version 0.12.3.
- Fixed: A_Wander used threshold as a timer, when it should have used
reactiontime.
- Fixed: A_CustomRailgun would not fire at all for actors without a target
when the aim parameter was disabled.
- Made the warp command work in multiplayer, again courtesy of Karate Chris.
- Fixed: Trying to spawn a bot while not in a game made for a crashing time.
(Patch courtesy of Karate Chris.)
- Removed some floating point math from hu_scores.cpp that somebody's GCC
gave warnings for (not mine, though).
- Fixed: The SBarInfo drawbar command crashed if the sprite image was
unavailable.
- Fixed: FString::operator=(const char *) did not release its old buffer when
being assigned to the null string.
- The scanner no longer has an upper limit on the length of strings it
accepts, though short strings will be faster than long ones.
- Moved all the text scanning functions into a class. Mainly, this means that
multiple script scanner states can be stored without being forced to do so
recursively. I think I might be taking advantage of that in the near
future. Possibly. Maybe.
- Removed some potential buffer overflows from the decal parser.
- Applied Blzut3's SBARINFO update #9:
* Fixed: When using even length values in drawnumber it would cap to a 98
value instead of a 99 as intended.
* The SBarInfo parser can now accept negatives for coordinates. This
doesn't allow much right now, but later I plan to add better fullscreen
hud support in which the negatives will be more useful. This also cleans
up the source a bit since all calls for (x, y) coordinates are with the
function getCoordinates().
- Added support for stencilling actors.
- Added support for non-black colors specified with DTA_ColorOverlay to the
software renderer.
- Fixed: The inverse, gold, red, and green fixed colormaps each allocated
space for 32 different colormaps, even though each only used the first one.
- Added two new blending flags to make reverse subtract blending more useful:
STYLEF_InvertSource and STYLEF_InvertOverlay. These invert the color that
gets blended with the background, since that seems like a good idea for
reverse subtraction. They also work with the other two blending operations.
- Added subtract and reverse subtract blending operations to the renderer.
Since the ERenderStyle enumeration was getting rather unwieldy, I converted
it into a new FRenderStyle structure that lets each parameter of the
blending equation be set separately. This simplified the set up for the
blend quite a bit, and it means a number of new combinations are available
by setting the parameters properly.
SVN r710 (trunk)
2008-01-25 23:57:44 +00:00
|
|
|
if (!sc.Compare("0") && !sc.Compare("NULL") && !sc.Compare(""))
|
2008-01-11 22:38:10 +00:00
|
|
|
{
|
2008-01-26 23:20:34 +00:00
|
|
|
tex = TexMan.CheckForTexture(sc.String, FTexture::TEX_MiscPatch);
|
2008-01-11 22:38:10 +00:00
|
|
|
}
|
2008-06-15 18:36:26 +00:00
|
|
|
else tex.SetInvalid();
|
2008-01-11 22:38:10 +00:00
|
|
|
|
2008-06-15 18:36:26 +00:00
|
|
|
if (ti) SetHUDIcon(const_cast<PClass*>(ti), tex);
|
2008-01-11 22:38:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|