mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +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:
@@ -36,7 +36,7 @@ namespace sdl
|
||||
// we want them in pixel coordinates (may be different with high-DPI enabled.)
|
||||
static void windowToPixelCoords(double *x, double *y)
|
||||
{
|
||||
window::Window *window = Module::getInstance<window::Window>(Module::M_WINDOW);
|
||||
auto window = Module::getInstance<window::Window>(Module::M_WINDOW);
|
||||
if (window)
|
||||
window->windowToPixelCoords(x, y);
|
||||
}
|
||||
@@ -44,7 +44,7 @@ static void windowToPixelCoords(double *x, double *y)
|
||||
// And vice versa for setting mouse coordinates.
|
||||
static void pixelToWindowCoords(double *x, double *y)
|
||||
{
|
||||
window::Window *window = Module::getInstance<window::Window>(Module::M_WINDOW);
|
||||
auto window = Module::getInstance<window::Window>(Module::M_WINDOW);
|
||||
if (window)
|
||||
window->pixelToWindowCoords(x, y);
|
||||
}
|
||||
@@ -146,7 +146,7 @@ void Mouse::getPosition(double &x, double &y) const
|
||||
|
||||
void Mouse::setPosition(double x, double y)
|
||||
{
|
||||
window::Window *window = Module::getInstance<window::Window>(Module::M_WINDOW);
|
||||
auto window = Module::getInstance<window::Window>(Module::M_WINDOW);
|
||||
|
||||
SDL_Window *handle = nullptr;
|
||||
if (window)
|
||||
@@ -211,14 +211,14 @@ bool Mouse::isVisible() const
|
||||
|
||||
void Mouse::setGrabbed(bool grab)
|
||||
{
|
||||
window::Window *window = Module::getInstance<window::Window>(Module::M_WINDOW);
|
||||
auto window = Module::getInstance<window::Window>(Module::M_WINDOW);
|
||||
if (window)
|
||||
window->setMouseGrab(grab);
|
||||
}
|
||||
|
||||
bool Mouse::isGrabbed() const
|
||||
{
|
||||
window::Window *window = Module::getInstance<window::Window>(Module::M_WINDOW);
|
||||
auto window = Module::getInstance<window::Window>(Module::M_WINDOW);
|
||||
if (window)
|
||||
return window->isMouseGrabbed();
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user