mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user