| 1 | /* ************************************************************************* * |
| 2 | SDL-Ball - DX-Ball/Breakout remake with openGL and SDL for Linux |
| 3 | Copyright (C) 2008 Jimmy Christensen ( dusted at dusted dot dk ) |
| 4 | |
| 5 | This program is free software: you can redistribute it and/or modify |
| 6 | it under the terms of the GNU General Public License as published by |
| 7 | the Free Software Foundation, either version 3 of the License, or |
| 8 | (at your option) any later version. |
| 9 | |
| 10 | This program is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | GNU General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU General Public License |
| 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | * ************************************************************************* */ |
| 18 | // #include <list> |
| 19 | |
| 20 | |
| 21 | class glScoreBoardcxx . . $ glScoreBoard# |
| 22 | { |
| 23 | private: |
| 24 | unsigned int lastScoreTickcxx . . $ glScoreBoard#lastScoreTick.; |
| 25 | uintcxx . . $ uint# tempScorecxx . . $ glScoreBoard#tempScore.; |
| 26 | uintcxx . . $ uint# scorecxx . . $ glScoreBoard#score.; |
| 27 | char tempTextcxx . . $ glScoreBoard#tempText.[255]; |
| 28 | |
| 29 | public: |
| 30 | |
| 31 | glScoreBoardcxx . . $ glScoreBoard#glScoreBoard(49f6e7a06ebc5aa8).() |
| 32 | { |
| 33 | initcxx . . $ glScoreBoard#init(49f6e7a06ebc5aa8).(); |
| 34 | } |
| 35 | |
| 36 | void initcxx . . $ glScoreBoard#init(49f6e7a06ebc5aa8).() |
| 37 | { |
| 38 | tempScorecxx . . $ glScoreBoard#tempScore.=1; |
| 39 | scorecxx . . $ glScoreBoard#score.=0; |
| 40 | lastScoreTickcxx . . $ glScoreBoard#lastScoreTick. = SDL_GetTicks(); |
| 41 | } |
| 42 | |
| 43 | void updatecxx . . $ glScoreBoard#update(d4f767463ce0a6b3).(int point) |
| 44 | { |
| 45 | scorecxx . . $ glScoreBoard#score.=point; |
| 46 | } |
| 47 | |
| 48 | void drawcxx . . $ glScoreBoard#draw(49f6e7a06ebc5aa8).() |
| 49 | { |
| 50 | int dif=scorecxx . . $ glScoreBoard#score. - tempScorecxx . . $ glScoreBoard#tempScore.; |
| 51 | |
| 52 | if(tempScorecxx . . $ glScoreBoard#tempScore. != scorecxx . . $ glScoreBoard#score. ) |
| 53 | { |
| 54 | if(lastScoreTickcxx . . $ glScoreBoard#lastScoreTick. + 50 < SDL_GetTicks()) |
| 55 | { |
| 56 | tempScorecxx . . $ glScoreBoard#tempScore.+= (float)dif/7.0 +1; ; |
| 57 | if(tempScorecxx . . $ glScoreBoard#tempScore. > scorecxx . . $ glScoreBoard#score.) |
| 58 | tempScorecxx . . $ glScoreBoard#tempScore.=scorecxx . . $ glScoreBoard#score.; |
| 59 | lastScoreTickcxx . . $ glScoreBoard#lastScoreTick. = SDL_GetTicks(); |
| 60 | |
| 61 | sprintf(tempTextcxx . . $ glScoreBoard#tempText., "%i", tempScorecxx . . $ glScoreBoard#tempScore.); |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | glLoadIdentity(); |
| 66 | glTranslatef(-1.55, 1.24-(glTextcxx . . $ glText.->getHeightcxx . . $ glTextClass#getHeight(5cde91ea12d43f46).(FONT_HIGHSCOREcxx . . $ `text.cpp:22:9`!)/2.0), -3.0); |
| 67 | |
| 68 | glColor4f(1.0,1.0,1.0,1.0); |
| 69 | glTextcxx . . $ glText.->writecxx . . $ glTextClass#write(e3805d4e487d2eea).(tempTextcxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d)., FONT_HIGHSCOREcxx . . $ `text.cpp:22:9`!, 0, 1.0, 0.0, 0.0); |
| 70 | |
| 71 | } |
| 72 | }; |
| 73 |