00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef INCL_PLSDLBMP
00012 #define INCL_PLSDLBMP
00013
00014 #ifndef INCL_PLBITMAP
00015 #include "plbitmap.h"
00016 #endif
00017
00018 #include <SDL/SDL.h>
00019
00020
00021
00022 class PLSDLBmp : public PLBmp
00023 {
00024
00025 public:
00026
00027 PLSDLBmp
00028 ( int SurfFlags = SDL_SWSURFACE
00029 );
00030
00031
00032 virtual ~PLSDLBmp
00033 ();
00034
00035
00036 PLSDLBmp
00037 ( const PLBmp &Orig
00038 );
00039
00040
00041 PLSDLBmp
00042 ( const PLSDLBmp &Orig
00043 );
00044
00045
00046
00047
00048 void Attach
00049 ( SDL_Surface * pSurface
00050 );
00051
00052 #ifdef _DEBUG
00053 virtual void AssertValid
00054 () const;
00055 #endif
00056
00057
00058 PLSDLBmp &operator=
00059 ( const PLBmp &Orig
00060 );
00061
00062
00063 PLSDLBmp &operator=
00064 ( const PLSDLBmp &Orig
00065 );
00066
00067
00068
00069
00070
00071
00072 SDL_Surface * GetSurface
00073 ();
00074
00075
00076 long GetMemUsed
00077 ();
00078
00079
00080 long GetBytesPerLine
00081 ();
00082
00083
00084
00085
00086 static long GetMemNeeded
00087 ( PLLONG width,
00088 PLLONG height,
00089 PLWORD BitsPerPixel
00090 );
00091
00092
00093 static long GetBitsMemNeeded
00094 ( PLLONG width,
00095 PLLONG height,
00096 PLWORD BitsPerPixel
00097 );
00098
00099
00100 protected:
00101
00102
00103
00104
00105 virtual void internalCreate
00106 ( PLLONG Width,
00107 PLLONG Height,
00108 PLWORD BitsPerPixel,
00109 bool bAlphaChannel,
00110 bool bIsGreyscale
00111 );
00112
00113
00114 virtual void freeMembers
00115 ();
00116
00117
00118 virtual void initLineArray
00119 ();
00120
00121 private:
00122 SDL_Surface * m_pSurface;
00123 int m_SurfFlags;
00124 };
00125
00126
00127
00128
00129 inline PLSDLBmp::PLSDLBmp
00130 ( const PLSDLBmp &Orig
00131 )
00132 : PLBmp ()
00133 {
00134 m_SurfFlags = Orig.m_SurfFlags;
00135 internalCopy (Orig);
00136 }
00137
00138 inline PLSDLBmp::PLSDLBmp
00139 ( const PLBmp &Orig
00140 )
00141 : PLBmp ()
00142 {
00143 m_SurfFlags = SDL_SWSURFACE;
00144 internalCopy (Orig);
00145 }
00146
00147 inline PLSDLBmp & PLSDLBmp::operator=
00148 ( const PLBmp &Orig
00149 )
00150 {
00151 PLBmp::operator=(Orig);
00152 return *this;
00153 }
00154
00155 inline PLSDLBmp & PLSDLBmp::operator=
00156 ( const PLSDLBmp &Orig
00157 )
00158 {
00159 m_SurfFlags = Orig.m_SurfFlags;
00160 PLBmp::operator=(Orig);
00161 return *this;
00162 }
00163
00164
00165 #endif
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178