Skip to content

Commit

Permalink
Match AnmManager::LoadSprite
Browse files Browse the repository at this point in the history
The torment is over, but at what cost...
  • Loading branch information
KSSBrawl committed Dec 5, 2024
1 parent af4d87c commit 3613588
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/AnmManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,14 @@ void AnmManager::LoadSprite(u32 spriteIdx, AnmLoadedSprite *sprite)
this->sprites[spriteIdx] = *sprite;
this->sprites[spriteIdx].spriteId = this->maybeLoadedSpriteCount++;

// For some reasons, all of thoses use a DIVR, how can we match here?
this->sprites[spriteIdx].uvStart.x =
this->sprites[spriteIdx].startPixelInclusive.x / this->sprites[spriteIdx].textureWidth;
this->sprites[spriteIdx].startPixelInclusive.x / (this->sprites[spriteIdx].textureWidth);
this->sprites[spriteIdx].uvEnd.x =
this->sprites[spriteIdx].endPixelInclusive.x / this->sprites[spriteIdx].textureWidth;
this->sprites[spriteIdx].endPixelInclusive.x / (this->sprites[spriteIdx].textureWidth);
this->sprites[spriteIdx].uvStart.y =
this->sprites[spriteIdx].startPixelInclusive.y / this->sprites[spriteIdx].textureHeight;
this->sprites[spriteIdx].startPixelInclusive.y / (this->sprites[spriteIdx].textureHeight);
this->sprites[spriteIdx].uvEnd.y =
this->sprites[spriteIdx].endPixelInclusive.y / this->sprites[spriteIdx].textureHeight;
this->sprites[spriteIdx].endPixelInclusive.y / (this->sprites[spriteIdx].textureHeight);

this->sprites[spriteIdx].widthPx =
this->sprites[spriteIdx].endPixelInclusive.x - this->sprites[spriteIdx].startPixelInclusive.x;
Expand Down

0 comments on commit 3613588

Please sign in to comment.