Commit 9469f01b authored by Ben Avison's avatar Ben Avison

Fix to capitalisation clash for version 2.00.

Fixes background display in sprite file window
Detail:
  Change made to main_clear_background to cope with background sprites which
  are the wrong colour depth.

  The background sprite is no longer used if the 'Textured window
  backgrounds' CMOS bit is not set.
Admin:
  Tested on Iyonix RO v5.11
Changed by:
  Colin Granville.

Version 2.00. Retagged as 'Paint-2_00'
parent b9aff2a3
......@@ -246,50 +246,76 @@ static
static void main_clear_background(wimp_redrawstr* rds)
{
char name[16];
char* address;
sprite_header* address;
char* base;
char* rombase;
int width;
int height;
int left;
int top;
int use_sprite=0;
_swix(Wimp_BaseOfSprites,_OUTR(0,1),&rombase,&base);
sprintf(name,"tile_1-%d",1<<bbc_vduvar(bbc_Log2BPP));
// test tiling disabled in CMOS
_swix(OS_Byte,_INR(0,1) | _OUT(2),161,0x8c,&use_sprite);
use_sprite=(use_sprite & 128)==0;
if (_swix(OS_SpriteOp,_INR(0,2) | _OUT(2),0x100+24,base,name,&address))
if (use_sprite)
{
if (_swix(OS_SpriteOp,_INR(0,2) | _OUT(2),0x100+24,rombase,name,&address))
address=name;
base=rombase;
// find sprite for mode
_swix(Wimp_BaseOfSprites,_OUTR(0,1),&rombase,&base);
sprintf(name,"tile_1-%d",1<<bbc_vduvar(bbc_Log2BPP));
if (_swix(OS_SpriteOp,_INR(0,2) | _OUT(2),0x100+24,base,name,&address))
{
if (_swix(OS_SpriteOp,_INR(0,2) | _OUT(2),0x100+24,rombase,name,&address))
use_sprite=0;
base=rombase;
}
}
if (address==name)
if (use_sprite)
{
_swix(ColourTrans_SetGCOL,_IN(0) | _INR(3,4),0xdfdfdf00,0x80,0) /* background_colour */;
bbc_clg();
return;
}
int spriteop=0x200+34;
char* transtab=0;
char pixtranstab[16];
_swix(OS_SpriteOp,_INR(0,2) | _OUTR(3,4),40+0x200,base,address,&width,&height);
_swix(OS_SpriteOp,_INR(0,2) | _OUTR(3,4),40+0x200,base,address,&width,&height);
width<<=bbc_vduvar(bbc_XEigFactor);
height<<=bbc_vduvar(bbc_YEigFactor);
width<<=bbc_modevar(address->mode,bbc_XEigFactor);
height<<=bbc_modevar(address->mode,bbc_YEigFactor);
left=WORKAREA_TO_SCREEN_X(rds,0);
left=left+(((left-rds->g.x0)/width)*width);
top=WORKAREA_TO_SCREEN_Y(rds,0);
top=top-(((top-rds->g.y1)/height)*height);
if (bbc_vduvar(bbc_Log2BPP)!=bbc_modevar(address->mode,bbc_Log2BPP))
{
spriteop=0x200+52;
transtab=pixtranstab;
_swix(Wimp_ReadPixTrans,_INR(0,2) | _INR(6,7),0x200,base,address,0,transtab);
}
//werr(0,"%d %d %d %d %d",left,bottom,width,height,rds->g.y0 );
left=WORKAREA_TO_SCREEN_X(rds,0);
left=left+(((left-rds->g.x0)/width)*width);
top=WORKAREA_TO_SCREEN_Y(rds,0);
top=top-(((top-rds->g.y1)/height)*height);
for (;top>rds->g.y0;top-=height)
//werr(0,"%d %d %d %d %d",left,bottom,width,height,rds->g.y0 );
for (;top>rds->g.y0;top-=height)
{
int x;
for (x=left;x<rds->g.x1;x+=width)
{
use_sprite=!_swix(OS_SpriteOp,_INR(0,7),spriteop,base,address,x,top-height,0,0,transtab);
if (!use_sprite) break;
}
}
}
if (!use_sprite)
{
int x;
for (x=left;x<rds->g.x1;x+=width)
_swix(OS_SpriteOp,_INR(0,5),34+0x200,base,address,x,top-height,0);
_swix(ColourTrans_SetGCOL,_IN(0) | _INR(3,4),0xdfdfdf00,0x80,0) /* background_colour */;
bbc_clg();
return;
}
}
os_error *main_read_pixel (sprite_area *area, sprite_id *id,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment