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:
authorXhmikosR <xhmikosr@users.sourceforge.net>2010-04-09 18:12:59 +0400
committerXhmikosR <xhmikosr@users.sourceforge.net>2010-04-09 18:12:59 +0400
commitefbc9d9043ff8ff92716ddd00a5f61412d535593 (patch)
tree8f3e621f756cf1f5b4d64d97964c7e7abd8aaf08 /src/apps/mplayerc/libpng.h
parentdf6b139a6d9027156f614b68687e039e3a5854db (diff)
revert r1783
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1785 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/libpng.h')
-rw-r--r--src/apps/mplayerc/libpng.h52
1 files changed, 24 insertions, 28 deletions
diff --git a/src/apps/mplayerc/libpng.h b/src/apps/mplayerc/libpng.h
index 98354380b..8593b1fba 100644
--- a/src/apps/mplayerc/libpng.h
+++ b/src/apps/mplayerc/libpng.h
@@ -23,11 +23,7 @@
#pragma once
-struct png_t
-{
- unsigned char* data;
- unsigned int size, pos;
-};
+struct png_t {unsigned char* data; unsigned int size, pos;};
#ifdef __cplusplus
@@ -38,31 +34,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 */