Skip to content

Commit

Permalink
Merge pull request #352 from KSSBrawl/match-anmmanager-loadsprite
Browse files Browse the repository at this point in the history
Match AnmManager::LoadSprite
  • Loading branch information
wearrrrr authored Dec 13, 2024
2 parents af4d87c + 3613588 commit b559522
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 b559522

Please sign in to comment.