File: graphics.h

package info (click to toggle)
chroma 1.19-2
  • links: PTS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 12,452 kB
  • sloc: ansic: 16,048; javascript: 5,957; perl: 3,312; xml: 1,585; sh: 177; makefile: 60; python: 12
file content (130 lines) | stat: -rw-r--r-- 3,584 bytes parent folder | download
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/*  
    graphics.h

    Copyright (C) 2010-2019 Amf

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version. 

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

#define GRAPHICS_DEFAULT    "chroma-zen.chroma"

/* Flags for pieces */
#define GRAPHICS_BEVEL          1
#define GRAPHICS_BEVEL_SHADOW   2
#define GRAPHICS_BEVEL16        4
#define GRAPHICS_RANDOM         8
#define GRAPHICS_KEY            16
#define GRAPHICS_MOVER          32
#define GRAPHICS_TILE           64
#define GRAPHICS_ANIMATE        128
#define GRAPHICS_LEVEL          256
#define GRAPHICS_CLONE          512
#define GRAPHICS_SCALE          1024

/* Flags for set */
#define GRAPHICS_CURSES         1
#define GRAPHICS_ZORDER         2
#define GRAPHICS_BACKGROUND     4
#define GRAPHICS_TRANSLATE      8

#define BEVEL_BASE              0x10000
#define BEVEL_L                (BEVEL_BASE * 1)
#define BEVEL_R                (BEVEL_BASE * 2)
#define BEVEL_U                (BEVEL_BASE * 4)
#define BEVEL_D                (BEVEL_BASE * 8)
#define BEVEL_TL               (BEVEL_BASE * 16)
#define BEVEL_TR               (BEVEL_BASE * 32)
#define BEVEL_BL               (BEVEL_BASE * 64)
#define BEVEL_BR               (BEVEL_BASE * 128)
#define BEVEL_ALL              (BEVEL_BASE * 255)

#define SHADOW_BASE            0x1000000
#define SHADOW_TOP_LEFT         1
#define SHADOW_TOP              2
#define SHADOW_TOP_RIGHT        4
#define SHADOW_LEFT             8
#define SHADOW_MIDDLE           16
#define SHADOW_RIGHT            32
#define SHADOW_BOTTOM_LEFT      64
#define SHADOW_BOTTOM           128
#define SHADOW_BOTTOM_RIGHT     256

#define IMAGE_PIECE             0
#define IMAGE_SHADOW            1
#define IMAGE_SMALL             2
#define IMAGE_MAX               3

#define SIZE_PIECES             1
#define SIZE_SMALL              2

struct graphicssize
{
    int x;
    int y;
    int flags;
    struct graphicssize *next;
};

struct shadow
{
    int x;
    int y;
    int z;
    int p;
    int flag;
    int shadow;
    struct shadow *next;
    struct shadow *nextordered;
    struct shadow *previousordered;
};


struct graphics
{
    int size_x;
    int size_y;
    int small_size_x;
    int small_size_y;
    int flags;
    char *title;
    int background[3];
    int level;
    int levels;

    int image_flags[PIECE_MAX];
    SDL_Surface *image[PIECE_MAX][3];

    int clone[PIECE_MAX];
    int shadow_z[PIECE_MAX];
    int shadow_offset_x[PIECE_MAX][10];
    int shadow_offset_y[PIECE_MAX][10];
    int shadow_start_x[PIECE_MAX][10];
    int shadow_start_y[PIECE_MAX][10];
    int shadow_width[PIECE_MAX][10];
    int shadow_height[PIECE_MAX][10];
    int shadow_flags[PIECE_MAX];

    struct graphicssize *sizes;
    struct shadow *shadows;

};

void graphics_init();
struct graphics* graphics_load(char *filename, int partial);
void graphics_delete(struct graphics*);
struct menu* graphics_menu();
SDL_Surface *graphics_loadimage(char *filename);
void graphics_reload();