summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/koopatlas/map.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/koopatlas/map.cpp b/src/koopatlas/map.cpp
index e37ee4b..65d71b8 100644
--- a/src/koopatlas/map.cpp
+++ b/src/koopatlas/map.cpp
@@ -303,6 +303,7 @@ void dWMMap_c::renderer_c::renderDoodadLayer(dKPLayer_s *layer) {
float effectiveX = doodad->x, effectiveY = doodad->y;
float effectiveWidth = doodad->width, effectiveHeight = doodad->height;
float effectiveAngle = doodad->angle;
+ int effectiveAlpha = layer->alpha;
if (doodad->animationCount > 0) {
for (int j = 0; j < doodad->animationCount; j++) {
@@ -315,9 +316,9 @@ void dWMMap_c::renderer_c::renderDoodadLayer(dKPLayer_s *layer) {
}
u32 elapsed = GlobalTickCount - baseTick;
- u32 elapsedAdjusted = elapsed;
if (anim->isReversed)
elapsed = anim->frameCount - 1 - elapsed;
+ u32 elapsedAdjusted = elapsed;
if (elapsed >= anim->frameCount) {
if (elapsed >= (anim->frameCount + anim->delay)) {
@@ -342,8 +343,10 @@ void dWMMap_c::renderer_c::renderDoodadLayer(dKPLayer_s *layer) {
anim->baseTick = GlobalTickCount;
break;
}
+ elapsedAdjusted = elapsed;
+ } else {
+ elapsedAdjusted = anim->frameCount;
}
- elapsedAdjusted = anim->frameCount;
}
// now calculate the thing
@@ -393,7 +396,7 @@ void dWMMap_c::renderer_c::renderDoodadLayer(dKPLayer_s *layer) {
effectiveY += scaleYMod;
break;
case dKPDoodad_s::animation_s::OPACITY:
- // TODO
+ effectiveAlpha = (effectiveAlpha * (frame * 2.55f)) / 255;
break;
}
}
@@ -415,6 +418,8 @@ void dWMMap_c::renderer_c::renderDoodadLayer(dKPLayer_s *layer) {
MTXConcat(doodadMtx, rotMtx, doodadMtx);
}
+ GXSetTevColor(GX_TEVREG0, (GXColor){255,255,255,effectiveAlpha});
+
loadCamera(doodadMtx);
loadTexture(doodad->texObj);