- 論壇徽章:
- 0
|
代碼如下,sheets_refresh()函數(shù)中sht=shtctl->sheet_info[h]語句報錯:incompatible types in assignment.問題出在哪里?
#define MAX_SHEETS 256
struct SHEET{
unsigned char *buf;
int bxsize,bysize,vx0,vy0,col_inv,height,flags; //bxsize,bysize,圖層大小
};
struct SHTCTL{ //sheet controller
unsigned char *vram;
int xsize,ysize,top;
struct SHEET *sheet_addr[MAX_SHEETS]; //記錄地址
struct SHEET sheet_info[MAX_SHEETS]; //記錄各個圖層詳細(xì)信息
};
//其實以上信息是放在頭文件中的,這里引用了過來
void sheets_refresh(struct SHTCTL *shtctl)
{
int h,bx,by,vx,vy;
unsigned char *buf,c,*vram=shtctl->vram;
struct SHEET *sht;
for(h=0;h<= shtctl->top;h++){
sht=shtctl->sheet_info[h]; //出錯語句
buf=sht->buf;
for(by=0;by< sht->bysize;by++){
vy=sht->vy0+by;
for(bx=0;bx< sht->bxsize;bx++){
vx=sht->vx0+bx;
c=buf[by*sht->bxsize+bx];
if(c!=sht->col_inv){
vram[vy*shtctl->xsize+vx]=c;
}
}
}
}
return;
} |
|