mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-03 20:03:50 +00:00
perf: eliminate double map lookups, dynamic_cast in render loops, div by 255
- Replace count()+operator[] double lookups with find() or try_emplace() in gameObjectInstances_, playerTextureSlotsByModelId_, onlinePlayerAppearance_ - Add Entity::isUnit() helper; replace 5 dynamic_cast<Unit*> in per-frame UI rendering (nameplates, combat text, pet frame) with isUnit()+static_cast - Add constexpr kInv255 reciprocal for per-pixel normal map generation loops in character_renderer and wmo_renderer
This commit is contained in:
parent
6f2c8962e5
commit
6b1c728377
5 changed files with 36 additions and 27 deletions
|
|
@ -153,6 +153,9 @@ public:
|
|||
ObjectType getType() const { return type; }
|
||||
void setType(ObjectType t) { type = t; }
|
||||
|
||||
/// True if this entity is a Unit or Player (both derive from Unit).
|
||||
bool isUnit() const { return type == ObjectType::UNIT || type == ObjectType::PLAYER; }
|
||||
|
||||
// Fields (for update values)
|
||||
void setField(uint16_t index, uint32_t value) {
|
||||
fields[index] = value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue