36 SDL_Texture *
const image,
37 const int x,
const int y,
38 const int width,
const int height) :
39 Image(image, width, height),
46 mParent->SDLTerminateAlphaCache();
47 mHasAlphaChannel = mParent->hasAlphaChannel();
48 mIsAlphaVisible = mHasAlphaChannel;
49 mAlphaChannel = mParent->SDLgetAlphaChannel();
50 mSource = parent->mIdPath;
53 static_cast<void*
>(
this),
56 #ifdef DEBUG_BIND_TEXTURE
57 mIdPath = parent->mIdPath;
62 mHasAlphaChannel =
false;
63 mIsAlphaVisible =
false;
64 mAlphaChannel =
nullptr;
74 mInternalBounds.x = mParent->mBounds.x;
75 mInternalBounds.y = mParent->mBounds.y;
76 mInternalBounds.w = mParent->mBounds.w;
77 mInternalBounds.h = mParent->mBounds.h;
81 mInternalBounds.x = 0;
82 mInternalBounds.y = 0;
83 mInternalBounds.w = 1;
84 mInternalBounds.h = 1;
86 mUseAlphaCache =
false;
91 SDL_Surface *
const image,
92 const int x,
const int y,
93 const int width,
const int height) :
101 mParent->SDLTerminateAlphaCache();
102 mHasAlphaChannel =
mParent->hasAlphaChannel();
103 mIsAlphaVisible = mHasAlphaChannel;
104 mAlphaChannel =
mParent->SDLgetAlphaChannel();
105 mSource = parent->mIdPath;
107 logger->
log(
"set name2 %p, %s",
static_cast<void*
>(
this),
110 #ifdef DEBUG_BIND_TEXTURE
111 mIdPath = parent->mIdPath;
116 mHasAlphaChannel =
false;
117 mIsAlphaVisible =
false;
118 mAlphaChannel =
nullptr;
140 mUseAlphaCache =
false;
146 const int x,
const int y,
147 const int width,
const int height,
148 const int texWidth,
const int texHeight) :
149 Image(image, width, height, texWidth, texHeight),
167 mSource = parent->mIdPath;
169 logger->
log(
"set name2 %p, %s",
static_cast<void*
>(
this),
172 #ifdef DEBUG_BIND_TEXTURE
173 mIdPath = parent->mIdPath;
183 mIsAlphaVisible = mHasAlphaChannel;
190 logger->
log(
"delete subimage: %p",
static_cast<void*
>(
this));
191 logger->
log(
" %s, %s", mIdPath.c_str(), mSource.c_str());
194 mSDLSurface =
nullptr;
196 mAlphaChannel =
nullptr;
207 logger->
log(
"decref from subminage: %p, parent: %p",
208 static_cast<void*
>(
this),
static_cast<void*
>(
mParent));
217 const int w,
const int h)
220 return mParent->getSubImage(mBounds.x +
x, mBounds.y +
y, w, h);
233 return static_cast<int>(
sizeof(
SubImage) +
234 sizeof(std::map<float, SDL_Surface*>)) +
void log(const char *const log_text,...)
int calcMemoryLocal() const
SubImage(Image *const parent, SDL_Surface *const image, const int x, const int y, const int width, const int height)
Image * getSubImage(const int x, const int y, const int width, const int height)