forked from cataclysmbnteam/Cataclysm-BN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pixel_minimap_projectors.h
56 lines (43 loc) · 1.78 KB
/
pixel_minimap_projectors.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once
#ifndef CATA_SRC_PIXEL_MINIMAP_PROJECTORS_H
#define CATA_SRC_PIXEL_MINIMAP_PROJECTORS_H
#include "point.h"
#include "sdl_wrappers.h"
class pixel_minimap_projector
{
public:
pixel_minimap_projector() = default;
virtual ~pixel_minimap_projector() = default;
virtual point get_tile_size() const = 0;
virtual point get_tiles_size( point tiles_count ) const = 0;
virtual point get_tile_pos( point p, point tiles_count ) const = 0;
virtual SDL_Rect get_chunk_rect( point p, point tiles_count ) const = 0;
};
class pixel_minimap_ortho_projector : public pixel_minimap_projector
{
public:
pixel_minimap_ortho_projector( point total_tiles_count,
const SDL_Rect &max_screen_rect,
bool square_pixels );
point get_tile_size() const override;
point get_tiles_size( point tiles_count ) const override;
point get_tile_pos( point p, point tiles_count ) const override;
SDL_Rect get_chunk_rect( point p, point tiles_count ) const override;
private:
point tile_size;
};
class pixel_minimap_iso_projector : public pixel_minimap_projector
{
public:
pixel_minimap_iso_projector( point total_tiles_count,
const SDL_Rect &max_screen_rect,
bool square_pixels );
point get_tile_size() const override;
point get_tiles_size( point tiles_count ) const override;
point get_tile_pos( point p, point tiles_count ) const override;
SDL_Rect get_chunk_rect( point p, point tiles_count ) const override;
private:
point total_tiles_count;
point tile_size;
};
#endif // CATA_SRC_PIXEL_MINIMAP_PROJECTORS_H