Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
'width' and 'height' parameters of wxBitmapFromMemoryRGBA should be u…
…nsigned.

Not a big deal, but it's good to do it for the sake of maintaining practicalities.
  • Loading branch information
lioncash committed Jan 14, 2013
1 parent 020ab74 commit 4ea4f2e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Source/Core/DolphinWX/Src/MemcardManager.cpp
Expand Up @@ -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);

Expand All @@ -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);
Expand Down

0 comments on commit 4ea4f2e

Please sign in to comment.