-/*
- * utility.cpp
- *
- * Created on: Oct 6, 2012
- * Author: holy
- */
-
#include "utility.h"
#include <cmath>
-using geometry::Vector;
+using math::Vector;
namespace sdl {
SDL_FillRect(dst, &destRect, color);
}
-void VerticalLine(SDL_Surface *dst, const geometry::Vector<int> &position, unsigned int length, Uint32 color) {
+void VerticalLine(SDL_Surface *dst, const math::Vector<int> &position, unsigned int length, Uint32 color) {
SDL_Rect destRect;
destRect.x = position.X();
destRect.y = position.Y();
destRect.w = dstrect->w;
destRect.h = 1;
SDL_FillRect(dst, &destRect, color);
- destRect.y += dstrect->h - 1;
+ destRect.x = dstrect->x;
+ destRect.y = dstrect->y + dstrect->h - 1;
+ destRect.w = dstrect->w;
+ destRect.h = 1;
SDL_FillRect(dst, &destRect, color);
+ destRect.x = dstrect->x;
destRect.y = dstrect->y;
destRect.w = 1;
destRect.h = dstrect->h;
SDL_FillRect(dst, &destRect, color);
- destRect.x += dstrect->w - 1;
+ destRect.x = dstrect->x + dstrect->w - 1;
+ destRect.y = dstrect->y;
+ destRect.w = 1;
+ destRect.h = dstrect->h;
SDL_FillRect(dst, &destRect, color);
}