- Added Blzut3's SBARINFO submission.

SVN r613 (trunk)
This commit is contained in:
Christoph Oelckers 2007-12-20 22:35:02 +00:00
parent 91a48d9aa7
commit 5ffda41c7e
6 changed files with 1721 additions and 4 deletions

View file

@ -1,4 +1,5 @@
December 20, 2007 (Changes by Graf Zahl) December 20, 2007 (Changes by Graf Zahl)
- Added Blzut3's SBARINFO submission.
- Added SnowKate709's A_LookEx submission. - Added SnowKate709's A_LookEx submission.
- Added Karate Chris's TEAMINFO submission. - Added Karate Chris's TEAMINFO submission.
- Added true color processing to FDDSTexture. This is untested so far - Added true color processing to FDDSTexture. This is untested so far

View file

@ -72,6 +72,7 @@
#include "m_menu.h" #include "m_menu.h"
#include "statnums.h" #include "statnums.h"
#include "vectors.h" #include "vectors.h"
#include "sbarinfo.h"
#include "gi.h" #include "gi.h"
@ -1527,6 +1528,13 @@ void G_InitNew (const char *mapname, bool bTitleLevel)
S_ResumeSound (); S_ResumeSound ();
} }
//SBarInfo support.
int stbar = gameinfo.gametype;
if(Wads.CheckNumForName("SBARINFO") != -1)
{
stbar = SBarInfoScript.ParseSBarInfo(Wads.GetNumForName("SBARINFO")); //load last SBARINFO lump to avoid clashes
}
//end most of the SBarInfo stuff
if (StatusBar != NULL) if (StatusBar != NULL)
{ {
delete StatusBar; delete StatusBar;
@ -1535,22 +1543,26 @@ void G_InitNew (const char *mapname, bool bTitleLevel)
{ {
StatusBar = new FBaseStatusBar (0); StatusBar = new FBaseStatusBar (0);
} }
else if (gameinfo.gametype == GAME_Doom) else if (stbar == GAME_Doom)
{ {
StatusBar = CreateDoomStatusBar (); StatusBar = CreateDoomStatusBar ();
} }
else if (gameinfo.gametype == GAME_Heretic) else if (stbar == GAME_Heretic)
{ {
StatusBar = CreateHereticStatusBar (); StatusBar = CreateHereticStatusBar ();
} }
else if (gameinfo.gametype == GAME_Hexen) else if (stbar == GAME_Hexen)
{ {
StatusBar = CreateHexenStatusBar (); StatusBar = CreateHexenStatusBar ();
} }
else if (gameinfo.gametype == GAME_Strife) else if (stbar == GAME_Strife)
{ {
StatusBar = CreateStrifeStatusBar (); StatusBar = CreateStrifeStatusBar ();
} }
else if (stbar == GAME_Any)
{
StatusBar = CreateCustomStatusBar (); //SBARINFO is empty unless scripted.
}
else else
{ {
StatusBar = new FBaseStatusBar (0); StatusBar = new FBaseStatusBar (0);

View file

@ -257,3 +257,4 @@ FBaseStatusBar *CreateDoomStatusBar ();
FBaseStatusBar *CreateHereticStatusBar (); FBaseStatusBar *CreateHereticStatusBar ();
FBaseStatusBar *CreateHexenStatusBar (); FBaseStatusBar *CreateHexenStatusBar ();
FBaseStatusBar *CreateStrifeStatusBar (); FBaseStatusBar *CreateStrifeStatusBar ();
FBaseStatusBar *CreateCustomStatusBar ();

1644
src/g_shared/sbarinfo.cpp Normal file

File diff suppressed because it is too large Load diff

51
src/g_shared/sbarinfo.h Normal file
View file

@ -0,0 +1,51 @@
#ifndef __SBarInfo_SBAR_H__
#define __SBarInfo_SBAR_H__
#include "tarray.h"
#include "v_collection.h"
struct SBarInfoCommand; //we need to be able to use this before it is defined.
struct SBarInfoBlock
{
TArray<SBarInfoCommand> commands;
};
struct SBarInfoCommand
{
int type;
int special;
int special2;
int special3;
int special4;
int flags;
int x;
int y;
int value;
int sprite;
char* string[2];
FFont *font;
EColorRange translation;
SBarInfoBlock subBlock; //for type SBarInfo_CMD_GAMEMODE
void setString(const char* source, int strnum, int maxlength=-1, bool exact=false);
SBarInfoCommand();
};
struct SBarInfo
{
TArray<const char*> Images;
SBarInfoBlock huds[6];
bool automapbar;
bool interpolateHealth;
int interpolationSpeed;
int height;
int ParseSBarInfo(int lump);
void ParseSBarInfoBlock(SBarInfoBlock &block);
int newImage(const char* patchname);
EColorRange GetTranslation(char* translation);
SBarInfo();
};
extern SBarInfo SBarInfoScript;
#endif //__SBarInfo_SBAR_H__

View file

@ -6183,6 +6183,14 @@
RelativePath=".\src\g_shared\sbar.h" RelativePath=".\src\g_shared\sbar.h"
> >
</File> </File>
<File
RelativePath=".\src\g_shared\sbarinfo.cpp"
>
</File>
<File
RelativePath=".\src\g_shared\sbarinfo.h"
>
</File>
<File <File
RelativePath=".\src\g_shared\shared_sbar.cpp" RelativePath=".\src\g_shared\shared_sbar.cpp"
> >