 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
Durante
Joined: 02 Oct 2005 Posts: 65 Location: Austria
|
Posted: Sun Oct 02, 2005 6:13 am Post subject: Bug in clearImage? ([edit] Rather: question & suggestion |
|
|
[edit]Disregard the following, I didn't notice that currently all textures are 2^n*2^n. Does the PSP support non-square textures?
Still, I think my cleaner variant is valid, and that the pixels outside of the real image area don't have to be cleared.
[/edit]
In graphics.c, line 233: | Code: | | int size = image->textureWidth * image->textureWidth; | Unless there's something going on that's way over my head, that should be | Code: | | int size = image->imageWidth * image->imageHeight; |
In fact, I'd suggest a cleaner (IMHO) variant like the following:
| Code: |
void clearImage(Color color, Image* image)
{
Color *data = image->data;
Color *end = data + (image->imageWidth * image->imageHeight);
do *data = color; while(++data < end);
}
|
|
|
| Back to top |
|
 |
LuMo
Joined: 21 Aug 2005 Posts: 410 Location: Austria
|
Posted: Sun Oct 02, 2005 6:30 am Post subject: |
|
|
images do not have to be squares (eg 512x512) _________________ "Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com |
|
| Back to top |
|
 |
Shine
Joined: 03 Dec 2004 Posts: 728 Location: Germany
|
Posted: Sun Oct 02, 2005 9:01 am Post subject: Re: Bug in clearImage? ([edit] Rather: question & sugges |
|
|
| Durante wrote: | | Does the PSP support non-square textures? |
I hope, I've changed this in the new version, would save some memory.
| Durante wrote: |
Still, I think my cleaner variant is valid, and that the pixels outside of the real image area don't have to be cleared.
|
Your fix won't work, because the internal image size is larger than imageWidth, but I think this doesn't matter much any more, now that we can have non-square (internal, texture) image sizes. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|