diff options
Diffstat (limited to 'src/apps/mplayerc/libpng.h')
-rw-r--r-- | src/apps/mplayerc/libpng.h | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/apps/mplayerc/libpng.h b/src/apps/mplayerc/libpng.h index 01894be0b..bd306944e 100644 --- a/src/apps/mplayerc/libpng.h +++ b/src/apps/mplayerc/libpng.h @@ -25,8 +25,8 @@ struct png_t
{
- unsigned char* data;
- unsigned int size, pos;
+ unsigned char* data;
+ unsigned int size, pos;
};
#ifdef __cplusplus
@@ -39,31 +39,31 @@ extern "C" unsigned char* DecompressPNG(struct png_t* png, int* w, int* h); class CMPCPngImage : public CImage
{
public:
- bool LoadFromResource(UINT id)
- {
- bool ret = false;
+ bool LoadFromResource(UINT id)
+ {
+ bool ret = false;
- CStringA str;
- if(LoadResource(id, str, _T("FILE")))
- {
- struct png_t png;
- png.data = (unsigned char*)(LPCSTR)str;
- png.size = str.GetLength();
- int w, h;
- if(BYTE* p = DecompressPNG(&png, &w, &h))
- {
- if(Create(w, -h, 32))
- {
- for(int y = 0; y < h; y++)
- memcpy(GetPixelAddress(0, y), &p[w*4*y], w*4);
- ret = true;
- }
+ CStringA str;
+ if(LoadResource(id, str, _T("FILE")))
+ {
+ struct png_t png;
+ png.data = (unsigned char*)(LPCSTR)str;
+ png.size = str.GetLength();
+ int w, h;
+ if(BYTE* p = DecompressPNG(&png, &w, &h))
+ {
+ if(Create(w, -h, 32))
+ {
+ for(int y = 0; y < h; y++)
+ memcpy(GetPixelAddress(0, y), &p[w*4*y], w*4);
+ ret = true;
+ }
- free(p);
- }
- }
+ free(p);
+ }
+ }
- return ret;
- }
+ return ret;
+ }
};
#endif /* __cplusplus */
|