mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
More internal code cleanup
This commit is contained in:
@@ -59,14 +59,14 @@ public:
|
||||
virtual void getWindow(int &width, int &height, WindowFlags &flags) const = 0;
|
||||
|
||||
virtual bool checkWindowSize(int width, int height, bool fullscreen) const = 0;
|
||||
virtual WindowSize **getFullscreenSizes(int &n) const = 0;
|
||||
virtual WindowSize *getFullscreenSizes(int &n) const = 0;
|
||||
|
||||
virtual int getWidth() const = 0;
|
||||
virtual int getHeight() const = 0;
|
||||
|
||||
virtual bool isCreated() const = 0;
|
||||
|
||||
virtual void setWindowTitle(std::string &title) = 0;
|
||||
virtual void setWindowTitle(const std::string &title) = 0;
|
||||
virtual std::string getWindowTitle() const = 0;
|
||||
|
||||
virtual bool setIcon(love::image::ImageData *imgd) = 0;
|
||||
|
||||
@@ -211,7 +211,7 @@ bool Window::checkWindowSize(int width, int height, bool fullscreen) const
|
||||
|
||||
typedef Window::WindowSize WindowSize;
|
||||
|
||||
WindowSize **Window::getFullscreenSizes(int &n) const
|
||||
WindowSize *Window::getFullscreenSizes(int &n) const
|
||||
{
|
||||
SDL_Rect **modes = SDL_ListModes(0, SDL_OPENGL | SDL_FULLSCREEN);
|
||||
|
||||
@@ -225,13 +225,12 @@ WindowSize **Window::getFullscreenSizes(int &n) const
|
||||
for (int i = 0; modes[i]; i++)
|
||||
n++;
|
||||
|
||||
WindowSize **sizes = new WindowSize*[n];
|
||||
WindowSize *sizes = new WindowSize[n];
|
||||
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
sizes[i] = new WindowSize;
|
||||
sizes[i]->width = modes[i]->w;
|
||||
sizes[i]->height = modes[i]->h;
|
||||
WindowSize w = {modes[i]->w, modes[i]->h};
|
||||
sizes[i] = w;
|
||||
}
|
||||
return sizes;
|
||||
}
|
||||
@@ -251,7 +250,7 @@ bool Window::isCreated() const
|
||||
return created;
|
||||
}
|
||||
|
||||
void Window::setWindowTitle(std::string &title)
|
||||
void Window::setWindowTitle(const std::string &title)
|
||||
{
|
||||
windowTitle = title;
|
||||
SDL_WM_SetCaption(windowTitle.c_str(), 0);
|
||||
|
||||
@@ -41,14 +41,14 @@ public:
|
||||
void getWindow(int &width, int &height, WindowFlags &flags) const;
|
||||
|
||||
bool checkWindowSize(int width, int height, bool fullscreen) const;
|
||||
WindowSize **getFullscreenSizes(int &n) const;
|
||||
WindowSize *getFullscreenSizes(int &n) const;
|
||||
|
||||
int getWidth() const;
|
||||
int getHeight() const;
|
||||
|
||||
bool isCreated() const;
|
||||
|
||||
void setWindowTitle(std::string &title);
|
||||
void setWindowTitle(const std::string &title);
|
||||
std::string getWindowTitle() const;
|
||||
|
||||
bool setIcon(love::image::ImageData *imgd);
|
||||
|
||||
Reference in New Issue
Block a user