Changeset View
Changeset View
Standalone View
Standalone View
source/graphics/ObjectBase.cpp
/* Copyright (C) 2018 Wildfire Games. | /* Copyright (C) 2019 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 158 Lines • ▼ Show 20 Lines | else if (option_name == el_animations) | ||||
anim.m_ID = ae.Value; | anim.m_ID = ae.Value; | ||||
else if (ae.Name == at_frequency) | else if (ae.Name == at_frequency) | ||||
anim.m_Frequency = ae.Value.ToInt(); | anim.m_Frequency = ae.Value.ToInt(); | ||||
else if (ae.Name == at_file) | else if (ae.Name == at_file) | ||||
anim.m_FileName = VfsPath("art/animation") / ae.Value.FromUTF8(); | anim.m_FileName = VfsPath("art/animation") / ae.Value.FromUTF8(); | ||||
else if (ae.Name == at_speed) | else if (ae.Name == at_speed) | ||||
anim.m_Speed = ae.Value.ToInt() > 0 ? ae.Value.ToInt() / 100.f : 1.f; | anim.m_Speed = ae.Value.ToInt() > 0 ? ae.Value.ToInt() / 100.f : 1.f; | ||||
else if (ae.Name == at_event) | else if (ae.Name == at_event) | ||||
anim.m_ActionPos = clamp(ae.Value.ToFloat(), 0.f, 1.f); | anim.m_ActionPos = Clamp(ae.Value.ToFloat(), 0.f, 1.f); | ||||
Stan: Switch case with fallthrough ? | |||||
Done Inline ActionsNope, switch accepts only constant expressions. vladislavbelov: Nope, switch accepts only constant expressions. | |||||
else if (ae.Name == at_load) | else if (ae.Name == at_load) | ||||
anim.m_ActionPos2 = clamp(ae.Value.ToFloat(), 0.f, 1.f); | anim.m_ActionPos2 = Clamp(ae.Value.ToFloat(), 0.f, 1.f); | ||||
else if (ae.Name == at_sound) | else if (ae.Name == at_sound) | ||||
anim.m_SoundPos = clamp(ae.Value.ToFloat(), 0.f, 1.f); | anim.m_SoundPos = Clamp(ae.Value.ToFloat(), 0.f, 1.f); | ||||
} | } | ||||
currentVariant.m_Anims.push_back(anim); | currentVariant.m_Anims.push_back(anim); | ||||
} | } | ||||
} | } | ||||
else if (option_name == el_props) | else if (option_name == el_props) | ||||
{ | { | ||||
XERO_ITER_EL(option, prop_element) | XERO_ITER_EL(option, prop_element) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 497 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Switch case with fallthrough ?