Skip to content

Commit

Permalink
Replace spaces with tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
aleck099 committed Jun 23, 2023
1 parent 6832809 commit dfb77be
Show file tree
Hide file tree
Showing 12 changed files with 83 additions and 83 deletions.
10 changes: 5 additions & 5 deletions src/config_param.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,11 @@ class ConfigParamBase {
}

template <typename U = T, typename std::enable_if<!std::is_enum<U>::value, int>::type = 0>
void ToIni(std::ostream& ini) const {
void ToIni(std::ostream& ini) const {
if (IsOptionVisible()) {
ini << _config_key << '=' << Get() << "\n";
ini << _config_key << '=' << Get() << "\n";
}
}
}

protected:
virtual bool vIsValid(const T& value) const = 0;
Expand Down Expand Up @@ -250,7 +250,7 @@ class ConfigParam : public ConfigParamBase<T> {
template <typename T>
class LockedConfigParam final : public ConfigParam<T> {
public:
explicit LockedConfigParam(StringView name, StringView description, T value = {}) :
explicit LockedConfigParam(StringView name, StringView description, T value = {}) :
ConfigParam<T>(name, description, "", "", value) {
this->Lock(value);
}
Expand Down Expand Up @@ -420,7 +420,7 @@ class EnumConfigParam : public ConfigParamBase<E> {

void ToIni(std::ostream& ini) const {
if (this->IsOptionVisible()) {
ini << this->_config_key << '=' << _tags[static_cast<int>(this->Get())] << "\n";
ini << this->_config_key << '=' << _tags[static_cast<int>(this->Get())] << "\n";
}
}

Expand Down
12 changes: 6 additions & 6 deletions src/font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

// Static variables.
namespace {
template <typename T>
template <typename T>
BitmapFontGlyph const* find_glyph(const T& glyphset, char32_t code) {
auto iter = std::lower_bound(std::begin(glyphset), std::end(glyphset), code);
if(iter != std::end(glyphset) && iter->code == code) {
Expand Down Expand Up @@ -296,7 +296,7 @@ FTFont::FTFont(Filesystem_Stream::InputStream is, int size, bool bold, bool ital

#ifdef HAVE_HARFBUZZ
hb_buffer = hb_buffer_create();
hb_font = hb_ft_font_create_referenced(face);
hb_font = hb_ft_font_create_referenced(face);
hb_ft_font_set_funcs(hb_font);
#endif

Expand Down Expand Up @@ -368,7 +368,7 @@ Rect FTFont::vGetSize(char32_t glyph) const {
}

Font::GlyphRet FTFont::vRender(char32_t glyph) const {
auto glyph_index = FT_Get_Char_Index(face, glyph);
auto glyph_index = FT_Get_Char_Index(face, glyph);

if (glyph_index == 0 && fallback_font) {
return fallback_font->vRender(glyph);
Expand Down Expand Up @@ -466,9 +466,9 @@ std::vector<Font::ShapeRet> FTFont::vShape(U32StringView txt) const {

hb_shape(hb_font, hb_buffer, nullptr, 0);

unsigned int glyph_count;
hb_glyph_info_t* glyph_info = hb_buffer_get_glyph_infos(hb_buffer, &glyph_count);
hb_glyph_position_t* glyph_pos = hb_buffer_get_glyph_positions(hb_buffer, &glyph_count);
unsigned int glyph_count;
hb_glyph_info_t* glyph_info = hb_buffer_get_glyph_infos(hb_buffer, &glyph_count);
hb_glyph_position_t* glyph_pos = hb_buffer_get_glyph_positions(hb_buffer, &glyph_count);

std::vector<Font::ShapeRet> ret;
Point advance;
Expand Down
8 changes: 4 additions & 4 deletions src/game_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1136,10 +1136,10 @@ void Game_Actor::ChangeClass(int new_class_id,
}

StringView Game_Actor::GetClassName() const {
if (!GetClass()) {
return {};
}
return GetClass()->name;
if (!GetClass()) {
return {};
}
return GetClass()->name;
}

static int ClampMaxHpMod(int hp, const Game_Actor* actor) {
Expand Down
16 changes: 8 additions & 8 deletions src/game_interpreter_battle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ bool Game_Interpreter_Battle::CommandForceFlee(lcf::rpg::EventCommand const& com
if (!check || Game_Battle::GetBattleCondition() != lcf::rpg::System::BattleCondition_pincers) {
this->force_flee_enabled = true;
}
break;
break;
case 1:
if (!check || Game_Battle::GetBattleCondition() != lcf::rpg::System::BattleCondition_surround) {
int num_escaped = 0;
Expand All @@ -245,7 +245,7 @@ bool Game_Interpreter_Battle::CommandForceFlee(lcf::rpg::EventCommand const& com
Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Game_System::SFX_Escape));
}
}
break;
break;
case 2:
if (!check || Game_Battle::GetBattleCondition() != lcf::rpg::System::BattleCondition_surround) {
auto* enemy = Main_Data::game_enemyparty->GetEnemy(com.parameters[1]);
Expand All @@ -255,7 +255,7 @@ bool Game_Interpreter_Battle::CommandForceFlee(lcf::rpg::EventCommand const& com
Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Game_System::SFX_Escape));
}
}
break;
break;
}

return true;
Expand Down Expand Up @@ -301,13 +301,13 @@ bool Game_Interpreter_Battle::CommandChangeMonsterHP(lcf::rpg::EventCommand cons
switch (com.parameters[2]) {
case 0:
change = com.parameters[3];
break;
break;
case 1:
change = Main_Data::game_variables->Get(com.parameters[3]);
break;
break;
case 2:
change = com.parameters[3] * hp / 100;
break;
break;
}

if (lose) {
Expand Down Expand Up @@ -339,10 +339,10 @@ bool Game_Interpreter_Battle::CommandChangeMonsterMP(lcf::rpg::EventCommand cons
switch (com.parameters[2]) {
case 0:
change = com.parameters[3];
break;
break;
case 1:
change = Main_Data::game_variables->Get(com.parameters[3]);
break;
break;
}

if (lose)
Expand Down
2 changes: 1 addition & 1 deletion src/image_png.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "image_png.h"

static void read_data(png_structp png_ptr, png_bytep data, png_size_t length) {
png_bytep* bufp = (png_bytep*) png_get_io_ptr(png_ptr);
png_bytep* bufp = (png_bytep*) png_get_io_ptr(png_ptr);
memcpy(data, *bufp, length);
*bufp += length;
}
Expand Down
16 changes: 8 additions & 8 deletions src/meta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,17 +209,17 @@ std::string Meta::GetLdbAlias() const {
}

std::string Meta::GetLmtAlias() const {
if (!Empty()) {
return ini->GetString(canon_ini_lookup, MTINI_FILEXT_LMT_ALIAS, "");
}
return "";
if (!Empty()) {
return ini->GetString(canon_ini_lookup, MTINI_FILEXT_LMT_ALIAS, "");
}
return "";
}

std::string Meta::GetLmuAlias() const {
if (!Empty()) {
return ini->GetString(canon_ini_lookup, MTINI_FILEXT_LMU_ALIAS, "");
}
return "";
if (!Empty()) {
return ini->GetString(canon_ini_lookup, MTINI_FILEXT_LMU_ALIAS, "");
}
return "";
}


Expand Down
30 changes: 15 additions & 15 deletions src/output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,21 +119,21 @@ EM_ASM({
msg = UTF8ToString($1);

switch (lvl) {
case 0:
console.error(msg);
break;
case 1:
console.warn(msg);
break;
case 2:
console.info(msg);
break;
case 3:
console.debug(msg);
break;
default:
console.log(msg);
break;
case 0:
console.error(msg);
break;
case 1:
console.warn(msg);
break;
case 2:
console.info(msg);
break;
case 3:
console.debug(msg);
break;
default:
console.log(msg);
break;
}
}, static_cast<int>(lvl), msg.c_str());

Expand Down
36 changes: 18 additions & 18 deletions src/scene_battle_rpg2k3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2845,27 +2845,27 @@ bool Scene_Battle_Rpg2k3::CheckAnimFlip(Game_Battler* battler) {
}

void Scene_Battle_Rpg2k3::SetWait(int min_wait, int max_wait) {
battle_action_wait = max_wait;
battle_action_min_wait = max_wait - min_wait;
battle_action_wait = max_wait;
battle_action_min_wait = max_wait - min_wait;
}

bool Scene_Battle_Rpg2k3::CheckWait() {
if (battle_action_wait > 0) {
if (Input::IsPressed(Input::CANCEL)) {
return false;
}
--battle_action_wait;
if (battle_action_wait > battle_action_min_wait) {
return false;
}
if (!Input::IsPressed(Input::DECISION)
&& !Input::IsPressed(Input::SHIFT)
&& battle_action_wait > 0) {
return false;
}
battle_action_wait = 0;
}
return true;
if (battle_action_wait > 0) {
if (Input::IsPressed(Input::CANCEL)) {
return false;
}
--battle_action_wait;
if (battle_action_wait > battle_action_min_wait) {
return false;
}
if (!Input::IsPressed(Input::DECISION)
&& !Input::IsPressed(Input::SHIFT)
&& battle_action_wait > 0) {
return false;
}
battle_action_wait = 0;
}
return true;
}

void Scene_Battle_Rpg2k3::OnPartyChanged(Game_Actor* actor, bool added) {
Expand Down
18 changes: 9 additions & 9 deletions src/scene_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,13 @@ void Scene_File::MoveFileWindows(int dy, int dt) {
void Scene_File::UpdateArrows() {
int max_index = static_cast<int>(file_windows.size()) - 1;

bool show_up_arrow = (top_index > 0);
bool show_down_arrow = (top_index < max_index - 2);

if (show_up_arrow || show_down_arrow) {
arrow_frame = (arrow_frame + 1) % (arrow_animation_frames * 2);
}
bool arrow_visible = (arrow_frame < arrow_animation_frames);
up_arrow->SetVisible(show_up_arrow && arrow_visible);
down_arrow->SetVisible(show_down_arrow && arrow_visible);
bool show_up_arrow = (top_index > 0);
bool show_down_arrow = (top_index < max_index - 2);

if (show_up_arrow || show_down_arrow) {
arrow_frame = (arrow_frame + 1) % (arrow_animation_frames * 2);
}
bool arrow_visible = (arrow_frame < arrow_animation_frames);
up_arrow->SetVisible(show_up_arrow && arrow_visible);
down_arrow->SetVisible(show_down_arrow && arrow_visible);
}
4 changes: 2 additions & 2 deletions src/util_macro.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@

template <typename T>
T max(T x, T y) {
return (x >= y) ? x : y;
return (x >= y) ? x : y;
}

template <typename T>
T min(T x, T y) {
return (x < y) ? x : y;
return (x < y) ? x : y;
}

#endif
12 changes: 6 additions & 6 deletions src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,12 +592,12 @@ uint32_t Utils::CRC32(std::istream& stream) {

// via https://stackoverflow.com/q/3418231/
std::string Utils::ReplaceAll(std::string str, const std::string& search, const std::string& replace) {
size_t start_pos = 0;
while((start_pos = str.find(search, start_pos)) != std::string::npos) {
str.replace(start_pos, search.length(), replace);
start_pos += replace.length(); // Handles case where 'replace' is a substring of 'search'
}
return str;
size_t start_pos = 0;
while((start_pos = str.find(search, start_pos)) != std::string::npos) {
str.replace(start_pos, search.length(), replace);
start_pos += replace.length(); // Handles case where 'replace' is a substring of 'search'
}
return str;
}

std::string Utils::ReplacePlaceholders(StringView text_template, Span<const char> types, Span<const StringView> values) {
Expand Down
2 changes: 1 addition & 1 deletion src/window_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

class MenuItem final : public ConfigParam<StringView> {
public:
explicit MenuItem(StringView name, StringView description, StringView value) :
explicit MenuItem(StringView name, StringView description, StringView value) :
ConfigParam<StringView>(name, description, "", "", value) {
}
};
Expand Down

0 comments on commit dfb77be

Please sign in to comment.