| 1 | // (_||_/ |
| 2 | // ( ) Utils functions |
| 3 | // ( o 0 ) |
| 4 | //-OOO°--(_)---°OOO--------------------------------------- |
| 5 | // Copyright (C) 2006 By Dominique Roux-Serret |
| 6 | // .OOOo oOOO. [email protected] |
| 7 | //-( )------( )--------------------------------------- |
| 8 | // ( ( ) / Copyright (C) 2023 By Johnny Jazeix |
| 9 | // (_) (_/ [email protected] |
| 10 | |
| 11 | // This program is free software; you can redistribute it and/or modify |
| 12 | // it under the terms of the GNU General Public License as published by |
| 13 | // the Free Software Foundation; either version 2 or version 3 of the License. |
| 14 | |
| 15 | // This program is distributed in the hope that it will be useful, |
| 16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | // GNU General Public License for more details. |
| 19 | |
| 20 | // You should have received a copy of the GNU General Public License along |
| 21 | // with this program; if not, write to the Free Software Foundation, Inc., |
| 22 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 23 | |
| 24 | #ifndef UTILS_DOM_ |
| 25 | #define UTILS_DOM_ |
| 26 | |
| 27 | #include <SDL2/SDL_render.h> |
| 28 | |
| 29 | class Utils |
| 30 | { |
| 31 | public: |
| 32 | static bool FileExists(const char *Path); // Check if the file exists |
| 33 | static long LoadFile(const char *Path, unsigned char *&Buf); // Load a file in memory |
| 34 | static bool SaveFile(const char *Path, char *Buf, long L); // Save a file |
| 35 | |
| 36 | static void GetPath(char *Path); // Add the path to the filename depending on the OS (sprites, levels) |
| 37 | |
| 38 | static bool LoadPref(); // Load preferences |
| 39 | static void SauvePref(); // Save preferences |
| 40 | |
| 41 | static void doScreenshot(SDL_Renderer *renderer); |
| 42 | }; |
| 43 | |
| 44 | #endif |