Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortetsuo55 <tetsuo55@users.sourceforge.net>2010-04-19 00:29:12 +0400
committertetsuo55 <tetsuo55@users.sourceforge.net>2010-04-19 00:29:12 +0400
commitb072e90c262fef233872e34f93bf298ce0d1fa03 (patch)
treeee8fd84e6d0e594d6e884e8be7e31d2c24be47fe /src/apps/mplayerc/libpng.h
parent5215e9e5c05dcfc26b4314a2b52966cbcea5306f (diff)
Style patch part1. based on newly released astyle 1.24.
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1790 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/libpng.h')
-rw-r--r--src/apps/mplayerc/libpng.h52
1 files changed, 28 insertions, 24 deletions
diff --git a/src/apps/mplayerc/libpng.h b/src/apps/mplayerc/libpng.h
index 8593b1fba..bedc25e92 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 */