mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Merge branch '12.0' into metal
This commit is contained in:
@@ -465,8 +465,8 @@ bool Window::setWindow(int width, int height, WindowSettings *settings)
|
||||
if (!graphics.get())
|
||||
graphics.set(Module::getInstance<graphics::Graphics>(Module::M_GRAPHICS));
|
||||
|
||||
if (graphics.get() && graphics->isCanvasActive())
|
||||
throw love::Exception("love.window.setMode cannot be called while a Canvas is active in love.graphics.");
|
||||
if (graphics.get() && graphics->isRenderTargetActive())
|
||||
throw love::Exception("love.window.setMode cannot be called while a render target is active in love.graphics.");
|
||||
|
||||
auto renderer = graphics->getRenderer();
|
||||
|
||||
@@ -702,8 +702,8 @@ void Window::close(bool allowExceptions)
|
||||
{
|
||||
if (graphics.get())
|
||||
{
|
||||
if (allowExceptions && graphics->isCanvasActive())
|
||||
throw love::Exception("love.window.close cannot be called while a Canvas is active in love.graphics.");
|
||||
if (allowExceptions && graphics->isRenderTargetActive())
|
||||
throw love::Exception("love.window.close cannot be called while a render target is active in love.graphics.");
|
||||
|
||||
graphics->unSetMode();
|
||||
}
|
||||
@@ -740,8 +740,8 @@ bool Window::setFullscreen(bool fullscreen, Window::FullscreenType fstype)
|
||||
if (!window)
|
||||
return false;
|
||||
|
||||
if (graphics.get() && graphics->isCanvasActive())
|
||||
throw love::Exception("love.window.setFullscreen cannot be called while a Canvas is active in love.graphics.");
|
||||
if (graphics.get() && graphics->isRenderTargetActive())
|
||||
throw love::Exception("love.window.setFullscreen cannot be called while a render target is active in love.graphics.");
|
||||
|
||||
WindowSettings newsettings = settings;
|
||||
newsettings.fullscreen = fullscreen;
|
||||
@@ -979,7 +979,7 @@ bool Window::setIcon(love::image::ImageData *imgd)
|
||||
|
||||
int w = imgd->getWidth();
|
||||
int h = imgd->getHeight();
|
||||
int bytesperpixel = (int) getPixelFormatSize(imgd->getFormat());
|
||||
int bytesperpixel = (int) getPixelFormatBlockSize(imgd->getFormat());
|
||||
int pitch = w * bytesperpixel;
|
||||
|
||||
SDL_Surface *sdlicon = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user