More internal code cleanup

This commit is contained in:
Alex Szpakowski
2013-03-31 19:02:27 -03:00
parent eef4eed636
commit d5aa807747
19 changed files with 105 additions and 124 deletions
+2 -2
View File
@@ -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;
+5 -6
View File
@@ -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);
+2 -2
View File
@@ -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);