4 * Created on: Aug 8, 2012
10 #include "../geometry/operators.h"
11 #include "../geometry/Vector.h"
15 using geometry::Point;
16 using geometry::Vector;
21 void Font::DrawDigit(int digit, SDL_Surface *dest, Point<int> position) const {
22 sprite->Draw(dest, position, digitsCol + digit, digitsRow);
25 void Font::DrawNumber(int numberIn, SDL_Surface *dest, Point<int> positionIn, int digits) const {
27 if (digits > 0 && numberIn >= pow(10.0, digits)) {
28 numberIn = pow(10.0, digits) - 1;
31 Point<int> position(positionIn);
32 Vector<int> step(sprite->Width(), 0);
36 while (number < pow(10.0, i)) {
49 DrawDigit((number / m) % 10, dest, position);