From ae19a87c4fe70f0ffcecb5dcdff40c5415526d91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Arzel?= Date: Sun, 14 Jan 2024 00:40:23 +0100 Subject: [PATCH] FF8: Fix Tonberry layer (#638) --- Changelog.md | 8 ++++++++ src/common.cpp | 5 +++++ src/ff8/mod.cpp | 7 +++++-- src/ff8/texture_packer.cpp | 4 ---- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Changelog.md b/Changelog.md index b3d068fd..14929f29 100644 --- a/Changelog.md +++ b/Changelog.md @@ -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 diff --git a/src/common.cpp b/src/common.cpp index 43e4ce57..5d407916 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -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(); diff --git a/src/ff8/mod.cpp b/src/ff8/mod.cpp index bfb9ab52..1a0daf8b 100644 --- a/src/ff8/mod.cpp +++ b/src/ff8/mod.cpp @@ -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(imgWidth - 128, 0), imgHeight, + vramPageIdTarget == _vramPageId ? 0 : 128, 0 ); return TexturePacker::ExternalTexture; diff --git a/src/ff8/texture_packer.cpp b/src/ff8/texture_packer.cpp index e1de4fd1..2c9405ea 100644 --- a/src/ff8/texture_packer.cpp +++ b/src/ff8/texture_packer.cpp @@ -471,16 +471,12 @@ std::list 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;