Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FF8: Fix Tonberry layer #638

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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