mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
Merge branch 'master' of https://github.com/rheit/zdoom
This commit is contained in:
commit
fbefe13bb2
21 changed files with 388 additions and 89 deletions
|
@ -111,6 +111,6 @@ if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
|
||||||
CHECK_CXX_COMPILER_FLAG( -msse DUMB_CAN_USE_SSE )
|
CHECK_CXX_COMPILER_FLAG( -msse DUMB_CAN_USE_SSE )
|
||||||
|
|
||||||
if( DUMB_CAN_USE_SSE )
|
if( DUMB_CAN_USE_SSE )
|
||||||
set_source_files_properties( src/it/filter.cpp PROPERTIES COMPILE_FLAGS -msse )
|
set_source_files_properties( src/helpers/resampler.c PROPERTIES COMPILE_FLAGS -msse )
|
||||||
endif( DUMB_CAN_USE_SSE )
|
endif( DUMB_CAN_USE_SSE )
|
||||||
endif( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
|
endif( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
|
||||||
|
|
|
@ -372,6 +372,7 @@ enum ActorFlag7
|
||||||
MF7_FLYCHEAT = 0x00020000, // must be part of the actor so that it can be tracked properly
|
MF7_FLYCHEAT = 0x00020000, // must be part of the actor so that it can be tracked properly
|
||||||
MF7_NODECAL = 0x00040000, // [ZK] Forces puff to have no impact decal
|
MF7_NODECAL = 0x00040000, // [ZK] Forces puff to have no impact decal
|
||||||
MF7_FORCEDECAL = 0x00080000, // [ZK] Forces puff's decal to override the weapon's.
|
MF7_FORCEDECAL = 0x00080000, // [ZK] Forces puff's decal to override the weapon's.
|
||||||
|
MF7_LAXTELEFRAGDMG = 0x00100000, // [MC] Telefrag damage can be reduced.
|
||||||
};
|
};
|
||||||
|
|
||||||
// --- mobj.renderflags ---
|
// --- mobj.renderflags ---
|
||||||
|
@ -823,7 +824,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// These also set CF_INTERPVIEW for players.
|
// These also set CF_INTERPVIEW for players.
|
||||||
void SetPitch(int p, bool interpolate);
|
void SetPitch(int p, bool interpolate, bool forceclamp = false);
|
||||||
void SetAngle(angle_t ang, bool interpolate);
|
void SetAngle(angle_t ang, bool interpolate);
|
||||||
void SetRoll(angle_t roll, bool interpolate);
|
void SetRoll(angle_t roll, bool interpolate);
|
||||||
|
|
||||||
|
|
|
@ -525,7 +525,7 @@ class CommandDrawSwitchableImage : public CommandDrawImage
|
||||||
}
|
}
|
||||||
else if(condition == INVULNERABILITY)
|
else if(condition == INVULNERABILITY)
|
||||||
{
|
{
|
||||||
if(statusBar->CPlayer->cheats&CF_GODMODE)
|
if(statusBar->CPlayer->cheats&(CF_GODMODE|CF_GODMODE2))
|
||||||
{
|
{
|
||||||
drawAlt = 1;
|
drawAlt = 1;
|
||||||
}
|
}
|
||||||
|
@ -1730,7 +1730,7 @@ class CommandDrawSelectedInventory : public CommandDrawImage, private CommandDra
|
||||||
static int artiflashTick;
|
static int artiflashTick;
|
||||||
static fixed_t itemflashFade;
|
static fixed_t itemflashFade;
|
||||||
};
|
};
|
||||||
int CommandDrawSelectedInventory::artiflashTick = 4;
|
int CommandDrawSelectedInventory::artiflashTick = 0;
|
||||||
int CommandDrawSelectedInventory::itemflashFade = FRACUNIT*3/4;
|
int CommandDrawSelectedInventory::itemflashFade = FRACUNIT*3/4;
|
||||||
|
|
||||||
void DSBarInfo::FlashItem(const PClass *itemtype)
|
void DSBarInfo::FlashItem(const PClass *itemtype)
|
||||||
|
|
|
@ -83,7 +83,7 @@ bool GetKnownFolder(int shell_folder, REFKNOWNFOLDERID known_folder, bool create
|
||||||
// new to Vista, hence the reason we support both.
|
// new to Vista, hence the reason we support both.
|
||||||
if (SHGetKnownFolderPath == NULL)
|
if (SHGetKnownFolderPath == NULL)
|
||||||
{
|
{
|
||||||
static TOptWin32Proc<HRESULT(*)(HWND, int, HANDLE, DWORD, LPTSTR)>
|
static TOptWin32Proc<HRESULT(WINAPI*)(HWND, int, HANDLE, DWORD, LPTSTR)>
|
||||||
SHGetFolderPathA("shell32.dll", "SHGetFolderPathA");
|
SHGetFolderPathA("shell32.dll", "SHGetFolderPathA");
|
||||||
|
|
||||||
// NT4 doesn't even have this function.
|
// NT4 doesn't even have this function.
|
||||||
|
@ -146,6 +146,7 @@ FString M_GetCachePath(bool create)
|
||||||
// Don't use GAME_DIR and such so that ZDoom and its child ports can
|
// Don't use GAME_DIR and such so that ZDoom and its child ports can
|
||||||
// share the node cache.
|
// share the node cache.
|
||||||
path += "/zdoom/cache";
|
path += "/zdoom/cache";
|
||||||
|
path.Substitute("//", "/"); // needed because progdir ends with a slash.
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -644,9 +644,13 @@ class DTextEnterMenu : public DMenu
|
||||||
int InputGridX;
|
int InputGridX;
|
||||||
int InputGridY;
|
int InputGridY;
|
||||||
|
|
||||||
|
// [TP]
|
||||||
|
bool AllowColors;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DTextEnterMenu(DMenu *parent, char *textbuffer, int maxlen, int sizemode, bool showgrid);
|
// [TP] Added allowcolors
|
||||||
|
DTextEnterMenu(DMenu *parent, char *textbuffer, int maxlen, int sizemode, bool showgrid, bool allowcolors = false);
|
||||||
|
|
||||||
void Drawer ();
|
void Drawer ();
|
||||||
bool MenuEvent (int mkey, bool fromcontroller);
|
bool MenuEvent (int mkey, bool fromcontroller);
|
||||||
|
|
|
@ -830,6 +830,63 @@ static void ParseOptionMenuBody(FScanner &sc, FOptionMenuDescriptor *desc)
|
||||||
FOptionMenuItem *it = new FOptionMenuScreenResolutionLine(sc.String);
|
FOptionMenuItem *it = new FOptionMenuScreenResolutionLine(sc.String);
|
||||||
desc->mItems.Push(it);
|
desc->mItems.Push(it);
|
||||||
}
|
}
|
||||||
|
// [TP] -- Text input widget
|
||||||
|
else if ( sc.Compare( "TextField" ))
|
||||||
|
{
|
||||||
|
sc.MustGetString();
|
||||||
|
FString label = sc.String;
|
||||||
|
sc.MustGetStringName( "," );
|
||||||
|
sc.MustGetString();
|
||||||
|
FString cvar = sc.String;
|
||||||
|
FString check;
|
||||||
|
|
||||||
|
if ( sc.CheckString( "," ))
|
||||||
|
{
|
||||||
|
sc.MustGetString();
|
||||||
|
check = sc.String;
|
||||||
|
}
|
||||||
|
|
||||||
|
FOptionMenuItem* it = new FOptionMenuTextField( label, cvar, check );
|
||||||
|
desc->mItems.Push( it );
|
||||||
|
}
|
||||||
|
// [TP] -- Number input widget
|
||||||
|
else if ( sc.Compare( "NumberField" ))
|
||||||
|
{
|
||||||
|
sc.MustGetString();
|
||||||
|
FString label = sc.String;
|
||||||
|
sc.MustGetStringName( "," );
|
||||||
|
sc.MustGetString();
|
||||||
|
FString cvar = sc.String;
|
||||||
|
float minimum = 0.0f;
|
||||||
|
float maximum = 100.0f;
|
||||||
|
float step = 1.0f;
|
||||||
|
FString check;
|
||||||
|
|
||||||
|
if ( sc.CheckString( "," ))
|
||||||
|
{
|
||||||
|
sc.MustGetFloat();
|
||||||
|
minimum = (float) sc.Float;
|
||||||
|
sc.MustGetStringName( "," );
|
||||||
|
sc.MustGetFloat();
|
||||||
|
maximum = (float) sc.Float;
|
||||||
|
|
||||||
|
if ( sc.CheckString( "," ))
|
||||||
|
{
|
||||||
|
sc.MustGetFloat();
|
||||||
|
step = (float) sc.Float;
|
||||||
|
|
||||||
|
if ( sc.CheckString( "," ))
|
||||||
|
{
|
||||||
|
sc.MustGetString();
|
||||||
|
check = sc.String;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FOptionMenuItem* it = new FOptionMenuNumberField( label, cvar,
|
||||||
|
minimum, maximum, step, check );
|
||||||
|
desc->mItems.Push( it );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sc.ScriptError("Unknown keyword '%s'", sc.String);
|
sc.ScriptError("Unknown keyword '%s'", sc.String);
|
||||||
|
|
|
@ -40,6 +40,8 @@
|
||||||
#include "d_gui.h"
|
#include "d_gui.h"
|
||||||
#include "v_font.h"
|
#include "v_font.h"
|
||||||
#include "v_palette.h"
|
#include "v_palette.h"
|
||||||
|
// [TP] New #includes
|
||||||
|
#include "v_text.h"
|
||||||
|
|
||||||
IMPLEMENT_ABSTRACT_CLASS(DTextEnterMenu)
|
IMPLEMENT_ABSTRACT_CLASS(DTextEnterMenu)
|
||||||
|
|
||||||
|
@ -64,7 +66,8 @@ CVAR(Bool, m_showinputgrid, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||||
//
|
//
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
DTextEnterMenu::DTextEnterMenu(DMenu *parent, char *textbuffer, int maxlen, int sizemode, bool showgrid)
|
// [TP] Added allowcolors
|
||||||
|
DTextEnterMenu::DTextEnterMenu(DMenu *parent, char *textbuffer, int maxlen, int sizemode, bool showgrid, bool allowcolors)
|
||||||
: DMenu(parent)
|
: DMenu(parent)
|
||||||
{
|
{
|
||||||
mEnterString = textbuffer;
|
mEnterString = textbuffer;
|
||||||
|
@ -83,6 +86,7 @@ DTextEnterMenu::DTextEnterMenu(DMenu *parent, char *textbuffer, int maxlen, int
|
||||||
InputGridX = 0;
|
InputGridX = 0;
|
||||||
InputGridY = 0;
|
InputGridY = 0;
|
||||||
}
|
}
|
||||||
|
AllowColors = allowcolors; // [TP]
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
@ -140,6 +144,10 @@ bool DTextEnterMenu::Responder(event_t *ev)
|
||||||
{
|
{
|
||||||
if (mEnterString[0])
|
if (mEnterString[0])
|
||||||
{
|
{
|
||||||
|
// [TP] If we allow color codes, colorize the string now.
|
||||||
|
if (AllowColors)
|
||||||
|
strbin(mEnterString);
|
||||||
|
|
||||||
DMenu *parent = mParentMenu;
|
DMenu *parent = mParentMenu;
|
||||||
Close();
|
Close();
|
||||||
parent->MenuEvent(MKEY_Input, false);
|
parent->MenuEvent(MKEY_Input, false);
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
**---------------------------------------------------------------------------
|
**---------------------------------------------------------------------------
|
||||||
**
|
**
|
||||||
*/
|
*/
|
||||||
|
#include "v_text.h"
|
||||||
|
|
||||||
|
|
||||||
void M_DrawConText (int color, int x, int y, const char *str);
|
void M_DrawConText (int color, int x, int y, const char *str);
|
||||||
|
@ -943,6 +944,207 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//=============================================================================
|
||||||
|
//
|
||||||
|
// [TP] FOptionMenuFieldBase
|
||||||
|
//
|
||||||
|
// Base class for input fields
|
||||||
|
//
|
||||||
|
//=============================================================================
|
||||||
|
|
||||||
|
class FOptionMenuFieldBase : public FOptionMenuItem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
FOptionMenuFieldBase ( const char* label, const char* menu, const char* graycheck ) :
|
||||||
|
FOptionMenuItem ( label, menu ),
|
||||||
|
mCVar ( FindCVar( mAction, NULL )),
|
||||||
|
mGrayCheck (( graycheck && strlen( graycheck )) ? FindCVar( graycheck, NULL ) : NULL ) {}
|
||||||
|
|
||||||
|
const char* GetCVarString()
|
||||||
|
{
|
||||||
|
if ( mCVar == NULL )
|
||||||
|
return "";
|
||||||
|
|
||||||
|
return mCVar->GetGenericRep( CVAR_String ).String;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual FString Represent()
|
||||||
|
{
|
||||||
|
return GetCVarString();
|
||||||
|
}
|
||||||
|
|
||||||
|
int Draw ( FOptionMenuDescriptor*, int y, int indent, bool selected )
|
||||||
|
{
|
||||||
|
bool grayed = mGrayCheck != NULL && !( mGrayCheck->GetGenericRep( CVAR_Bool ).Bool );
|
||||||
|
drawLabel( indent, y, selected ? OptionSettings.mFontColorSelection : OptionSettings.mFontColor, grayed );
|
||||||
|
int overlay = grayed? MAKEARGB( 96, 48, 0, 0 ) : 0;
|
||||||
|
|
||||||
|
screen->DrawText( SmallFont, OptionSettings.mFontColorValue, indent + CURSORSPACE, y,
|
||||||
|
Represent().GetChars(), DTA_CleanNoMove_1, true, DTA_ColorOverlay, overlay, TAG_DONE );
|
||||||
|
return indent;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GetString ( int i, char* s, int len )
|
||||||
|
{
|
||||||
|
if ( i == 0 )
|
||||||
|
{
|
||||||
|
strncpy( s, GetCVarString(), len );
|
||||||
|
s[len - 1] = '\0';
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SetString ( int i, const char* s )
|
||||||
|
{
|
||||||
|
if ( i == 0 )
|
||||||
|
{
|
||||||
|
if ( mCVar )
|
||||||
|
{
|
||||||
|
UCVarValue vval;
|
||||||
|
vval.String = s;
|
||||||
|
mCVar->SetGenericRep( vval, CVAR_String );
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Action is a CVar in this class and derivatives.
|
||||||
|
FBaseCVar* mCVar;
|
||||||
|
FBaseCVar* mGrayCheck;
|
||||||
|
};
|
||||||
|
|
||||||
|
//=============================================================================
|
||||||
|
//
|
||||||
|
// [TP] FOptionMenuTextField
|
||||||
|
//
|
||||||
|
// A text input field widget, for use with string CVars.
|
||||||
|
//
|
||||||
|
//=============================================================================
|
||||||
|
|
||||||
|
class FOptionMenuTextField : public FOptionMenuFieldBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
FOptionMenuTextField ( const char *label, const char* menu, const char* graycheck ) :
|
||||||
|
FOptionMenuFieldBase ( label, menu, graycheck ),
|
||||||
|
mEntering ( false ) {}
|
||||||
|
|
||||||
|
FString Represent()
|
||||||
|
{
|
||||||
|
FString text = mEntering ? mEditName : GetCVarString();
|
||||||
|
|
||||||
|
if ( mEntering )
|
||||||
|
text += ( gameinfo.gametype & GAME_DoomStrifeChex ) ? '_' : '[';
|
||||||
|
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MenuEvent ( int mkey, bool fromcontroller )
|
||||||
|
{
|
||||||
|
if ( mkey == MKEY_Enter )
|
||||||
|
{
|
||||||
|
S_Sound( CHAN_VOICE | CHAN_UI, "menu/choose", snd_menuvolume, ATTN_NONE );
|
||||||
|
strcpy( mEditName, GetCVarString() );
|
||||||
|
mEntering = true;
|
||||||
|
DMenu* input = new DTextEnterMenu ( DMenu::CurrentMenu, mEditName, sizeof mEditName, 2, fromcontroller );
|
||||||
|
M_ActivateMenu( input );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if ( mkey == MKEY_Input )
|
||||||
|
{
|
||||||
|
if ( mCVar )
|
||||||
|
{
|
||||||
|
UCVarValue vval;
|
||||||
|
vval.String = mEditName;
|
||||||
|
mCVar->SetGenericRep( vval, CVAR_String );
|
||||||
|
}
|
||||||
|
|
||||||
|
mEntering = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if ( mkey == MKEY_Abort )
|
||||||
|
{
|
||||||
|
mEntering = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FOptionMenuItem::MenuEvent( mkey, fromcontroller );
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool mEntering;
|
||||||
|
char mEditName[128];
|
||||||
|
};
|
||||||
|
|
||||||
|
//=============================================================================
|
||||||
|
//
|
||||||
|
// [TP] FOptionMenuNumberField
|
||||||
|
//
|
||||||
|
// A numeric input field widget, for use with number CVars where sliders are inappropriate (i.e.
|
||||||
|
// where the user is interested in the exact value specifically)
|
||||||
|
//
|
||||||
|
//=============================================================================
|
||||||
|
|
||||||
|
class FOptionMenuNumberField : public FOptionMenuFieldBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
FOptionMenuNumberField ( const char *label, const char* menu, float minimum, float maximum,
|
||||||
|
float step, const char* graycheck )
|
||||||
|
: FOptionMenuFieldBase ( label, menu, graycheck ),
|
||||||
|
mMinimum ( minimum ),
|
||||||
|
mMaximum ( maximum ),
|
||||||
|
mStep ( step )
|
||||||
|
{
|
||||||
|
if ( mMaximum <= mMinimum )
|
||||||
|
swapvalues( mMinimum, mMaximum );
|
||||||
|
|
||||||
|
if ( mStep <= 0 )
|
||||||
|
mStep = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MenuEvent ( int mkey, bool fromcontroller )
|
||||||
|
{
|
||||||
|
if ( mCVar )
|
||||||
|
{
|
||||||
|
float value = mCVar->GetGenericRep( CVAR_Float ).Float;
|
||||||
|
|
||||||
|
if ( mkey == MKEY_Left )
|
||||||
|
{
|
||||||
|
value -= mStep;
|
||||||
|
|
||||||
|
if ( value < mMinimum )
|
||||||
|
value = mMaximum;
|
||||||
|
}
|
||||||
|
else if ( mkey == MKEY_Right || mkey == MKEY_Enter )
|
||||||
|
{
|
||||||
|
value += mStep;
|
||||||
|
|
||||||
|
if ( value > mMaximum )
|
||||||
|
value = mMinimum;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return FOptionMenuItem::MenuEvent( mkey, fromcontroller );
|
||||||
|
|
||||||
|
UCVarValue vval;
|
||||||
|
vval.Float = value;
|
||||||
|
mCVar->SetGenericRep( vval, CVAR_Float );
|
||||||
|
S_Sound( CHAN_VOICE | CHAN_UI, "menu/change", snd_menuvolume, ATTN_NONE );
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
float mMinimum;
|
||||||
|
float mMaximum;
|
||||||
|
float mStep;
|
||||||
|
};
|
||||||
#ifndef NO_IMP
|
#ifndef NO_IMP
|
||||||
CCMD(am_restorecolors)
|
CCMD(am_restorecolors)
|
||||||
{
|
{
|
||||||
|
|
|
@ -946,6 +946,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
|
||||||
bool forcedPain = false;
|
bool forcedPain = false;
|
||||||
int fakeDamage = 0;
|
int fakeDamage = 0;
|
||||||
int holdDamage = 0;
|
int holdDamage = 0;
|
||||||
|
int rawdamage = damage;
|
||||||
|
|
||||||
if (damage < 0) damage = 0;
|
if (damage < 0) damage = 0;
|
||||||
|
|
||||||
|
@ -980,7 +981,11 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if ((target->flags2 & MF2_INVULNERABLE) && (damage < TELEFRAG_DAMAGE) && (!(flags & DMG_FORCED)))
|
// [MC] Changed it to check rawdamage here for consistency, even though that doesn't actually do anything
|
||||||
|
// different here. At any rate, invulnerable is being checked before type factoring, which is then being
|
||||||
|
// checked by player cheats/invul/buddha followed by monster buddha. This is inconsistent. Don't let the
|
||||||
|
// original telefrag damage CHECK (rawdamage) be influenced by outside factors when looking at cheats/invul.
|
||||||
|
if ((target->flags2 & MF2_INVULNERABLE) && (rawdamage < TELEFRAG_DAMAGE) && (!(flags & DMG_FORCED)))
|
||||||
{ // actor is invulnerable
|
{ // actor is invulnerable
|
||||||
if (target->player == NULL)
|
if (target->player == NULL)
|
||||||
{
|
{
|
||||||
|
@ -1040,7 +1045,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (damage < TELEFRAG_DAMAGE) // TELEFRAG_DAMAGE may not be reduced at all or it may not guarantee its effect.
|
if ((rawdamage < TELEFRAG_DAMAGE) || (target->flags7 & MF7_LAXTELEFRAGDMG)) // TELEFRAG_DAMAGE may only be reduced with NOTELEFRAGPIERCE or it may not guarantee its effect.
|
||||||
{
|
{
|
||||||
if (player && damage > 1)
|
if (player && damage > 1)
|
||||||
{
|
{
|
||||||
|
@ -1218,7 +1223,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
|
||||||
{
|
{
|
||||||
if (player)
|
if (player)
|
||||||
FriendlyFire = true;
|
FriendlyFire = true;
|
||||||
if (damage < TELEFRAG_DAMAGE)
|
if (rawdamage < TELEFRAG_DAMAGE) //Use the original damage to check for telefrag amount. Don't let the now-amplified damagetypes do it.
|
||||||
{ // Still allow telefragging :-(
|
{ // Still allow telefragging :-(
|
||||||
damage = (int)((float)damage * level.teamdamage);
|
damage = (int)((float)damage * level.teamdamage);
|
||||||
if (damage < 0)
|
if (damage < 0)
|
||||||
|
@ -1261,7 +1266,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
|
||||||
if (!(flags & DMG_FORCED))
|
if (!(flags & DMG_FORCED))
|
||||||
{
|
{
|
||||||
// check the real player, not a voodoo doll here for invulnerability effects
|
// check the real player, not a voodoo doll here for invulnerability effects
|
||||||
if ((damage < TELEFRAG_DAMAGE && ((player->mo->flags2 & MF2_INVULNERABLE) ||
|
if ((rawdamage < TELEFRAG_DAMAGE && ((player->mo->flags2 & MF2_INVULNERABLE) ||
|
||||||
(player->cheats & CF_GODMODE))) ||
|
(player->cheats & CF_GODMODE))) ||
|
||||||
(player->cheats & CF_GODMODE2) || (player->mo->flags5 & MF5_NODAMAGE))
|
(player->cheats & CF_GODMODE2) || (player->mo->flags5 & MF5_NODAMAGE))
|
||||||
//Absolutely no hurting if NODAMAGE is involved. Same for GODMODE2.
|
//Absolutely no hurting if NODAMAGE is involved. Same for GODMODE2.
|
||||||
|
@ -1286,7 +1291,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
|
||||||
{
|
{
|
||||||
player->mo->Inventory->AbsorbDamage(damage, mod, newdam);
|
player->mo->Inventory->AbsorbDamage(damage, mod, newdam);
|
||||||
}
|
}
|
||||||
if (damage < TELEFRAG_DAMAGE)
|
if ((rawdamage < TELEFRAG_DAMAGE) || (player->mo->flags7 & MF7_LAXTELEFRAGDMG)) //rawdamage is never modified.
|
||||||
{
|
{
|
||||||
// if we are telefragging don't let the damage value go below that magic value. Some further checks would fail otherwise.
|
// if we are telefragging don't let the damage value go below that magic value. Some further checks would fail otherwise.
|
||||||
damage = newdam;
|
damage = newdam;
|
||||||
|
@ -1305,7 +1310,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (damage >= player->health && damage < TELEFRAG_DAMAGE
|
if (damage >= player->health && rawdamage < TELEFRAG_DAMAGE
|
||||||
&& (G_SkillProperty(SKILLP_AutoUseHealth) || deathmatch)
|
&& (G_SkillProperty(SKILLP_AutoUseHealth) || deathmatch)
|
||||||
&& !player->morphTics)
|
&& !player->morphTics)
|
||||||
{ // Try to use some inventory health
|
{ // Try to use some inventory health
|
||||||
|
@ -1329,7 +1334,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
|
||||||
// but telefragging should still do enough damage to kill the player)
|
// but telefragging should still do enough damage to kill the player)
|
||||||
// Ignore players that are already dead.
|
// Ignore players that are already dead.
|
||||||
// [MC]Buddha2 absorbs telefrag damage, and anything else thrown their way.
|
// [MC]Buddha2 absorbs telefrag damage, and anything else thrown their way.
|
||||||
if (!(flags & DMG_FORCED) && (((player->cheats & CF_BUDDHA2) || (((player->cheats & CF_BUDDHA) || (player->mo->flags7 & MF7_BUDDHA)) && (damage < TELEFRAG_DAMAGE))) && (player->playerstate != PST_DEAD)))
|
if (!(flags & DMG_FORCED) && (((player->cheats & CF_BUDDHA2) || (((player->cheats & CF_BUDDHA) || (player->mo->flags7 & MF7_BUDDHA)) && (rawdamage < TELEFRAG_DAMAGE))) && (player->playerstate != PST_DEAD)))
|
||||||
{
|
{
|
||||||
// If this is a voodoo doll we need to handle the real player as well.
|
// If this is a voodoo doll we need to handle the real player as well.
|
||||||
player->mo->health = target->health = player->health = 1;
|
player->mo->health = target->health = player->health = 1;
|
||||||
|
@ -1394,7 +1399,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
|
||||||
if (target->health <= 0)
|
if (target->health <= 0)
|
||||||
{
|
{
|
||||||
//[MC]Buddha flag for monsters.
|
//[MC]Buddha flag for monsters.
|
||||||
if (!(flags & DMG_FORCED) && ((target->flags7 & MF7_BUDDHA) && (damage < TELEFRAG_DAMAGE) && ((inflictor == NULL || !(inflictor->flags7 & MF7_FOILBUDDHA)) && !(flags & DMG_FOILBUDDHA))))
|
if (!(flags & DMG_FORCED) && ((target->flags7 & MF7_BUDDHA) && (rawdamage < TELEFRAG_DAMAGE) && ((inflictor == NULL || !(inflictor->flags7 & MF7_FOILBUDDHA)) && !(flags & DMG_FOILBUDDHA))))
|
||||||
{ //FOILBUDDHA or Telefrag damage must kill it.
|
{ //FOILBUDDHA or Telefrag damage must kill it.
|
||||||
target->health = 1;
|
target->health = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3115,8 +3115,24 @@ void AActor::SetShade (int r, int g, int b)
|
||||||
fillcolor = MAKEARGB(ColorMatcher.Pick (r, g, b), r, g, b);
|
fillcolor = MAKEARGB(ColorMatcher.Pick (r, g, b), r, g, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AActor::SetPitch(int p, bool interpolate)
|
void AActor::SetPitch(int p, bool interpolate, bool forceclamp)
|
||||||
{
|
{
|
||||||
|
if (player != NULL || forceclamp)
|
||||||
|
{ // clamp the pitch we set
|
||||||
|
int min, max;
|
||||||
|
|
||||||
|
if (player != NULL)
|
||||||
|
{
|
||||||
|
min = player->MinPitch;
|
||||||
|
max = player->MaxPitch;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
min = -ANGLE_90 + (1 << ANGLETOFINESHIFT);
|
||||||
|
max = ANGLE_90 - (1 << ANGLETOFINESHIFT);
|
||||||
|
}
|
||||||
|
p = clamp<int>(p, min, max);
|
||||||
|
}
|
||||||
if (p != pitch)
|
if (p != pitch)
|
||||||
{
|
{
|
||||||
pitch = p;
|
pitch = p;
|
||||||
|
|
|
@ -207,10 +207,10 @@ void P_BringUpWeapon (player_t *player)
|
||||||
player->ReadyWeapon = weapon;
|
player->ReadyWeapon = weapon;
|
||||||
player->psprites[ps_weapon].sy = player->cheats & CF_INSTANTWEAPSWITCH
|
player->psprites[ps_weapon].sy = player->cheats & CF_INSTANTWEAPSWITCH
|
||||||
? WEAPONTOP : WEAPONBOTTOM;
|
? WEAPONTOP : WEAPONBOTTOM;
|
||||||
P_SetPsprite (player, ps_weapon, newstate);
|
|
||||||
// make sure that the previous weapon's flash state is terminated.
|
// make sure that the previous weapon's flash state is terminated.
|
||||||
// When coming here from a weapon drop it may still be active.
|
// When coming here from a weapon drop it may still be active.
|
||||||
P_SetPsprite(player, ps_flash, NULL);
|
P_SetPsprite(player, ps_flash, NULL);
|
||||||
|
P_SetPsprite (player, ps_weapon, newstate);
|
||||||
player->mo->weaponspecial = 0;
|
player->mo->weaponspecial = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1741,7 +1741,7 @@ static void P_SpawnScrollers(void)
|
||||||
if (lines[i].special == Sector_CopyScroller)
|
if (lines[i].special == Sector_CopyScroller)
|
||||||
{
|
{
|
||||||
// don't allow copying the scroller if the sector has the same tag as it would just duplicate it.
|
// don't allow copying the scroller if the sector has the same tag as it would just duplicate it.
|
||||||
if (tagManager.SectorHasTag(lines[i].frontsector, lines[i].args[0]))
|
if (!tagManager.SectorHasTag(lines[i].frontsector, lines[i].args[0]))
|
||||||
{
|
{
|
||||||
copyscrollers.Push(i);
|
copyscrollers.Push(i);
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,6 +98,8 @@ void FTagManager::AddSectorTag(int sector, int tag)
|
||||||
|
|
||||||
void FTagManager::RemoveSectorTags(int sect)
|
void FTagManager::RemoveSectorTags(int sect)
|
||||||
{
|
{
|
||||||
|
if (startForSector.Size() > 0)
|
||||||
|
{
|
||||||
int start = startForSector[sect];
|
int start = startForSector[sect];
|
||||||
if (start >= 0)
|
if (start >= 0)
|
||||||
{
|
{
|
||||||
|
@ -107,6 +109,7 @@ void FTagManager::RemoveSectorTags(int sect)
|
||||||
start++;
|
start++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
@ -49,6 +49,7 @@ public:
|
||||||
startForSector.Clear();
|
startForSector.Clear();
|
||||||
startForLine.Clear();
|
startForLine.Clear();
|
||||||
memset(TagHashFirst, -1, sizeof(TagHashFirst));
|
memset(TagHashFirst, -1, sizeof(TagHashFirst));
|
||||||
|
memset(IDHashFirst, -1, sizeof(IDHashFirst));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SectorHasTags(const sector_t *sector) const;
|
bool SectorHasTags(const sector_t *sector) const;
|
||||||
|
|
|
@ -28,7 +28,7 @@ class SDLFB : public DFrameBuffer
|
||||||
{
|
{
|
||||||
DECLARE_CLASS(SDLFB, DFrameBuffer)
|
DECLARE_CLASS(SDLFB, DFrameBuffer)
|
||||||
public:
|
public:
|
||||||
SDLFB (int width, int height, bool fullscreen);
|
SDLFB (int width, int height, bool fullscreen, SDL_Window *oldwin);
|
||||||
~SDLFB ();
|
~SDLFB ();
|
||||||
|
|
||||||
bool Lock (bool buffer);
|
bool Lock (bool buffer);
|
||||||
|
@ -67,7 +67,6 @@ private:
|
||||||
SDL_Texture *Texture;
|
SDL_Texture *Texture;
|
||||||
SDL_Surface *Surface;
|
SDL_Surface *Surface;
|
||||||
};
|
};
|
||||||
SDL_Rect UpdateRect;
|
|
||||||
|
|
||||||
bool UsingRenderer;
|
bool UsingRenderer;
|
||||||
bool NeedPalUpdate;
|
bool NeedPalUpdate;
|
||||||
|
@ -261,6 +260,8 @@ DFrameBuffer *SDLVideo::CreateFrameBuffer (int width, int height, bool fullscree
|
||||||
PalEntry flashColor;
|
PalEntry flashColor;
|
||||||
int flashAmount;
|
int flashAmount;
|
||||||
|
|
||||||
|
SDL_Window *oldwin = NULL;
|
||||||
|
|
||||||
if (old != NULL)
|
if (old != NULL)
|
||||||
{ // Reuse the old framebuffer if its attributes are the same
|
{ // Reuse the old framebuffer if its attributes are the same
|
||||||
SDLFB *fb = static_cast<SDLFB *> (old);
|
SDLFB *fb = static_cast<SDLFB *> (old);
|
||||||
|
@ -275,6 +276,10 @@ DFrameBuffer *SDLVideo::CreateFrameBuffer (int width, int height, bool fullscree
|
||||||
}
|
}
|
||||||
return old;
|
return old;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
oldwin = fb->Screen;
|
||||||
|
fb->Screen = NULL;
|
||||||
|
|
||||||
old->GetFlash (flashColor, flashAmount);
|
old->GetFlash (flashColor, flashAmount);
|
||||||
old->ObjectFlags |= OF_YesReallyDelete;
|
old->ObjectFlags |= OF_YesReallyDelete;
|
||||||
if (screen == old) screen = NULL;
|
if (screen == old) screen = NULL;
|
||||||
|
@ -286,7 +291,7 @@ DFrameBuffer *SDLVideo::CreateFrameBuffer (int width, int height, bool fullscree
|
||||||
flashAmount = 0;
|
flashAmount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDLFB *fb = new SDLFB (width, height, fullscreen);
|
SDLFB *fb = new SDLFB (width, height, fullscreen, oldwin);
|
||||||
|
|
||||||
// If we could not create the framebuffer, try again with slightly
|
// If we could not create the framebuffer, try again with slightly
|
||||||
// different parameters in this order:
|
// different parameters in this order:
|
||||||
|
@ -340,7 +345,7 @@ void SDLVideo::SetWindowedScale (float scale)
|
||||||
|
|
||||||
// FrameBuffer implementation -----------------------------------------------
|
// FrameBuffer implementation -----------------------------------------------
|
||||||
|
|
||||||
SDLFB::SDLFB (int width, int height, bool fullscreen)
|
SDLFB::SDLFB (int width, int height, bool fullscreen, SDL_Window *oldwin)
|
||||||
: DFrameBuffer (width, height)
|
: DFrameBuffer (width, height)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -351,15 +356,27 @@ SDLFB::SDLFB (int width, int height, bool fullscreen)
|
||||||
NotPaletted = false;
|
NotPaletted = false;
|
||||||
FlashAmount = 0;
|
FlashAmount = 0;
|
||||||
|
|
||||||
|
if (oldwin)
|
||||||
|
{
|
||||||
|
// In some cases (Mac OS X fullscreen) SDL2 doesn't like having multiple windows which
|
||||||
|
// appears to inevitably happen while compositor animations are running. So lets try
|
||||||
|
// to reuse the existing window.
|
||||||
|
Screen = oldwin;
|
||||||
|
SDL_SetWindowSize (Screen, width, height);
|
||||||
|
SetFullscreen (fullscreen);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
FString caption;
|
FString caption;
|
||||||
caption.Format(GAMESIG " %s (%s)", GetVersionString(), GetGitTime());
|
caption.Format(GAMESIG " %s (%s)", GetVersionString(), GetGitTime());
|
||||||
|
|
||||||
Screen = SDL_CreateWindow (caption,
|
Screen = SDL_CreateWindow (caption,
|
||||||
SDL_WINDOWPOS_UNDEFINED_DISPLAY(vid_adapter), SDL_WINDOWPOS_UNDEFINED_DISPLAY(vid_adapter),
|
SDL_WINDOWPOS_UNDEFINED_DISPLAY(vid_adapter), SDL_WINDOWPOS_UNDEFINED_DISPLAY(vid_adapter),
|
||||||
width, height, (fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0));
|
width, height, (fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0)|SDL_WINDOW_RESIZABLE);
|
||||||
|
|
||||||
if (Screen == NULL)
|
if (Screen == NULL)
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Renderer = NULL;
|
Renderer = NULL;
|
||||||
Texture = NULL;
|
Texture = NULL;
|
||||||
|
@ -381,8 +398,6 @@ SDLFB::SDLFB (int width, int height, bool fullscreen)
|
||||||
|
|
||||||
SDLFB::~SDLFB ()
|
SDLFB::~SDLFB ()
|
||||||
{
|
{
|
||||||
if(Screen)
|
|
||||||
{
|
|
||||||
if (Renderer)
|
if (Renderer)
|
||||||
{
|
{
|
||||||
if (Texture)
|
if (Texture)
|
||||||
|
@ -390,6 +405,8 @@ SDLFB::~SDLFB ()
|
||||||
SDL_DestroyRenderer (Renderer);
|
SDL_DestroyRenderer (Renderer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(Screen)
|
||||||
|
{
|
||||||
SDL_DestroyWindow (Screen);
|
SDL_DestroyWindow (Screen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -498,7 +515,8 @@ void SDLFB::Update ()
|
||||||
SDL_UnlockTexture (Texture);
|
SDL_UnlockTexture (Texture);
|
||||||
|
|
||||||
SDLFlipCycles.Clock();
|
SDLFlipCycles.Clock();
|
||||||
SDL_RenderCopy(Renderer, Texture, NULL, &UpdateRect);
|
SDL_RenderClear(Renderer);
|
||||||
|
SDL_RenderCopy(Renderer, Texture, NULL, NULL);
|
||||||
SDL_RenderPresent(Renderer);
|
SDL_RenderPresent(Renderer);
|
||||||
SDLFlipCycles.Unclock();
|
SDLFlipCycles.Unclock();
|
||||||
}
|
}
|
||||||
|
@ -613,6 +631,9 @@ void SDLFB::GetFlashedPalette (PalEntry pal[256])
|
||||||
|
|
||||||
void SDLFB::SetFullscreen (bool fullscreen)
|
void SDLFB::SetFullscreen (bool fullscreen)
|
||||||
{
|
{
|
||||||
|
if (IsFullscreen() == fullscreen)
|
||||||
|
return;
|
||||||
|
|
||||||
SDL_SetWindowFullscreen (Screen, fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0);
|
SDL_SetWindowFullscreen (Screen, fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0);
|
||||||
if (!fullscreen)
|
if (!fullscreen)
|
||||||
{
|
{
|
||||||
|
@ -645,6 +666,8 @@ void SDLFB::ResetSDLRenderer ()
|
||||||
if (!Renderer)
|
if (!Renderer)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
SDL_SetRenderDrawColor(Renderer, 0, 0, 0, 255);
|
||||||
|
|
||||||
Uint32 fmt;
|
Uint32 fmt;
|
||||||
switch(vid_displaybits)
|
switch(vid_displaybits)
|
||||||
{
|
{
|
||||||
|
@ -681,24 +704,14 @@ void SDLFB::ResetSDLRenderer ()
|
||||||
NotPaletted = false;
|
NotPaletted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate update rectangle
|
// In fullscreen, set logical size according to animorphic ratio.
|
||||||
|
// Windowed modes are rendered to fill the window (usually 1:1)
|
||||||
if (IsFullscreen ())
|
if (IsFullscreen ())
|
||||||
{
|
{
|
||||||
int w, h;
|
int w, h;
|
||||||
SDL_GetWindowSize (Screen, &w, &h);
|
SDL_GetWindowSize (Screen, &w, &h);
|
||||||
UpdateRect.w = w;
|
ScaleWithAspect (w, h, Width, Height);
|
||||||
UpdateRect.h = h;
|
SDL_RenderSetLogicalSize (Renderer, w, h);
|
||||||
ScaleWithAspect (UpdateRect.w, UpdateRect.h, Width, Height);
|
|
||||||
UpdateRect.x = (w - UpdateRect.w)/2;
|
|
||||||
UpdateRect.y = (h - UpdateRect.h)/2;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// In windowed mode we just update the whole window.
|
|
||||||
UpdateRect.x = 0;
|
|
||||||
UpdateRect.y = 0;
|
|
||||||
UpdateRect.w = Width;
|
|
||||||
UpdateRect.h = Height;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -726,13 +739,14 @@ void SDLFB::SetVSync (bool vsync)
|
||||||
|
|
||||||
void SDLFB::ScaleCoordsFromWindow(SWORD &x, SWORD &y)
|
void SDLFB::ScaleCoordsFromWindow(SWORD &x, SWORD &y)
|
||||||
{
|
{
|
||||||
|
int w, h;
|
||||||
|
SDL_GetWindowSize (Screen, &w, &h);
|
||||||
|
|
||||||
// Detect if we're doing scaling in the Window and adjust the mouse
|
// Detect if we're doing scaling in the Window and adjust the mouse
|
||||||
// coordinates accordingly. This could be more efficent, but I
|
// coordinates accordingly. This could be more efficent, but I
|
||||||
// don't think performance is an issue in the menus.
|
// don't think performance is an issue in the menus.
|
||||||
if(IsFullscreen())
|
if(IsFullscreen())
|
||||||
{
|
{
|
||||||
int w, h;
|
|
||||||
SDL_GetWindowSize (Screen, &w, &h);
|
|
||||||
int realw = w, realh = h;
|
int realw = w, realh = h;
|
||||||
ScaleWithAspect (realw, realh, SCREENWIDTH, SCREENHEIGHT);
|
ScaleWithAspect (realw, realh, SCREENWIDTH, SCREENHEIGHT);
|
||||||
if (realw != SCREENWIDTH || realh != SCREENHEIGHT)
|
if (realw != SCREENWIDTH || realh != SCREENHEIGHT)
|
||||||
|
@ -751,6 +765,11 @@ void SDLFB::ScaleCoordsFromWindow(SWORD &x, SWORD &y)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x = (SWORD)(x*Width/w);
|
||||||
|
y = (SWORD)(y*Height/h);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ADD_STAT (blit)
|
ADD_STAT (blit)
|
||||||
|
|
|
@ -267,6 +267,11 @@ void FSoftwareRenderer::RenderTextureView (FCanvasTexture *tex, AActor *viewpoin
|
||||||
BYTE *Pixels = const_cast<BYTE*>(tex->GetPixels());
|
BYTE *Pixels = const_cast<BYTE*>(tex->GetPixels());
|
||||||
DSimpleCanvas *Canvas = tex->GetCanvas();
|
DSimpleCanvas *Canvas = tex->GetCanvas();
|
||||||
|
|
||||||
|
// curse Doom's overuse of global variables in the renderer.
|
||||||
|
// These get clobbered by rendering to a camera texture but they need to be preserved so the final rendering can be done with the correct palette.
|
||||||
|
unsigned char *savecolormap = fixedcolormap;
|
||||||
|
FSpecialColormap *savecm = realfixedcolormap;
|
||||||
|
|
||||||
float savedfov = LastFOV;
|
float savedfov = LastFOV;
|
||||||
R_SetFOV ((float)fov);
|
R_SetFOV ((float)fov);
|
||||||
R_RenderViewToCanvas (viewpoint, Canvas, 0, 0, tex->GetWidth(), tex->GetHeight(), tex->bFirstUpdate);
|
R_RenderViewToCanvas (viewpoint, Canvas, 0, 0, tex->GetWidth(), tex->GetHeight(), tex->bFirstUpdate);
|
||||||
|
@ -280,6 +285,8 @@ void FSoftwareRenderer::RenderTextureView (FCanvasTexture *tex, AActor *viewpoin
|
||||||
FTexture::FlipNonSquareBlockRemap (Pixels, Canvas->GetBuffer(), tex->GetWidth(), tex->GetHeight(), Canvas->GetPitch(), GPalette.Remap);
|
FTexture::FlipNonSquareBlockRemap (Pixels, Canvas->GetBuffer(), tex->GetWidth(), tex->GetHeight(), Canvas->GetPitch(), GPalette.Remap);
|
||||||
}
|
}
|
||||||
tex->SetUpdated();
|
tex->SetUpdated();
|
||||||
|
fixedcolormap = savecolormap;
|
||||||
|
realfixedcolormap = savecm;
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
|
@ -62,9 +62,6 @@
|
||||||
extern bool DrawFSHUD; // [RH] Defined in d_main.cpp
|
extern bool DrawFSHUD; // [RH] Defined in d_main.cpp
|
||||||
EXTERN_CVAR (Bool, cl_capfps)
|
EXTERN_CVAR (Bool, cl_capfps)
|
||||||
|
|
||||||
extern lighttable_t* fixedcolormap;
|
|
||||||
extern FSpecialColormap*realfixedcolormap;
|
|
||||||
|
|
||||||
// TYPES -------------------------------------------------------------------
|
// TYPES -------------------------------------------------------------------
|
||||||
|
|
||||||
struct InterpolationViewer
|
struct InterpolationViewer
|
||||||
|
@ -1101,11 +1098,6 @@ void FCanvasTextureInfo::UpdateAll ()
|
||||||
{
|
{
|
||||||
FCanvasTextureInfo *probe;
|
FCanvasTextureInfo *probe;
|
||||||
|
|
||||||
// curse Doom's overuse of global variables in the renderer.
|
|
||||||
// These get clobbered by rendering to a camera texture but they need to be preserved so the final rendering can be done with the correct palette.
|
|
||||||
unsigned char *savecolormap = fixedcolormap;
|
|
||||||
FSpecialColormap *savecm = realfixedcolormap;
|
|
||||||
|
|
||||||
for (probe = List; probe != NULL; probe = probe->Next)
|
for (probe = List; probe != NULL; probe = probe->Next)
|
||||||
{
|
{
|
||||||
if (probe->Viewpoint != NULL && probe->Texture->bNeedsUpdate)
|
if (probe->Viewpoint != NULL && probe->Texture->bNeedsUpdate)
|
||||||
|
@ -1113,9 +1105,6 @@ void FCanvasTextureInfo::UpdateAll ()
|
||||||
Renderer->RenderTextureView(probe->Texture, probe->Viewpoint, probe->FOV);
|
Renderer->RenderTextureView(probe->Texture, probe->Viewpoint, probe->FOV);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fixedcolormap = savecolormap;
|
|
||||||
realfixedcolormap = savecm;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
|
@ -3989,23 +3989,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetPitch)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ref->player != NULL || (flags & SPF_FORCECLAMP))
|
ref->SetPitch(pitch, !!(flags & SPF_INTERPOLATE), !!(flags & SPF_FORCECLAMP));
|
||||||
{ // clamp the pitch we set
|
|
||||||
int min, max;
|
|
||||||
|
|
||||||
if (ref->player != NULL)
|
|
||||||
{
|
|
||||||
min = ref->player->MinPitch;
|
|
||||||
max = ref->player->MaxPitch;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
min = -ANGLE_90 + (1 << ANGLETOFINESHIFT);
|
|
||||||
max = ANGLE_90 - (1 << ANGLETOFINESHIFT);
|
|
||||||
}
|
|
||||||
pitch = clamp<int>(pitch, min, max);
|
|
||||||
}
|
|
||||||
ref->SetPitch(pitch, !!(flags & SPF_INTERPOLATE));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
|
@ -258,6 +258,8 @@ static FFlagDef ActorFlagDefs[]=
|
||||||
DEFINE_FLAG(MF7, NODECAL, AActor, flags7),
|
DEFINE_FLAG(MF7, NODECAL, AActor, flags7),
|
||||||
DEFINE_FLAG(MF7, FORCEDECAL, AActor, flags7),
|
DEFINE_FLAG(MF7, FORCEDECAL, AActor, flags7),
|
||||||
|
|
||||||
|
DEFINE_FLAG(MF7, LAXTELEFRAGDMG, AActor, flags7),
|
||||||
|
|
||||||
// Effect flags
|
// Effect flags
|
||||||
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),
|
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),
|
||||||
DEFINE_FLAG2(FX_ROCKET, ROCKETTRAIL, AActor, effects),
|
DEFINE_FLAG2(FX_ROCKET, ROCKETTRAIL, AActor, effects),
|
||||||
|
|
|
@ -536,7 +536,7 @@ map LEVEL09 lookup "NHUSTR_9"
|
||||||
|
|
||||||
cluster 11
|
cluster 11
|
||||||
{
|
{
|
||||||
flat = "RROCK19"
|
flat = "SLIME16"
|
||||||
music = "$MUSIC_READ_M"
|
music = "$MUSIC_READ_M"
|
||||||
exittext = lookup, "NERVETEXT"
|
exittext = lookup, "NERVETEXT"
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ statusbar fullscreen, fullscreenoffsets
|
||||||
|
|
||||||
statusbar Normal
|
statusbar Normal
|
||||||
{
|
{
|
||||||
drawimage "H2BAR", 0, 135;
|
drawimage "H2BAR", 0, 134;
|
||||||
drawimage "STATBAR", 38, 162;
|
drawimage "STATBAR", 38, 162;
|
||||||
|
|
||||||
drawselectedinventory artiflash, INDEXFONT_RAVEN, 143, 163, 174, 184, untranslated;
|
drawselectedinventory artiflash, INDEXFONT_RAVEN, 143, 163, 174, 184, untranslated;
|
||||||
|
@ -204,7 +204,7 @@ statusbar Normal
|
||||||
|
|
||||||
statusbar Automap
|
statusbar Automap
|
||||||
{
|
{
|
||||||
drawimage "H2BAR", 0, 135;
|
drawimage "H2BAR", 0, 134;
|
||||||
drawimage "KEYBAR", 38, 162;
|
drawimage "KEYBAR", 38, 162;
|
||||||
drawkeybar 5, horizontal, 20, 46, 164;
|
drawkeybar 5, horizontal, 20, 46, 164;
|
||||||
drawimage hexenarmor(armor, "ARMSLOT1"), 150, 164;
|
drawimage hexenarmor(armor, "ARMSLOT1"), 150, 164;
|
||||||
|
|
Loading…
Reference in a new issue