Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent 0fe4faf commit 3a1a5ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
10 changes: 3 additions & 7 deletions doomsday/libs/gui/src/graphics/image.cpp
Expand Up @@ -524,22 +524,18 @@ const dbyte *Image::bits() const

dbyte *Image::bits()
{
// if (d->format == UseQImageFormat)
// {
// return d->image.bits();
// }
if (!d->pixels.isEmpty())
{
return d->pixels.data();
}
return reinterpret_cast<dbyte *>(d->refPixels.base());
}
}

const dbyte *Image::row(duint y) const
{
{
DE_ASSERT(y < height());
return bits() + stride() * y;
}
}

dbyte *Image::row(duint y)
{
Expand Down
4 changes: 2 additions & 2 deletions doomsday/libs/gui/src/text/sdlnativefont.cpp
Expand Up @@ -277,8 +277,8 @@ Image SdlNativeFont::nativeFontRasterize(const String & text,
SDL_Surface *rgba = SDL_ConvertSurfaceFormat(pal, SDL_PIXELFORMAT_RGBA32, 0);
SDL_FreeSurface(pal);
SDL_LockSurface(rgba);
const Block pixels(rgba->pixels, dsize(rgba->h * rgba->pitch));
const Image img{{duint(rgba->w), duint(rgba->h)}, Image::RGBA_8888, pixels};
const Image img{{duint(rgba->w), duint(rgba->h)}, Image::RGBA_8888,
Block(rgba->pixels, dsize(rgba->h * rgba->pitch))};
SDL_UnlockSurface(rgba);
SDL_FreeSurface(rgba);
const int comps[4] = {0, 0, 0, 0}; // red channel used for blending each component
Expand Down

0 comments on commit 3a1a5ad

Please sign in to comment.