TWINE: use BodyData for rendering

This commit is contained in:
Martin Gerhardy 2021-03-27 08:57:54 +01:00
parent cdc6281bd0
commit 33371ae454
16 changed files with 232 additions and 393 deletions

View file

@ -343,13 +343,13 @@ void Redraw::processDrawListActors(const DrawListStruct &drawCmd, bool bgRedraw)
ActorStruct *actor = _engine->_scene->getActor(actorIdx);
if (actor->previousAnimIdx >= 0) {
const AnimData &animData = _engine->_resources->animData[actor->previousAnimIdx];
_engine->_animations->setModelAnimation(actor->animPosition, animData, _engine->_resources->bodyTable[actor->entity], &actor->animTimerData);
_engine->_animations->setModelAnimation(actor->animPosition, animData, _engine->_resources->bodyData[actor->entity], &actor->animTimerData);
}
const int32 x = actor->pos.x - _engine->_grid->camera.x;
const int32 y = actor->pos.y - _engine->_grid->camera.y;
const int32 z = actor->pos.z - _engine->_grid->camera.z;
if (!_engine->_renderer->renderIsoModel(x, y, z, ANGLE_0, actor->angle, ANGLE_0, _engine->_resources->bodyTable[actor->entity])) {
if (!_engine->_renderer->renderIsoModel(x, y, z, ANGLE_0, actor->angle, ANGLE_0, _engine->_resources->bodyData[actor->entity])) {
return;
}
@ -623,7 +623,7 @@ void Redraw::renderOverlays() {
_engine->_interface->drawFilledRect(rect, COLOR_BLACK);
_engine->_interface->setClip(rect);
const uint8* bodyPtr = _engine->_resources->inventoryTable[item];
const BodyData &bodyPtr = _engine->_resources->inventoryTable[item];
_overlayRotation += 1; // overlayRotation += 8;
_engine->_renderer->renderInventoryItem(40, 40, bodyPtr, _overlayRotation, 16000);
_engine->_menu->drawBox(rect);