Address PR feedback.
This commit is contained in:
+17
-17
@@ -33,8 +33,8 @@ public:
|
||||
ActorMultiVertex( const ActorMultiVertex &cpy );
|
||||
virtual ~ActorMultiVertex();
|
||||
|
||||
void LoadFromNode( const XNode* Node );
|
||||
virtual ActorMultiVertex *Copy() const;
|
||||
void LoadFromNode( const XNode* Node ) override;
|
||||
virtual ActorMultiVertex *Copy() const override;
|
||||
|
||||
struct AMV_TweenState
|
||||
{
|
||||
@@ -68,19 +68,19 @@ public:
|
||||
}
|
||||
const AMV_TweenState& AMV_DestTweenState() const { return const_cast<ActorMultiVertex*>(this)->AMV_DestTweenState(); }
|
||||
|
||||
virtual void EnableAnimation(bool bEnable);
|
||||
virtual void Update(float fDelta);
|
||||
virtual bool EarlyAbortDraw() const;
|
||||
virtual void DrawPrimitives();
|
||||
virtual void EnableAnimation(bool bEnable) override;
|
||||
virtual void Update(float fDelta) override;
|
||||
virtual bool EarlyAbortDraw() const override;
|
||||
virtual void DrawPrimitives() override;
|
||||
virtual void DrawInternal( const AMV_TweenState *TS );
|
||||
|
||||
void SetCurrentTweenStart();
|
||||
void EraseHeadTween();
|
||||
void UpdatePercentThroughTween( float PercentThroughTween );
|
||||
void BeginTweening( float time, ITween *pInterp );
|
||||
void SetCurrentTweenStart() override;
|
||||
void EraseHeadTween() override;
|
||||
void UpdatePercentThroughTween( float PercentThroughTween ) override;
|
||||
void BeginTweening( float time, ITween *pInterp ) override;
|
||||
|
||||
void StopTweening();
|
||||
void FinishTweening();
|
||||
void StopTweening() override;
|
||||
void FinishTweening() override;
|
||||
|
||||
void SetTexture( RageTexture *Texture );
|
||||
RageTexture* GetTexture() { return _Texture; };
|
||||
@@ -119,7 +119,7 @@ public:
|
||||
RectF rect;
|
||||
float delay;
|
||||
};
|
||||
int GetNumStates() const { return _states.size(); }
|
||||
int GetNumStates() const override { return _states.size(); }
|
||||
void AddState(const State& new_state) { _states.push_back(new_state); }
|
||||
void RemoveState(size_t i)
|
||||
{ ASSERT(i < _states.size()); _states.erase(_states.begin()+i); }
|
||||
@@ -130,10 +130,10 @@ public:
|
||||
{ ASSERT(i < _states.size()); _states[i]= s; }
|
||||
void SetStateProperties(const std::vector<State>& new_states)
|
||||
{ _states= new_states; SetState(0); }
|
||||
void SetState(int i);
|
||||
void SetState(int i) override;
|
||||
void SetAllStateDelays(float delay);
|
||||
float GetAnimationLengthSeconds() const;
|
||||
void SetSecondsIntoAnimation(float seconds);
|
||||
float GetAnimationLengthSeconds() const override;
|
||||
void SetSecondsIntoAnimation(float seconds) override;
|
||||
void UpdateAnimationState(bool force_update= false);
|
||||
size_t GetNumQuadStates() const
|
||||
{ return AMV_DestTweenState().quad_states.size(); }
|
||||
@@ -148,7 +148,7 @@ public:
|
||||
bool _use_animation_state;
|
||||
bool _decode_movie;
|
||||
|
||||
virtual void PushSelf( lua_State *L );
|
||||
virtual void PushSelf( lua_State *L ) override;
|
||||
|
||||
private:
|
||||
RageTexture* _Texture;
|
||||
|
||||
+20
-20
@@ -319,8 +319,8 @@ void ArrowEffects::Update()
|
||||
const Style::ColumnInfo* pCols = pStyle->m_ColumnInfo[pn];
|
||||
const SongPosition &position = GAMESTATE->m_bIsUsingStepTiming
|
||||
? GAMESTATE->m_pPlayerState[pn]->m_Position : GAMESTATE->m_Position;
|
||||
const auto& effects= GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.GetCurrent().m_fEffects;
|
||||
const auto& accels= GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.GetCurrent().m_fAccels;
|
||||
const float* effects= GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.GetCurrent().m_fEffects;
|
||||
const float* accels= GAMESTATE->m_pPlayerState[pn]->m_PlayerOptions.GetCurrent().m_fAccels;
|
||||
|
||||
PerPlayerData &data = g_EffectData[pn];
|
||||
|
||||
@@ -514,8 +514,8 @@ float ArrowEffects::GetYOffset( const PlayerState* pPlayerState, int iCol, float
|
||||
return fYOffset * fScrollSpeed;
|
||||
}
|
||||
|
||||
const auto& fAccels = curr_options->m_fAccels;
|
||||
const auto& fEffects = curr_options->m_fEffects;
|
||||
const float* fAccels = curr_options->m_fAccels;
|
||||
const float* fEffects = curr_options->m_fEffects;
|
||||
|
||||
// TODO: Don't index by PlayerNumber.
|
||||
PerPlayerData &data = g_EffectData[pPlayerState->m_PlayerNumber];
|
||||
@@ -636,7 +636,7 @@ float ArrowEffects::GetYPos( const PlayerState* pPlayerState, int iCol, float fY
|
||||
// TODO: Don't index by PlayerNumber.
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle(pPlayerState->m_PlayerNumber);
|
||||
const Style::ColumnInfo* pCols = pStyle->m_ColumnInfo[pPlayerState->m_PlayerNumber];
|
||||
const auto& fEffects = curr_options->m_fEffects;
|
||||
const float* fEffects = curr_options->m_fEffects;
|
||||
|
||||
// Doing the math with a precalculated result of 0 should be faster than
|
||||
// checking whether tipsy is on. -Kyz
|
||||
@@ -669,7 +669,7 @@ float ArrowEffects::GetYOffsetFromYPos(int iCol, float YPos, float fYReverseOffs
|
||||
{
|
||||
float f = YPos;
|
||||
|
||||
const auto& fEffects = curr_options->m_fEffects;
|
||||
const float* fEffects = curr_options->m_fEffects;
|
||||
// Doing the math with a precalculated result of 0 should be faster than
|
||||
// checking whether tipsy is on. -Kyz
|
||||
// TODO: Don't index by PlayerNumber.
|
||||
@@ -694,7 +694,7 @@ float ArrowEffects::GetXPos( const PlayerState* pPlayerState, int iColNum, float
|
||||
float fPixelOffsetFromCenter = 0; // fill this in below
|
||||
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle(pPlayerState->m_PlayerNumber);
|
||||
const auto& fEffects = curr_options->m_fEffects;
|
||||
const float* fEffects = curr_options->m_fEffects;
|
||||
|
||||
// TODO: Don't index by PlayerNumber.
|
||||
const Style::ColumnInfo* pCols = pStyle->m_ColumnInfo[pPlayerState->m_PlayerNumber];
|
||||
@@ -864,7 +864,7 @@ float ArrowEffects::GetXPos( const PlayerState* pPlayerState, int iColNum, float
|
||||
|
||||
float ArrowEffects::GetRotationX(const PlayerState* pPlayerState, float fYOffset, bool bIsHoldCap, int iCol)
|
||||
{
|
||||
const auto& fEffects = curr_options->m_fEffects;
|
||||
const float* fEffects = curr_options->m_fEffects;
|
||||
float fRotation = 0;
|
||||
if( fEffects[PlayerOptions::EFFECT_CONFUSION_X] != 0 || fEffects[PlayerOptions::EFFECT_CONFUSION_X_OFFSET] != 0 ||
|
||||
curr_options->m_fConfusionX[iCol] != 0
|
||||
@@ -879,7 +879,7 @@ float ArrowEffects::GetRotationX(const PlayerState* pPlayerState, float fYOffset
|
||||
|
||||
float ArrowEffects::GetRotationY(const PlayerState* pPlayerState, float fYOffset, int iCol)
|
||||
{
|
||||
const auto& fEffects = curr_options->m_fEffects;
|
||||
const float* fEffects = curr_options->m_fEffects;
|
||||
float fRotation = 0;
|
||||
if( fEffects[PlayerOptions::EFFECT_CONFUSION_Y] != 0 || fEffects[PlayerOptions::EFFECT_CONFUSION_Y_OFFSET] != 0 ||
|
||||
curr_options->m_fConfusionY[iCol] != 0
|
||||
@@ -894,7 +894,7 @@ float ArrowEffects::GetRotationY(const PlayerState* pPlayerState, float fYOffset
|
||||
|
||||
float ArrowEffects::GetRotationZ( const PlayerState* pPlayerState, float fNoteBeat, bool bIsHoldHead, int iCol )
|
||||
{
|
||||
const auto& fEffects = curr_options->m_fEffects;
|
||||
const float* fEffects = curr_options->m_fEffects;
|
||||
float fRotation = 0;
|
||||
if( fEffects[PlayerOptions::EFFECT_CONFUSION] != 0 || fEffects[PlayerOptions::EFFECT_CONFUSION_OFFSET] != 0 ||
|
||||
curr_options->m_fConfusionZ[iCol] != 0
|
||||
@@ -916,7 +916,7 @@ float ArrowEffects::GetRotationZ( const PlayerState* pPlayerState, float fNoteBe
|
||||
|
||||
float ArrowEffects::ReceptorGetRotationZ( const PlayerState* pPlayerState, int iCol )
|
||||
{
|
||||
const auto& fEffects = curr_options->m_fEffects;
|
||||
const float* fEffects = curr_options->m_fEffects;
|
||||
float fRotation = 0;
|
||||
|
||||
if( curr_options->m_fConfusionZ[iCol] != 0 )
|
||||
@@ -939,7 +939,7 @@ float ArrowEffects::ReceptorGetRotationZ( const PlayerState* pPlayerState, int i
|
||||
|
||||
float ArrowEffects::ReceptorGetRotationX( const PlayerState* pPlayerState, int iCol )
|
||||
{
|
||||
const auto& fEffects = curr_options->m_fEffects;
|
||||
const float* fEffects = curr_options->m_fEffects;
|
||||
float fRotation = 0;
|
||||
|
||||
if( curr_options->m_fConfusionX[iCol] != 0 )
|
||||
@@ -962,7 +962,7 @@ float ArrowEffects::ReceptorGetRotationX( const PlayerState* pPlayerState, int i
|
||||
|
||||
float ArrowEffects::ReceptorGetRotationY( const PlayerState* pPlayerState, int iCol )
|
||||
{
|
||||
const auto& fEffects = curr_options->m_fEffects;
|
||||
const float* fEffects = curr_options->m_fEffects;
|
||||
float fRotation = 0;
|
||||
|
||||
if( curr_options->m_fConfusionY[iCol] != 0 )
|
||||
@@ -985,7 +985,7 @@ float ArrowEffects::ReceptorGetRotationY( const PlayerState* pPlayerState, int i
|
||||
|
||||
float ArrowEffects::GetMoveX(int iCol)
|
||||
{
|
||||
const auto& fMoves = curr_options->m_fMovesX;
|
||||
const float* fMoves = curr_options->m_fMovesX;
|
||||
float f = 0;
|
||||
if( fMoves[iCol] != 0 )
|
||||
f += ARROW_SIZE * fMoves[iCol];
|
||||
@@ -994,7 +994,7 @@ float ArrowEffects::GetMoveX(int iCol)
|
||||
|
||||
float ArrowEffects::GetMoveY(int iCol)
|
||||
{
|
||||
const auto& fMoves = curr_options->m_fMovesY;
|
||||
const float* fMoves = curr_options->m_fMovesY;
|
||||
float f = 0;
|
||||
if( fMoves[iCol] != 0 )
|
||||
f += ARROW_SIZE * fMoves[iCol];
|
||||
@@ -1003,7 +1003,7 @@ float ArrowEffects::GetMoveY(int iCol)
|
||||
|
||||
float ArrowEffects::GetMoveZ(int iCol)
|
||||
{
|
||||
const auto& fMoves = curr_options->m_fMovesZ;
|
||||
const float* fMoves = curr_options->m_fMovesZ;
|
||||
float f = 0;
|
||||
if( fMoves[iCol] != 0 )
|
||||
f += ARROW_SIZE * fMoves[iCol];
|
||||
@@ -1024,7 +1024,7 @@ static float GetCenterLine()
|
||||
|
||||
static float GetHiddenSudden()
|
||||
{
|
||||
const auto& fAppearances = curr_options->m_fAppearances;
|
||||
const float* fAppearances = curr_options->m_fAppearances;
|
||||
return fAppearances[PlayerOptions::APPEARANCE_HIDDEN] *
|
||||
fAppearances[PlayerOptions::APPEARANCE_SUDDEN];
|
||||
}
|
||||
@@ -1084,7 +1084,7 @@ float ArrowGetPercentVisible(float fYPosWithoutReverse, int iCol, float fYOffset
|
||||
if( fYPos < 0 && curr_options->m_bStealthPastReceptors == false) // past Gray Arrows
|
||||
return 1; // totally visible
|
||||
|
||||
const auto& fAppearances = curr_options->m_fAppearances;
|
||||
const float* fAppearances = curr_options->m_fAppearances;
|
||||
|
||||
float fVisibleAdjust = 0;
|
||||
|
||||
@@ -1173,7 +1173,7 @@ float ArrowEffects::GetBrightness( const PlayerState* pPlayerState, float fNoteB
|
||||
float ArrowEffects::GetZPos( const PlayerState* pPlayerState, int iCol, float fYOffset)
|
||||
{
|
||||
float fZPos=0;
|
||||
const auto& fEffects = curr_options->m_fEffects;
|
||||
const float* fEffects = curr_options->m_fEffects;
|
||||
const Style* pStyle = GAMESTATE->GetCurrentStyle(pPlayerState->m_PlayerNumber);
|
||||
|
||||
// TODO: Don't index by PlayerNumber.
|
||||
@@ -1295,7 +1295,7 @@ float ArrowEffects::GetZPos( const PlayerState* pPlayerState, int iCol, float fY
|
||||
|
||||
bool ArrowEffects::NeedZBuffer()
|
||||
{
|
||||
const auto& fEffects = curr_options->m_fEffects;
|
||||
const float* fEffects = curr_options->m_fEffects;
|
||||
// We also need to use the Z buffer if twirl is in play, because of
|
||||
// hold modulation. -vyhd (OpenITG r623)
|
||||
if( fEffects[PlayerOptions::EFFECT_BUMPY] != 0 ||
|
||||
|
||||
+1
-1
@@ -669,7 +669,7 @@ void BackgroundImpl::LoadFromSong( const Song* pSong )
|
||||
// Look for the random file marker, and replace the segment with LoadFromRandom.
|
||||
for( unsigned i=0; i<mainlayer.m_aBGChanges.size(); i++ )
|
||||
{
|
||||
const auto bgChange = mainlayer.m_aBGChanges[i];
|
||||
const BackgroundChange bgChange = mainlayer.m_aBGChanges[i];
|
||||
if( bgChange.m_def.m_sFile1 != RANDOM_BACKGROUND_FILE )
|
||||
continue;
|
||||
|
||||
|
||||
+1
-1
@@ -647,7 +647,7 @@ void BitmapText::CropLineToWidth(size_t l, int width)
|
||||
{
|
||||
int used_width= width;
|
||||
std::wstring& line= m_wTextLines[l];
|
||||
const auto fit= m_pFont->GetGlyphsThatFit(line, &used_width);
|
||||
const size_t fit= m_pFont->GetGlyphsThatFit(line, &used_width);
|
||||
if(fit < line.size())
|
||||
{
|
||||
line.erase(line.begin()+fit, line.end());
|
||||
|
||||
+13
-13
@@ -16,8 +16,8 @@ public:
|
||||
BitmapText &operator=(const BitmapText &cpy);
|
||||
virtual ~BitmapText();
|
||||
|
||||
virtual void LoadFromNode( const XNode* pNode );
|
||||
virtual BitmapText *Copy() const;
|
||||
virtual void LoadFromNode( const XNode* pNode ) override;
|
||||
virtual BitmapText *Copy() const override;
|
||||
|
||||
struct BMT_TweenState
|
||||
{
|
||||
@@ -43,16 +43,16 @@ public:
|
||||
}
|
||||
BMT_TweenState const& BMT_DestTweenState() const { return const_cast<BitmapText*>(this)->BMT_DestTweenState(); }
|
||||
|
||||
virtual void SetCurrentTweenStart();
|
||||
virtual void EraseHeadTween();
|
||||
virtual void UpdatePercentThroughTween(float between);
|
||||
virtual void BeginTweening(float time, ITween* interp);
|
||||
virtual void SetCurrentTweenStart() override;
|
||||
virtual void EraseHeadTween() override;
|
||||
virtual void UpdatePercentThroughTween(float between) override;
|
||||
virtual void BeginTweening(float time, ITween* interp) override;
|
||||
// This function exists because the compiler tried to connect a call of
|
||||
// "BeginTweening(1.2f)" to the function above. -Kyz
|
||||
virtual void BeginTweening(float time, TweenType tt = TWEEN_LINEAR)
|
||||
virtual void BeginTweening(float time, TweenType tt = TWEEN_LINEAR) override
|
||||
{ Actor::BeginTweening(time, tt); }
|
||||
virtual void StopTweening();
|
||||
virtual void FinishTweening();
|
||||
virtual void StopTweening() override;
|
||||
virtual void FinishTweening() override;
|
||||
|
||||
bool LoadFromFont( const RString& sFontName );
|
||||
bool LoadFromTextureAndChars( const RString& sTexturePath, const RString& sChars );
|
||||
@@ -65,8 +65,8 @@ public:
|
||||
void CropLineToWidth(size_t l, int width);
|
||||
void CropToWidth(int width);
|
||||
|
||||
virtual bool EarlyAbortDraw() const;
|
||||
virtual void DrawPrimitives();
|
||||
virtual bool EarlyAbortDraw() const override;
|
||||
virtual void DrawPrimitives() override;
|
||||
|
||||
void SetUppercase( bool b );
|
||||
void SetRainbowScroll( bool b ) { m_bRainbowScroll = b; }
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
void set_mult_attrs_with_diffuse(bool m);
|
||||
bool get_mult_attrs_with_diffuse();
|
||||
|
||||
void SetHorizAlign( float f );
|
||||
void SetHorizAlign( float f ) override;
|
||||
|
||||
void SetStrokeColor(RageColor c) { BMT_DestTweenState().SetStrokeColor(c); }
|
||||
RageColor const& GetStrokeColor() { return BMT_DestTweenState().GetStrokeColor(); }
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
void ClearAttributes();
|
||||
|
||||
// Commands
|
||||
virtual void PushSelf( lua_State *L );
|
||||
virtual void PushSelf( lua_State *L ) override;
|
||||
|
||||
protected:
|
||||
Font *m_pFont;
|
||||
|
||||
+12
-10
@@ -543,20 +543,22 @@ ulg crc32(ulg crc, const uch *buf, size_t len)
|
||||
class TZip
|
||||
{
|
||||
public:
|
||||
TZip() = default;
|
||||
TZip() : pfout(nullptr),ooffset(0),oerr(false),writ(0),hasputcen(false),zfis(0),hfin(0)
|
||||
{
|
||||
}
|
||||
~TZip() = default;
|
||||
|
||||
// These variables say about the file we're writing into
|
||||
// We can write to pipe, file-by-handle, file-by-name, memory-to-memmapfile
|
||||
RageFile *pfout{nullptr}; // if valid, we'll write here (for files or pipes)
|
||||
unsigned ooffset{0}; // for pfout, this is where the pointer was initially
|
||||
ZRESULT oerr{false}; // did a write operation give rise to an error?
|
||||
unsigned writ{0}; // how have we written. This is maintained by Add, not write(), to avoid confusion over seeks
|
||||
unsigned int opos{0}; // current pos in the mmap
|
||||
unsigned int mapsize{0}; // the size of the map we created
|
||||
bool hasputcen{false}; // have we yet placed the central directory?
|
||||
RageFile *pfout; // if valid, we'll write here (for files or pipes)
|
||||
unsigned ooffset; // for pfout, this is where the pointer was initially
|
||||
ZRESULT oerr; // did a write operation give rise to an error?
|
||||
unsigned writ; // how have we written. This is maintained by Add, not write(), to avoid confusion over seeks
|
||||
unsigned int opos; // current pos in the mmap
|
||||
unsigned int mapsize; // the size of the map we created
|
||||
bool hasputcen; // have we yet placed the central directory?
|
||||
//
|
||||
TZipFileInfo *zfis{nullptr}; // each file gets added onto this list, for writing the table at the end
|
||||
TZipFileInfo *zfis; // each file gets added onto this list, for writing the table at the end
|
||||
|
||||
ZRESULT Start(RageFile *f);
|
||||
static unsigned sflush(void *param,const char *buf, unsigned *size);
|
||||
@@ -571,7 +573,7 @@ public:
|
||||
ulg attr; iztimes times; ulg timestamp; // all open_* methods set these
|
||||
long isize,ired; // size is not set until close() on pips
|
||||
ulg crc; // crc is not set until close(). iwrit is cumulative
|
||||
RageFile *hfin{nullptr}; // for input files and pipes
|
||||
RageFile *hfin; // for input files and pipes
|
||||
const char *bufin; unsigned int lenin,posin; // for memory
|
||||
// and a variable for what we've done with the input: (i.e. compressed it!)
|
||||
ulg csize; // compressed size, set by the compression routines
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
/** @brief Specifies the max number of charts available for a song.
|
||||
*
|
||||
* This includes autogenned charts. */
|
||||
inline constexpr auto MAX_METERS = (Enum::to_integral(NUM_Difficulty) * Enum::to_integral(NUM_StepsType)) + MAX_EDITS_PER_SONG;
|
||||
inline constexpr int MAX_METERS = (Enum::to_integral(NUM_Difficulty) * Enum::to_integral(NUM_StepsType)) + MAX_EDITS_PER_SONG;
|
||||
|
||||
REGISTER_ACTOR_CLASS( StepsDisplayList );
|
||||
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ void ModIcon::Load( RString sMetricsGroup )
|
||||
|
||||
// stop words
|
||||
STOP_WORDS.Load( sMetricsGroup, "StopWords" );
|
||||
// TODO should m_vStopWords be cleared?
|
||||
m_vStopWords.clear();
|
||||
split(STOP_WORDS, ",", m_vStopWords);
|
||||
|
||||
Set("");
|
||||
|
||||
+3
-3
@@ -151,11 +151,11 @@ void ModIconRow::SetFromGameState()
|
||||
for( unsigned i=0; i<vsOptions.size(); i++ )
|
||||
{
|
||||
RString sOption = vsOptions[i];
|
||||
int iPerferredCol = OptionToPreferredColumn( sOption );
|
||||
iPerferredCol = clamp( iPerferredCol, 0, (int)m_vpModIcon.size()-1 );
|
||||
int iPreferredCol = OptionToPreferredColumn( sOption );
|
||||
iPreferredCol = clamp( iPreferredCol, 0, (int)m_vpModIcon.size()-1 );
|
||||
|
||||
// search for a vacant spot
|
||||
for( int j=iPerferredCol; j<NUM_OPTION_ICONS; j++ )
|
||||
for( int j=iPreferredCol; j<NUM_OPTION_ICONS; j++ )
|
||||
{
|
||||
if( vsText[j] != "" )
|
||||
{
|
||||
|
||||
+10
-10
@@ -17,7 +17,7 @@ class Model : public Actor
|
||||
public:
|
||||
Model();
|
||||
virtual ~Model();
|
||||
virtual Model *Copy() const;
|
||||
virtual Model *Copy() const override;
|
||||
|
||||
void Clear();
|
||||
void Load( const RString &sFile );
|
||||
@@ -27,26 +27,26 @@ public:
|
||||
void LoadMaterialsFromMilkshapeAscii( const RString &sPath );
|
||||
bool LoadMilkshapeAsciiBones( const RString &sAniName, const RString &sPath );
|
||||
|
||||
void LoadFromNode( const XNode* pNode );
|
||||
void LoadFromNode( const XNode* pNode ) override;
|
||||
|
||||
void PlayAnimation( const RString &sAniName, float fPlayRate = 1 );
|
||||
void SetRate( float fRate ) { m_fCurAnimationRate = fRate; }
|
||||
void SetLoop( bool b ) { m_bLoop = b; }
|
||||
void SetPosition( float fSeconds );
|
||||
|
||||
virtual void Update( float fDelta );
|
||||
virtual bool EarlyAbortDraw() const;
|
||||
virtual void DrawPrimitives();
|
||||
virtual void Update( float fDelta ) override;
|
||||
virtual bool EarlyAbortDraw() const override;
|
||||
virtual void DrawPrimitives() override;
|
||||
|
||||
void DrawCelShaded();
|
||||
void SetCelShading( bool bShading ) { m_bDrawCelShaded = bShading; }
|
||||
|
||||
virtual int GetNumStates() const;
|
||||
virtual void SetState( int iNewState );
|
||||
virtual float GetAnimationLengthSeconds() const
|
||||
virtual int GetNumStates() const override;
|
||||
virtual void SetState( int iNewState ) override;
|
||||
virtual float GetAnimationLengthSeconds() const override
|
||||
{ return m_animation_length_seconds; }
|
||||
virtual void RecalcAnimationLengthSeconds();
|
||||
virtual void SetSecondsIntoAnimation( float fSeconds );
|
||||
virtual void SetSecondsIntoAnimation( float fSeconds ) override;
|
||||
|
||||
RString GetDefaultAnimation() const { return m_sDefaultAnimation; };
|
||||
void SetDefaultAnimation( RString sAnimation, float fPlayRate = 1 );
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
bool MaterialsNeedNormals() const;
|
||||
|
||||
// Lua
|
||||
virtual void PushSelf( lua_State *L );
|
||||
virtual void PushSelf( lua_State *L ) override;
|
||||
|
||||
Model& operator=(const Model& rhs) = delete;
|
||||
|
||||
|
||||
@@ -424,14 +424,14 @@ void MusicWheelItem::HandleMessage( const Message &msg )
|
||||
break;
|
||||
}
|
||||
|
||||
Message tmpMsg( "Set" );
|
||||
tmpMsg.SetParam( "Song", pWID->m_pSong );
|
||||
tmpMsg.SetParam( "Course", pWID->m_pCourse );
|
||||
tmpMsg.SetParam( "Text", pWID->m_sText );
|
||||
tmpMsg.SetParam( "Type", MusicWheelItemTypeToString(type) );
|
||||
tmpMsg.SetParam( "Color", pWID->m_color );
|
||||
tmpMsg.SetParam( "Label", pWID->m_sLabel );
|
||||
this->HandleMessage( tmpMsg );
|
||||
Message setMsg( "Set" );
|
||||
setMsg.SetParam( "Song", pWID->m_pSong );
|
||||
setMsg.SetParam( "Course", pWID->m_pCourse );
|
||||
setMsg.SetParam( "Text", pWID->m_sText );
|
||||
setMsg.SetParam( "Type", MusicWheelItemTypeToString(type) );
|
||||
setMsg.SetParam( "Color", pWID->m_color );
|
||||
setMsg.SetParam( "Label", pWID->m_sLabel );
|
||||
this->HandleMessage( setMsg );
|
||||
|
||||
RefreshGrades();
|
||||
}
|
||||
|
||||
+10
-1
@@ -30,7 +30,7 @@ bool NoteData::IsComposite() const
|
||||
{
|
||||
for( int track = 0; track < GetNumTracks(); ++track )
|
||||
{
|
||||
for (const auto& tn : m_TapNotes[track])
|
||||
for (const std::pair<const int, TapNote>& tn : m_TapNotes[track])
|
||||
if( tn.second.pn != PLAYER_INVALID )
|
||||
return true;
|
||||
}
|
||||
@@ -1339,6 +1339,15 @@ NoteData::_all_tracks_iterator<ND, iter, TN>::_all_tracks_iterator( const _all_t
|
||||
m_pNoteData->AddATIToList(this);
|
||||
}
|
||||
|
||||
template<typename ND, typename iter, typename TN>
|
||||
NoteData::_all_tracks_iterator<ND, iter, TN>::~_all_tracks_iterator()
|
||||
{
|
||||
if(m_pNoteData != nullptr)
|
||||
{
|
||||
m_pNoteData->RemoveATIFromList(this);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename ND, typename iter, typename TN>
|
||||
NoteData::_all_tracks_iterator<ND, iter, TN> &NoteData::_all_tracks_iterator<ND, iter, TN>::operator=( const _all_tracks_iterator &other )
|
||||
{
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ public:
|
||||
public:
|
||||
_all_tracks_iterator( ND &nd, int iStartRow, int iEndRow, bool bReverse, bool bInclusive );
|
||||
_all_tracks_iterator( const _all_tracks_iterator &other );
|
||||
~_all_tracks_iterator() { if(m_pNoteData != nullptr) { m_pNoteData->RemoveATIFromList(this); } }
|
||||
~_all_tracks_iterator();
|
||||
_all_tracks_iterator &operator=( const _all_tracks_iterator &other );
|
||||
_all_tracks_iterator &operator++(); // preincrement
|
||||
_all_tracks_iterator operator++( int dummy ); // postincrement
|
||||
|
||||
+8
-8
@@ -297,8 +297,8 @@ struct NoteColumnRenderer : public Actor
|
||||
// and receptor positions follow the splines. It's called by their row
|
||||
// update functions. -Kyz
|
||||
void UpdateReceptorGhostStuff(Actor* receptor) const;
|
||||
virtual void DrawPrimitives();
|
||||
virtual void PushSelf(lua_State* L);
|
||||
virtual void DrawPrimitives() override;
|
||||
virtual void PushSelf(lua_State* L) override;
|
||||
|
||||
struct NCR_TweenState
|
||||
{
|
||||
@@ -321,12 +321,12 @@ struct NoteColumnRenderer : public Actor
|
||||
}
|
||||
const NCR_TweenState& NCR_DestTweenState() const { return const_cast<NoteColumnRenderer*>(this)->NCR_DestTweenState(); }
|
||||
|
||||
virtual void SetCurrentTweenStart();
|
||||
virtual void EraseHeadTween();
|
||||
virtual void UpdatePercentThroughTween(float between);
|
||||
virtual void BeginTweening(float time, ITween* interp);
|
||||
virtual void StopTweening();
|
||||
virtual void FinishTweening();
|
||||
virtual void SetCurrentTweenStart() override;
|
||||
virtual void EraseHeadTween() override;
|
||||
virtual void UpdatePercentThroughTween(float between) override;
|
||||
virtual void BeginTweening(float time, ITween* interp) override;
|
||||
virtual void StopTweening() override;
|
||||
virtual void FinishTweening() override;
|
||||
|
||||
NCSplineHandler* GetPosHandler() { return &NCR_DestTweenState().m_pos_handler; }
|
||||
NCSplineHandler* GetRotHandler() { return &NCR_DestTweenState().m_rot_handler; }
|
||||
|
||||
+2
-2
@@ -674,7 +674,7 @@ float FindLastDisplayedBeat( const PlayerState* pPlayerState, int iDrawDistanceB
|
||||
|
||||
bool bBoomerang;
|
||||
{
|
||||
const auto& fAccels = pPlayerState->m_PlayerOptions.GetCurrent().m_fAccels;
|
||||
const float* fAccels = pPlayerState->m_PlayerOptions.GetCurrent().m_fAccels;
|
||||
bBoomerang = (fAccels[PlayerOptions::ACCEL_BOOMERANG] != 0);
|
||||
}
|
||||
|
||||
@@ -902,7 +902,7 @@ void NoteField::DrawPrimitives()
|
||||
AttackArray &attacks = GAMESTATE->m_bIsUsingStepTiming ?
|
||||
GAMESTATE->m_pCurSteps[PLAYER_1]->m_Attacks :
|
||||
GAMESTATE->m_pCurSong->m_Attacks;
|
||||
for (Attack const &a : attacks)
|
||||
for (const Attack &a : attacks)
|
||||
{
|
||||
float fBeat = timing.GetBeatFromElapsedTime(a.fStartSecond);
|
||||
if (BeatToNoteRow(fBeat) >= m_FieldRenderArgs.first_row &&
|
||||
|
||||
@@ -544,7 +544,7 @@ bool BMSChart::Load( const RString &chartPath )
|
||||
std::vector<RString> lines;
|
||||
Tree.evaluateBMSTree(headers, lines);
|
||||
|
||||
for (const auto& line : lines)
|
||||
for (const RString& line : lines)
|
||||
{
|
||||
RString data = line.substr(7);
|
||||
int measure = atoi(line.substr(1, 3).c_str());
|
||||
|
||||
@@ -205,7 +205,7 @@ inline void VerifySelected(SelectType st, std::vector<bool> &selected, const RSt
|
||||
int num_selected = 0;
|
||||
if( st == SELECT_ONE )
|
||||
{
|
||||
int first_selected= -1;
|
||||
size_t first_selected= std::numeric_limits<size_t>::max();
|
||||
if(selected.empty())
|
||||
{
|
||||
LuaHelpers::ReportScriptErrorFmt("Option row %s requires only one "
|
||||
@@ -213,14 +213,14 @@ inline void VerifySelected(SelectType st, std::vector<bool> &selected, const RSt
|
||||
"elements.", sName.c_str());
|
||||
return;
|
||||
}
|
||||
for(unsigned int e= 0; e < selected.size(); ++e)
|
||||
for(size_t e= 0; e < selected.size(); ++e)
|
||||
{
|
||||
if(selected[e])
|
||||
{
|
||||
num_selected++;
|
||||
if(first_selected == -1)
|
||||
if(first_selected == std::numeric_limits<size_t>::max())
|
||||
{
|
||||
first_selected= static_cast<int>(e);
|
||||
first_selected= e;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -229,9 +229,9 @@ inline void VerifySelected(SelectType st, std::vector<bool> &selected, const RSt
|
||||
LuaHelpers::ReportScriptErrorFmt("Option row %s requires only one "
|
||||
"thing to be selected, but %i out of %i things are selected.",
|
||||
sName.c_str(), num_selected, static_cast<int>(selected.size()));
|
||||
for(unsigned int e= 0; e < selected.size(); ++e)
|
||||
for(size_t e= 0; e < selected.size(); ++e)
|
||||
{
|
||||
if(selected[e] && (first_selected < 0 || e != static_cast<uint32_t>(first_selected)))
|
||||
if(selected[e] && e != first_selected)
|
||||
{
|
||||
selected[e]= false;
|
||||
}
|
||||
|
||||
+2
-2
@@ -18,8 +18,8 @@ public:
|
||||
|
||||
void Load( const RString &sMetricsGroup, bool bLoadCanGos );
|
||||
|
||||
void StopTweening();
|
||||
void BeginTweening( float fSecs, TweenType tt = TWEEN_LINEAR );
|
||||
void StopTweening() override;
|
||||
void BeginTweening( float fSecs, TweenType tt = TWEEN_LINEAR ) override;
|
||||
void SetBarWidth( int iWidth );
|
||||
int GetBarWidth() const;
|
||||
void SetCanGo( bool bCanGoLeft, bool bCanGoRight );
|
||||
|
||||
+2
-2
@@ -1136,8 +1136,8 @@ void Player::Update( float fDeltaTime )
|
||||
* .5 before the row. Use a very slow song (around 2 BPM) as a test case: without
|
||||
* rounding, autoplay steps early. -glenn */
|
||||
const float fPositionSeconds = m_pPlayerState->m_Position.m_fMusicSeconds - PREFSMAN->m_fPadStickSeconds;
|
||||
const float fSongBeatTmp = m_pPlayerState->GetDisplayedTiming().GetBeatFromElapsedTime( fPositionSeconds );
|
||||
const int iRowNow = BeatToNoteRowNotRounded( fSongBeatTmp );
|
||||
const float fDisplayedSongBeat = m_pPlayerState->GetDisplayedTiming().GetBeatFromElapsedTime( fPositionSeconds );
|
||||
const int iRowNow = BeatToNoteRowNotRounded( fDisplayedSongBeat );
|
||||
|
||||
if( iRowNow >= 0 )
|
||||
{
|
||||
|
||||
+3
-3
@@ -96,7 +96,7 @@ void Profile::ClearSongs()
|
||||
int Profile::HighScoresForASong::GetNumTimesPlayed() const
|
||||
{
|
||||
int iCount = 0;
|
||||
for (const auto& i : m_StepsHighScores)
|
||||
for (const std::pair<const StepsID, HighScoresForASteps>& i : m_StepsHighScores)
|
||||
{
|
||||
iCount += i.second.hsl.GetNumTimesPlayed();
|
||||
}
|
||||
@@ -106,7 +106,7 @@ int Profile::HighScoresForASong::GetNumTimesPlayed() const
|
||||
int Profile::HighScoresForACourse::GetNumTimesPlayed() const
|
||||
{
|
||||
int iCount = 0;
|
||||
for (const auto& i : m_TrailHighScores)
|
||||
for (const std::pair<const TrailID, HighScoresForATrail>& i : m_TrailHighScores)
|
||||
{
|
||||
iCount += i.second.hsl.GetNumTimesPlayed();
|
||||
}
|
||||
@@ -1605,7 +1605,7 @@ XNode* Profile::SaveGeneralDataCreateNode() const
|
||||
|
||||
{
|
||||
XNode* pNumSongsPlayedByStyle = pGeneralDataNode->AppendChild("NumSongsPlayedByStyle");
|
||||
for (const auto& iter : m_iNumSongsPlayedByStyle)
|
||||
for (const std::pair<StyleID const, int>& iter : m_iNumSongsPlayedByStyle)
|
||||
{
|
||||
const StyleID &s = iter.first;
|
||||
int iNumPlays = iter.second;
|
||||
|
||||
+22
-17
@@ -114,28 +114,33 @@ public:
|
||||
|
||||
VideoModeParams(const VideoModeParams &other) = default;
|
||||
|
||||
VideoModeParams() = default;
|
||||
VideoModeParams(): windowed(false), width(0), height(0),
|
||||
bpp(0), rate(0), vsync(false), interlaced(false),
|
||||
bSmoothLines(false), bTrilinearFiltering(false),
|
||||
bAnisotropicFiltering(false), bWindowIsFullscreenBorderless(false),
|
||||
sWindowTitle(RString()), sIconFile(RString()),
|
||||
PAL(false), fDisplayAspectRatio(0.0f) {}
|
||||
|
||||
// Subclassing VideoModeParams in ActualVideoModeParams. Make destructor virtual just in case
|
||||
// someone tries to delete one of those through a pointer to base...
|
||||
virtual ~VideoModeParams() = default;
|
||||
|
||||
bool windowed{false};
|
||||
RString sDisplayId{};
|
||||
int width{0};
|
||||
int height{0};
|
||||
int bpp{0};
|
||||
int rate{0};
|
||||
bool vsync{false};
|
||||
bool interlaced{false};
|
||||
bool bSmoothLines{false};
|
||||
bool bTrilinearFiltering{false};
|
||||
bool bAnisotropicFiltering{false};
|
||||
bool bWindowIsFullscreenBorderless{false};
|
||||
RString sWindowTitle{};
|
||||
RString sIconFile{};
|
||||
bool PAL{false};
|
||||
float fDisplayAspectRatio{0.0f};
|
||||
bool windowed;
|
||||
RString sDisplayId;
|
||||
int width;
|
||||
int height;
|
||||
int bpp;
|
||||
int rate;
|
||||
bool vsync;
|
||||
bool interlaced;
|
||||
bool bSmoothLines;
|
||||
bool bTrilinearFiltering;
|
||||
bool bAnisotropicFiltering;
|
||||
bool bWindowIsFullscreenBorderless;
|
||||
RString sWindowTitle;
|
||||
RString sIconFile;
|
||||
bool PAL;
|
||||
float fDisplayAspectRatio;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -114,7 +114,7 @@ size_t zipRead(void *pOpaque, mz_uint64 file_ofs, void *pBuf, size_t n)
|
||||
{
|
||||
RageFile *f = static_cast<RageFile*>(pOpaque);
|
||||
|
||||
const auto pos = f->Seek(file_ofs);
|
||||
const int pos = f->Seek(file_ofs);
|
||||
if (pos >= 0 && static_cast<uint64_t>(pos) != file_ofs)
|
||||
{
|
||||
return 0;
|
||||
|
||||
+1
-1
@@ -616,7 +616,7 @@ float RageFastSin(float angle)
|
||||
{
|
||||
if(angle == 0) { return 0; }
|
||||
float index= angle * sine_table_index_mult;
|
||||
auto first_index= static_cast<uint32_t>(index);
|
||||
auto first_index= static_cast<unsigned int>(index);
|
||||
auto second_index= (first_index + 1) % sine_index_mod;
|
||||
float remainder= index - first_index;
|
||||
first_index%= sine_index_mod;
|
||||
|
||||
@@ -110,16 +110,7 @@ namespace
|
||||
|
||||
int GCD( int i1, int i2 )
|
||||
{
|
||||
for(;;)
|
||||
{
|
||||
unsigned iRem = i2 % i1;
|
||||
if( iRem == 0 )
|
||||
{
|
||||
return i1;
|
||||
}
|
||||
i2 = i1;
|
||||
i1 = iRem;
|
||||
}
|
||||
return std::gcd(i1, i2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -52,8 +52,9 @@ RageSurfaceFormat::RageSurfaceFormat( const RageSurfaceFormat &cpy ):
|
||||
Mask = cpy.Mask;
|
||||
Shift = cpy.Shift;
|
||||
Loss = cpy.Loss;
|
||||
if( palette )
|
||||
if( palette ) {
|
||||
palette = std::make_unique<RageSurfacePalette>(*palette);
|
||||
}
|
||||
}
|
||||
|
||||
void RageSurfaceFormat::GetRGB( uint32_t val, uint8_t *r, uint8_t *g, uint8_t *b ) const
|
||||
|
||||
+23
-23
@@ -518,10 +518,10 @@ static bool blit_rgba_to_rgba( const RageSurface *src_surf, const RageSurface *d
|
||||
const int srcskip = src_surf->pitch - width*src_surf->format->BytesPerPixel;
|
||||
const int dstskip = dst_surf->pitch - width*dst_surf->format->BytesPerPixel;
|
||||
|
||||
const auto &src_shifts = src_surf->format->Shift;
|
||||
const auto &dst_shifts = dst_surf->format->Shift;
|
||||
const auto &src_masks = src_surf->format->Mask;
|
||||
const auto &dst_masks = dst_surf->format->Mask;
|
||||
const std::array<uint32_t, 4> &src_shifts = src_surf->format->Shift;
|
||||
const std::array<uint32_t, 4> &dst_shifts = dst_surf->format->Shift;
|
||||
const std::array<uint32_t, 4> &src_masks = src_surf->format->Mask;
|
||||
const std::array<uint32_t, 4> &dst_masks = dst_surf->format->Mask;
|
||||
|
||||
uint8_t lookup[4][256];
|
||||
for( int c = 0; c < 4; ++c )
|
||||
@@ -833,44 +833,44 @@ RageSurface *RageSurfaceUtils::LoadSurface( RString file )
|
||||
* two bits are the alpha component.
|
||||
*
|
||||
* This gives us a generic way to handle arbitrary 8-bit texture formats. */
|
||||
RageSurface *RageSurfaceUtils::PalettizeToGrayscale( const RageSurface *src_surf, uint32_t GrayBits, uint32_t AlphaBits )
|
||||
RageSurface *RageSurfaceUtils::PalettizeToGrayscale( const RageSurface *src_surf, unsigned int GrayBits, unsigned int AlphaBits )
|
||||
{
|
||||
AlphaBits = std::min( AlphaBits, 8-src_surf->format->Loss[3] );
|
||||
|
||||
const auto TotalBits = GrayBits + AlphaBits;
|
||||
const unsigned int TotalBits = GrayBits + AlphaBits;
|
||||
ASSERT( TotalBits <= 8 );
|
||||
|
||||
RageSurface *dst_surf = CreateSurface(src_surf->w, src_surf->h,
|
||||
8, 0,0,0,0 );
|
||||
|
||||
// Set up the palette.
|
||||
const auto TotalColors = 1u << TotalBits;
|
||||
const auto Ivalues = 1u << GrayBits; // number of intensity values
|
||||
const auto Ishift = 0u; // intensity shift
|
||||
const auto Imask = ((1u << GrayBits) - 1u) << Ishift; // intensity mask
|
||||
const auto Iloss = 8u-GrayBits;
|
||||
const unsigned int TotalColors = 1u << TotalBits;
|
||||
const unsigned int Ivalues = 1u << GrayBits; // number of intensity values
|
||||
const unsigned int Ishift = 0u; // intensity shift
|
||||
const unsigned int Imask = ((1u << GrayBits) - 1u) << Ishift; // intensity mask
|
||||
const unsigned int Iloss = 8u-GrayBits;
|
||||
|
||||
const auto Avalues = 1u << AlphaBits; // number of alpha values
|
||||
const auto Ashift = GrayBits; // alpha shift
|
||||
const auto Amask = ((1u << AlphaBits) - 1u) << Ashift; // alpha mask
|
||||
const auto Aloss = 8u-AlphaBits;
|
||||
const unsigned int Avalues = 1u << AlphaBits; // number of alpha values
|
||||
const unsigned int Ashift = GrayBits; // alpha shift
|
||||
const unsigned int Amask = ((1u << AlphaBits) - 1u) << Ashift; // alpha mask
|
||||
const unsigned int Aloss = 8u-AlphaBits;
|
||||
|
||||
for( size_t index = 0; index < TotalColors; ++index )
|
||||
{
|
||||
const auto I = (index & Imask) >> Ishift;
|
||||
const auto A = (index & Amask) >> Ashift;
|
||||
const unsigned int I = (index & Imask) >> Ishift;
|
||||
const unsigned int A = (index & Amask) >> Ashift;
|
||||
|
||||
// if only one intensity value, always fullbright
|
||||
const auto ScaledI = Ivalues == 1 ? 255 : clamp( lrintf(I * (255.0f / (Ivalues-1))), 0L, 255L );
|
||||
const uint8_t ScaledI = Ivalues == 1 ? 255 : clamp( lrintf(I * (255.0f / (Ivalues-1))), 0L, 255L );
|
||||
|
||||
// if only one alpha value, always opaque
|
||||
const auto ScaledA = Avalues == 1 ? 255 : clamp( lrintf(A * (255.0f / (Avalues-1))), 0L, 255L );
|
||||
const uint8_t ScaledA = Avalues == 1 ? 255 : clamp( lrintf(A * (255.0f / (Avalues-1))), 0L, 255L );
|
||||
|
||||
RageSurfaceColor c;
|
||||
c.r = uint8_t(ScaledI);
|
||||
c.g = uint8_t(ScaledI);
|
||||
c.b = uint8_t(ScaledI);
|
||||
c.a = uint8_t(ScaledA);
|
||||
c.r = ScaledI;
|
||||
c.g = ScaledI;
|
||||
c.b = ScaledI;
|
||||
c.a = ScaledA;
|
||||
|
||||
dst_surf->fmt.palette->colors[index] = c;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace RageSurfaceUtils
|
||||
RageSurface *LoadSurface( RString file );
|
||||
|
||||
/* Quickly palettize to an gray/alpha texture. */
|
||||
RageSurface *PalettizeToGrayscale( const RageSurface *src_surf, uint32_t GrayBits, uint32_t AlphaBits );
|
||||
RageSurface *PalettizeToGrayscale( const RageSurface *src_surf, unsigned int GrayBits, unsigned int AlphaBits );
|
||||
|
||||
RageSurface *MakeDummySurface( int height, int width );
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ void RageSurfaceUtils::Palettize( RageSurface *&pImg, int iColors, bool bDither
|
||||
|
||||
// Rescale the palette colors to a maxval of 255.
|
||||
{
|
||||
auto& pal = pRet->format->palette;
|
||||
std::unique_ptr<RageSurfacePalette>& pal = pRet->format->palette;
|
||||
for( int x = 0; x < pal->ncolors; ++x )
|
||||
{
|
||||
// This is really just PAM_DEPTH() broken out for the palette.
|
||||
|
||||
@@ -26,13 +26,9 @@ extern "C" {
|
||||
struct my_jpeg_error_mgr
|
||||
{
|
||||
struct jpeg_error_mgr pub; /* "public" fields */
|
||||
|
||||
uint8_t pad1[8]; // Explicitly add padding that's implicitly added by the compiler
|
||||
|
||||
jmp_buf setjmp_buffer; /* for return to caller */
|
||||
|
||||
char errorbuf[JMSG_LENGTH_MAX];
|
||||
|
||||
uint8_t pad2[8]; // Explicitly add padding that's implicitly added by the compiler
|
||||
jmp_buf setjmp_buffer; /* for return to caller */
|
||||
};
|
||||
|
||||
void my_output_message( j_common_ptr cinfo )
|
||||
|
||||
+30
-23
@@ -103,7 +103,7 @@ struct lua_State;
|
||||
struct RageVector2
|
||||
{
|
||||
public:
|
||||
RageVector2() = default;
|
||||
RageVector2(): x(0), y(0) {}
|
||||
RageVector2( const float * f ): x(f[0]), y(f[1]) {}
|
||||
RageVector2( float x1, float y1 ): x(x1), y(y1) {}
|
||||
|
||||
@@ -125,14 +125,14 @@ public:
|
||||
|
||||
friend RageVector2 operator * ( float f, const RageVector2& other ) { return other*f; }
|
||||
|
||||
float x{0}, y{0};
|
||||
float x, y;
|
||||
};
|
||||
|
||||
|
||||
struct RageVector3
|
||||
{
|
||||
public:
|
||||
RageVector3() = default;
|
||||
RageVector3(): x(0), y(0), z(0) {}
|
||||
RageVector3( const float * f ): x(f[0]), y(f[1]), z(f[2]) {}
|
||||
RageVector3( float x1, float y1, float z1 ): x(x1), y(y1), z(z1) {}
|
||||
|
||||
@@ -154,14 +154,14 @@ public:
|
||||
|
||||
friend RageVector3 operator * ( float f, const RageVector3& other ) { return other*f; }
|
||||
|
||||
float x{0}, y{0}, z{0};
|
||||
float x, y, z;
|
||||
};
|
||||
|
||||
|
||||
struct RageVector4
|
||||
{
|
||||
public:
|
||||
RageVector4() = default;
|
||||
RageVector4(): x(0), y(0), z(0), w(0) {}
|
||||
RageVector4( const float * f ): x(f[0]), y(f[1]), z(f[2]), w(f[3]) {}
|
||||
RageVector4( float x1, float y1, float z1, float w1 ): x(x1), y(y1), z(z1), w(w1) {}
|
||||
|
||||
@@ -183,13 +183,13 @@ public:
|
||||
|
||||
friend RageVector4 operator * ( float f, const RageVector4& other ) { return other*f; }
|
||||
|
||||
float x{0}, y{0}, z{0}, w{0};
|
||||
float x, y, z, w;
|
||||
};
|
||||
|
||||
struct RageColor
|
||||
{
|
||||
public:
|
||||
RageColor() = default;
|
||||
RageColor(): r(0), g(0), b(0), a(0) {}
|
||||
explicit RageColor( const float * f ): r(f[0]), g(f[1]), b(f[2]), a(f[3]) {}
|
||||
RageColor( float r1, float g1, float b1, float a1 ): r(r1), g(g1), b(b1), a(a1) {}
|
||||
|
||||
@@ -261,7 +261,7 @@ public:
|
||||
void FromStack( lua_State *L, int iPos );
|
||||
void FromStackCompat( lua_State *L, int iPos );
|
||||
|
||||
float r{0}, g{0}, b{0}, a{0};
|
||||
float r, g, b, a;
|
||||
};
|
||||
|
||||
/* Convert floating-point 0..1 value to integer 0..255 value. *
|
||||
@@ -320,9 +320,9 @@ inline unsigned char FTOC(float a)
|
||||
class RageVColor
|
||||
{
|
||||
public:
|
||||
uint8_t b{0},g{0},r{0},a{0}; // specific ordering required by Direct3D
|
||||
uint8_t b,g,r,a; // specific ordering required by Direct3D
|
||||
|
||||
RageVColor() = default;
|
||||
RageVColor(): b(0), g(0), r(0), a(0) { }
|
||||
RageVColor(const RageColor &rc): b(0), g(0), r(0), a(0) { *this = rc; }
|
||||
RageVColor &operator= (const RageColor &rc)
|
||||
{
|
||||
@@ -337,7 +337,7 @@ namespace StepMania
|
||||
class Rect
|
||||
{
|
||||
public:
|
||||
Rect() = default;
|
||||
Rect(): left(0), top(0), right(0), bottom(0) {}
|
||||
Rect(T l, T t, T r, T b): left(l), top(t), right(r), bottom(b) {}
|
||||
|
||||
T GetWidth() const { return right-left; };
|
||||
@@ -357,7 +357,7 @@ public:
|
||||
}
|
||||
bool operator!=( const Rect &other ) const { return !operator==(other); }
|
||||
|
||||
T left{}, top{}, right{}, bottom{};
|
||||
T left, top, right, bottom;
|
||||
};
|
||||
}
|
||||
typedef StepMania::Rect<int> RectI;
|
||||
@@ -367,11 +367,11 @@ typedef StepMania::Rect<float> RectF;
|
||||
* have the same layout that D3D expects. */
|
||||
struct RageSpriteVertex // has color
|
||||
{
|
||||
RageSpriteVertex() = default;
|
||||
RageVector3 p{}; // position
|
||||
RageVector3 n{}; // normal
|
||||
RageVColor c{}; // diffuse color
|
||||
RageVector2 t{}; // texture coordinates
|
||||
RageSpriteVertex(): p(), n(), c(), t() {}
|
||||
RageVector3 p; // position
|
||||
RageVector3 n; // normal
|
||||
RageVColor c; // diffuse color
|
||||
RageVector2 t; // texture coordinates
|
||||
};
|
||||
|
||||
void lerp_rage_color(RageColor& out, RageColor const& a, RageColor const& b, float t);
|
||||
@@ -379,12 +379,19 @@ void WeightedAvergeOfRSVs(RageSpriteVertex& average_out, RageSpriteVertex const&
|
||||
|
||||
struct RageModelVertex // doesn't have color. Relies on material color
|
||||
{
|
||||
RageModelVertex() = default;
|
||||
RageVector3 p{}; // position
|
||||
RageVector3 n{}; // normal
|
||||
RageVector2 t{}; // texture coordinates
|
||||
int8_t bone{0};
|
||||
RageVector2 TextureMatrixScale{1,1}; // usually 1,1
|
||||
/* Zero out by default. */
|
||||
RageModelVertex():
|
||||
p(0,0,0),
|
||||
n(0,0,0),
|
||||
t(0,0),
|
||||
bone(0),
|
||||
TextureMatrixScale(1,1)
|
||||
{ }
|
||||
RageVector3 p; // position
|
||||
RageVector3 n; // normal
|
||||
RageVector2 t; // texture coordinates
|
||||
int8_t bone;
|
||||
RageVector2 TextureMatrixScale; // usually 1,1
|
||||
};
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -1981,7 +1981,7 @@ void ReplaceEntityText( RString &sText, const std::map<char, RString> &m )
|
||||
{
|
||||
RString sFind;
|
||||
|
||||
for (const auto &c : m)
|
||||
for (const std::pair<const char, RString> &c : m)
|
||||
sFind.append( 1, c.first );
|
||||
|
||||
RString sRet;
|
||||
|
||||
@@ -176,7 +176,7 @@ public:
|
||||
}
|
||||
#endif
|
||||
|
||||
bool isNull() const { return !m_pPtr; }
|
||||
bool isNull() const { return m_pPtr != nullptr; }
|
||||
|
||||
private:
|
||||
T *m_pPtr;
|
||||
|
||||
+1
-1
@@ -5256,7 +5256,7 @@ void ScreenEdit::HandleAlterMenuChoice(AlterMenuChoice c, const std::vector<int>
|
||||
case tempo:
|
||||
{
|
||||
// This affects all steps.
|
||||
const auto tt = static_cast<TempoType>(answers[c]);
|
||||
const TempoType tt = static_cast<TempoType>(answers[c]);
|
||||
float fScale = -1;
|
||||
|
||||
switch( tt )
|
||||
|
||||
@@ -374,7 +374,7 @@ void ScreenSelectMaster::HandleScreenMessage( const ScreenMessage SM )
|
||||
|
||||
if( SM == SM_PlayPostSwitchPage )
|
||||
{
|
||||
const auto iNewChoice = m_iChoice[ GAMESTATE->GetMasterPlayerNumber() ];
|
||||
const int iNewChoice = m_iChoice[ GAMESTATE->GetMasterPlayerNumber() ];
|
||||
Page newPage = GetPage( iNewChoice );
|
||||
|
||||
Message msg("PostSwitchPage");
|
||||
@@ -390,7 +390,7 @@ void ScreenSelectMaster::HandleScreenMessage( const ScreenMessage SM )
|
||||
{
|
||||
for (PlayerNumber const &p : vpns)
|
||||
{
|
||||
const auto iChoice = m_iChoice[p];
|
||||
const int iChoice = m_iChoice[p];
|
||||
m_vsprScroll[p][iChoice]->HandleMessage( msg );
|
||||
}
|
||||
}
|
||||
@@ -460,7 +460,7 @@ void ScreenSelectMaster::UpdateSelectableChoices()
|
||||
|
||||
for ( PlayerNumber &p : vpns)
|
||||
{
|
||||
if(disabled && m_iChoice[p] == static_cast<int32_t>(c))
|
||||
if(disabled && m_iChoice[p] == static_cast<int>(c))
|
||||
{
|
||||
on_unplayable[p]= true;
|
||||
}
|
||||
@@ -503,7 +503,7 @@ bool ScreenSelectMaster::Move( PlayerNumber pn, MenuDir dir )
|
||||
if( !AnyOptionsArePlayable() )
|
||||
return false;
|
||||
|
||||
auto iSwitchToIndex = m_iChoice[pn];
|
||||
int iSwitchToIndex = m_iChoice[pn];
|
||||
std::set<int> seen;
|
||||
|
||||
do
|
||||
|
||||
+1
-1
@@ -575,7 +575,7 @@ void SongManager::UnlistSong(Song *song)
|
||||
// remove all occurences of the song in each of our song vectors
|
||||
std::vector<Song*>* songVectors[3] = { &m_pSongs, &m_pPopularSongs, &m_pShuffledSongs };
|
||||
for (int songVecIdx=0; songVecIdx<3; ++songVecIdx) {
|
||||
auto& v = *songVectors[songVecIdx];
|
||||
std::vector<Song*>& v = *songVectors[songVecIdx];
|
||||
std::erase_if( v, [song](Song* vSong){return vSong == song;} );
|
||||
}
|
||||
}
|
||||
|
||||
+20
-11
@@ -33,18 +33,27 @@ LuaDeclareType( SoundEffectType );
|
||||
class SongOptions
|
||||
{
|
||||
public:
|
||||
bool m_bAssistClap{false};
|
||||
bool m_bAssistMetronome{false};
|
||||
float m_fMusicRate{1.0f}, m_SpeedfMusicRate{1.0f};
|
||||
float m_fHaste{0.0f}, m_SpeedfHaste{1.0f};
|
||||
AutosyncType m_AutosyncType{AutosyncType_Off};
|
||||
SoundEffectType m_SoundEffectType{SoundEffectType_Off};
|
||||
bool m_bStaticBackground{false};
|
||||
bool m_bRandomBGOnly{false};
|
||||
bool m_bSaveScore{true};
|
||||
bool m_bSaveReplay{false};
|
||||
bool m_bAssistClap;
|
||||
bool m_bAssistMetronome;
|
||||
float m_fMusicRate, m_SpeedfMusicRate;
|
||||
float m_fHaste, m_SpeedfHaste;
|
||||
AutosyncType m_AutosyncType;
|
||||
SoundEffectType m_SoundEffectType;
|
||||
bool m_bStaticBackground;
|
||||
bool m_bRandomBGOnly;
|
||||
bool m_bSaveScore;
|
||||
bool m_bSaveReplay;
|
||||
|
||||
SongOptions() = default;
|
||||
/**
|
||||
* @brief Set up the SongOptions with reasonable defaults.
|
||||
*/
|
||||
SongOptions(): m_bAssistClap(false),
|
||||
m_bAssistMetronome(false), m_fMusicRate(1.0f),
|
||||
m_SpeedfMusicRate(1.0f), m_fHaste(0.0f),
|
||||
m_SpeedfHaste(1.0f), m_AutosyncType(AutosyncType_Off),
|
||||
m_SoundEffectType(SoundEffectType_Off),
|
||||
m_bStaticBackground(false), m_bRandomBGOnly(false),
|
||||
m_bSaveScore(true), m_bSaveReplay(false) {};
|
||||
void Init() { *this = {}; }
|
||||
void Approach( const SongOptions& other, float fDeltaSeconds );
|
||||
void GetMods( std::vector<RString> &AddTo ) const;
|
||||
|
||||
+12
-12
@@ -27,14 +27,14 @@ public:
|
||||
// See explanation in source.
|
||||
static Sprite* NewBlankSprite();
|
||||
|
||||
virtual void InitState();
|
||||
virtual void InitState() override;
|
||||
|
||||
void LoadFromNode( const XNode* pNode );
|
||||
virtual Sprite *Copy() const;
|
||||
void LoadFromNode( const XNode* pNode ) override;
|
||||
virtual Sprite *Copy() const override;
|
||||
|
||||
virtual bool EarlyAbortDraw() const;
|
||||
virtual void DrawPrimitives();
|
||||
virtual void Update( float fDeltaTime );
|
||||
virtual bool EarlyAbortDraw() const override;
|
||||
virtual void DrawPrimitives() override;
|
||||
virtual void Update( float fDeltaTime ) override;
|
||||
|
||||
void UpdateAnimationState(); // take m_fSecondsIntoState, and move to a new state
|
||||
|
||||
@@ -50,15 +50,15 @@ public:
|
||||
void UnloadTexture();
|
||||
RageTexture* GetTexture() { return m_pTexture; };
|
||||
|
||||
virtual void EnableAnimation( bool bEnable );
|
||||
virtual void EnableAnimation( bool bEnable ) override;
|
||||
|
||||
virtual int GetNumStates() const;
|
||||
virtual void SetState( int iNewState );
|
||||
virtual int GetNumStates() const override;
|
||||
virtual void SetState( int iNewState ) override;
|
||||
int GetState() { return m_iCurState; }
|
||||
virtual float GetAnimationLengthSeconds() const
|
||||
virtual float GetAnimationLengthSeconds() const override
|
||||
{ return m_animation_length_seconds; }
|
||||
virtual void RecalcAnimationLengthSeconds();
|
||||
virtual void SetSecondsIntoAnimation( float fSeconds );
|
||||
virtual void SetSecondsIntoAnimation( float fSeconds ) override;
|
||||
void SetStateProperties(const std::vector<State>& new_states)
|
||||
{ m_States= new_states; RecalcAnimationLengthSeconds(); SetState(0); }
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
void CropTo( float fWidth, float fHeight );
|
||||
|
||||
// Commands
|
||||
virtual void PushSelf( lua_State *L );
|
||||
virtual void PushSelf( lua_State *L ) override;
|
||||
|
||||
void SetAllStateDelays(float fDelay);
|
||||
|
||||
|
||||
+1
-1
@@ -314,7 +314,7 @@ bool StageStats::PlayerHasHighScore( PlayerNumber pn ) const
|
||||
PROFILEMAN->GetMachineProfile()->GetCourseHighScoreList(pCourse, pTrail) :
|
||||
PROFILEMAN->GetMachineProfile()->GetStepsHighScoreList(pSong, pSteps);
|
||||
|
||||
const auto iScore = m_player[pn].m_iScore;
|
||||
const unsigned int iScore = m_player[pn].m_iScore;
|
||||
float fPercentDP = m_player[pn].GetPercentDancePoints();
|
||||
for( int h=0; h<(int)hsl.vHighScores.size() && h<PREFSMAN->m_iMaxHighScoresPerListForMachine; ++h )
|
||||
{
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ void StepsUtil::GetAllMatchingEndless( Song *pSong, const StepsCriteria &stc, st
|
||||
{
|
||||
const std::vector<Steps*> &vSteps = ( stc.m_st == StepsType_Invalid ? pSong->GetAllSteps() :
|
||||
pSong->GetStepsByStepsType( stc.m_st ) );
|
||||
const auto previousSize = out.size();
|
||||
const size_t previousSize = out.size();
|
||||
int successful = false;
|
||||
|
||||
GetAllMatching( pSong, stc, out );
|
||||
|
||||
+2
-2
@@ -274,7 +274,7 @@ void TimingData::ShiftRange(int start_row, int end_row,
|
||||
// the rows of the segments, the second time removing segments that
|
||||
// have been run over by a segment being moved. Attempts to combine
|
||||
// both operations into a single loop were error prone. -Kyz
|
||||
for(size_t i= first_affected; last_affected >= 0 && i <= static_cast<uint32_t>(last_affected) && i < segs.size(); ++i)
|
||||
for(size_t i= first_affected; i <= static_cast<size_t>(last_affected) && i < segs.size(); ++i)
|
||||
{
|
||||
int seg_row= segs[i]->GetRow();
|
||||
if(seg_row > 0 && seg_row >= start_row && seg_row <= end_row)
|
||||
@@ -284,7 +284,7 @@ void TimingData::ShiftRange(int start_row, int end_row,
|
||||
}
|
||||
}
|
||||
#define ERASE_SEG(s) if(segs.size() > 1) { EraseSegment(segs, s, segs[s]); --i; --last_affected; erased= true; }
|
||||
for(size_t i= first_affected; last_affected >= 0 && i <= static_cast<uint32_t>(last_affected) && i < segs.size(); ++i)
|
||||
for(size_t i= first_affected; i <= static_cast<size_t>(last_affected) && i < segs.size(); ++i)
|
||||
{
|
||||
bool erased= false;
|
||||
int seg_row= segs[i]->GetRow();
|
||||
|
||||
@@ -771,8 +771,8 @@ void InputHandler_DInput::UpdateBuffered( DIDevice &device, const RageTimer &tm
|
||||
}
|
||||
}
|
||||
|
||||
inline constexpr auto XINPUT_GAMEPAD_THUMB_MIN = std::numeric_limits<short>::min();
|
||||
inline constexpr auto XINPUT_GAMEPAD_THUMB_MAX = std::numeric_limits<short>::max();
|
||||
inline constexpr short XINPUT_GAMEPAD_THUMB_MIN = std::numeric_limits<short>::min();
|
||||
inline constexpr short XINPUT_GAMEPAD_THUMB_MAX = std::numeric_limits<short>::max();
|
||||
|
||||
void InputHandler_DInput::UpdateXInput( XIDevice &device, const RageTimer &tm )
|
||||
{
|
||||
|
||||
@@ -263,6 +263,9 @@ EventDevice::~EventDevice()
|
||||
}
|
||||
|
||||
InputHandler_Linux_Event::InputHandler_Linux_Event()
|
||||
: m_NextDevice(DEVICE_JOY10)
|
||||
, m_bShutdown(true)
|
||||
, m_bDevicesChanged(false)
|
||||
{
|
||||
if(LINUXINPUT == nullptr) LINUXINPUT = new LinuxInputManager;
|
||||
LINUXINPUT->InitDriver(this);
|
||||
|
||||
@@ -23,8 +23,8 @@ private:
|
||||
void InputThread();
|
||||
|
||||
RageThread m_InputThread;
|
||||
InputDevice m_NextDevice{DEVICE_JOY10};
|
||||
bool m_bShutdown{true}, m_bDevicesChanged{false};
|
||||
InputDevice m_NextDevice;
|
||||
bool m_bShutdown, m_bDevicesChanged;
|
||||
};
|
||||
#define USE_INPUT_HANDLER_LINUX_JOYSTICK
|
||||
|
||||
|
||||
@@ -388,8 +388,8 @@ RString LowLevelWindow_X11::TryVideoMode( const VideoModeParams &p, bool &bNewDe
|
||||
// with as close to our desired refresh rate as possible.
|
||||
for (int i = 0; i < scrRes->nmode; i++) {
|
||||
const XRRModeInfo &thisMI = scrRes->modes[i];
|
||||
const auto modeWidth = bPortrait ? thisMI.height : thisMI.width;
|
||||
const auto modeHeight = bPortrait ? thisMI.width : thisMI.height;
|
||||
const unsigned int modeWidth = bPortrait ? thisMI.height : thisMI.width;
|
||||
const unsigned int modeHeight = bPortrait ? thisMI.width : thisMI.height;
|
||||
if (p.width >= 0 && p.height >= 0 && modeWidth == static_cast<uint32_t>(p.width) && modeHeight == static_cast<uint32_t>(p.height)) {
|
||||
float fTempRefresh = calcRandRRefresh(thisMI.dotClock, thisMI.hTotal, thisMI.vTotal);
|
||||
float fTempDiff = std::abs(p.rate - fTempRefresh);
|
||||
|
||||
Reference in New Issue
Block a user