TempleOSCDV3.11.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:46:29 +02:00
1 parent f8c05f98f4
commit ed64d7e3b8
549 files changed
+10643 -12855

No files matched your search

-53
View File
@@ -1,24 +1,3 @@
#help_index "Graphics"
U0 GrInit1()
{
DefineLstLoad("ST_SPRITE_ELEM_TYPES",
"End\0Color\0Dither Color\0"
"Width\0Planar Symmetry\0Transform On\0Transform Off\0Shift\0"
"Point\0PolyPoint\0Line\0PolyLine\0Rect\0Rotated Rect\0"
"Circle\0Ellipse\0Polygon\0BSpline2\0BSpline2 Closed\0"
"BSpline3\0BSpline3 Closed\0"
"Flood Fill\0Flood Fill Not Color\0BitMap\0Mesh\0Shiftable Mesh\0"
"Arrow\0Text\0Text Box\0Text Diamond\0");
DefineLstLoad("ST_SPRITE_ELEM_CODES",
"End\0Color\0Color\0"
"Width\0PlanarSymmetry\0Transform\0Transform\0Shift\0"
"Pt\0PolyPt\0Line\0PolyLine\0Rect\0Rect\0"
"Circle\0Ellipse\0Polygon\0BSpline2\0BSpline2\0BSpline3\0BSpline3\0"
"FloodFill\0FloodFill\0BitMap\0Mesh\0Mesh\0"
"Arrow\0Text\0TextBox\0TextDiamond\0");
}
GrInit1;
#help_index "Sprites/Binary"
class CMeshTri
@@ -195,35 +174,3 @@ public class CSprite
CSpritePtStr ps;
}
};
#help_index "Graphics"
extern I64 GrBlot3(CDC *dc,I64 x1,I64 y1,I64 z1,CDC *img);
extern U8 *GrBitMap4ToBitMap8(U8 *dst,U8 *src,I64 src_size,I64 bkcolor);
extern I64 *Mat4x4New(I64 *src,CTask *mem_task=NULL);
extern U8 *SpriteQue2Sprite(CSprite *root,I64 *_size=NULL);
#include "GrGlbls"
#include "GrTextBase"
#include "GrAsm"
#include "GrPalette"
#include "GrDC"
#include "GrInit"
#include "GrMath"
#include "GrScreen"
#include "GrBitMap"
#include "GrPrimatives"
#include "GrComposites"
#define GE_ABORT (-1)
#define GE_EXIT 0
#define GE_CONT 1
#include "SpriteNew"
#include "GrSpritePlot"
#include "SpriteMesh"
#include "SpriteBitMap"
#include "SpriteCode"
#include "SpriteEd"
#include "SpriteMain"
#include "GrEnd"
+1 -1
View File
@@ -71,7 +71,7 @@ public I64 GrBlot(CDC *dc=gr.dc,I64 x,I64 y,CDC *img)
reg bit_shift,win_z_buf_line_inc,win_z_buf_line_dec,win_z_num,
color_mask;
U8 reg *dst,*src;
I32 db;
I32 *db;
U16 reg *win_z_buf_ptr;
CColorROPU32 color,c,old_color;
CTask *win_task;
+2 -2
View File
@@ -296,7 +296,7 @@ mesh_done:
#help_index "Graphics/Misc;Input Pointer/Displayed Image"
public U0 DrawStdInputPtr(CDC *dc,I64 x,I64 y)
{//This is a callback. See $LK,"::/Demo/Graphics/Grid.CPP.Z"$.
{//This is a callback. See $LK,"::/Demo/Graphics/Grid.CPP"$.
//Called by $LK,"DrawInputPtr",A="MN:DrawInputPtr"$() which is
//called by $LK,"WinFinalUpdate",A="MN:WinFinalUpdate"$().
dc->pen_width=1;
@@ -307,7 +307,7 @@ public U0 DrawStdInputPtr(CDC *dc,I64 x,I64 y)
gr.fp_draw_input_ptr=&DrawStdInputPtr;
public U0 DrawWaitInputPtr(CDC *dc,I64 x,I64 y)
{//This is a callback. See $LK,"::/Demo/Graphics/Grid.CPP.Z"$.
{//This is a callback. See $LK,"::/Demo/Graphics/Grid.CPP"$.
I64 old_pen_width=dc->pen_width;
CColorROPU32 old_color=dc->color;
dc->pen_width=3;
+14 -14
View File
@@ -3,12 +3,12 @@
#define GR_SCALE (1<<32)
public U0 Mat4x4MulXYZ(I64 r[4][4],I64 *_x,I64 *_y,I64 *_z)
public U0 Mat4x4MulXYZ(I64 *r,I64 *_x,I64 *_y,I64 *_z)
{//Rotate 3D point using 4x4 matrix. Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$.
I64 x1,y1,z1,xx=*_x,yy=*_y,zz=*_z;
x1=(r[0][0]*xx+r[0][1]*yy+r[0][2]*zz+r[0][3])>>32;
y1=(r[1][0]*xx+r[1][1]*yy+r[1][2]*zz+r[1][3])>>32;
z1=(r[2][0]*xx+r[2][1]*yy+r[2][2]*zz+r[2][3])>>32;
x1=(r[0*4+0]*xx+r[0*4+1]*yy+r[0*4+2]*zz+r[0*4+3])>>32;
y1=(r[1*4+0]*xx+r[1*4+1]*yy+r[1*4+2]*zz+r[1*4+3])>>32;
z1=(r[2*4+0]*xx+r[2*4+1]*yy+r[2*4+2]*zz+r[2*4+3])>>32;
*_x=x1;*_y=y1;*_z=z1;
}
@@ -21,13 +21,13 @@ public U0 DCTransform(CDC *dc,I64 *_x,I64 *_y,I64 *_z)
*_z+=dc->z;
}
public I64 *Mat4x4IdentEqu(I64 r[4][4])
public I64 *Mat4x4IdentEqu(I64 *r)
{//Set matrix to identity. Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$.
MemSet(r,0,sizeof(I64)*16);
r[0][0].i32[1]=1;
r[1][1].i32[1]=1;
r[2][2].i32[1]=1;
r[3][3].i32[1]=1;
r[0*4+0].i32[1]=1;
r[1*4+1].i32[1]=1;
r[2*4+2].i32[1]=1;
r[3*4+3].i32[1]=1;
return r;
}
@@ -36,15 +36,15 @@ public I64 *Mat4x4IdentNew(CTask *mem_task=NULL)
return Mat4x4IdentEqu(MAlloc(sizeof(I64)*16,mem_task));
}
public I64 Mat4x4NormSqr65536(I64 r[4][4])
public I64 Mat4x4NormSqr65536(I64 *r)
{//Norm Squared of r.
//(1.0/Sqrt(3))*65536=37837.22
return SqrI64((r[0][0]*37838+r[0][1]*37838+r[0][2]*37838)>>32)+
SqrI64((r[1][0]*37837+r[1][1]*37837+r[1][2]*37837)>>32)+
SqrI64((r[2][0]*37837+r[2][1]*37837+r[2][2]*37837)>>32);
return SqrI64((r[0*4+0]*37838+r[0*4+1]*37838+r[0*4+2]*37838)>>32)+
SqrI64((r[1*4+0]*37837+r[1*4+1]*37837+r[1*4+2]*37837)>>32)+
SqrI64((r[2*4+0]*37837+r[2*4+1]*37837+r[2*4+2]*37837)>>32);
}
public U0 DCMat4x4Set(CDC *dc=NULL,I64 r[4][4])
public U0 DCMat4x4Set(CDC *dc=NULL,I64 *r)
{//Set device context's rot matrix. Will be $LK,"Free",A="MN:Free"$d() in $LK,"DCDel",A="MN:DCDel"$().Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$.
//The main purpose is to set matrix norm for pen width scaling.
//NULL as dc means gr.dc
+3 -2
View File
@@ -7,7 +7,8 @@ U0 CtrlAltZ(I64 sc)
else
GrScaleZoom(2.0);
}
CtrlAltLetCBSet('Z',&CtrlAltZ,"Sys/Zoom In or Out");
CtrlAltCBSet('Z',&CtrlAltZ,"Cmd /Zoom In",
"Cmd /Zoom Out");
U0 Screen2Clipboard(I64)
{
@@ -25,4 +26,4 @@ U0 CtrlAltS(I64)
{
Spawn(&Screen2Clipboard);
}
CtrlAltLetCBSet('S',&CtrlAltS,"Sys/Screen Shot to Clipboard");
CtrlAltCBSet('S',&CtrlAltS,"Cmd /Screen Shot to Clipboard");
+5
View File
@@ -0,0 +1,5 @@
#help_index "Graphics"
extern U8 *GrBitMap4ToBitMap8(U8 *dst,U8 *src,I64 src_size,I64 bkcolor);
extern I64 GrBlot3(CDC *dc,I64 x1,I64 y1,I64 z1,CDC *img);
extern I64 *Mat4x4New(I64 *src,CTask *mem_task=NULL);
extern U8 *SpriteQue2Sprite(CSprite *root,I64 *_size=NULL);
+2 -2
View File
@@ -23,7 +23,7 @@ public class CGrGlbls
U0 (*fp_wall_paper)(CTask *task);
U0 (*fp_draw_input_ptr)(CDC *dc,I64 x,I64 y);
U0 (*fp_draw_grab_input_ptr)(CDC *dc,I64 x,I64 y,Bool closed);
U8 *empty_sprite; //Gets assigned $LK,"gr.empty_sprite",A="FF:::/Adam/WallPaper.CPP,empty_sprite"$
U8 *empty_sprite; //Gets assigned $LK,"gr.empty_sprite",A="FF:::/Adam/AInputPointer.CPP,empty_sprite"$
#define GR_NUM_PEN_BRUSHES 64
CDC *pen_brushes[GR_NUM_PEN_BRUSHES],
@@ -45,7 +45,7 @@ public class CGrGlbls
HashPublic("GR_WIDTH",HTT_DEFINE_STR);;
HashPublic("GR_HEIGHT",HTT_DEFINE_STR);;
#help_index "Char"
#help_index "Char;TextBase Layer/Char"
DefinePrint("TEXT_ROWS","%d",text.rows);;;
HashPublic("TEXT_ROWS",HTT_DEFINE_STR);;;
DefinePrint("TEXT_COLS","%d",text.cols);;;
+21
View File
@@ -0,0 +1,21 @@
#help_index "Graphics"
U0 GrInit1()
{
DefineLstLoad("ST_SPRITE_ELEM_TYPES",
"End\0Color\0Dither Color\0"
"Width\0Planar Symmetry\0Transform On\0Transform Off\0Shift\0"
"Point\0PolyPoint\0Line\0PolyLine\0Rect\0Rotated Rect\0"
"Circle\0Ellipse\0Polygon\0BSpline2\0BSpline2 Closed\0"
"BSpline3\0BSpline3 Closed\0"
"Flood Fill\0Flood Fill Not Color\0BitMap\0Mesh\0Shiftable Mesh\0"
"Arrow\0Text\0Text Box\0Text Diamond\0");
DefineLstLoad("ST_SPRITE_ELEM_CODES",
"End\0Color\0Color\0"
"Width\0PlanarSymmetry\0Transform\0Transform\0Shift\0"
"Pt\0PolyPt\0Line\0PolyLine\0Rect\0Rect\0"
"Circle\0Ellipse\0Polygon\0BSpline2\0BSpline2\0BSpline3\0BSpline3\0"
"FloodFill\0FloodFill\0BitMap\0Mesh\0Mesh\0"
"Arrow\0Text\0TextBox\0TextDiamond\0");
}
GrInit1;
+1 -2
View File
@@ -1,4 +1,5 @@
#help_index "Graphics/Screen"
U0 GrSetUpTables()
{
CDC *dc;
@@ -138,7 +139,6 @@ public U0 WinZBufUpdate()
I64 i,z=1;
U16 *ptr;
CTask *task,*task1;
Bool old_preempt=Preempt;
if (gr.win_z_buf) {
LBtr(&sys_semas[SYS_SEMA_UPDATE_WIN_Z_BUF],0);
task1=task=sys_winmgr_task;
@@ -156,7 +156,6 @@ public U0 WinZBufUpdate()
for (ptr=gr.win_z_buf,i=TEXT_ROWS*TEXT_COLS;i;i--)
Bts(gr.win_uncovered_bitmap,*ptr++);
}
Preempt(old_preempt);
}
#help_index "Graphics"
+10 -10
View File
@@ -179,21 +179,21 @@ public U0 DCPenWidthScale(CDC *dc=gr.dc)
}
}
public I64 *Mat4x4TranslationEqu(I64 r[4][4],I64 x,I64 y,I64 z)
public I64 *Mat4x4TranslationEqu(I64 *r,I64 x,I64 y,I64 z)
{//Set translation values in 4x4 matrix. Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$.
r[0][3]=x<<32;
r[1][3]=y<<32;
r[2][3]=z<<32;
r[3][3]=GR_SCALE;
r[0*4+3]=x<<32;
r[1*4+3]=y<<32;
r[2*4+3]=z<<32;
r[3*4+3]=GR_SCALE;
return r;
}
public I64 *Mat4x4TranslationAdd(I64 r[4][4],I64 x,I64 y,I64 z)
public I64 *Mat4x4TranslationAdd(I64 *r,I64 x,I64 y,I64 z)
{//Add translation to 4x4 matrix. Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.CPP"$.
r[0][3]+=x<<32;
r[1][3]+=y<<32;
r[2][3]+=z<<32;
r[3][3]=GR_SCALE;
r[0*4+3]+=x<<32;
r[1*4+3]+=y<<32;
r[2*4+3]+=z<<32;
r[3*4+3]=GR_SCALE;
return r;
}
-4
View File
@@ -106,7 +106,6 @@ U0 GrFixZoomScale()
public U0 GrScaleZoom(F64 scale)
{//Multiply zoom factor larger or smaller.
Bool old_preempt=Preempt;
F64 s=gr.screen_zoom;
gr.screen_zoom=gr.screen_zoom*scale;
GrFixZoomScale;
@@ -120,7 +119,6 @@ public U0 GrScaleZoom(F64 scale)
gr.sx=ip.pos.x-gr.zoomed_dc->width >>1/gr.screen_zoom;
gr.sy=ip.pos.y-gr.zoomed_dc->height>>1/gr.screen_zoom;
GrFixZoomScale;
Preempt(old_preempt);
}
U0 GrZoomInScreen()
@@ -403,7 +401,6 @@ U0 GrUpdateVGAGraphics()
U0 GrUpdateScreen()
{//Called by the Window Manager $LK,"HERE",A="FF:::/Adam/WinB.CPP,GrUpdateScreen"$, 60 times a second.
CDC *dc;
Preempt(ON);
if (!Bt(&sys_run_level,RLf_VGA)) //if text mode
GrUpdateTasks;
else {
@@ -412,7 +409,6 @@ U0 GrUpdateScreen()
GrUpdateTasks;
DCBlotColor8(gr.dc2,gr.dc);
}
Preempt;
dc=DCAlias(gr.dc2,Fs);
dc->flags|=DCF_ON_TOP;
+31
View File
@@ -0,0 +1,31 @@
Cd(__DIR__);;
#include "GrInitA"
#include "Gr.HPP"
#include "GrExt"
#include "GrGlbls"
#include "GrTextBase"
#include "GrAsm"
#include "GrPalette"
#include "GrDC"
#include "GrInitB"
#include "GrMath"
#include "GrScreen"
#include "GrBitMap"
#include "GrPrimatives"
#include "GrComposites"
#define GE_ABORT (-1)
#define GE_EXIT 0
#define GE_CONT 1
#include "SpriteNew"
#include "GrSpritePlot"
#include "SpriteMesh"
#include "SpriteBitMap"
#include "SpriteCode"
#include "SpriteEd"
#include "SpriteMain"
#include "GrEnd"
Cd("..");;
+6 -8
View File
@@ -144,7 +144,7 @@ U0 SpriteSetOrigin(CSprite *root,I64 dx,I64 dy,I64 dz)
}
}
CSprite *SpriteTransformCircle(I64 r[4][4],CSprite *tempg)
CSprite *SpriteTransformCircle(I64 *r,CSprite *tempg)
{
I64 x,y,z;
F64 m1,a1,m2,radius=tempg->pr.radius<<16;
@@ -171,7 +171,7 @@ CSprite *SpriteTransformCircle(I64 r[4][4],CSprite *tempg)
return tempg1;
}
CSprite *SpriteTransformEllipse(I64 r[4][4],CSprite *tempg)
CSprite *SpriteTransformEllipse(I64 *r,CSprite *tempg)
{
I64 x,y,z;
F64 m1,a1,m2,a2,s,c,x_radius=tempg->pwha.width<<16,
@@ -211,7 +211,7 @@ CSprite *SpriteTransformEllipse(I64 r[4][4],CSprite *tempg)
return tempg1;
}
CSprite *SpriteTransformRect(I64 r[4][4],CSprite *tempg,F64 é)
CSprite *SpriteTransformRect(I64 *r,CSprite *tempg,F64 é)
{
I64 x,y,z,w,h;
F64 m1,a1,m2,a2,s,c,
@@ -252,7 +252,7 @@ CSprite *SpriteTransformRect(I64 r[4][4],CSprite *tempg,F64
return tempg1;
}
CSprite *SpriteTransformBitmap(I64 r[4][4],CSprite *tempg)
CSprite *SpriteTransformBitmap(I64 *r,CSprite *tempg)
{
CDC *img,*tempb;
U8 *elems;
@@ -334,7 +334,7 @@ CSprite *SpriteTransformBitmap(I64 r[4][4],CSprite *tempg)
return tempg1;
}
U0 SpriteTransform(I64 r[4][4],CSprite *root)
U0 SpriteTransform(I64 *r,CSprite *root)
{
I64 i,j,k,num,
x,y,z,x1,y1,z1,x2,y2,z2,x3,y3,z3;
@@ -886,14 +886,13 @@ U0 SpriteCtrlPtsMove(CEdSprite *root,I64 dx,I64 dy)
Bool SpriteShiftPts(U8 *elems,I64 x,I64 y,I64 *_cur_elem_num,I64 mode)
{
I64 msg_code,a1,a2,xx,yy,xx2,yy2,dd,best_dd,cur_elem_num;
Bool old_preempt,result=TRUE;
Bool result=TRUE;
CDC *dc=DCAlias;
CEdSprite root,*temppe,*best_pe;
SpritePtQueNew(elems,x,y,&root);
cur_elem_num=0;
if (root.next!=&root) {
old_preempt=Preempt;
while (TRUE) {
SpriteCtrlPtsDraw(dc,&root); //has WinMgrSync
switch (msg_code=ScanMsg(&a1,&a2,
@@ -999,7 +998,6 @@ gs_key:
}
}
gs_done:
Preempt(old_preempt);
QueDel(&root,TRUE);
}
DCFill(dc);
-1
View File
@@ -965,7 +965,6 @@ $WW,0$*/
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
AutoComplete;
Preempt; //We don't really want window update while modifying links
RegOneTimePopUp(ARf_MESH_ED,
"$$GREEN$$Right Mouse$$FG$$: Hold and move to shift cursor z\n"
"$$GREEN$$'j'$$FG$$: Jump cursor Z to nearest vertex's Z\n"