You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are others conditions that may update witdh and height but this one is the most obvious and error prone to me.
Questions
What is the exact purpose of this check ?
Why cannot we load not multiple by 4 PNG data ?
When check is removed, all seems to work fine. Is this related to Wii hardware ?
Do we really need to recompute image size + decode PNG data if content is zeroed after ?
Does this check can be moved to libpngu ?
Looking at the code, most PNG loading tricks are not needed if we drop content.
Function can be simplified (see 2654a89).
This may be silly, but what is the exact purpose of libpngu ?
Is it here to make an abstraction layer between GRRLIB and libpng ?
Does it come from somewhere else ? Most of the code in it look unused / dead.
Should we add some documentation on GRRLIB_LoadTexturePNG on the image size multiple by 4 (instead of not correct) ?
Code to reproduce
I have made a branch on repository fork to store code and resources (see commit: 2b73935).
Bellow are some screenshot of running application.
with image of 352*89:
with image of 352*82:
The text was updated successfully, but these errors were encountered:
Hi,
This question may have been ask earlier on GRRLIB forum, but I did not find any reference to this issue.
Problem description
There is weird / maybe undocumented behavior with PNG texture loading.
If texture width or height is not multiple of 4, then PNG data is zeroed.
This is due to the following check in
GRRLIB_LoadTexturePNG
:GRRLIB/GRRLIB/GRRLIB/GRRLIB_texEdit.c
Lines 173 to 176 in 3ee20bf
Width and height parameter are changed in
libpngu
in functionPNGU_DecodeTo4x4RGBA8
here:GRRLIB/GRRLIB/lib/pngu/pngu.c
Lines 601 to 602 in 3ee20bf
There are others conditions that may update witdh and height but this one is the most obvious and error prone to me.
Questions
What is the exact purpose of this check ?
Why cannot we load not multiple by 4 PNG data ?
When check is removed, all seems to work fine. Is this related to Wii hardware ?
Do we really need to recompute image size + decode PNG data if content is zeroed after ?
Does this check can be moved to
libpngu
?Looking at the code, most PNG loading tricks are not needed if we drop content.
Function can be simplified (see 2654a89).
This may be silly, but what is the exact purpose of
libpngu
?Is it here to make an abstraction layer between
GRRLIB
andlibpng
?Does it come from somewhere else ? Most of the code in it look unused / dead.
Should we add some documentation on
GRRLIB_LoadTexturePNG
on the image size multiple by 4 (instead of not correct) ?Code to reproduce
I have made a branch on repository fork to store code and resources (see commit: 2b73935).
Bellow are some screenshot of running application.
with image of 352*89:
with image of 352*82:
The text was updated successfully, but these errors were encountered: