mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
'width' and 'height' parameters of wxBitmapFromMemoryRGBA should be unsigned.
Not a big deal, but it's good to do it for the sake of maintaining practicalities.
This commit is contained in:
parent
020ab743a9
commit
4ea4f2eb45
@ -39,11 +39,11 @@ const u8 hdr[] = {
|
||||
0x00,0x00,0x00,0x00
|
||||
};
|
||||
|
||||
wxBitmap wxBitmapFromMemoryRGBA(const unsigned char* data, int width, int height)
|
||||
wxBitmap wxBitmapFromMemoryRGBA(const unsigned char* data, u32 width, u32 height)
|
||||
{
|
||||
int stride = (4*width);
|
||||
u32 stride = (4*width);
|
||||
|
||||
int bytes = (stride*height) + sizeof(hdr);
|
||||
u32 bytes = (stride*height) + sizeof(hdr);
|
||||
|
||||
bytes = (bytes+3)&(~3);
|
||||
|
||||
@ -54,13 +54,13 @@ wxBitmap wxBitmapFromMemoryRGBA(const unsigned char* data, int width, int height
|
||||
|
||||
u8 *pixelData = pdata + sizeof(hdr);
|
||||
|
||||
for (int y=0;y<height;y++)
|
||||
for (u32 y=0;y<height;y++)
|
||||
{
|
||||
memcpy(pixelData+y*stride,data+(height-y-1)*stride,stride);
|
||||
}
|
||||
|
||||
*(int*)(pdata+18) = width;
|
||||
*(int*)(pdata+22) = height;
|
||||
*(u32*)(pdata+18) = width;
|
||||
*(u32*)(pdata+22) = height;
|
||||
*(u32*)(pdata+34) = bytes-sizeof(hdr);
|
||||
|
||||
wxMemoryInputStream is(pdata, bytes);
|
||||
|
Loading…
Reference in New Issue
Block a user