hsb.h
2.59 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
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
/*---------------------------------------------------------------------*
Copyright (C) 1998 Nintendo.
$RCSfile: hsb.h,v $
$Revision: 1.1.1.1 $
$Date: 2002/05/02 03:27:21 $
*---------------------------------------------------------------------*/
/*
sb.h Ѵؿ StringBar BackTile
*/
#ifndef __SB_H__
#define __SB_H__
#include "hglobals.h"
#include "hdd.h"
#define XOR(a,b) ((a && !b) || (!a && b))
#define RGBA_WHITE 0xFFFFFFFF
#define RGBA_GREY 0x888888FF
#define RGBA_PINK 0xFF0088FF
#define RGBA_SKYBLUE 0x8888FFFF
#define RGBA_SKYBLUEALPHA 0x8888FF80
#define RGBA_BLUEALPHA 0x000080C0
#define RGBA_VIOLETALPHA 0x600060C0
#define RGBA_VIOLET 0x600060FF
#define AS_HEX 1
#define AS_DEC 2
#define AS_ASC 4
#define AS_SUBST 8
#define EXIST_IN(x,y,sq) ( \
(x > (sq).left) && (x < (sq).right) && \
(y > (sq).top) && (y < (sq).bottom) \
)
#define SBAR_MAXLENGTH 256
#define BD_X (-5)
#define BD_Y 0
typedef struct {
s32 x;
s32 y;
} TPoint ;
typedef struct {
s32 left;
s32 top;
s32 right;
s32 bottom;
}TSquare;
typedef struct {
u8 str[SBAR_MAXLENGTH];
s32 x;
s32 y;
TPoint base;
s32 clipping;
TSquare clip;
u32 color;
s32 visible;
s32 autoprintf;
s32 length;
void * src;
s32 src_as;
s32 src_length;
u8 **src_sub; /* enable selection by substitute macro */
} TStringBar;
typedef struct {
s32 x;
s32 y;
s32 w;
s32 h;
TPoint base;
s32 clipping;
TSquare clip;
u32 color;
s32 visible;
} TBackTile;
extern s32 sb_clip(s32 val ,s32 from ,s32 to);
extern u16 sb_jpad( u16 trig );
extern s32 sb_length(u8 *s);
extern s32 sbar_create(TStringBar * bar,u8 * str, s32 xpos ,s32 ypos );
extern s32 sbar_show(TStringBar * bar);
extern s32 sbar_setBase(TStringBar * bar,s32 x ,s32 y);
extern s32 sbar_setClip(TStringBar * bar,s32 left ,s32 top ,s32 right ,s32 bottom );
extern s32 sbar_setSubst(TStringBar * bar,void * src, u8 **src_sub ,s32 length );
extern s32 sbar_setSrc(TStringBar * bar,void * src, s32 type ,s32 length );
extern s32 sbar_moveCenter(TStringBar * bar ,s32 left ,s32 right );
extern s32 sbar_getWidth(TStringBar * bar);
extern s32 btile_create(TBackTile *bt ,s32 xpos ,s32 ypos ,s32 width ,s32 height ,u32 color);
extern s32 btile_setBase(TBackTile * bt ,s32 x ,s32 y);
extern s32 btile_moveCenter(TBackTile * bt ,s32 left ,s32 right );
extern s32 btile_setClip(TBackTile * bt,s32 left ,s32 top ,s32 right ,s32 bottom );
extern s32 btile_show(TBackTile * bt);
#endif /* __SB_H__ */