Skip to content

Commit

Permalink
Merge pull request #2323 from rueter37/issue-2266
Browse files Browse the repository at this point in the history
Fix HSL to RGB overflow error
  • Loading branch information
Ghabry authored Sep 10, 2020
2 parents 57f6c63 + 66e1fd0 commit db99af4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/bitmap_hslrgb.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static inline void HSL_to_RGB(const int& h, const int& s, const int& l,

static inline void HSL_adjust(int& h, int& s, int& l, int hue) {
h += hue;
if (h > 0x600) h -= 0x600;
if (h >= 0x600) h -= 0x600;
if (s > 0xFF) s = 0xFF;
l = (l > 0xFF) ? 0xFF : (l < 0) ? 0 : l;
}
Expand Down
2 changes: 1 addition & 1 deletion src/scene_battle_rpg2k3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1486,7 +1486,7 @@ void Scene_Battle_Rpg2k3::ShowNotification(std::string text) {

bool Scene_Battle_Rpg2k3::CheckAnimFlip(Game_Battler* battler) {
if (Game_System::GetInvertAnimations()) {
return battler->IsDirectionFlipped() ^ battler->GetType() == Game_Battler::Type_Enemy;
return battler->IsDirectionFlipped() ^ (battler->GetType() == Game_Battler::Type_Enemy);
}
return false;
}

0 comments on commit db99af4

Please sign in to comment.