mirror of
https://github.com/love2d/love.git
synced 2026-08-19 20:19:42 +02:00
Small code style cleanup
--HG-- branch : minor
This commit is contained in:
@@ -65,7 +65,7 @@ bool File::open(Mode mode)
|
|||||||
throw love::Exception("Could not open file %s. Does not exist.", filename.c_str());
|
throw love::Exception("Could not open file %s. Does not exist.", filename.c_str());
|
||||||
|
|
||||||
// Check whether the write directory is set.
|
// Check whether the write directory is set.
|
||||||
if ((mode == MODE_APPEND || mode == MODE_WRITE) && (PHYSFS_getWriteDir() == 0) && !hack_setupWriteDirectory())
|
if ((mode == MODE_APPEND || mode == MODE_WRITE) && (PHYSFS_getWriteDir() == nullptr) && !hack_setupWriteDirectory())
|
||||||
throw love::Exception("Could not set write directory.");
|
throw love::Exception("Could not set write directory.");
|
||||||
|
|
||||||
// File already open?
|
// File already open?
|
||||||
|
|||||||
@@ -448,7 +448,7 @@ bool Window::setWindow(int width, int height, WindowSettings *settings)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
sdlflags |= SDL_WINDOW_FULLSCREEN;
|
sdlflags |= SDL_WINDOW_FULLSCREEN;
|
||||||
SDL_DisplayMode mode = {0, width, height, 0, 0};
|
SDL_DisplayMode mode = {0, width, height, 0, nullptr};
|
||||||
|
|
||||||
// Fullscreen window creation will bug out if no mode can be used.
|
// Fullscreen window creation will bug out if no mode can be used.
|
||||||
if (SDL_GetClosestDisplayMode(f.display, &mode, &mode) == nullptr)
|
if (SDL_GetClosestDisplayMode(f.display, &mode, &mode) == nullptr)
|
||||||
@@ -738,9 +738,7 @@ const char *Window::getDisplayName(int displayindex) const
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef Window::WindowSize WindowSize;
|
std::vector<Window::WindowSize> Window::getFullscreenSizes(int displayindex) const
|
||||||
|
|
||||||
std::vector<WindowSize> Window::getFullscreenSizes(int displayindex) const
|
|
||||||
{
|
{
|
||||||
std::vector<WindowSize> sizes;
|
std::vector<WindowSize> sizes;
|
||||||
|
|
||||||
@@ -866,7 +864,7 @@ bool Window::setIcon(love::image::ImageData *imgd)
|
|||||||
int h = imgd->getHeight();
|
int h = imgd->getHeight();
|
||||||
int pitch = imgd->getWidth() * 4;
|
int pitch = imgd->getWidth() * 4;
|
||||||
|
|
||||||
SDL_Surface *sdlicon = 0;
|
SDL_Surface *sdlicon = nullptr;
|
||||||
|
|
||||||
{
|
{
|
||||||
// We don't want another thread modifying the ImageData mid-copy.
|
// We don't want another thread modifying the ImageData mid-copy.
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace window
|
|||||||
namespace sdl
|
namespace sdl
|
||||||
{
|
{
|
||||||
|
|
||||||
class Window : public love::window::Window
|
class Window final : public love::window::Window
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user