85 |
} |
} |
86 |
|
|
87 |
/* Store a glyph in the font cache */ |
/* Store a glyph in the font cache */ |
88 |
void cache_put_font(uint8 font, uint32 character, uint16 baseline, |
void cache_put_font(uint8 font, uint16 character, uint16 offset, |
89 |
uint16 width, uint16 height, HGLYPH pixmap) |
uint16 baseline, uint16 width, uint16 height, HGLYPH pixmap) |
90 |
{ |
{ |
91 |
FONTGLYPH *glyph; |
FONTGLYPH *glyph; |
92 |
|
|
97 |
if (glyph->pixmap != NULL) |
if (glyph->pixmap != NULL) |
98 |
ui_destroy_glyph(glyph->pixmap); |
ui_destroy_glyph(glyph->pixmap); |
99 |
|
|
100 |
|
glyph->offset = offset; |
101 |
glyph->baseline = baseline; |
glyph->baseline = baseline; |
102 |
glyph->width = width; |
glyph->width = width; |
103 |
glyph->height = height; |
glyph->height = height; |
155 |
static uint8 deskcache[0x38400]; |
static uint8 deskcache[0x38400]; |
156 |
|
|
157 |
/* Retrieve desktop data from the cache */ |
/* Retrieve desktop data from the cache */ |
158 |
uint8 *cache_get_desktop(uint32 offset, uint32 length) |
uint8 *cache_get_desktop(uint32 offset, int cx, int cy) |
159 |
{ |
{ |
160 |
|
int length = cx * cy; |
161 |
|
|
162 |
if ((offset + length) <= sizeof(deskcache)) |
if ((offset + length) <= sizeof(deskcache)) |
163 |
{ |
{ |
164 |
return &deskcache[offset]; |
return &deskcache[offset]; |
169 |
} |
} |
170 |
|
|
171 |
/* Store desktop data in the cache */ |
/* Store desktop data in the cache */ |
172 |
void cache_put_desktop(uint32 offset, uint32 length, uint8 *data) |
void cache_put_desktop(uint32 offset, int cx, int cy, int scanline, uint8 *data) |
173 |
{ |
{ |
174 |
|
int length = cx * cy; |
175 |
|
|
176 |
if ((offset + length) <= sizeof(deskcache)) |
if ((offset + length) <= sizeof(deskcache)) |
177 |
{ |
{ |
178 |
memcpy(&deskcache[offset], data, length); |
while (cy--) |
179 |
|
{ |
180 |
|
memcpy(&deskcache[offset], data, cx); |
181 |
|
data += scanline; |
182 |
|
offset += cx; |
183 |
|
} |
184 |
} |
} |
185 |
else |
else |
186 |
{ |
{ |