Debian Codegraph @

terps/scott/saga/sagagraphics.h

raw symbols SCIP
1 //
2 // graphics.h
3 // part of ScottFree, an interpreter for adventures in Scott Adams format
4 //
5 // Created by Petter Sjölund on 2022-09-07.
6 //
7
8 #ifndef graphics_h
9 #define graphics_h
10
11 #include <stdio.h>
12
13 #include "glk.h"
14 #include "scottdefines.h"
15
16 typedef struct USImage {
17 USImageType usage;
18 int index;
19 MachineType systype;
20 size_t datasize;
21 uint8_t *imagedata;
22 int cropleft;
23 int cropright;
24 struct USImage *previous;
25 struct USImage *next;
26 } USImage;
27
28 extern struct USImage *USImages;
29
30 typedef struct CropList {
31 GameIDType game;
32 USImageType usage;
33 int index;
34 int cropleft;
35 int cropright;
36 } CropList;
37
38 typedef uint8_t RGB[3];
39 typedef RGB PALETTE[16];
40
41 extern int pixel_size;
42 extern int x_offset, y_offset;
43 extern int right_margin, left_margin;
44 extern PALETTE pal;
45
46 void SetColor(int32_t index, const RGB *color);
47 void SetRGB(int32_t index, int red, int green, int blue);
48
49 void PutPixel(glsi32 x, glsi32 y, int32_t color);
50 void PutDoublePixel(glsi32 xpos, glsi32 ypos, int32_t color);
51
52 USImage *new_image(void);
53 int issagaimg(const char *name);
54 int has_graphics(void);
55
56 #endif /* graphics_h */