OpenGTA/util/map_helper.cpp
Anonymous Maarten e20673c2cd 2007-04-16
2015-12-03 01:37:37 +01:00

15 lines
477 B
C++

#include "map_helper.h"
#include "log.h"
namespace Util {
void SpriteCreationArea::setRects(const SDL_Rect & allowed, const SDL_Rect & denied) {
validRects = std::make_pair<SDL_Rect, SDL_Rect>(allowed, denied);
}
TupleOfUint8 SpriteCreationArea::getValidCoord() {
uint32_t x = rnd.nextUint(validRects.first.w) + validRects.first.x;
uint32_t y = rnd.nextUint(validRects.first.h) + validRects.first.y;
return std::make_pair<uint8_t, uint8_t>(x, y);
}
}