| 1 | // (_||_/ |
| 2 | // ( ) Screen class |
| 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 SCREEN_DOM_ |
| 25 | #define SCREEN_DOM_ |
| 26 | |
| 27 | #include "sprite.h" |
| 28 | #include "preference.h" |
| 29 | |
| 30 | /*** Définitions générales ***/ |
| 31 | /*****************************/ |
| 32 | struct s_Screen |
| 33 | { |
| 34 | e_Sprite NumSpr; |
| 35 | int Num; |
| 36 | int x, y; |
| 37 | int fx, fy; |
| 38 | }; |
| 39 | |
| 40 | /*** Definitions de la class Ecran ***/ |
| 41 | /*************************************/ |
| 42 | class Screen |
| 43 | { |
| 44 | public: |
| 45 | Screen() = default; |
| 46 | ~Screen() = default; |
| 47 | |
| 48 | /*** Fonctions ***/ |
| 49 | void PrintSprite(e_Sprite NumSpr, int Num, int x, int y); // Affiche un sprite |
| 50 | void PrintCable(int dx, int dy, int fx, int fy); // Affiche un cable |
| 51 | void PrintText(e_Sprite Text, int x, int y); // Affiche un text à l'ecran |
| 52 | void PrintOptions(int NVies, int NScore); // Affiche les options sur le coté |
| 53 | void ClearSprite(e_Sprite NumSpriteFondEcran); // Efface tous ce qui a été affiché |
| 54 | void CleanSpriteAndScreen(e_Sprite NumSpriteFondEcran); // Efface l'ecran avec l'image de fond |
| 55 | |
| 56 | private: |
| 57 | /*** Variables ***/ |
| 58 | int N { 0 }; // Nombre de sprites mémorisés aprés l'affichage |
| 59 | int Score { -1 }; // Mémorise le score affiché |
| 60 | s_Screen B[LT * HT * 2]; // N° des sprites à effacer plus tard |
| 61 | }; |
| 62 | |
| 63 | #endif |