diff options
author | tetsuo55 <tetsuo55@users.sourceforge.net> | 2010-04-09 01:14:58 +0400 |
---|---|---|
committer | tetsuo55 <tetsuo55@users.sourceforge.net> | 2010-04-09 01:14:58 +0400 |
commit | a9b7bf3fb3e1334d8defd05ca4cfae870b4912e5 (patch) | |
tree | 2dab453d94d5e003379a6cc895eceb84c80e23ec /src/apps/mplayerc/libpng.h | |
parent | aafd49a91f7c2fa9c7103971c16fa6e1b29e8bfd (diff) |
astyle formatting cleanup to make the sourcecode more accessible
switch used: astyle --style=ansi --min-conditional-indent=0 --pad=oper --unpad=paren
http://astyle.sourceforge.net/
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1783 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/libpng.h')
-rw-r--r-- | src/apps/mplayerc/libpng.h | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/src/apps/mplayerc/libpng.h b/src/apps/mplayerc/libpng.h index 8593b1fba..98354380b 100644 --- a/src/apps/mplayerc/libpng.h +++ b/src/apps/mplayerc/libpng.h @@ -23,7 +23,11 @@ #pragma once
-struct png_t {unsigned char* data; unsigned int size, pos;};
+struct png_t
+{
+ unsigned char* data;
+ unsigned int size, pos;
+};
#ifdef __cplusplus
@@ -34,31 +38,31 @@ extern "C" unsigned char* DecompressPNG(struct png_t* png, int* w, int* h); class CPngImage : 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 */
|