summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
Diffstat (limited to 'src/being')
-rw-r--r--src/being/actorsprite.cpp97
-rw-r--r--src/being/actorsprite.h9
2 files changed, 16 insertions, 90 deletions
diff --git a/src/being/actorsprite.cpp b/src/being/actorsprite.cpp
index c494da7ed..a56e31463 100644
--- a/src/being/actorsprite.cpp
+++ b/src/being/actorsprite.cpp
@@ -61,8 +61,6 @@
#define end_foreach }
-static const unsigned int STATUS_EFFECTS = 32;
-
AnimatedSprite *ActorSprite::targetCursor
[CAST_SIZE(TargetCursorType::NUM_TCT)]
[CAST_SIZE(TargetCursorSize::NUM_TC)];
@@ -218,34 +216,6 @@ void ActorSprite::setStatusEffect(const int32_t index,
}
}
-// function for legacy configs only. Must be removed in future
-void ActorSprite::setStatusEffectBlock(const int offset,
- const uint16_t newEffects)
-{
- for (unsigned i = 0; i < STATUS_EFFECTS; i++)
- {
- const bool val = (newEffects & (1 << i)) > 0;
- const int32_t index = StatusEffectDB::blockIdToId(
- offset + i); // block-id (offset + i) to id (index)
-
- if (index != -1)
- {
- setStatusEffect(index,
- fromBool(val, Enable),
- IsStart_true);
- }
- else if (val && config.getBoolValue("unimplimentedLog"))
- {
- const std::string str = strprintf(
- "Error: unknown effect by block-index. "
- "Offset: %d, effect int: %d, i: %u",
- offset, CAST_S32(newEffects), i);
- logger->log(str);
- DebugMessageListener::distributeEvent(str);
- }
- }
-}
-
static void applyEffectByOption(ActorSprite *const actor,
uint32_t option,
const char *const name,
@@ -316,67 +286,32 @@ void ActorSprite::setStatusEffectOpitons(const uint32_t option,
const uint32_t opt2,
const uint32_t opt3)
{
- if (settings.legacyEffects == false)
- {
- applyEffectByOption(this, option, "option",
- StatusEffectDB::getOptionMap());
- applyEffectByOption1(this, opt1, "opt1",
- StatusEffectDB::getOpt1Map());
- applyEffectByOption(this, opt2, "opt2",
- StatusEffectDB::getOpt2Map());
- applyEffectByOption(this, opt3, "opt3",
- StatusEffectDB::getOpt3Map());
- }
- else
- {
- uint32_t statusEffects = opt2;
- statusEffects |= option << 16;
- setStatusEffectBlock(0,
- CAST_U16((statusEffects >> 16) & 0xffffU));
- setStatusEffectBlock(16,
- CAST_U16(statusEffects & 0xffffU));
- setStatusEffectBlock(32,
- CAST_U16(opt3));
- }
+ applyEffectByOption(this, option, "option",
+ StatusEffectDB::getOptionMap());
+ applyEffectByOption1(this, opt1, "opt1",
+ StatusEffectDB::getOpt1Map());
+ applyEffectByOption(this, opt2, "opt2",
+ StatusEffectDB::getOpt2Map());
+ applyEffectByOption(this, opt3, "opt3",
+ StatusEffectDB::getOpt3Map());
}
void ActorSprite::setStatusEffectOpitons(const uint32_t option,
const uint32_t opt1,
const uint32_t opt2)
{
- if (settings.legacyEffects == false)
- {
- applyEffectByOption(this, option, "option",
- StatusEffectDB::getOptionMap());
- applyEffectByOption1(this, opt1, "opt1",
- StatusEffectDB::getOpt1Map());
- applyEffectByOption(this, opt2, "opt2",
- StatusEffectDB::getOpt2Map());
- }
- else
- {
- uint32_t statusEffects = opt2;
- statusEffects |= option << 16;
- setStatusEffectBlock(0,
- CAST_U16((statusEffects >> 16) & 0xffffU));
- setStatusEffectBlock(16,
- CAST_U16(statusEffects & 0xffffU));
- }
+ applyEffectByOption(this, option, "option",
+ StatusEffectDB::getOptionMap());
+ applyEffectByOption1(this, opt1, "opt1",
+ StatusEffectDB::getOpt1Map());
+ applyEffectByOption(this, opt2, "opt2",
+ StatusEffectDB::getOpt2Map());
}
void ActorSprite::setStatusEffectOpiton0(const uint32_t option)
{
- if (settings.legacyEffects == false)
- {
- applyEffectByOption(this, option, "option",
- StatusEffectDB::getOptionMap());
- }
- else
- {
- const uint32_t statusEffects = option << 16;
- setStatusEffectBlock(0,
- CAST_U16((statusEffects >> 16) & 0xffff));
- }
+ applyEffectByOption(this, option, "option",
+ StatusEffectDB::getOptionMap());
}
void ActorSprite::updateStatusEffect(const int32_t index,
diff --git a/src/being/actorsprite.h b/src/being/actorsprite.h
index a73c91ef7..b872b52c6 100644
--- a/src/being/actorsprite.h
+++ b/src/being/actorsprite.h
@@ -201,15 +201,6 @@ class ActorSprite notfinal : public CompoundSprite, public Actor
protected:
/**
- * A status effect block is a 16 bit mask of status effects. We assign
- * each such flag a block ID of offset + bitnr.
- *
- * These are NOT the same as the status effect indices.
- */
- void setStatusEffectBlock(const int offset,
- const uint16_t newEffects);
-
- /**
* Notify self that a status effect has flipped.
* The new flag is passed.
*/