mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-25 05:27:00 +03:00
[project @ 2003-09-12 19:51:17 by bursa]
Display sprites with extension areas, fix some warnings. svn path=/import/netsurf/; revision=289
This commit is contained in:
parent
72c753c582
commit
83f6cd25ab
@ -35,13 +35,14 @@ int sprite_convert(struct content *c, unsigned int width, unsigned int height)
|
||||
{
|
||||
os_error *error;
|
||||
int w, h;
|
||||
osspriteop_area *area = c->data.sprite.data;
|
||||
|
||||
/* fill in the size (first word) of the area */
|
||||
memcpy(c->data.sprite.data, (char*)&c->data.sprite.length, 4);
|
||||
area->size = c->data.sprite.length;
|
||||
|
||||
error = xosspriteop_read_sprite_info(osspriteop_PTR,
|
||||
(osspriteop_area*)(c->data.sprite.data),
|
||||
(osspriteop_id)((osspriteop_area*)c->data.sprite.data + 1),
|
||||
area,
|
||||
(osspriteop_id)(c->data.sprite.data + area->first),
|
||||
&w, &h, NULL, NULL);
|
||||
|
||||
if (error) {
|
||||
@ -81,18 +82,19 @@ void sprite_redraw(struct content *c, long x, long y,
|
||||
long clip_x0, long clip_y0, long clip_x1, long clip_y1)
|
||||
{
|
||||
unsigned int size;
|
||||
osspriteop_area *area = c->data.sprite.data;
|
||||
osspriteop_trans_tab *table;
|
||||
os_factors factors;
|
||||
|
||||
xcolourtrans_generate_table_for_sprite(
|
||||
(osspriteop_area*)(c->data.sprite.data),
|
||||
(osspriteop_id) ((osspriteop_area*)c->data.sprite.data + 1),
|
||||
area,
|
||||
(osspriteop_id)(c->data.sprite.data + area->first),
|
||||
colourtrans_CURRENT_MODE, colourtrans_CURRENT_PALETTE,
|
||||
0, colourtrans_GIVEN_SPRITE, 0, 0, &size);
|
||||
table = xcalloc(size, 1);
|
||||
xcolourtrans_generate_table_for_sprite(
|
||||
(osspriteop_area*)(c->data.sprite.data),
|
||||
(osspriteop_id) ((osspriteop_area*)c->data.sprite.data + 1),
|
||||
area,
|
||||
(osspriteop_id)(c->data.sprite.data + area->first),
|
||||
colourtrans_CURRENT_MODE, colourtrans_CURRENT_PALETTE,
|
||||
table, colourtrans_GIVEN_SPRITE, 0, 0, 0);
|
||||
|
||||
@ -102,8 +104,8 @@ void sprite_redraw(struct content *c, long x, long y,
|
||||
factors.ydiv = c->height * 2;
|
||||
|
||||
xosspriteop_put_sprite_scaled(osspriteop_PTR,
|
||||
(osspriteop_area*)(c->data.sprite.data),
|
||||
(osspriteop_id) ((osspriteop_area*)c->data.sprite.data + 1),
|
||||
area,
|
||||
(osspriteop_id)(c->data.sprite.data + area->first),
|
||||
x, y - height,
|
||||
osspriteop_USE_MASK | osspriteop_USE_PALETTE, &factors, table);
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
struct content;
|
||||
|
||||
struct content_sprite_data {
|
||||
void* data;
|
||||
char *data;
|
||||
unsigned long length;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user