~ppsspp/ppsspp/ppsspp_1.3.0

« back to all changes in this revision

Viewing changes to ext/native/gfx/texture_atlas.h

  • Committer: Sérgio Benjamim
  • Date: 2017-01-02 00:12:05 UTC
  • Revision ID: sergio_br2@yahoo.com.br-20170102001205-cxbta9za203nmjwm
1.3.0 source (from ppsspp_1.3.0-r160.p5.l1762.a165.t83~56~ubuntu16.04.1.tar.xz).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#pragma once
 
2
 
 
3
typedef int ImageID;
 
4
 
 
5
struct AtlasChar {
 
6
        // texcoords
 
7
        float sx, sy, ex, ey;
 
8
        // offset from the origin
 
9
        float ox, oy;
 
10
        // distance to move the origin forward
 
11
        float wx;
 
12
        // size in pixels
 
13
        unsigned short pw, ph;
 
14
};
 
15
 
 
16
struct AtlasCharRange {
 
17
        int start;
 
18
        int end;
 
19
        int start_index;
 
20
};
 
21
 
 
22
struct AtlasFont {
 
23
        float padding;
 
24
        float height;
 
25
        float ascend;
 
26
        float distslope;
 
27
        const AtlasChar *charData;
 
28
        const AtlasCharRange *ranges;
 
29
        int numRanges;
 
30
        const char *name;
 
31
 
 
32
        // Returns 0 on no match.
 
33
        const AtlasChar *getChar(int utf32) const ;
 
34
};
 
35
 
 
36
struct AtlasImage {
 
37
        float u1, v1, u2, v2;
 
38
        int w, h;
 
39
        const char *name;
 
40
};
 
41
 
 
42
struct Atlas {
 
43
        const char *filename;
 
44
        const AtlasFont **fonts;
 
45
        int num_fonts;
 
46
        const AtlasImage *images;
 
47
        int num_images;
 
48
 
 
49
        // These are inefficient linear searches, try not to call every frame.
 
50
        const AtlasFont *getFontByName(const char *name) const;
 
51
        const AtlasImage *getImageByName(const char *name) const;
 
52
};