Skip to content

Commit

Permalink
FF8: Fix Tonberry layer (#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
myst6re committed Jan 13, 2024
1 parent 82d9fa7 commit ae19a87
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
8 changes: 8 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

- Full commit list since last stable release: https://github.com/julianxhokaxhiu/FFNx/compare/1.17.0...master

## Common

- Core: Hide cursor when the game is started in fullscreen mode ( https://github.com/julianxhokaxhiu/FFNx/pull/638 )

## FF8

- Graphics: Fix Tonberry compatibility layer for field backgrouns ( https://github.com/julianxhokaxhiu/FFNx/pull/638 )

# 1.17.0

- Full commit list since last stable release: https://github.com/julianxhokaxhiu/FFNx/compare/1.16.0...1.17.0
Expand Down
5 changes: 5 additions & 0 deletions src/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,11 @@ int common_create_window(HINSTANCE hInstance, struct game_obj* game_object)
// Show the cursor
while (ShowCursor(true) < 0);
}
else if (fullscreen)
{
// Hide the cursor
while (ShowCursor(false) >= 0);
}

nxAudioEngine.init();

Expand Down
7 changes: 5 additions & 2 deletions src/ff8/mod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,11 +518,14 @@ TexturePacker::TextureTypes TextureBackground::drawToImage(

// Tomberry way
if (_vramPageId >= 0) {
const int realOffsetX = (_vramPageId * TEXTURE_WIDTH_BPP16 - offsetX) / (4 >> uint16_t(targetBpp));
const int vramPageIdTarget = realOffsetX / TEXTURE_WIDTH_BPP16;

drawImage(
imgData, imgWidth, imgScale,
targetRgba, targetW, targetScale,
0, 0, imgWidth, imgHeight,
0, 0
0, 0, vramPageIdTarget == _vramPageId ? imgWidth : std::max<int>(imgWidth - 128, 0), imgHeight,
vramPageIdTarget == _vramPageId ? 0 : 128, 0
);

return TexturePacker::ExternalTexture;
Expand Down
4 changes: 0 additions & 4 deletions src/ff8/texture_packer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,16 +471,12 @@ std::list<TexturePacker::IdentifiedTexture> TexturePacker::matchTextures(const T
return ret;
}

int textureId = 0;

TexturePacker::TextureTypes TexturePacker::drawTextures(
const uint8_t *texData, uint32_t *rgbaImageData, uint32_t dataSize, int originalW, int originalH,
int palIndex, uint8_t *outScale, uint32_t **outTarget) const
{
if (trace_all || trace_vram) ffnx_trace("TexturePacker::%s texData=0x%X originalSize=(%d, %d) palIndex=%d\n", __func__, texData, originalW, originalH, palIndex);

textureId++;

*outScale = 1;
*outTarget = rgbaImageData;

Expand Down

0 comments on commit ae19a87

Please sign in to comment.