2006-02-24 04:48:15 +00:00
|
|
|
/*
|
|
|
|
** sbar.h
|
|
|
|
** Base status bar definition
|
|
|
|
**
|
|
|
|
**---------------------------------------------------------------------------
|
2006-06-11 01:37:00 +00:00
|
|
|
** Copyright 1998-2006 Randy Heit
|
2006-02-24 04:48:15 +00:00
|
|
|
** 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.
|
|
|
|
**---------------------------------------------------------------------------
|
|
|
|
**
|
|
|
|
*/
|
|
|
|
|
2010-01-01 09:11:55 +00:00
|
|
|
#ifndef __SBAR_H__
|
|
|
|
#define __SBAR_H__
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
#include "dobject.h"
|
|
|
|
#include "v_collection.h"
|
|
|
|
#include "v_text.h"
|
|
|
|
|
2008-06-01 07:52:33 +00:00
|
|
|
class player_t;
|
- Discovered that Shader Model 1.4 clamps my constants, so I can't use
palettes smaller than 256 entries with the shader I wrote for it. Is there
a list of gotchas like this listed some where? I'd really like to see it.
Well, when compiled with SM2.0, the PalTex shader seems to be every-so-
slightly faster on my GF7950GT than the SM1.4 version, so I guess it's a
minor win for cards that support it.
- Fixed: ST_Endoom() failed to free the bitmap it used.
- Added the DTA_ColorOverlay attribute to blend a color with the texture
being drawn. For software, this (currently) only works with black. For
hardware, it works with any color. The motiviation for this was so I could
rewrite the status bar calls that passed DIM_MAP to DTA_Translation to
draw darker icons into something that didn't require making a whole new
remap table.
- After having an "OMG! How could I have been so stupid?" moment, I have
removed the off-by-one check from D3DFB. I had thought the off-by-one error
was caused by rounding errors by the shader hardware. Not so. Rather, I
wasn't sampling what I thought I was sampling. A texture that uses palette
index 255 passes the value 1.0 to the shader. The shader needs to adjust the
range of its palette indexes, or it will end up trying to read color 256
from the palette texture when it should be reading color 255. Doh!
- The TranslationToTable() function has been added to map from translation
numbers used by actors to the tables those numbers represent. This function
performs validation for the input and returns NULL if the input value
is invalid.
- Major changes to the way translation tables work: No longer are they each a
256-byte array. Instead, the FRemapTable structure is used to represent each
one. It includes a remap array for the software renderer, a palette array
for a hardware renderer, and a native texture pointer for D3DFB. The
translationtables array itself is now an array of TArrays that point to the
real tables. The DTA_Translation attribute must also be passed a pointer
to a FRemapTable, not a byte array as previously.
- Modified DFrameBuffer::DrawRateStuff() so that it can do its thing properly
for D3DFB's 2D mode. Before, any fullscreen graphics (like help images)
covered it up.
SVN r640 (trunk)
2007-12-26 04:42:15 +00:00
|
|
|
struct FRemapTable;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
extern int SB_state;
|
|
|
|
|
|
|
|
enum EHudState
|
|
|
|
{
|
|
|
|
HUD_StatusBar,
|
|
|
|
HUD_Fullscreen,
|
2013-01-21 21:02:14 +00:00
|
|
|
HUD_None,
|
|
|
|
|
|
|
|
HUD_AltHud // Used for passing through popups to the alt hud
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class AWeapon;
|
|
|
|
|
2013-02-27 03:10:25 +00:00
|
|
|
void ST_SetNeedRefresh();
|
|
|
|
|
2008-06-01 03:35:47 +00:00
|
|
|
// HUD Message base object --------------------------------------------------
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
class DHUDMessage : public DObject
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (DHUDMessage, DObject)
|
2008-03-12 02:56:11 +00:00
|
|
|
HAS_OBJECT_POINTERS
|
2006-02-24 04:48:15 +00:00
|
|
|
public:
|
2008-11-27 17:43:36 +00:00
|
|
|
DHUDMessage (FFont *font, const char *text, float x, float y, int hudwidth, int hudheight,
|
2006-02-24 04:48:15 +00:00
|
|
|
EColorRange textColor, float holdTime);
|
|
|
|
virtual ~DHUDMessage ();
|
|
|
|
|
|
|
|
virtual void Serialize (FArchive &arc);
|
|
|
|
|
2012-08-12 22:24:15 +00:00
|
|
|
void Draw (int bottom, int visibility);
|
2006-02-24 04:48:15 +00:00
|
|
|
virtual void ResetText (const char *text);
|
|
|
|
virtual void DrawSetup ();
|
|
|
|
virtual void DoDraw (int linenum, int x, int y, bool clean, int hudheight);
|
|
|
|
virtual bool Tick (); // Returns true to indicate time for removal
|
|
|
|
virtual void ScreenSizeChanged ();
|
|
|
|
|
2012-08-12 22:24:15 +00:00
|
|
|
void SetVisibility(int vis)
|
|
|
|
{
|
|
|
|
VisibilityFlags = vis;
|
|
|
|
}
|
2012-08-12 23:14:31 +00:00
|
|
|
void SetRenderStyle(ERenderStyle style)
|
|
|
|
{
|
|
|
|
Style = style;
|
|
|
|
}
|
|
|
|
void SetAlpha(fixed_t alpha)
|
|
|
|
{
|
|
|
|
Alpha = alpha;
|
|
|
|
}
|
- Added cybermind's HUD message clipping patch, with numerous changes. There is a new flag
and two new functions, both of which are intended for use in conjunction with SetHUDSize:
* SetHUDClipRect(x, y, width, height[, wrapwidth]) - Set the clipping rectangle for future
HUD messages. If you do not specify <wrapwidth>, the HUD message will be layed out as
normal, but pixels outside the rectangle will not be drawn. If you specify <wrapwidth>,
then the message will be wrapped to that width. Use SetHUDClipRect(0, 0, 0, 0[, 0]) to
reset everything
back to normal.
* SetHUDWrapWidth(wrapwidth) - Sets the wrapping width for future HUD messages without
altering the clipping rectangle. If you set the wrapping width to 0, messages will wrap
to the full width of the HUD, as normal.
* HUDMSG_NOWRAP - A HUDMessage() flag that disables wrapping for one message. It is
functionally equivalent to SetHUDWrapWidth(0x7FFFFFFF), except that it only affects the
message it's attached to.
SVN r3960 (trunk)
2012-11-10 03:18:52 +00:00
|
|
|
void SetNoWrap(bool nowrap)
|
|
|
|
{
|
|
|
|
NoWrap = nowrap;
|
|
|
|
ResetText(SourceText);
|
|
|
|
}
|
|
|
|
void SetClipRect(int x, int y, int width, int height)
|
|
|
|
{
|
|
|
|
ClipX = x;
|
|
|
|
ClipY = y;
|
|
|
|
ClipWidth = width;
|
|
|
|
ClipHeight = height;
|
|
|
|
}
|
|
|
|
void SetWrapWidth(int wrap)
|
|
|
|
{
|
|
|
|
WrapWidth = wrap;
|
|
|
|
ResetText(SourceText);
|
|
|
|
}
|
2012-08-12 22:24:15 +00:00
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
protected:
|
2006-08-31 00:16:12 +00:00
|
|
|
FBrokenLines *Lines;
|
2006-02-24 04:48:15 +00:00
|
|
|
int Width, Height, NumLines;
|
|
|
|
float Left, Top;
|
- Added cybermind's HUD message clipping patch, with numerous changes. There is a new flag
and two new functions, both of which are intended for use in conjunction with SetHUDSize:
* SetHUDClipRect(x, y, width, height[, wrapwidth]) - Set the clipping rectangle for future
HUD messages. If you do not specify <wrapwidth>, the HUD message will be layed out as
normal, but pixels outside the rectangle will not be drawn. If you specify <wrapwidth>,
then the message will be wrapped to that width. Use SetHUDClipRect(0, 0, 0, 0[, 0]) to
reset everything
back to normal.
* SetHUDWrapWidth(wrapwidth) - Sets the wrapping width for future HUD messages without
altering the clipping rectangle. If you set the wrapping width to 0, messages will wrap
to the full width of the HUD, as normal.
* HUDMSG_NOWRAP - A HUDMessage() flag that disables wrapping for one message. It is
functionally equivalent to SetHUDWrapWidth(0x7FFFFFFF), except that it only affects the
message it's attached to.
SVN r3960 (trunk)
2012-11-10 03:18:52 +00:00
|
|
|
bool CenterX, NoWrap;
|
2006-02-24 04:48:15 +00:00
|
|
|
int HoldTics;
|
|
|
|
int Tics;
|
|
|
|
int State;
|
2012-08-12 22:24:15 +00:00
|
|
|
int VisibilityFlags;
|
2006-02-24 04:48:15 +00:00
|
|
|
int HUDWidth, HUDHeight;
|
- Added cybermind's HUD message clipping patch, with numerous changes. There is a new flag
and two new functions, both of which are intended for use in conjunction with SetHUDSize:
* SetHUDClipRect(x, y, width, height[, wrapwidth]) - Set the clipping rectangle for future
HUD messages. If you do not specify <wrapwidth>, the HUD message will be layed out as
normal, but pixels outside the rectangle will not be drawn. If you specify <wrapwidth>,
then the message will be wrapped to that width. Use SetHUDClipRect(0, 0, 0, 0[, 0]) to
reset everything
back to normal.
* SetHUDWrapWidth(wrapwidth) - Sets the wrapping width for future HUD messages without
altering the clipping rectangle. If you set the wrapping width to 0, messages will wrap
to the full width of the HUD, as normal.
* HUDMSG_NOWRAP - A HUDMessage() flag that disables wrapping for one message. It is
functionally equivalent to SetHUDWrapWidth(0x7FFFFFFF), except that it only affects the
message it's attached to.
SVN r3960 (trunk)
2012-11-10 03:18:52 +00:00
|
|
|
int ClipX, ClipY, ClipWidth, ClipHeight, WrapWidth; // in HUD coords
|
|
|
|
int ClipLeft, ClipTop, ClipRight, ClipBot; // in screen coords
|
2006-02-24 04:48:15 +00:00
|
|
|
EColorRange TextColor;
|
|
|
|
FFont *Font;
|
2012-08-12 23:14:31 +00:00
|
|
|
FRenderStyle Style;
|
|
|
|
fixed_t Alpha;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
- Added cybermind's HUD message clipping patch, with numerous changes. There is a new flag
and two new functions, both of which are intended for use in conjunction with SetHUDSize:
* SetHUDClipRect(x, y, width, height[, wrapwidth]) - Set the clipping rectangle for future
HUD messages. If you do not specify <wrapwidth>, the HUD message will be layed out as
normal, but pixels outside the rectangle will not be drawn. If you specify <wrapwidth>,
then the message will be wrapped to that width. Use SetHUDClipRect(0, 0, 0, 0[, 0]) to
reset everything
back to normal.
* SetHUDWrapWidth(wrapwidth) - Sets the wrapping width for future HUD messages without
altering the clipping rectangle. If you set the wrapping width to 0, messages will wrap
to the full width of the HUD, as normal.
* HUDMSG_NOWRAP - A HUDMessage() flag that disables wrapping for one message. It is
functionally equivalent to SetHUDWrapWidth(0x7FFFFFFF), except that it only affects the
message it's attached to.
SVN r3960 (trunk)
2012-11-10 03:18:52 +00:00
|
|
|
void CalcClipCoords(int hudheight);
|
2006-02-24 04:48:15 +00:00
|
|
|
DHUDMessage () : SourceText(NULL) {}
|
|
|
|
|
|
|
|
private:
|
2008-03-12 02:56:11 +00:00
|
|
|
TObjPtr<DHUDMessage> Next;
|
2006-02-24 04:48:15 +00:00
|
|
|
DWORD SBarID;
|
|
|
|
char *SourceText;
|
|
|
|
|
2008-03-12 02:56:11 +00:00
|
|
|
friend class DBaseStatusBar;
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
2012-08-12 22:24:15 +00:00
|
|
|
// HUD message visibility flags
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
HUDMSG_NotWith3DView = 1,
|
|
|
|
HUDMSG_NotWithFullMap = 2,
|
|
|
|
HUDMSG_NotWithOverlayMap = 4,
|
|
|
|
};
|
|
|
|
|
2008-06-01 03:35:47 +00:00
|
|
|
// HUD Message; appear instantly, then fade out type ------------------------
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
class DHUDMessageFadeOut : public DHUDMessage
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (DHUDMessageFadeOut, DHUDMessage)
|
|
|
|
public:
|
2008-11-27 17:43:36 +00:00
|
|
|
DHUDMessageFadeOut (FFont *font, const char *text, float x, float y, int hudwidth, int hudheight,
|
2006-02-24 04:48:15 +00:00
|
|
|
EColorRange textColor, float holdTime, float fadeOutTime);
|
|
|
|
|
|
|
|
virtual void Serialize (FArchive &arc);
|
|
|
|
virtual void DoDraw (int linenum, int x, int y, bool clean, int hudheight);
|
|
|
|
virtual bool Tick ();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
int FadeOutTics;
|
|
|
|
|
|
|
|
DHUDMessageFadeOut() {}
|
|
|
|
};
|
|
|
|
|
2008-06-01 03:35:47 +00:00
|
|
|
// HUD Message; fade in, then fade out type ---------------------------------
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
class DHUDMessageFadeInOut : public DHUDMessageFadeOut
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (DHUDMessageFadeInOut, DHUDMessageFadeOut)
|
|
|
|
public:
|
2008-11-27 17:43:36 +00:00
|
|
|
DHUDMessageFadeInOut (FFont *font, const char *text, float x, float y, int hudwidth, int hudheight,
|
2006-02-24 04:48:15 +00:00
|
|
|
EColorRange textColor, float holdTime, float fadeInTime, float fadeOutTime);
|
|
|
|
|
|
|
|
virtual void Serialize (FArchive &arc);
|
|
|
|
virtual void DoDraw (int linenum, int x, int y, bool clean, int hudheight);
|
|
|
|
virtual bool Tick ();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
int FadeInTics;
|
|
|
|
|
|
|
|
DHUDMessageFadeInOut() {}
|
|
|
|
};
|
|
|
|
|
2008-06-01 03:35:47 +00:00
|
|
|
// HUD Message; type on, then fade out type ---------------------------------
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
class DHUDMessageTypeOnFadeOut : public DHUDMessageFadeOut
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (DHUDMessageTypeOnFadeOut, DHUDMessageFadeOut)
|
|
|
|
public:
|
2008-11-27 17:43:36 +00:00
|
|
|
DHUDMessageTypeOnFadeOut (FFont *font, const char *text, float x, float y, int hudwidth, int hudheight,
|
2006-02-24 04:48:15 +00:00
|
|
|
EColorRange textColor, float typeTime, float holdTime, float fadeOutTime);
|
|
|
|
|
|
|
|
virtual void Serialize (FArchive &arc);
|
|
|
|
virtual void DoDraw (int linenum, int x, int y, bool clean, int hudheight);
|
|
|
|
virtual bool Tick ();
|
|
|
|
virtual void ScreenSizeChanged ();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
float TypeOnTime;
|
|
|
|
int CurrLine;
|
|
|
|
int LineVisible;
|
|
|
|
int LineLen;
|
|
|
|
|
|
|
|
DHUDMessageTypeOnFadeOut() {}
|
|
|
|
};
|
|
|
|
|
2008-06-01 03:35:47 +00:00
|
|
|
// Mug shots ----------------------------------------------------------------
|
|
|
|
|
|
|
|
struct FMugShotFrame
|
|
|
|
{
|
|
|
|
TArray<FString> Graphic;
|
|
|
|
int Delay;
|
|
|
|
|
|
|
|
FMugShotFrame();
|
|
|
|
~FMugShotFrame();
|
2010-04-17 02:06:26 +00:00
|
|
|
FTexture *GetTexture(const char *default_face, const char *skin_face, int random, int level=0,
|
2008-06-01 03:35:47 +00:00
|
|
|
int direction=0, bool usesLevels=false, bool health2=false, bool healthspecial=false,
|
|
|
|
bool directional=false);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct FMugShotState
|
|
|
|
{
|
|
|
|
BYTE bUsesLevels:1;
|
|
|
|
BYTE bHealth2:1; // Health level is the 2nd character from the end.
|
|
|
|
BYTE bHealthSpecial:1; // Like health2 only the 2nd frame gets the normal health type.
|
|
|
|
BYTE bDirectional:1; // Faces direction of damage.
|
|
|
|
BYTE bFinished:1;
|
|
|
|
|
|
|
|
unsigned int Position;
|
|
|
|
int Time;
|
|
|
|
int Random;
|
|
|
|
FName State;
|
|
|
|
TArray<FMugShotFrame> Frames;
|
|
|
|
|
|
|
|
FMugShotState(FName name);
|
|
|
|
~FMugShotState();
|
|
|
|
void Tick();
|
|
|
|
void Reset();
|
|
|
|
FMugShotFrame &GetCurrentFrame() { return Frames[Position]; }
|
2010-04-17 02:06:26 +00:00
|
|
|
FTexture *GetCurrentFrameTexture(const char *default_face, const char *skin_face, int level=0, int direction=0)
|
2008-06-01 03:35:47 +00:00
|
|
|
{
|
2010-04-17 02:06:26 +00:00
|
|
|
return GetCurrentFrame().GetTexture(default_face, skin_face, Random, level, direction, bUsesLevels, bHealth2, bHealthSpecial, bDirectional);
|
2008-06-01 03:35:47 +00:00
|
|
|
}
|
|
|
|
private:
|
|
|
|
FMugShotState();
|
|
|
|
};
|
|
|
|
|
2008-06-01 07:52:33 +00:00
|
|
|
class player_t;
|
2010-01-01 09:11:55 +00:00
|
|
|
class FMugShot
|
2008-06-01 03:35:47 +00:00
|
|
|
{
|
2010-01-01 09:11:55 +00:00
|
|
|
public:
|
|
|
|
enum StateFlags
|
|
|
|
{
|
|
|
|
STANDARD = 0x0,
|
|
|
|
|
|
|
|
XDEATHFACE = 0x1,
|
|
|
|
ANIMATEDGODMODE = 0x2,
|
|
|
|
DISABLEGRIN = 0x4,
|
|
|
|
DISABLEOUCH = 0x8,
|
|
|
|
DISABLEPAIN = 0x10,
|
|
|
|
DISABLERAMPAGE = 0x20,
|
|
|
|
};
|
|
|
|
|
|
|
|
FMugShot();
|
|
|
|
void Grin(bool grin=true) { bEvilGrin = grin; }
|
2010-05-21 19:56:13 +00:00
|
|
|
void Reset();
|
2010-01-01 09:11:55 +00:00
|
|
|
void Tick(player_t *player);
|
|
|
|
bool SetState(const char *state_name, bool wait_till_done=false, bool reset=false);
|
|
|
|
int UpdateState(player_t *player, StateFlags stateflags=STANDARD);
|
|
|
|
FTexture *GetFace(player_t *player, const char *default_face, int accuracy, StateFlags stateflags=STANDARD);
|
|
|
|
|
|
|
|
private:
|
|
|
|
FMugShotState *CurrentState;
|
|
|
|
int RampageTimer;
|
|
|
|
int LastDamageAngle;
|
|
|
|
int FaceHealth;
|
|
|
|
bool bEvilGrin;
|
|
|
|
bool bDamageFaceActive;
|
|
|
|
bool bNormal;
|
|
|
|
bool bOuchActive;
|
2008-06-01 03:35:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern TArray<FMugShotState> MugShotStates;
|
|
|
|
|
|
|
|
FMugShotState *FindMugShotState(FName state);
|
|
|
|
int FindMugShotStateIndex(FName state);
|
|
|
|
|
|
|
|
// Base Status Bar ----------------------------------------------------------
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
class FTexture;
|
|
|
|
class AAmmo;
|
|
|
|
|
2012-08-12 22:24:15 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
HUDMSGLayer_OverHUD,
|
|
|
|
HUDMSGLayer_UnderHUD,
|
|
|
|
HUDMSGLayer_OverMap,
|
|
|
|
|
|
|
|
NUM_HUDMSGLAYERS,
|
|
|
|
HUDMSGLayer_Default = HUDMSGLayer_OverHUD,
|
|
|
|
};
|
|
|
|
|
2008-03-12 02:56:11 +00:00
|
|
|
class DBaseStatusBar : public DObject
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
2008-03-12 02:56:11 +00:00
|
|
|
DECLARE_CLASS (DBaseStatusBar, DObject)
|
|
|
|
HAS_OBJECT_POINTERS
|
2006-02-24 04:48:15 +00:00
|
|
|
public:
|
|
|
|
// Popup screens for Strife's status bar
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
POP_NoChange = -1,
|
|
|
|
POP_None,
|
|
|
|
POP_Log,
|
|
|
|
POP_Keys,
|
|
|
|
POP_Status
|
|
|
|
};
|
|
|
|
|
2008-03-26 08:50:54 +00:00
|
|
|
// Status face stuff
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
ST_NUMPAINFACES = 5,
|
|
|
|
ST_NUMSTRAIGHTFACES = 3,
|
|
|
|
ST_NUMTURNFACES = 2,
|
|
|
|
ST_NUMSPECIALFACES = 3,
|
|
|
|
ST_NUMEXTRAFACES = 2,
|
|
|
|
ST_FACESTRIDE = ST_NUMSTRAIGHTFACES+ST_NUMTURNFACES+ST_NUMSPECIALFACES,
|
|
|
|
ST_NUMFACES = ST_FACESTRIDE*ST_NUMPAINFACES+ST_NUMEXTRAFACES,
|
|
|
|
|
|
|
|
ST_TURNOFFSET = ST_NUMSTRAIGHTFACES,
|
|
|
|
ST_OUCHOFFSET = ST_TURNOFFSET + ST_NUMTURNFACES,
|
|
|
|
ST_EVILGRINOFFSET = ST_OUCHOFFSET + 1,
|
|
|
|
ST_RAMPAGEOFFSET = ST_EVILGRINOFFSET + 1,
|
|
|
|
ST_GODFACE = ST_NUMPAINFACES*ST_FACESTRIDE,
|
|
|
|
ST_DEADFACE = ST_GODFACE + 1
|
|
|
|
};
|
|
|
|
|
2010-05-21 19:56:13 +00:00
|
|
|
DBaseStatusBar (int reltop, int hres=320, int vres=200);
|
2008-03-12 02:56:11 +00:00
|
|
|
void Destroy ();
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2008-08-06 07:38:21 +00:00
|
|
|
void SetScaled (bool scale, bool force=false);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2012-08-12 22:24:15 +00:00
|
|
|
void AttachMessage (DHUDMessage *msg, uint32 id=0, int layer=HUDMSGLayer_Default);
|
2006-02-24 04:48:15 +00:00
|
|
|
DHUDMessage *DetachMessage (DHUDMessage *msg);
|
2006-09-14 00:02:31 +00:00
|
|
|
DHUDMessage *DetachMessage (uint32 id);
|
2006-02-24 04:48:15 +00:00
|
|
|
void DetachAllMessages ();
|
|
|
|
void ShowPlayerName ();
|
|
|
|
fixed_t GetDisplacement () { return Displacement; }
|
|
|
|
int GetPlayer ();
|
|
|
|
|
2006-05-09 00:28:01 +00:00
|
|
|
static void AddBlend (float r, float g, float b, float a, float v_blend[4]);
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
virtual void Serialize (FArchive &arc);
|
|
|
|
|
|
|
|
virtual void Tick ();
|
|
|
|
virtual void Draw (EHudState state);
|
2012-08-12 22:24:15 +00:00
|
|
|
void DrawBottomStuff (EHudState state);
|
2006-02-24 04:48:15 +00:00
|
|
|
void DrawTopStuff (EHudState state);
|
2006-05-10 02:40:43 +00:00
|
|
|
virtual void FlashItem (const PClass *itemtype);
|
2008-06-01 07:52:33 +00:00
|
|
|
virtual void AttachToPlayer (player_t *player);
|
2006-02-24 04:48:15 +00:00
|
|
|
virtual void FlashCrosshair ();
|
|
|
|
virtual void BlendView (float blend[4]);
|
|
|
|
virtual void NewGame ();
|
|
|
|
virtual void ScreenSizeChanged ();
|
|
|
|
virtual void MultiplayerChanged ();
|
|
|
|
virtual void SetInteger (int pname, int param);
|
|
|
|
virtual void ShowPop (int popnum);
|
|
|
|
virtual void ReceivedWeapon (AWeapon *weapon);
|
2008-01-11 22:38:10 +00:00
|
|
|
virtual bool MustDrawLog(EHudState state);
|
2008-06-01 22:41:46 +00:00
|
|
|
virtual void SetMugShotState (const char *state_name, bool wait_till_done=false, bool reset=false);
|
2008-01-11 22:38:10 +00:00
|
|
|
void DrawLog();
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void DrawPowerups ();
|
|
|
|
|
|
|
|
void UpdateRect (int x, int y, int width, int height) const;
|
- Discovered that Shader Model 1.4 clamps my constants, so I can't use
palettes smaller than 256 entries with the shader I wrote for it. Is there
a list of gotchas like this listed some where? I'd really like to see it.
Well, when compiled with SM2.0, the PalTex shader seems to be every-so-
slightly faster on my GF7950GT than the SM1.4 version, so I guess it's a
minor win for cards that support it.
- Fixed: ST_Endoom() failed to free the bitmap it used.
- Added the DTA_ColorOverlay attribute to blend a color with the texture
being drawn. For software, this (currently) only works with black. For
hardware, it works with any color. The motiviation for this was so I could
rewrite the status bar calls that passed DIM_MAP to DTA_Translation to
draw darker icons into something that didn't require making a whole new
remap table.
- After having an "OMG! How could I have been so stupid?" moment, I have
removed the off-by-one check from D3DFB. I had thought the off-by-one error
was caused by rounding errors by the shader hardware. Not so. Rather, I
wasn't sampling what I thought I was sampling. A texture that uses palette
index 255 passes the value 1.0 to the shader. The shader needs to adjust the
range of its palette indexes, or it will end up trying to read color 256
from the palette texture when it should be reading color 255. Doh!
- The TranslationToTable() function has been added to map from translation
numbers used by actors to the tables those numbers represent. This function
performs validation for the input and returns NULL if the input value
is invalid.
- Major changes to the way translation tables work: No longer are they each a
256-byte array. Instead, the FRemapTable structure is used to represent each
one. It includes a remap array for the software renderer, a palette array
for a hardware renderer, and a native texture pointer for D3DFB. The
translationtables array itself is now an array of TArrays that point to the
real tables. The DTA_Translation attribute must also be passed a pointer
to a FRemapTable, not a byte array as previously.
- Modified DFrameBuffer::DrawRateStuff() so that it can do its thing properly
for D3DFB's 2D mode. Before, any fullscreen graphics (like help images)
covered it up.
SVN r640 (trunk)
2007-12-26 04:42:15 +00:00
|
|
|
void DrawImage (FTexture *image, int x, int y, FRemapTable *translation=NULL) const;
|
|
|
|
void DrawDimImage (FTexture *image, int x, int y, bool dimmed) const;
|
2006-02-24 04:48:15 +00:00
|
|
|
void DrawFadedImage (FTexture *image, int x, int y, fixed_t shade) const;
|
|
|
|
void DrawPartialImage (FTexture *image, int wx, int ww) const;
|
|
|
|
|
|
|
|
void DrINumber (signed int val, int x, int y, int imgBase=imgINumbers) const;
|
|
|
|
void DrBNumber (signed int val, int x, int y, int w=3) const;
|
|
|
|
void DrSmallNumber (int val, int x, int y) const;
|
|
|
|
|
|
|
|
void DrINumberOuter (signed int val, int x, int y, bool center=false, int w=9) const;
|
|
|
|
void DrBNumberOuter (signed int val, int x, int y, int w=3) const;
|
|
|
|
void DrBNumberOuterFont (signed int val, int x, int y, int w=3) const;
|
|
|
|
void DrSmallNumberOuter (int val, int x, int y, bool center) const;
|
|
|
|
|
|
|
|
void RefreshBackground () const;
|
|
|
|
|
|
|
|
void GetCurrentAmmo (AAmmo *&ammo1, AAmmo *&ammo2, int &ammocount1, int &ammocount2) const;
|
|
|
|
|
2006-04-11 16:27:41 +00:00
|
|
|
public:
|
|
|
|
AInventory *ValidateInvFirst (int numVisible) const;
|
|
|
|
void DrawCrosshair ();
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
int ST_X, ST_Y;
|
|
|
|
int RelTop;
|
2010-05-21 19:56:13 +00:00
|
|
|
int HorizontalResolution, VirticalResolution;
|
2006-02-24 04:48:15 +00:00
|
|
|
bool Scaled;
|
|
|
|
bool Centering;
|
|
|
|
bool FixedOrigin;
|
2012-07-18 22:30:10 +00:00
|
|
|
bool CompleteBorder;
|
2006-02-24 04:48:15 +00:00
|
|
|
fixed_t CrosshairSize;
|
|
|
|
fixed_t Displacement;
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
imgLAME = 0,
|
|
|
|
imgNEGATIVE = 1,
|
|
|
|
imgINumbers = 2,
|
|
|
|
imgBNEGATIVE = 12,
|
|
|
|
imgBNumbers = 13,
|
|
|
|
imgSmNumbers = 23,
|
|
|
|
NUM_BASESB_IMAGES = 33
|
|
|
|
};
|
|
|
|
FImageCollection Images;
|
|
|
|
|
2008-06-01 07:52:33 +00:00
|
|
|
player_t *CPlayer;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
private:
|
2008-03-12 02:56:11 +00:00
|
|
|
DBaseStatusBar() {}
|
2006-02-24 04:48:15 +00:00
|
|
|
bool RepositionCoords (int &x, int &y, int xo, int yo, const int w, const int h) const;
|
2012-08-12 22:24:15 +00:00
|
|
|
void DrawMessages (int layer, int bottom);
|
2006-02-24 04:48:15 +00:00
|
|
|
void DrawConsistancy () const;
|
2013-05-25 22:01:26 +00:00
|
|
|
void DrawWaiting () const;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2012-08-12 22:24:15 +00:00
|
|
|
TObjPtr<DHUDMessage> Messages[NUM_HUDMSGLAYERS];
|
2008-01-11 22:38:10 +00:00
|
|
|
bool ShowLog;
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
2008-03-12 02:56:11 +00:00
|
|
|
extern DBaseStatusBar *StatusBar;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2008-06-01 03:35:47 +00:00
|
|
|
// Status bar factories -----------------------------------------------------
|
|
|
|
|
|
|
|
DBaseStatusBar *CreateStrifeStatusBar();
|
2008-12-06 10:22:37 +00:00
|
|
|
DBaseStatusBar *CreateCustomStatusBar(int script=0);
|
2009-07-01 02:00:36 +00:00
|
|
|
|
|
|
|
// Crosshair stuff ----------------------------------------------------------
|
|
|
|
|
2010-10-24 07:31:39 +00:00
|
|
|
void ST_FormatMapName(FString &mapname, const char *mapnamecolor = "");
|
2009-07-01 02:00:36 +00:00
|
|
|
void ST_LoadCrosshair(bool alwaysload=false);
|
2010-12-15 00:09:31 +00:00
|
|
|
void ST_Clear();
|
2009-07-01 02:00:36 +00:00
|
|
|
extern FTexture *CrosshairImage;
|
2010-01-01 09:11:55 +00:00
|
|
|
|
2012-04-22 09:41:06 +00:00
|
|
|
FTextureID GetWeaponIcon(AWeapon *weapon);
|
|
|
|
|
2010-01-01 09:11:55 +00:00
|
|
|
#endif /* __SBAR_H__ */
|