-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathimage_spec.h
More file actions
57 lines (46 loc) · 1.27 KB
/
image_spec.h
File metadata and controls
57 lines (46 loc) · 1.27 KB
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
#ifndef IMAGE_SPEC_H
#define IMAGE_SPEC_H
#include "ILBM_image.h"
//BOBSheet types
#define BST_DISTRUBUTED 0
#define BST_IRREGULAR 1
struct HitBox {
struct MinNode node;
WORD x1, y1;
WORD x2, y2;
UWORD index;
UWORD next;
};
struct ImageSpec {
UWORD x; //x coord of image on the sheet
UWORD y; //y coord of image on the sheet
UWORD width;
UWORD height;
WORD h_offs;
WORD v_offs;
struct HitBox* active_hitbox;
struct MinList hitboxes;
};
struct Sheet {
STRPTR sheet_file; //The file path for the bobsheet or the spritebank
STRPTR ilbm_file; //The file name for the ilbm file of the bobsheet
APTR sprite_bank;
ULONG sprite_bank_size;
UWORD type;
UWORD num_images;
UWORD num_hitboxes;
struct ILBMImage* image;
struct ImageSpec spec[0];
};
struct Sheet* loadBOBSheet(STRPTR fileName);
struct Sheet* loadSpriteBank(STRPTR fileName);
VOID freeSheet(struct Sheet* bs);
struct HitBox* newHitBox(WORD x1, WORD y1, WORD x2, WORD y2, UWORD index, UWORD next);
VOID deleteHitBox(struct HitBox* hb);
#endif /* IMAGE_SPEC_H */
/*
for (hb = (struct HitBox*)list->mlh_Head; hb->node.mln_Succ; hb = (struct HitBox*)hb->node.mln_Succ) {
}
if (hb_next->node.mln_Succ)
hb_new = newHitBox(hb->x1, hb->y1, hb->x2, hb->y2, h, UWORD next);
*/