Added the ability to use custom mipmaps in Images, via love.graphics.newImage(filename, {mipmap1, mipmap2, ...}). Resolves issue #1064.

All mipmap levels must be present if custom mipmaps are used (and their sizes must be half the size of the previous mipmap level, rounded down.)

Image:getData now returns all custom mipmaps in an Image.
This commit is contained in:
Alex Szpakowski
2015-07-30 20:48:36 -03:00
parent 6bce7c7cd0
commit 66942d5f31
14 changed files with 247 additions and 129 deletions
+3 -3
View File
@@ -194,7 +194,7 @@ void Graphics::checkSetDefaultFont()
// Create a new default font if we don't have one yet.
if (!defaultFont.get())
{
font::Font *fontmodule = Module::getInstance<font::Font>(M_FONT);
auto fontmodule = Module::getInstance<font::Font>(M_FONT);
if (!fontmodule)
throw love::Exception("Font module has not been loaded.");
@@ -664,12 +664,12 @@ void Graphics::clearStencil()
glClear(GL_STENCIL_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
Image *Graphics::newImage(love::image::ImageData *data, const Image::Flags &flags)
Image *Graphics::newImage(const std::vector<love::image::ImageData *> &data, const Image::Flags &flags)
{
return new Image(data, flags);
}
Image *Graphics::newImage(love::image::CompressedImageData *cdata, const Image::Flags &flags)
Image *Graphics::newImage(const std::vector<love::image::CompressedImageData *> &cdata, const Image::Flags &flags)
{
return new Image(cdata, flags);
}