commit 9f4f860a
Merge branch 'sago-lint'
Changed files
diff --git a/source/code/BlockGame.hpp b/source/code/BlockGame.hpp
index 2c233e4..cc7932e 100644
--- a/source/code/BlockGame.hpp
+++ b/source/code/BlockGame.hpp
@@ -258,8 +258,8 @@ public:
int GetCursorY() const;
void GetMouseCursor(bool& pressed, int& x, int&y) const;
bool GetIsWinner() const;
- bool isSinglePuzzle() const;
- int getLevel() const;
+ bool isSinglePuzzle() const;
+ int getLevel() const;
bool GetAIenabled() const;
bool IsNearDeath() const;
const BlockGameInfo& GetBlockGameInfo() {
diff --git a/source/code/DialogBox.hpp b/source/code/DialogBox.hpp
index a3a00f1..7f838b6 100644
--- a/source/code/DialogBox.hpp
+++ b/source/code/DialogBox.hpp
@@ -40,9 +40,9 @@ public:
bool IsActive() override;
void Draw(SDL_Renderer* target) override;
void ProcessInput(const SDL_Event& event, bool &processed) override;
- void SetName(const std::string& name);
- std::string GetName() const;
- bool IsUpdated() const;
+ void SetName(const std::string& name);
+ std::string GetName() const;
+ bool IsUpdated() const;
private:
bool isActive = true;
std::shared_ptr<ReadKeyboard> rk;
diff --git a/source/code/MenuSystem.cpp b/source/code/MenuSystem.cpp
index e515e6b..fae99e2 100644
--- a/source/code/MenuSystem.cpp
+++ b/source/code/MenuSystem.cpp
@@ -303,13 +303,6 @@ void Menu::Draw(SDL_Renderer* target) {
drawSelf(target);
}
void Menu::ProcessInput(const SDL_Event& event, bool &processed) {
- UpdateMouseCoordinates(event, globalData.mousex, globalData.mousey);
- if ( event.type == SDL_QUIT ) {
- Config::getInstance()->setShuttingDown(5);
- running = false;
- processed = true;
- }
-
if (isUpEvent(event)) {
marked--;
if (marked<0) {
diff --git a/source/code/main.cpp b/source/code/main.cpp
index 40db252..edc0cab 100644
--- a/source/code/main.cpp
+++ b/source/code/main.cpp
@@ -299,7 +299,7 @@ void UpdateMouseCoordinates(const SDL_Event& event, int& mousex, int& mousey) {
break;
default:
break;
- }
+ }
}
//The small things that are faaling when you clear something
diff --git a/source/code/replayhandler.cpp b/source/code/replayhandler.cpp
index 6ebcdf1..657e7f2 100644
--- a/source/code/replayhandler.cpp
+++ b/source/code/replayhandler.cpp
@@ -28,7 +28,7 @@ http://www.blockattack.net
static std::tm GetLocalTime() {
std::time_t t = std::time(nullptr);
- std::tm ret = *std::localtime(&t);
+ std::tm ret = *std::localtime(&t);
return ret;
}
diff --git a/source/code/sago/GameStateInterface.hpp b/source/code/sago/GameStateInterface.hpp
index 646e6ff..43b528b 100644
--- a/source/code/sago/GameStateInterface.hpp
+++ b/source/code/sago/GameStateInterface.hpp
@@ -1,15 +1,26 @@
/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-
-/*
- * File: GameStateInterface.hpp
- * Author: poul
- *
- * Created on 7. februar 2016, 17:26
- */
+Copyright (c) 2016 Poul Sander
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation files
+(the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
#ifndef GAMESTATEINTERFACE_HPP
#define GAMESTATEINTERFACE_HPP
diff --git a/source/code/sago/SagoDataHolder.cpp b/source/code/sago/SagoDataHolder.cpp
index 3db057f..97b8bdf 100644
--- a/source/code/sago/SagoDataHolder.cpp
+++ b/source/code/sago/SagoDataHolder.cpp
@@ -1,25 +1,25 @@
/*
- Copyright (c) 2015 Poul Sander
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation files
- (the "Software"), to deal in the Software without restriction,
- including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software,
- and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
+Copyright (c) 2015 Poul Sander
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation files
+(the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
*/
#include "SagoDataHolder.hpp"
diff --git a/source/code/sago/SagoDataHolder.hpp b/source/code/sago/SagoDataHolder.hpp
index 8dcd84a..f1cadff 100644
--- a/source/code/sago/SagoDataHolder.hpp
+++ b/source/code/sago/SagoDataHolder.hpp
@@ -1,25 +1,25 @@
/*
- Copyright (c) 2015 Poul Sander
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation files
- (the "Software"), to deal in the Software without restriction,
- including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software,
- and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
+Copyright (c) 2015 Poul Sander
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation files
+(the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
*/
#include "SDL.h"
@@ -39,9 +39,9 @@ public:
SagoDataHolder(SDL_Renderer* renderer);
/**
* Return a pointer to the given texture. The pointer is valid for the lifetime of SagoDataHolder object it was taken from.
- * @param textureName Name of the texture
- * @return Pointer to the loaded texture
- */
+ * @param textureName Name of the texture
+ * @return Pointer to the loaded texture
+ */
SDL_Texture* getTexturePtr(const std::string &textureName) const;
TTF_Font* getFontPtr(const std::string &fontName, int ptsize) const;
Mix_Music* getMusicPtr(const std::string &musicName) const;
@@ -50,7 +50,7 @@ public:
virtual ~SagoDataHolder();
private:
SagoDataHolder(const SagoDataHolder& base) = delete;
- SagoDataHolder& operator=(const SagoDataHolder& base) = delete;
+ SagoDataHolder& operator=(const SagoDataHolder& base) = delete;
struct SagoDataHolderData;
mutable SagoDataHolderData *data;
};
diff --git a/source/code/sago/SagoMisc.cpp b/source/code/sago/SagoMisc.cpp
index e0f2c0b..da58bd8 100644
--- a/source/code/sago/SagoMisc.cpp
+++ b/source/code/sago/SagoMisc.cpp
@@ -1,25 +1,25 @@
/*
- Copyright (c) 2015 Poul Sander
+Copyright (c) 2015 Poul Sander
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation files
- (the "Software"), to deal in the Software without restriction,
- including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software,
- and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation files
+(the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
*/
#include "SagoMisc.hpp"
diff --git a/source/code/sago/SagoMisc.hpp b/source/code/sago/SagoMisc.hpp
index ec9b11b..1904237 100644
--- a/source/code/sago/SagoMisc.hpp
+++ b/source/code/sago/SagoMisc.hpp
@@ -1,25 +1,25 @@
/*
- Copyright (c) 2015 Poul Sander
+Copyright (c) 2015 Poul Sander
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation files
- (the "Software"), to deal in the Software without restriction,
- including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software,
- and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation files
+(the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
*/
#ifndef SAGOMISC_HPP
@@ -33,17 +33,17 @@ namespace sago {
/**
* Returns a vector with all filenames in a given directory.
* PHYSFS must be setup before hand. The directory is relative to the PHYSFS base
- * @param dir The directory to list
- * @return A vector with the filenames in the given directory. If empty the directory was empty or did not exist
- */
+ * @param dir The directory to list
+ * @return A vector with the filenames in the given directory. If empty the directory was empty or did not exist
+ */
std::vector<std::string> GetFileList(const char* dir);
/**
* Reads an entire file into memory.
* PHYSFS must be setup before hand
- * @param filename The file to read
- * @return The content of the file. If empty either the file was empty, did not exist or could not be opened
- */
+ * @param filename The file to read
+ * @return The content of the file. If empty either the file was empty, did not exist or could not be opened
+ */
std::string GetFileContent(const char* filename);
bool FileExists(const char* filename);
diff --git a/source/code/sago/SagoMiscSdl2.cpp b/source/code/sago/SagoMiscSdl2.cpp
index 3db095b..8a3d294 100644
--- a/source/code/sago/SagoMiscSdl2.cpp
+++ b/source/code/sago/SagoMiscSdl2.cpp
@@ -1,25 +1,25 @@
/*
- Copyright (c) 2016 Poul Sander
+Copyright (c) 2016 Poul Sander
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation files
- (the "Software"), to deal in the Software without restriction,
- including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software,
- and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation files
+(the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
*/
#include "SagoMiscSdl2.hpp"
@@ -27,19 +27,19 @@
void sago::SagoFatalError(const char* errorMsg) {
const SDL_MessageBoxButtonData buttons[] = {
- { SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, 0, "Ok" },
- };
+ { SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, 0, "Ok" },
+ };
const SDL_MessageBoxData messageboxdata = {
- SDL_MESSAGEBOX_INFORMATION, /* .flags */
- nullptr, /* .window */
- "Fatal error", /* .title */
- errorMsg, /* .message */
- SDL_arraysize(buttons), /* .numbuttons */
- buttons, /* .buttons */
- nullptr /* .colorScheme */
- };
+ SDL_MESSAGEBOX_INFORMATION, /* .flags */
+ nullptr, /* .window */
+ "Fatal error", /* .title */
+ errorMsg, /* .message */
+ SDL_arraysize(buttons), /* .numbuttons */
+ buttons, /* .buttons */
+ nullptr /* .colorScheme */
+ };
int buttonid;
- SDL_ShowMessageBox(&messageboxdata, &buttonid);
+ SDL_ShowMessageBox(&messageboxdata, &buttonid);
abort();
}
diff --git a/source/code/sago/SagoMiscSdl2.hpp b/source/code/sago/SagoMiscSdl2.hpp
index 667cdac..1bc115b 100644
--- a/source/code/sago/SagoMiscSdl2.hpp
+++ b/source/code/sago/SagoMiscSdl2.hpp
@@ -1,25 +1,25 @@
/*
- Copyright (c) 2016 Poul Sander
+Copyright (c) 2016 Poul Sander
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation files
- (the "Software"), to deal in the Software without restriction,
- including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software,
- and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation files
+(the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
*/
#ifndef SAGOMISCSDL2_HPP
diff --git a/source/code/sago/SagoSprite.cpp b/source/code/sago/SagoSprite.cpp
index 39d0ef0..2068196 100644
--- a/source/code/sago/SagoSprite.cpp
+++ b/source/code/sago/SagoSprite.cpp
@@ -1,25 +1,25 @@
/*
- Copyright (c) 2015 Poul Sander
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation files
- (the "Software"), to deal in the Software without restriction,
- including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software,
- and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
+Copyright (c) 2015 Poul Sander
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation files
+(the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
*/
#include "SagoSprite.hpp"
diff --git a/source/code/sago/SagoSprite.hpp b/source/code/sago/SagoSprite.hpp
index 83d8646..6a19c3f 100644
--- a/source/code/sago/SagoSprite.hpp
+++ b/source/code/sago/SagoSprite.hpp
@@ -1,25 +1,25 @@
/*
- Copyright (c) 2015 Poul Sander
+Copyright (c) 2015 Poul Sander
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation files
- (the "Software"), to deal in the Software without restriction,
- including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software,
- and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation files
+(the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
*/
#ifndef SAGOSPRITE_HPP
@@ -35,20 +35,20 @@ public:
SagoSprite(const SagoDataHolder &texHolder, const std::string &texture,const SDL_Rect& initImage,const int animationFrames, const int animationFrameLength);
/**
* Draws the sprite to a given render window
- * @param target The render window to draw on
- * @param frameTime The time in milliseonds since gamestart. Used to determen the place in the animation
- * @param x Place to draw the sprite
- * @param y Place to draw the sprite
- */
+ * @param target The render window to draw on
+ * @param frameTime The time in milliseonds since gamestart. Used to determen the place in the animation
+ * @param x Place to draw the sprite
+ * @param y Place to draw the sprite
+ */
void Draw(SDL_Renderer* target, Sint32 frameTime, int x, int y) const;
/**
* Draws part of the sprite to a given render window
- * @param target The render window to draw on
- * @param frameTime The time in milliseonds since gamestart. Used to determen the place in the animation
- * @param x Place to draw the sprite
- * @param y Place to draw the sprite
- * @param part the part of the sprite that should be drawn.
- */
+ * @param target The render window to draw on
+ * @param frameTime The time in milliseonds since gamestart. Used to determen the place in the animation
+ * @param x Place to draw the sprite
+ * @param y Place to draw the sprite
+ * @param part the part of the sprite that should be drawn.
+ */
void Draw(SDL_Renderer* target, Sint32 frameTime, int x, int y, const SDL_Rect& part) const;
/**
* Draws the wprite to the given renderer but makes sure to not draw outside th bounds given
@@ -62,11 +62,11 @@ public:
void DrawScaled(SDL_Renderer* target, Sint32 frameTime, int x, int y, int w, int h) const;
/**
* Set a different origin. Normally it is the top left cornor. But in some cases you might want to center the origin or tranform it for other reasons
- * @param newOrigin the coordinates that should be the new origin. Call with {0,0} to reset to default
- */
+ * @param newOrigin the coordinates that should be the new origin. Call with {0,0} to reset to default
+ */
void SetOrigin(const SDL_Rect& newOrigin);
SagoSprite(const SagoSprite& base);
- SagoSprite& operator=(const SagoSprite& base);
+ SagoSprite& operator=(const SagoSprite& base);
int GetWidth() const;
int GetHeight() const;
virtual ~SagoSprite();
diff --git a/source/code/sago/SagoSpriteHolder.cpp b/source/code/sago/SagoSpriteHolder.cpp
index 0773f44..4d40101 100644
--- a/source/code/sago/SagoSpriteHolder.cpp
+++ b/source/code/sago/SagoSpriteHolder.cpp
@@ -1,25 +1,25 @@
/*
- Copyright (c) 2015 Poul Sander
+Copyright (c) 2015 Poul Sander
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation files
- (the "Software"), to deal in the Software without restriction,
- including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software,
- and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation files
+(the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
*/
#include "SagoSpriteHolder.hpp"
diff --git a/source/code/sago/SagoSpriteHolder.hpp b/source/code/sago/SagoSpriteHolder.hpp
index b3c32f9..2e88528 100644
--- a/source/code/sago/SagoSpriteHolder.hpp
+++ b/source/code/sago/SagoSpriteHolder.hpp
@@ -1,25 +1,25 @@
/*
- Copyright (c) 2015 Poul Sander
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation files
- (the "Software"), to deal in the Software without restriction,
- including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software,
- and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
+Copyright (c) 2015 Poul Sander
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation files
+(the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
*/
#ifndef SAGOSPRITEHOLDER_HPP
@@ -39,7 +39,7 @@ public:
const SagoDataHolder& GetDataHolder() const;
private:
SagoSpriteHolder(const SagoSpriteHolder& base) = delete;
- SagoSpriteHolder& operator=(const SagoSpriteHolder& base) = delete;
+ SagoSpriteHolder& operator=(const SagoSpriteHolder& base) = delete;
void ReadSpriteFile(const std::string &filename);
struct SagoSpriteHolderData;
SagoSpriteHolderData *data;
diff --git a/source/code/sago/platform_folders.cpp b/source/code/sago/platform_folders.cpp
index 3fca858..34513bf 100644
--- a/source/code/sago/platform_folders.cpp
+++ b/source/code/sago/platform_folders.cpp
@@ -1,29 +1,29 @@
/*
- Its is under the MIT license, to encourage reuse by cut-and-paste.
-
- The original files are hosted here: https://github.com/sago007/PlatformFolders
-
- Copyright (c) 2015-2016 Poul Sander
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation files
- (the "Software"), to deal in the Software without restriction,
- including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software,
- and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
+Its is under the MIT license, to encourage reuse by cut-and-paste.
+
+The original files are hosted here: https://github.com/sago007/PlatformFolders
+
+Copyright (c) 2015-2016 Poul Sander
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation files
+(the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
*/
#include "platform_folders.h"
@@ -85,12 +85,12 @@ static std::string GetAppDataLocal() {
static std::string GetMacFolder(OSType folderType, const char* errorMsg) {
std::string ret;
FSRef ref;
- char path[PATH_MAX];
- OSStatus err = FSFindFolder( kUserDomain, folderType, kCreateFolder, &ref );
+ char path[PATH_MAX];
+ OSStatus err = FSFindFolder( kUserDomain, folderType, kCreateFolder, &ref );
if (err != noErr) {
throw std::runtime_error(errorMsg);
}
- FSRefMakePath( &ref, (UInt8*)&path, PATH_MAX );
+ FSRefMakePath( &ref, (UInt8*)&path, PATH_MAX );
ret = path;
return ret;
}
diff --git a/source/code/sago/platform_folders.h b/source/code/sago/platform_folders.h
index 4c85283..0e3ef4a 100644
--- a/source/code/sago/platform_folders.h
+++ b/source/code/sago/platform_folders.h
@@ -1,29 +1,29 @@
/*
- Its is under the MIT license, to encourage reuse by cut-and-paste.
+Its is under the MIT license, to encourage reuse by cut-and-paste.
- The original files are hosted here: https://github.com/sago007/PlatformFolders
-
- Copyright (c) 2015 Poul Sander
+The original files are hosted here: https://github.com/sago007/PlatformFolders
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation files
- (the "Software"), to deal in the Software without restriction,
- including without limitation the rights to use, copy, modify, merge,
- publish, distribute, sublicense, and/or sell copies of the Software,
- and to permit persons to whom the Software is furnished to do so,
- subject to the following conditions:
+Copyright (c) 2015 Poul Sander
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation files
+(the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
*/
#ifndef SAGO_PLATFORM_FOLDERS_H
diff --git a/source/misc/lint/runLint.sh b/source/misc/lint/runLint.sh
new file mode 100644
index 0000000..5e49ccf
--- /dev/null
+++ b/source/misc/lint/runLint.sh
@@ -0,0 +1,20 @@
+#! /bin/bash
+set -euo pipefail
+
+TMPFILE=$(mktemp /tmp/sago-lint.XXXXXX)
+
+find ./source/code/ -name "*.cpp" -not -path "./source/code/Libs/*" | xargs --no-run-if-empty grep --with-filename --line-number "^ " >> ${TMPFILE} || true
+find ./source/code/ -name "*.h*" -not -path "./source/code/Libs/*" | xargs --no-run-if-empty grep --with-filename --line-number "^ " >> ${TMPFILE} || true
+
+if [ -s "$TMPFILE" ]
+then
+echo "In the following places the lines are indended with spaces. This project uses tabs for indentation."
+echo "The rule applies to comments too although the check can be bypassed by using either C++ style comments or \" *\" to start a line (Doxygen comments)"
+cat "$TMPFILE"
+echo ""
+echo "Validation failed"
+rm "$TMPFILE"
+exit 1
+fi
+
+rm "$TMPFILE"
diff --git a/travis_build.script b/travis_build.script
index bab9ebe..37d83d4 100755
--- a/travis_build.script
+++ b/travis_build.script
@@ -1,5 +1,9 @@
#! /bin/bash
set -e
+
+# First check for formatting errors
+bash source/misc/lint/runLint.sh
+
# Travis runs Ubuntu 12.04 and misses libutfcpp-dev.
cp source/misc/travis_help/utf8_v2_3_4/source/utf8.h source/code/
cp -r source/misc/travis_help/utf8_v2_3_4/source/utf8 source/code/