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

Fix French and German ultimate staff sprite with PoL assets #9204

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

zenseii
Copy link
Collaborator

@zenseii zenseii commented Oct 16, 2024

The staff sprite is corrupted/wrong in at least the German and French PoL assets from GOG. Apparently this bug was introduced with patch 2.0 in those languages. In the Succession Wars asset the correct sprite is still present so we use that instead.

In master:
image

In original game:
image

@zenseii zenseii added improvement New feature, request or improvement assets Game data related stuff labels Oct 16, 2024
@zenseii zenseii added this to the 1.1.3 milestone Oct 16, 2024
@zenseii zenseii requested a review from ihhub October 16, 2024 19:09
@ihhub ihhub modified the milestones: 1.1.3, 1.1.4 Oct 19, 2024
Copy link
Owner

@ihhub ihhub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @zenseii , I put 2 comments here. Would you mind to take a look when you have spare time?

src/fheroes2/agg/agg.h Show resolved Hide resolved
Comment on lines +4206 to +4218
imageStream.seek( headerSize + assetIndex * 13 );

fheroes2::ICNHeader header1;
imageStream >> header1;

fheroes2::ICNHeader header2;
imageStream >> header2;
const uint32_t dataSize = header2.offsetData - header1.offsetData;

const uint8_t * data = body.data() + headerSize + header1.offsetData;
const uint8_t * dataEnd = data + dataSize;

_icnVsSprite[id][assetIndex] = fheroes2::decodeICNSprite( data, dataEnd, header1 );
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we create a helper function for this code which is duplicate of the code in function void LoadOriginalICN( const int id )? I think it could be like this:

void readImage( ROStreamBuf & stream, fheroes2::Sprite & image, const int32_t imageIndex, const bool isLastImage )
{
    ...
}

and then we can use this function in both places. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assets Game data related stuff improvement New feature, request or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants