Пример #1
0
SDL_Rect find_map_rect(Idevice& input, Viewpoint& camera)
{
    SDL_Rect tilerect;
    int tilex, tiley;
    tilex = (input.get_x() + camera.get_x()) / TILEW;
    tiley = (input.get_y() + camera.get_y()) / TILEH;
    tilerect.x = tilex * TILEW; tilerect.y = tiley * TILEH;
    tilerect.w = TILEW; tilerect.h = TILEH;
    return tilerect;
}
Пример #2
0
int tile_x(Idevice& input, Viewpoint& camera)
{
    int tilex = (input.get_x() + camera.get_x()) / TILEW;
    return tilex;
}