TempleOS V5.03 Nightly (ISO SHA-1 aed1efc)
This commit is contained in:
1 parent
bbd014d8e9
commit
da84afbaf7
124 files changed
+3453
-3407
No files matched your search
@@ -634,6 +634,60 @@ public CDC *DCExt(CDC *dc=gr.dc,I64 x1,I64 y1,I64 x2,I64 y2,
|
||||
return res;
|
||||
}
|
||||
|
||||
public CDC *DCDiff(CDC *base,CDC *update)
|
||||
{//Trim to win of what has chged.
|
||||
I64 i,x1=0,y1=0,x2=update->width-1,y2=update->height-1; //inclusive
|
||||
U32 *ptr_base,*ptr_update;
|
||||
CDC *res;
|
||||
ptr_base =base->body;
|
||||
ptr_update=update->body;
|
||||
while (y1<=y2) {
|
||||
i=update->width>>2;
|
||||
while (i--)
|
||||
if (*ptr_base++!=*ptr_update++)
|
||||
goto df_y2;
|
||||
i=update->width&3;
|
||||
while (i--)
|
||||
if (*ptr_base(U8 *)++!=*ptr_update(U8 *)++)
|
||||
goto df_y2;
|
||||
y1++;
|
||||
}
|
||||
return NULL;
|
||||
df_y2:
|
||||
ptr_base =base->body +base->width_internal *base->height;
|
||||
ptr_update=update->body+update->width_internal*update->height;
|
||||
while (y1<y2) {
|
||||
i=update->width>>2;
|
||||
while (i--)
|
||||
if (*--ptr_base!=*--ptr_update)
|
||||
goto df_x1;
|
||||
i=update->width&3;
|
||||
while (i--)
|
||||
if (*--ptr_base(U8 *)!=*--ptr_update(U8 *))
|
||||
goto df_x1;
|
||||
y2--;
|
||||
}
|
||||
df_x1:
|
||||
while (x1<x2) {
|
||||
for (i=y1;i<=y2;i++)
|
||||
if (GrPeek0(base,x1,i)!=GrPeek0(update,x1,i))
|
||||
goto df_x2;
|
||||
x1++;
|
||||
}
|
||||
df_x2:
|
||||
while (x1<x2) {
|
||||
for (i=y1;i<=y2;i++)
|
||||
if (GrPeek0(base,x2,i)!=GrPeek0(update,x2,i))
|
||||
goto df_done;
|
||||
x2--;
|
||||
}
|
||||
df_done:
|
||||
res=DCExt(update,x1,y1,x2,y2);
|
||||
res->x0=x1;
|
||||
res->y0=y1;
|
||||
return res;
|
||||
}
|
||||
|
||||
#help_index "Graphics/Char;Char/Graphics"
|
||||
|
||||
public I64 GrPutChar(CDC *dc=gr.dc,I64 x,I64 y,U8 ch)
|
||||
|
||||
Reference in new issue
Block a user