TempleOS V5.03 Nightly (ISO SHA-1 aed1efc)

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-09 11:35:02 +02:00
1 parent bbd014d8e9
commit da84afbaf7
124 files changed
+3453 -3407

No files matched your search

+54
View File
@@ -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)
+5 -1
View File
@@ -376,6 +376,10 @@ public CDC *DCLoad(U8 *src,I64 *_size=NULL,CTask *task=NULL)
#help_index "Graphics/GR Files"
#help_file "::/Doc/GRFiles"
#help_index "Graphics/Device Contexts;Graphics/GR Files"
#define GR_FILE_MAX (offset(CDC.end)-offset(CDC.start)+\
COLORS_NUM*sizeof(CBGR48)+sizeof(CArcCtrl)+GR_WIDTH*GR_HEIGHT)
public I64 GRWrite(U8 *filename,CDC *dc,I64 dcsf_flags=DCSF_COMPRESSED)
{//TempleOS GR File.
I64 size;
@@ -414,7 +418,7 @@ public CDC *DCScrnCapture(Bool include_zoom=TRUE,CTask *task=NULL)
{//Capture scrn to a device context.
CDC *dc;
U8 *dst;
Refresh(2,TRUE);
Refresh(0,FALSE);
if (include_zoom)
dc=DCCopy(gr.scrn_image,task);
else
+1
View File
@@ -14,6 +14,7 @@ Cd(__DIR__);;
#include "GrBitMap"
#include "GrPrimatives"
#include "GrComposites"
#include "GrMV"
#define SPE_ABORT (-1)
#define SPE_EXIT 0
+4 -11
View File
@@ -26,8 +26,7 @@
#define SPBM_ADD_OUTLINE 23
#define SPBM_ETCH 24
#define SPBM_UNDO 25
#define SPBM_SAVE_BMP 26
#define SPBM_SAVE_GRA 27
#define SPBM_SAVE_GR 26
U0 GrInit4()
{
@@ -36,7 +35,7 @@ U0 GrInit4()
"Rect\0Circle\0Text\0Text Box\0Text Diamond\0Flood Fill\0"
"Flood Fill Not Color\0PolyLine\0PolyPoint\0Copy\0Delete\0Paste\0"
"Paste Transparent\0Find and Replace\0Trim to Extents\0Add Outline\0"
"Etch\0Undo\0Save BMP\0Save GR\0");
"Etch\0Undo\0Save GR\0");
}
GrInit4;
@@ -79,8 +78,7 @@ I64 PopUpSpriteBitMap(CColorROPU32 color,I64 width)
"$$MU-UL,\"Delete to Clip\",LE=SPBM_DELETE$$\n"
"$$MU-UL,\"Paste Clip\",LE=SPBM_PASTE$$\n"
"$$MU-UL,\"Paste Transparent Clip\",LE=SPBM_PASTE_TRANSPARENT$$\n"
"\n$$MU-UL,\"Save BMP File\",LE=SPBM_SAVE_BMP$$\n"
"$$MU-UL,\"Save GR File\",LE=SPBM_SAVE_GRA$$\n"
"\n$$MU-UL,\"Save GR File\",LE=SPBM_SAVE_GR$$\n"
"\n$$MU-UL,\"Undo\",LE=SPBM_UNDO$$\n"
"\n$$PURPLE$$$$MU-UL,\"+] Sprite Main Menu\",LE=SPBM_MAIN_MENU$$$$LTBLUE$$\n"
"$$MU-UL,\"Exit Sprite\",LE=SPBM_EXIT$$\n"
@@ -293,12 +291,7 @@ bm_menu:
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
}
goto bm_menu;
case SPBM_SAVE_BMP:
*filename.name=0;
if (DocForm(&filename) && *filename.name)
BMPWrite(filename.name,img);
goto bm_menu;
case SPBM_SAVE_GRA:
case SPBM_SAVE_GR:
*filename.name=0;
if (DocForm(&filename) && *filename.name)
GRWrite(filename.name,img,DCSF_COMPRESSED|DCSF_PALETTE_GET);