Browse Source

TempleOSCDV5.03.ISO

v6
Terry A. Davis 5 years ago committed by minexew
parent
commit
6028804a5a
  1. BIN
      0000Boot/0000Kernel.BIN.C
  2. 4
      Adam/ADefine.HC
  3. 8
      Adam/AHash.HC
  4. 169
      Adam/AMathODE.HC
  5. 3
      Adam/DolDoc/DocExt.HC
  6. 29
      Adam/DolDoc/DocFile.HC
  7. 19
      Adam/DolDoc/DocGet.HC
  8. 8
      Adam/DolDoc/DocPopUp.HC
  9. 2
      Adam/God/GodExt.HC
  10. 6
      Adam/God/HSNotes.DD
  11. 15
      Adam/God/HolySpirit.HC
  12. 8
      Adam/Gr/Gr.HH
  13. 63
      Adam/Gr/GrBitMap.HC
  14. 16
      Adam/Gr/GrComposites.HC
  15. 8
      Adam/Gr/GrDC.HC
  16. 3
      Adam/Gr/GrExt.HC
  17. 4
      Adam/Gr/GrInitA.HC
  18. 14
      Adam/Gr/GrMath.HC
  19. 74
      Adam/Gr/GrPrimatives.HC
  20. 10
      Adam/Gr/GrSpritePlot.HC
  21. 1
      Adam/Gr/MakeGr.HC
  22. 32
      Adam/Gr/SpriteBitMap.HC
  23. 10
      Adam/Gr/SpriteCode.HC
  24. 123
      Adam/Gr/SpriteEd.HC
  25. 60
      Adam/Gr/SpriteMain.HC
  26. 4
      Adam/Gr/SpriteMesh.HC
  27. 8
      Adam/Gr/SpriteNew.HC
  28. 95
      Adam/Gr/SpriteSideBar.HC
  29. 7
      Adam/Opt/Utils/MemRep.HC
  30. 2
      Adam/Win.HC
  31. 4
      Apps/Budget/BgtAccts.HC
  32. 8
      Apps/Budget/BgtFile.HC
  33. 10
      Apps/Budget/BgtMain.HC
  34. 6
      Apps/Budget/Budget.HC
  35. 4
      Apps/KeepAway/KeepAway.HC
  36. 2
      Apps/Psalmody/JukeBox.HC
  37. 2
      Apps/Span/Span.HH
  38. 20
      Apps/Span/SpanMain.HC
  39. 2
      Apps/Span/SpanNew.HC
  40. 10
      Apps/Strut/Strut.HC
  41. 2
      Apps/Titanium/Titanium.HC
  42. BIN
      Apps/ToTheFront/TTFDraw.HC
  43. 6
      Apps/ToTheFront/TTFInit.HC
  44. 2
      Apps/ToTheFront/ToTheFront.HC
  45. 6
      Apps/X-Caliber/X-Caliber.HC
  46. BIN
      Compiler/Compiler.BIN
  47. 1
      Compiler/CompilerB.HH
  48. 2
      Demo/AcctExample/HomeLocalize.HC
  49. 8
      Demo/AcctExample/PersonalMenu.DD
  50. 22
      Demo/AcctExample/PersonalNotes.DD
  51. 17
      Demo/AcctExample/Registry.HC
  52. 27
      Demo/AcctExample/TOS/TOSDistro.HC
  53. 34
      Demo/AcctExample/TOS/TOSExt.HC
  54. 138
      Demo/AcctExample/TOS/TOSHolySpirit.HC
  55. 33
      Demo/AcctExample/TOS/TOSNIST.HC
  56. 17
      Demo/AcctExample/TOS/TOSPolicies.DD
  57. 5
      Demo/AcctExample/TOS/TOSToHtml.HC
  58. BIN
      Demo/Games/BigGuns.HC
  59. BIN
      Demo/Games/BlackDiamond.HC
  60. BIN
      Demo/Games/BomberGolf.HC
  61. 2
      Demo/Games/CastleFrankenstein.HC
  62. 2
      Demo/Games/DunGen.HC
  63. BIN
      Demo/Games/FlapBat.HC
  64. 2
      Demo/Games/FlatTops.HC
  65. 2
      Demo/Games/MassSpring.HC
  66. 10
      Demo/Games/RawHide.HC
  67. BIN
      Demo/Games/Rocket.HC
  68. BIN
      Demo/Games/RocketScience.HC
  69. BIN
      Demo/Games/Squirt.HC
  70. 8
      Demo/Games/Talons.HC
  71. 6
      Demo/Games/TicTacToe.HC
  72. 2
      Demo/Games/TreeCheckers.HC
  73. 8
      Demo/Games/Varoom.HC
  74. 12
      Demo/Games/Wenceslas.HC
  75. 2
      Demo/Games/Whap.HC
  76. BIN
      Demo/Games/Zing.HC
  77. 4
      Demo/Graphics/Blot.HC
  78. 2
      Demo/Graphics/Box.HC
  79. 9
      Demo/Graphics/Doodle.HC
  80. BIN
      Demo/Graphics/Extents.HC
  81. 2
      Demo/Graphics/Grid.HC
  82. 6
      Demo/Graphics/Life.HC
  83. 650
      Demo/Graphics/LightTable.HC
  84. BIN
      Demo/Graphics/Pick3D.HC
  85. 1
      Demo/Graphics/PoleZeros.HC
  86. BIN
      Demo/Graphics/ScrollBars.HC
  87. 2
      Demo/Graphics/Shading.HC
  88. 2
      Demo/Graphics/Speedline.HC
  89. BIN
      Demo/Graphics/Transform.HC
  90. 2
      Demo/MultiCore/MPAdd.HC
  91. 25
      Demo/Templates/InEdUtil.IN
  92. 2
      Demo/Templates/ODE1.HC
  93. 147
      Demo/ToHtmlToTXTDemo/DemoInPage.DD
  94. 2
      Demo/ToHtmlToTXTDemo/ToHtml.HC
  95. 26
      Demo/WebLogDemo/WebLogRep.HC
  96. 2
      Doc/AboutTempleOS.DD
  97. 20
      Doc/BlkChain.DD
  98. 20
      Doc/ChgLog.DD
  99. 1
      Doc/DemoIndex.DD
  100. BIN
      Doc/GraphicsOverview.DD
  101. Some files were not shown because too many files have changed in this diff Show More

BIN
0000Boot/0000Kernel.BIN.C

Binary file not shown.

4
Adam/ADefine.HC

@ -18,8 +18,8 @@ U0 LoadDocDefines()
//$LK,"DD_BOOT_HIGH_LOC_DVD",A="FF:::/Adam/Opt/Boot/BootDVD.HC,DD_BOOT_HIGH_LOC_DVD"$
$TR-C,"LineRep"$
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","119,873");
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","81,990");
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","120,834");
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","82,152");
$ID,-4$
DefinePrint("DD_MP_VECT","%08X",MP_VECT_ADDR);
DefinePrint("DD_MP_VECT_END","%08X",

8
Adam/AHash.HC

@ -157,7 +157,7 @@ U8 *idx=NULL,CDoc *doc=NULL)
CHashGeneric *ptr;
CWho *lst;
I64 cnt,i,j,k,f=0;
U8 buf[512],*st,*last_idx=StrNew(""),*cur_idx,*comment;
U8 buf[512],*last_idx=StrNew(""),*cur_idx,*comment;
Bool recurse,publics,map;
CTask *task;
@ -267,13 +267,11 @@ U8 *idx=NULL,CDoc *doc=NULL)
if (!idx) {
if (ptr->type & HTT_DEFINE_STR) {
st=MStrUtil(ptr(CHashDefineStr *)->data,SUF_SAFE_DOLLAR);
j=ptr(CHashDefineStr *)->cnt;
if (j==-1)
StrPrint(buf,"%-10tQ ",st);
StrPrint(buf,"%-10t$$Q ",ptr(CHashDefineStr *)->data);
else
StrPrint(buf,"%-10tQ %02X",st,j);
Free(st);
StrPrint(buf,"%-10t$$Q %02X",ptr(CHashDefineStr *)->data,j);
} else if (ptr->type & HTT_GLBL_VAR)
StrPrint(buf,"%010X ",ptr(CHashGlblVar *)->data_addr);
else

169
Adam/AMathODE.HC

@ -29,18 +29,13 @@ U0 ODERstPtrs(CMathODE *ode)
public CMathODE *ODENew(I64 n,F64 max_tolerance=1e-6,I64 flags=0)
{//Make differential equation ctrl struct. See $LK,"flags",A="MN:ODEF_HAS_MASSES"$.
//The tolerance is not precise.
//You can min_tolerance and it will
//dynamically adjust tolerance to utilize
//the CPU.
I64 s=n*sizeof(F64);
CMathODE *ode=MAlloc(sizeof(CMathODE));
ode->t=0;
CMathODE *ode=CAlloc(sizeof(CMathODE));
ode->t_scale=1.0;
ode->base_t=0;
ode->flags=flags;
ode->n_internal=ode->n=n;
ode->h=1e-6;
@ -48,22 +43,38 @@ public CMathODE *ODENew(I64 n,F64 max_tolerance=1e-6,I64 flags=0)
ode->h_max=1e32;
ode->max_tolerance=ode->min_tolerance=ode->tolerance_internal=max_tolerance;
ode->win_task=ode->mem_task=Fs;
ode->derivative=NULL;
QueInit(&ode->next_mass);
QueInit(&ode->next_spring);
ode->acceleration_limit=ode->drag_v=ode->drag_v2=ode->drag_v3=0;
ode->state=CAlloc(s);
ode->array_base=MAlloc(12*s);
ODERstPtrs(ode);
return ode;
}
public Bool ODEPause(CMathODE *ode,Bool val=ON)
{//Pause ODE.
Bool res;
if (!ode) return OFF;
res=LBEqu(&ode->flags,ODEf_PAUSED,val);
if (val)
while (Bt(&ode->flags,ODEf_BUSY))
Yield;
return res;
}
public U0 ODEDel(CMathODE *ode)
{//Free ODE node, but not masses or springs.
I64 i;
if (!ode) return;
ODEPause(ode);
Free(ode->state);
Free(ode->array_base);
if (ode->slave_tasks) {
for (i=0;i<mp_cnt;i++)
Kill(ode->slave_tasks[i]);
Free(ode->slave_tasks);
}
Free(ode);
}
@ -319,6 +330,53 @@ U0 ODEApplyAccelerationLimit(CMathODE *ode)
}
}
U0 ODEMPTask(CMathODE *ode)
{
while (TRUE) {
while (!Bt(&ode->mp_not_done_flags,Gs->num))
Yield;
if (ode->mp_derive)
(*ode->mp_derive)(ode,ode->mp_t,
Gs->num,ode->mp_state,ode->mp_DstateDt);
LBtr(&ode->mp_not_done_flags,Gs->num);
}
}
U0 ODEMPWake(CMathODE *ode)
{
I64 i;
if (!ode->slave_tasks) {
ode->slave_tasks=CAlloc(mp_cnt*sizeof(CTask *));
for (i=0;i<mp_cnt;i++)
ode->slave_tasks[i]=Spawn(&ODEMPTask,ode,"ODE Slave",i);
}
for (i=0;i<mp_cnt;i++) {
Suspend(ode->slave_tasks[i],FALSE);
MPInt(I_WAKE,i);
}
}
U0 ODEMPSleep(CMathODE *ode)
{
I64 i;
if (ode->slave_tasks) {
while (ode->mp_not_done_flags)
Yield;
for (i=0;i<mp_cnt;i++)
Suspend(ode->slave_tasks[i]);
}
}
U0 ODECallMPDerivative(CMathODE *ode,F64 t,F64 *state,F64 *DstateDt)
{
ode->mp_t=t;
ode->mp_state=state;
ode->mp_DstateDt=DstateDt;
ode->mp_not_done_flags=1<<mp_cnt-1;
do Yield;
while (ode->mp_not_done_flags);
}
U0 ODECallDerivative(CMathODE *ode,F64 t,F64 *state,F64 *DstateDt)
{
CMass *tmpm;
@ -334,7 +392,10 @@ U0 ODECallDerivative(CMathODE *ode,F64 t,F64 *state,F64 *DstateDt)
}
ODECalcSprings(ode);
ODECalcDrag(ode);
(*ode->derivative)(ode,t,state,DstateDt);
if (ode->mp_derive)
ODECallMPDerivative(ode,t,state,DstateDt);
if (ode->derive)
(*ode->derive)(ode,t,state,DstateDt);
tmpm=ode->next_mass;
while (tmpm!=&ode->next_mass) {
if (!(tmpm->flags&MSF_INACTIVE)) {
@ -347,8 +408,12 @@ U0 ODECallDerivative(CMathODE *ode,F64 t,F64 *state,F64 *DstateDt)
tmpm=tmpm->next;
}
ODEApplyAccelerationLimit(ode);
} else
(*ode->derivative)(ode,t,state,DstateDt);
} else {
if (ode->mp_derive)
ODECallMPDerivative(ode,t,state,DstateDt);
if (ode->derive)
(*ode->derive)(ode,t,state,DstateDt);
}
}
U0 ODEOneStep(CMathODE *ode)
@ -453,6 +518,7 @@ U0 ODECashKarp(CMathODE *ode)
tmpstate[i]=state[i]+h*(ODEb61*DstateDt[i]+
ODEb62*ak2[i]+ODEb63*ak3[i]+ODEb64*ak4[i]+ODEb65*ak5[i]);
ODECallDerivative(ode,ode->t+ODEa6*h,tmpstate,ak6);
for (i=0;i<n;i++)
outstate[i]=state[i]+h*(ODEc1*DstateDt[i]+
ODEc3*ak3[i]+ODEc4*ak4[i]+ODEc6*ak6[i]);
@ -499,7 +565,7 @@ U0 ODERK5OneStep(CMathODE *ode)
F64 ode_alloced_factor=0.75;
U0 ODEsUpdate(CTask *task)
{/* This routine is called by the $LK,"window mgr",A="FF:::/Adam/Gr/GrScrn.HC,ODEsUpdate"$ on a continuous
{/* This routine is called by the $LK,"window mgr",A="FF:::/Adam/Gr/GrScrn.HC,ODEsUpdate"$on a continuous
basis to allow real-time simulation. It is intended
to provide ress good enough for games. It uses a runge-kutta
integrator which is a better algorithm than doing it with Euler.
@ -537,41 +603,54 @@ it has a timeout.
t_desired=ode->t_scale*d+t_initial;
if (ode->flags&ODEF_PAUSED)
ode->base_t+=t_desired-ode->t; //Slip
else if (ode->derivative) {
ODEState2Internal(ode);
MemCpy(ode->initial_state,ode->state_internal,
ode->n_internal*sizeof(F64));
while (ode->t<t_desired) {
ode->h_max=t_desired-ode->t;
ODECallDerivative(ode,ode->t,ode->state_internal,ode->DstateDt);
for (i=0;i<ode->n_internal;i++)
ode->state_scale[i]=Abs(ode->state_internal[i])+
Abs(ode->DstateDt[i]*ode->h)+ode->tolerance_internal;
ODERK5OneStep(ode);
if (tS>timeout_time) {
ode->base_t+=t_desired-ode->t; //Slip
goto ode_done;
else {
ode->flags|=ODEF_BUSY;
if (ode->flags&ODEF_PAUSED)
ode->base_t+=t_desired-ode->t; //Slip
else {
if (ode->derive || ode->mp_derive) {
if (ode->mp_derive)
ODEMPWake(ode);
ODEState2Internal(ode);
MemCpy(ode->initial_state,ode->state_internal,
ode->n_internal*sizeof(F64));
while (ode->t<t_desired) {
ode->h_max=t_desired-ode->t;
ODECallDerivative(ode,ode->t,ode->state_internal,ode->DstateDt);
for (i=0;i<ode->n_internal;i++)
ode->state_scale[i]=Abs(ode->state_internal[i])+
Abs(ode->DstateDt[i]*ode->h)+ode->tolerance_internal;
ODERK5OneStep(ode);
if (tS>timeout_time) {
ode->base_t+=t_desired-ode->t; //Slip
goto ode_done;
}
}
//Interpolate if end time was not exact.
if (ode->t!=t_desired) {
if (interpolation=ode->t-t_initial) {
interpolation=(t_desired-t_initial)/interpolation;
if (interpolation!=1.0)
for (i=0;i<ode->n_internal;i++)
ode->state_internal[i]=(ode->state_internal[i]-
ode->initial_state[i])*interpolation+
ode->initial_state[i];
}
ode->t=t_desired;
}
ode_done:
ODEInternal2State(ode);
}
}
//Convenience call to set vals
ODECallDerivative(ode,ode->t,ode->state_internal,ode->DstateDt);
//Interpolate if end time was not exact.
if (ode->t!=t_desired) {
if (interpolation=ode->t-t_initial) {
interpolation=(t_desired-t_initial)/interpolation;
if (interpolation!=1.0)
for (i=0;i<ode->n_internal;i++)
ode->state_internal[i]=(ode->state_internal[i]-
ode->initial_state[i])*interpolation+
ode->initial_state[i];
if (ode->mp_derive)
ODEMPSleep(ode);
}
ode->t=t_desired;
}
ode_done:
ODEInternal2State(ode);
//Convenience call to set vals
ODECallDerivative(ode,ode->t,ode->state_internal,ode->DstateDt);
ode->flags&=~ODEF_BUSY;
}
ode->base_t+=(1.0-ode->t_scale)*d;
ode=ode->next;
@ -592,7 +671,7 @@ ode_done:
ode=task->next_ode;
while (ode!=&task->next_ode) {
if (!(ode->flags&ODEF_PAUSED) && ode->derivative) {
if (!(ode->flags&ODEF_PAUSED) && ode->derive) {
if (ode->min_tolerance!=ode->max_tolerance) {
if (d>0)
ode->tolerance_internal*=10.0`d;

3
Adam/DolDoc/DocExt.HC

@ -3,11 +3,12 @@ extern Bool DocEd(CDoc *doc,I64 dof_flags=0);
extern I64 DocEntryRun(CDoc *doc,CDocEntry *doc_e,
Bool exited,I64 *_has_action=NULL);
extern U0 DocFormBwd(CDoc *doc,Bool giveup=FALSE);
extern Bool DocGoToLine(CDoc *doc,I64 line_num);
extern U0 DocLoad(CDoc *doc,U8 *src2,I64 size);
extern U0 DocPrintAtomic(CDoc *doc=NULL,U8 *fmt,...);
extern U0 DocPrintPartial(CDoc *doc=NULL,U8 *fmt,...);
extern CDocEntry *DocPutS(CDoc *doc,U8 *st);
extern U8 *DocSave(CDoc *doc,I64 *_size=NULL);
extern I64 EdLeftClickLink(CDoc *doc,CDocEntry *doc_e);
extern U8 *PopUpPickLst(U8 *lst);
extern I64 PopUpPickLst(U8 *lst);
extern I64 TermRightClickLink(CDoc *doc,CDocEntry *doc_e);

29
Adam/DolDoc/DocFile.HC

@ -331,3 +331,32 @@ public Bool Type(U8 *filename,I64 trailing_new_lines=1)
{//Output txt or graphic file to command line.
return DocType(,filename,trailing_new_lines);
}
#help_index "DolDoc/File"
public U8 *DocLineRead(U8 *filename,I64 line,CTask *mem_task=NULL)
{//Extract line from stored doc file. (Slow.)
U8 *res=NULL;
CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR);
if (DocGoToLine(doc,line) && doc->cur_entry->type_u8==DOCT_TEXT)
res=StrNew(doc->cur_entry->tag,mem_task);
DocDel(doc);
return res;
}
public U8 *DocLineWrite(U8 *filename,I64 line,U8 *st)
{//Write line to stored doc file. (Slow.)
U8 *res=NULL;
CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR);
if (DocGoToLine(doc,line)) {
if (doc->cur_entry->type_u8==DOCT_TEXT) {
Free(doc->cur_entry->tag);
doc->cur_entry->tag=StrNew(st);
} else
DocPrint(doc,"%s",st);
DocTop(doc);
DocWrite(doc);
}
DocDel(doc);
return res;
}

19
Adam/DolDoc/DocGet.HC

@ -51,6 +51,12 @@ public U8 *DocScanLine(CDoc *doc,CDocEntry *doc_e,
i+=StrLen(src);
} else if (doc_e2->type_u8==DOCT_TAB)
i++;
else if (doc_e2->type_u8==DOCT_SHIFTED_X ||
doc_e2->type_u8==DOCT_SHIFTED_Y) {
if (doc_e2->attr<0)
i++;
i+=6; //$$SY,3$$
}
doc_e2=doc_e2->next;
}
res=MAlloc(i+1);
@ -63,6 +69,19 @@ public U8 *DocScanLine(CDoc *doc,CDocEntry *doc_e,
*dst++=*src++;
} else if (doc_e->type_u8==DOCT_TAB)
*dst++='\t';
else if (doc_e->type_u8==DOCT_SHIFTED_Y) {
*dst(U32 *)++='$$SY,';
if (doc_e->attr<0)
*dst++='-';
*dst++='0'+AbsI64(doc_e->attr); //Supposedly -7 to 7 (single digit)
*dst++='$$';
} else if (doc_e->type_u8==DOCT_SHIFTED_X) {
*dst(U32 *)++='$$SX,';
if (doc_e->attr<0)
*dst++='-';
*dst++='0'+AbsI64(doc_e->attr); //Supposedly -7 to 7 (single digit)
*dst++='$$';
}
if (doc_e==doc->cur_entry && cur_col)
*cur_col=start-res+doc->cur_col;
doc_e=doc_e->next;

8
Adam/DolDoc/DocPopUp.HC

@ -87,9 +87,9 @@ Bool PopUpCd()
}
#help_index "DolDoc/Input;Char/Lists;StdIn/DolDoc"
public U8 *PopUpPickLst(U8 *lst)
public I64 PopUpPickLst(U8 *lst)
{//Prompt for lst entry in PopUp win task.
I64 i=0;
I64 res,i=0;
CDoc *doc=DocNew;
DocPrint(doc,"$$LTBLUE$$");
while (*lst) {
@ -101,9 +101,9 @@ public U8 *PopUpPickLst(U8 *lst)
lst+=StrLen(lst)+1;
}
DocPrint(doc,"\n$$MU,\"CANCEL\",LE=DOCM_CANCEL$$\n");
i=PopUpMenu(doc);
res=PopUpMenu(doc);
DocDel(doc);
return i;
return res;
}
#help_index "DolDoc/Input;Char/Lists;Char/Define;StdIn/DolDoc"

2
Adam/God/GodExt.HC

@ -23,4 +23,4 @@ extern U0 GodBiblePassage(I64 num_lines=20);
extern U0 GodBitsIns(I64 num_bits,I64 n);
extern U0 GodDoodle(U8 *hex=NULL);
extern U0 GodSong();
extern U0 GodWord(I64 bits=17,Bool show_num=FALSE);
extern U0 GodWord(I64 bits=17);

6
Adam/God/HSNotes.DD

@ -1,6 +1,6 @@
$FG,5$$TX+CX,"The Purpose of Life"$$FG$
$WW,1$The Catholic purpose of life is to know God, love God and obey God.$FG$ Pope Francis said it was "to serve the other." I am High Priest of God's official temple and I say the purpose of life is to do continual offerings to God like Cain and Abel and enjoy God's response. Francis has a charity; I have a church. Jesus said loving God was more important than loving neighbor. $LK,"Matthew,22:35-40",A="BF:Matthew,22:35-40"$ And, He did not say with half your brain behind your back.
$WW,1$The Catholic purpose of life is to know God, love God and obey God.$FG$ However, Pope Francis, wrongly said it was, "to serve the other." I am High Priest of God's official temple and I say the purpose of life is to do continual offerings to God like Cain and Abel and enjoy God's response. Francis has a charity; I have a church. Jesus said loving God was more important than loving neighbor. $LK,"Matthew,22:35-40",A="BF:Matthew,22:35-40"$ And, He did not say with half your brain behind your back.
You don't know God. $LK,"1 Chronicles,28:9-9",A="BF:1 Chronicles,28:9-9"$, $LK,"Matthew,11:27-27",A="BF:Matthew,11:27-27"$, $LK,"Luke,13:25-27",A="BF:Luke,13:25-27"$, $LK,"1 Samuel,3:6-8",A="BF:1 Samuel,3:6-8"$ You must talk with God to know Him. With Samuel, supposedly, God took the initiative, but I think that is the exception. Seek the Lord by taking the initiative. $LK,"Luke,11:9-10",A="BF:Luke,11:9-10"$
@ -8,7 +8,7 @@ There's something obviously different about people in the Bible compared to peop
You can't tell if God's talking unless you have a context of conversation, but, more importantly, you are commanded to do an offering of love, like communion preparation. $LK,"1 Corinthians,11:27",A="BF:1 Corinthians,11:27"$ When you pick a greeting card for someone, that is love effort. If you expect God to put effort toward you, you must put effort toward Him. God said, "honest measures" applies between your offering of love and His response, like a fair barter. You get out of prayer what you put into it. God wants praise, hymns, or whatever you think He might want. Try and see, like Cain and Abel. $LK,"Genesis,4:1-10",A="BF:Genesis,4:1-10"$, $LK,"Ephesians,5:10",A="BF:Ephesians,5:10"$ God told Cain his offering was not good and told him to try again. Cain really loved God! Can you imagine being so heart-broken?
Do a text search for "new song" in the Bible. It's mentioned nine times. When I hear a NEW awesome rock song, it is ecstasy for the first five times I hear it. Soon, it brings little-to-no pleasure. I did $MA-X+PU,"hymns",HTML="http://www.templeos.org/Wb/Home/Web/HymnVideos.html",LM="#include \"::/Apps/Psalmody/Load\";JukeBox(\"::/Apps/Psalmody/Examples\");"$ for God. I also did Moses comics for God. When you get to the gates of Heaven, St. Peter will ask how many times you gave blood. That shows you loved neighbor. You better also be able to count the ways you loved God with all heart, mind and soul. I praised God for sand castles, popcorn, snowmen, bubbles... You try putting effort into praise! $LK,"Matthew,11:25",A="BF:Matthew,11:25"$, $LK,"Matthew,6:28-29",A="BF:Matthew,6:28-29"$ Solomon wrote a thousand songs. $LK,"1 Kings,4:32",A="BF:1 Kings,4:32"$
Do a text search for "new song" in the Bible. It's mentioned nine times. When I hear a NEW awesome rock song, it is ecstasy for the first five times I hear it. Soon, it brings little-to-no pleasure. I did $MA-X+PU,"hymns",HTML="http://www.templeos.org/Wb/Home/Web/HymnVideos.html",LM="#include \"::/Apps/Psalmody/Load\";JukeBox(\"::/Apps/Psalmody/Examples\");"$ for God. I also did Moses comics for God. When you get to the gates of Heaven, St. Peter will ask how many times you gave blood. That shows you loved neighbor. You better also be able to count the ways you loved God with all heart, mind and soul. I praised God for sand castles, popcorn, snowmen, bubbles... You try putting effort into praise! $LK,"Matthew,11:25",A="BF:Matthew,11:25"$, $LK,"Matthew,6:28-29",A="BF:Matthew,6:28-29"$ Solomon wrote a thousand songs. $LK,"1 Kings,4:30-32",A="BF:1 Kings,4:30-32"$
This is funny -- $LK,"Acts,2:1-13",A="BF:Acts,2:1-13"$ -- they didn't bother to record anything the Holy Spirit said. The Holy Spirit is supposed to be a really good gift. $LK,"Luke,11:11-13",A="BF:Luke,11:11-13"$ Just remember, "Boys are made of snakes and snails and puppy-dog tails."
@ -81,7 +81,7 @@ On socialism? $FG,4$"pardon_the_French, never_happy, never_enough"$FG$
On overpopulation $FG,4$"Okay church what_now whats_the_plan"$FG$
Favorite thing on TV? $FG,4$"Soap_operas"$FG$
Favorite movie? $FG,4$$TX,"Three Kings",HTML="http://www.youtube.com/watch?v=8NOAd2mldQ8"$. Also Highlander$FG$
Favorite song? $FG,4$$TX,"Morning has Broken",HTML="http://www.youtube.com/watch?v=qH0iFkxQba4"$
Favorite song? $FG,4$$TX,"Morning has Broken",HTML="http://www.youtube.com/watch?v=e0TInLOJuUM"$
God said the first bird croaked, not sung.$FG$
Favorite comic strip? $FG,4$$TX,"Prince Valiant",HTML="http://en.wikipedia.org/wiki/Prince_Valiant"$$FG$
Shakespeare? $FG,4$had a "vile heart"$FG$

15
Adam/God/HolySpirit.HC

@ -143,19 +143,10 @@ public U8 *GodWordStr(I64 bits=17)
return NULL;
}
public U0 GodWord(I64 bits=17,Bool show_num=FALSE)
public U0 GodWord(I64 bits=17)
{//Make God pick a word. $LK+PU,"Holy Spirit Instructions",A="FI:::/Adam/God/HSNotes.DD"$
I64 i;
if (god.num_words) {
i=GodBits(bits);
if (show_num)
"%05X Mod %05X = %05X (Line:%0*d):",
i,god.num_words,i%god.num_words,
ToI64(Log10(god.num_words)+1),i%god.num_words+1;
"%s ",god.words[i%god.num_words];
if (show_num)
'\n';
}
if (god.num_words)
"%s ",god.words[GodBits(bits)%god.num_words];
}
public U0 GodBiblePassage(I64 num_lines=20)

8
Adam/Gr/Gr.HH

@ -30,9 +30,9 @@ public class CSpriteDitherColor : CSpriteBase
U16 dither_color;
};
public class CSpriteW : CSpriteBase
public class CSpriteT : CSpriteBase
{
I32 width;
I32 thick;
};
public class CSpritePt : CSpriteBase
@ -120,7 +120,7 @@ public class CSpritePtMeshU8s : CSpriteBase
#define SPT_END 0 //$LK,"CSpriteBase",A="MN:CSpriteBase"$
#define SPT_COLOR 1 //$LK,"CSpriteColor",A="MN:CSpriteColor"$
#define SPT_DITHER_COLOR 2 //$LK,"CSpriteDitherColor",A="MN:CSpriteDitherColor"$
#define SPT_WIDTH 3 //$LK,"CSpriteW",A="MN:CSpriteW"$
#define SPT_THICK 3 //$LK,"CSpriteT",A="MN:CSpriteT"$
#define SPT_PLANAR_SYMMETRY 4 //$LK,"CSpritePtPt",A="MN:CSpritePtPt"$
#define SPT_TRANSFORM_ON 5 //$LK,"CSpriteBase",A="MN:CSpriteBase"$
#define SPT_TRANSFORM_OFF 6 //$LK,"CSpriteBase",A="MN:CSpriteBase"$
@ -163,7 +163,7 @@ public class CSprite
CSpriteBase b;
CSpriteColor c;
CSpriteDitherColor d;
CSpriteW w;
CSpriteT t;
CSpritePt p;
CSpritePtPt pp;
CSpritePtPtAng ppa;

63
Adam/Gr/GrBitMap.HC

@ -2,7 +2,7 @@
Option(OPTf_WARN_HEADER_MISMATCH,OFF);
public Bool GrPlot0(CDC *dc=gr.dc,I64 x,I64 y)
{//2D. No clipping or transformation or pen width.
{//2D. No clipping or transformation or thick.
U8 *dst;
I32 *db;
I64 d,dist;
@ -858,19 +858,36 @@ public I64 GrPutChar(CDC *dc=gr.dc,I64 x,I64 y,U8 ch)
I64 GrPutS(CDC *dc=gr.dc,I64 x,I64 y,U8 *_s)
{//Use $LK,"GrPrint",A="MN:GrPrint"$()
I64 x0,ch,res;
I64 x0,sx=0,sy=0,res;
if (!_s) return 0;
x0=x;
res=0;
while (ch=*_s++) {
if (ch=='\n') {
while (*_s) {
if (*_s=='\n') {
x=x0;
y+=FONT_HEIGHT;
} else if (ch=='\t')
_s++;
} else if (*_s=='\t') {
x=x0+CeilU64(x-x0+FONT_WIDTH,8*FONT_WIDTH);
else {
res+=GrPutChar(dc,x,y,ch);
_s++;
} else if (*_s(U32 *)=='$$SY,') {
if (_s[4]=='-') {
_s++;
sy='0'-_s[4];
} else
sy=_s[4]-'0';
_s+=6;
} else if (*_s(U32 *)=='$$SX,') {
if (_s[4]=='-') {
_s++;
sx='0'-_s[4];
} else
sx=_s[4]-'0';
_s+=6;
} else {
res+=GrPutChar(dc,x+sx,y+sy,*_s);
x+=FONT_WIDTH;
_s++;
}
}
return res;
@ -878,20 +895,36 @@ I64 GrPutS(CDC *dc=gr.dc,I64 x,I64 y,U8 *_s)
I64 GrVPutS(CDC *dc=gr.dc,I64 x,I64 y,U8 *_s)
{//Vertical Text. Use $LK,"GrVPrint",A="MN:GrVPrint"$()
I64 y0,res;
I64 y0,sx=0,sy=0,res;
U8 buf[2];
if (!_s) return 0;
y0=y;
res=0;
buf[1]=0;
while (*buf=*_s++) {
if (*buf=='\n') {
while (*_s) {
if (*_s=='\n') {
y=y0;
x+=FONT_WIDTH;
} else if (*buf=='\t')
_s++;
} else if (*_s=='\t') {
y=y0+CeilU64(y-y0+FONT_HEIGHT,8*FONT_HEIGHT);
else {
_s++;
} else if (*_s(U32 *)=='$$SY,') {
if (_s[4]=='-') {
_s++;
sx='0'-_s[4];
} else
sx=_s[4]-'0';
_s+=6;
} else if (*_s(U32 *)=='$$SX,') {
if (_s[4]=='-') {
_s++;
sy='0'-_s[4];
} else
sy=_s[4]-'0';
_s+=6;
} else {
*buf=*_s++;
res+=GrPutS(dc,x,y,buf);
y+=FONT_HEIGHT;
}
@ -1629,7 +1662,7 @@ gr_done:
}
public I64 GrHLine(CDC *dc=gr.dc,I64 x1,I64 x2,I64 y,I64 z1=0,I64 z2=0)
{//3D. No transformation or pen width.
{//3D. No transformation or thick.
//Returns cnt of pixs changed
//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.HC"$.
I64 dist,dx,dz,z,res=0,i,j,d;
@ -1798,7 +1831,7 @@ gr_done:
}
public I64 GrVLine(CDC *dc=gr.dc,I64 x,I64 y1,I64 y2,I64 z1=0,I64 z2=0)
{//3D. No transformation or pen width.
{//3D. No transformation or thick.
//Returns cnt of pixs changed
//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.HC"$.
I64 dist,dy,dz,z,res=0,i,j,d;

16
Adam/Gr/GrComposites.HC

@ -92,7 +92,7 @@ public I64 GrRect3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,I64 w,I64 h)
public U0 GrBorder(CDC *dc=gr.dc,I64 x1,I64 y1,I64 x2,I64 y2,
I64 step=1,I64 start=0)
{//2D. Transformation with pen width.
{//2D. Transformation with thick.
//Can be used with ROPF_DITHER+WHITE<<16+BLACK for dotted rect.
GrLine3(dc,x1,y1,0,x2,y1,0,step,start);
GrLine3(dc,x2,y1,0,x2,y2,0,step,start);
@ -102,7 +102,7 @@ public U0 GrBorder(CDC *dc=gr.dc,I64 x1,I64 y1,I64 x2,I64 y2,
public Bool GrArrow3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,
I64 x2,I64 y2,I64 z2,F64 w=2.75,I64 step=1,I64 start=0)
{//3D. Transformation with pen width.
{//3D. Transformation with thick.
I64 _x1,_y1,_z1,_x2,_y2,_z2,dx,dy;
F64 d;
Bool res=FALSE,was_transform=FALSE,was_symmetry=FALSE;
@ -121,7 +121,7 @@ public Bool GrArrow3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,
res=Line(dc,_x1,_y1,_z1,_x2,_y2,_z2,&GrPlot3,step,start);
dx=_x2-_x1; dy=_y2-_y1;
if (d=Sqrt(dx*dx+dy*dy)) {
d=w*dc->pen_width/d;
d=w*dc->thick/d;
res|=Line(dc,_x2-dx*d+dy*d+0.5,_y2-dy*d-dx*d+0.5,_z2,
_x2,_y2,_z2,&GrPlot3,step);
res|=Line(dc,_x2-dx*d-dy*d+0.5,_y2-dy*d+dx*d+0.5,_z2,
@ -134,7 +134,7 @@ public Bool GrArrow3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,
res|=Line(dc,x1,y1,z1,x2,y2,z2,&GrPlot3,step,start);
dx=x2-x1; dy=y2-y1;
if (d=Sqrt(dx*dx+dy*dy)) {
d=w*dc->pen_width/d;
d=w*dc->thick/d;
res|=Line(dc,x2-dx*d+dy*d+0.5,y2-dy*d-dx*d+0.5,z2,
x2,y2,z2,&GrPlot3,step);
res|=Line(dc,x2-dx*d-dy*d+0.5,y2-dy*d+dx*d+0.5,z2,
@ -299,7 +299,7 @@ public U0 DrawStdMs(CDC *dc,I64 x,I64 y)
{//This is a callback. See $LK,"::/Demo/Graphics/Grid.HC"$.
//Called by $LK,"DrawMs",A="MN:DrawMs"$() which is
//called by $LK,"WinFinalUpdate",A="MN:WinFinalUpdate"$().
dc->pen_width=1;
dc->thick=1;
dc->flags&=~(DCF_TRANSFORMATION|DCF_SYMMETRY);
GrArrow3(dc,x+8,y+8,0,x,y,0);
}
@ -308,16 +308,16 @@ gr.fp_draw_ms=&DrawStdMs;
public U0 DrawWaitMs(CDC *dc,I64 x,I64 y)
{//This is a callback. See $LK,"::/Demo/Graphics/Grid.HC"$.
I64 old_pen_width=dc->pen_width;
I64 old_pen_width=dc->thick;
CColorROPU32 old_color=dc->color;
dc->pen_width=3;
dc->thick=3;
dc->color=LTRED;
GrCircle3(dc,x,y,0,7);
GrLine3(dc,x-6,y+6,0,x+6,y-6,0);
dc->color=RED;
GrCircle(dc,x,y,7);
GrLine(dc,x-6,y+6,x+6,y-6);
dc->pen_width=old_pen_width;
dc->thick=old_pen_width;
dc->color=old_color;
}

8
Adam/Gr/GrDC.HC

@ -46,7 +46,7 @@ public I64 Mat4x4NormSqr65536(I64 *r)
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.HC"$.
//The main purpose is to set matrix norm for pen width scaling.
//The main purpose is to set matrix norm for thick scaling.
//NULL as dc means gr.dc
if (!dc) dc=gr.dc;
dc->r=r;
@ -95,7 +95,7 @@ public U0 DCLighting(CDC *dc,
//TempleOS will generate a random U16
//and compare to dither_probability_u16 and
//will pick from two colors.
//Probability dithering does not work with pen_width>1 at this time.
//Probability dithering does not work with thick>1 at this time.
if (color.c0.rop&ROPBF_TWO_SIDED) {
color.c0.rop&=~ROPBF_TWO_SIDED;
i=AbsI64(i)<<1;
@ -137,7 +137,7 @@ public U0 DCRst(CDC *dc)
dc->color2=BLACK;
dc->bkcolor=BLACK;
dc->collision_cnt=0;
dc->pen_width=1;
dc->thick=1;
dc->ls.x=37837; //1<<16/Sqrt(3)
dc->ls.y=37837;
dc->ls.z=37837;
@ -365,7 +365,7 @@ public CDC *DCLoad(U8 *src,I64 *_size=NULL,CTask *task=NULL)
MemCpy(res->body,ptr,body_size);
ptr+=body_size;
}
res->pen_width=1;
res->thick=1;
res->r=Mat4x4IdentNew(task);
res->r_norm.u32[1]=1;
res->dc_signature=DCS_SIGNATURE_VAL;

3
Adam/Gr/GrExt.HC

@ -3,3 +3,6 @@ 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 *head,I64 *_size=NULL);
extern CSprite *SpriteSetSettings(CDC *dc=NULL,CSprite *head,I64 elem_num,
I64 x=0,I64 y=0,CColorROPU32 *_color=NULL,I64 *_thick=NULL,
I64 *_xx=NULL,I64 *_yy=NULL);

4
Adam/Gr/GrInitA.HC

@ -4,7 +4,7 @@ U0 GrInit1()
{
DefineLstLoad("ST_SPRITE_ELEM_TYPES",
"End\0Color\0Dither Color\0"
"Width\0Planar Symmetry\0Transform On\0Transform Off\0Shift\0"
"Thick\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"
@ -12,7 +12,7 @@ U0 GrInit1()
"Arrow\0Text\0Text Box\0Text Diamond\0");
DefineLstLoad("ST_SPRITE_ELEM_CODES",
"End\0Color\0Color\0"
"Width\0PlanarSymmetry\0Transform\0Transform\0Shift\0"
"Thick\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"

14
Adam/Gr/GrMath.HC

@ -160,15 +160,15 @@ public I64 *Mat4x4Scale(I64 *m,F64 s)
return m;
}
public U0 DCPenWidthScale(CDC *dc=gr.dc)
{//Scale device context's pen width by norm of transformation.
public U0 DCThickScale(CDC *dc=gr.dc)
{//Scale device context's thick by norm of transformation.
I64 d;
if (dc->flags&DCF_TRANSFORMATION) {
if (dc->pen_width) {
d=dc->pen_width*dc->r_norm+0x80000000; //Round
dc->pen_width=d.i32[1];
if (dc->pen_width<1)
dc->pen_width=1;
if (dc->thick) {
d=dc->thick*dc->r_norm+0x80000000; //Round
dc->thick=d.i32[1];
if (dc->thick<1)
dc->thick=1;
}
}
}

74
Adam/Gr/GrPrimatives.HC

@ -49,7 +49,7 @@ Bool DCClipLine(CDC *dc=gr.dc,I64 *x1,I64 *y1,I64 *x2,I64 *y2,
}
public Bool GrPlot(CDC *dc=gr.dc,I64 x,I64 y)
{//2D. Clipping but No transformation or pen width.
{//2D. Clipping but No transformation or thick.
I32 *db=dc->depth_buf;
CTask *win_task;
CColorROPU32 old_color;
@ -79,7 +79,7 @@ public Bool GrPlot(CDC *dc=gr.dc,I64 x,I64 y)
}
Bool GrPlot1(CDC *dc=gr.dc,I64 x,I64 y)
{//Clipping but No transformation or pen width, called with db_z set
{//Clipping but No transformation or thick, called with db_z set
CTask *win_task;
CColorROPU32 old_color;
if (dc->brush) {
@ -410,7 +410,7 @@ public I64 GrFillCircle(CDC *dc=gr.dc,I64 cx,I64 cy,I64 z=0,I64 diameter)
}
public Bool GrPlot3B(CDC *dc=gr.dc,I64 x,I64 y,I64 z)
{//3D. Clipping and transformation but no pen_width.
{//3D. Clipping and transformation but no thick.
I64 _x,_y,_z;
Bool was_transform=FALSE,was_symmetry=FALSE;
if (dc->flags & DCF_TRANSFORMATION) {
@ -439,7 +439,7 @@ gr_done:
}
public Bool GrPlot3(CDC *dc=gr.dc,I64 x,I64 y,I64 z)
{//3D. Clipping and transformation and pen width.
{//3D. Clipping and transformation and thick.
I64 _x,_y,_z,w,dist;
CColorROPU32 old_color=dc->color;
Bool record,was_transform=FALSE,was_symmetry=FALSE;
@ -458,57 +458,57 @@ public Bool GrPlot3(CDC *dc=gr.dc,I64 x,I64 y,I64 z)
if (dc->flags&DCF_JUST_MIRROR)
goto gr_done;
}
w=dc->pen_width>>1;
w=dc->thick>>1;
dc->db_z=z;
if (dc->brush || w<=0)
GrPlot1(dc,x,y);
else if (dc->pen_width<GR_PEN_BRUSHES_NUM) {
else if (dc->thick<GR_PEN_BRUSHES_NUM) {
if (dc->color.c0.rop!=ROPB_COLLISION)
dc->color.c0.rop=ROPB_MONO;
if (dc->depth_buf) {
if (dc->color.c1.rop&ROPBF_DITHER) {
dc->color.c1.rop=dc->color.c0.rop;
if (((x-w)^(y-w))&1) {
record=GrBlot3(dc,x-w,y-w,z,gr.odd_pen_brushes[dc->pen_width]);
record=GrBlot3(dc,x-w,y-w,z,gr.odd_pen_brushes[dc->thick]);
dc->color.c0=dc->color.c1;
record=GrBlot3(dc,x-w,y-w,z,gr.even_pen_brushes[dc->pen_width]);
record=GrBlot3(dc,x-w,y-w,z,gr.even_pen_brushes[dc->thick]);
} else {
record=GrBlot3(dc,x-w,y-w,z,gr.even_pen_brushes[dc->pen_width]);
record=GrBlot3(dc,x-w,y-w,z,gr.even_pen_brushes[dc->thick]);
dc->color.c0=dc->color.c1;
record=GrBlot3(dc,x-w,y-w,z,gr.odd_pen_brushes[dc->pen_width]);
record=GrBlot3(dc,x-w,y-w,z,gr.odd_pen_brushes[dc->thick]);
}
} else {
if (dc->color.c0.rop==ROPB_COLLISION) {
if (dc->color.c0.color!=dc->bkcolor.c0.color &&
dc->color.c0.color!=TRANSPARENT)
record=GrBlot3(dc,x-w,y-w,z,
gr.collision_pen_brushes[dc->pen_width]);
gr.collision_pen_brushes[dc->thick]);
else
record=FALSE;
} else
record=GrBlot3(dc,x-w,y-w,z,gr.pen_brushes[dc->pen_width]);
record=GrBlot3(dc,x-w,y-w,z,gr.pen_brushes[dc->thick]);
}
} else {
if (dc->color.c1.rop&ROPBF_DITHER) {
dc->color.c1.rop=dc->color.c0.rop;
if (((x-w)^(y-w))&1) {
record=GrBlot(dc,x-w,y-w,gr.odd_pen_brushes[dc->pen_width]);
record=GrBlot(dc,x-w,y-w,gr.odd_pen_brushes[dc->thick]);
dc->color.c0=dc->color.c1;
record=GrBlot(dc,x-w,y-w,gr.even_pen_brushes[dc->pen_width]);
record=GrBlot(dc,x-w,y-w,gr.even_pen_brushes[dc->thick]);
} else {
record=GrBlot(dc,x-w,y-w,gr.even_pen_brushes[dc->pen_width]);
record=GrBlot(dc,x-w,y-w,gr.even_pen_brushes[dc->thick]);
dc->color.c0=dc->color.c1;
record=GrBlot(dc,x-w,y-w,gr.odd_pen_brushes[dc->pen_width]);
record=GrBlot(dc,x-w,y-w,gr.odd_pen_brushes[dc->thick]);
}
} else {
if (dc->color.c0.rop==ROPB_COLLISION) {
if (dc->color.c0.color!=dc->bkcolor.c0.color &&
dc->color.c0.color!=TRANSPARENT)
record=GrBlot(dc,x-w,y-w,gr.collision_pen_brushes[dc->pen_width]);
record=GrBlot(dc,x-w,y-w,gr.collision_pen_brushes[dc->thick]);
else
record=FALSE;
} else
record=GrBlot(dc,x-w,y-w,gr.pen_brushes[dc->pen_width]);
record=GrBlot(dc,x-w,y-w,gr.pen_brushes[dc->thick]);
}
}
if (record) {
@ -525,7 +525,7 @@ public Bool GrPlot3(CDC *dc=gr.dc,I64 x,I64 y,I64 z)
if (dc->flags & DCF_RECORD_EXTENTS) {
if (x-w<dc->min_x) dc->min_x=x-w;
if (y-w<dc->min_y) dc->min_y=y-w;
if (dc->pen_width & 1) {
if (dc->thick & 1) {
if (x+w>dc->max_x) dc->max_x=x+w;
if (y+w>dc->max_y) dc->max_y=y+w;
} else {
@ -535,7 +535,7 @@ public Bool GrPlot3(CDC *dc=gr.dc,I64 x,I64 y,I64 z)
}
}
} else
GrFillCircle(dc,x,y,dc->db_z,dc->pen_width);
GrFillCircle(dc,x,y,dc->db_z,dc->thick);
gr_done:
dc->color=old_color;
if (was_transform)
@ -615,7 +615,7 @@ public Bool GrRegPoly(CDC *dc=gr.dc,
I64 step=1,
F64 start_radians=0,
F64 len_radians=2*ã)
{//2D. Clipping but no transform or pen width.
{//2D. Clipping but no transform or thick.
Bool res;
I32 *db=dc->depth_buf;
dc->depth_buf=NULL;
@ -626,22 +626,22 @@ public Bool GrRegPoly(CDC *dc=gr.dc,
}
public Bool Gr2Bezier(CDC *dc=gr.dc,CD3I32 *ctrl)
{//2nd order. Clipping but no transform or pen width.
{//2nd order. Clipping but no transform or thick.
return Bezier2(dc,ctrl,&GrLinePlot);
}
public Bool Gr3Bezier(CDC *dc=gr.dc,CD3I32 *ctrl)
{//3rd order. Clipping but no transform or pen width.
{//3rd order. Clipping but no transform or thick.
return Bezier3(dc,ctrl,&GrLinePlot);
}
public Bool Gr2BSpline(CDC *dc=gr.dc,CD3I32 *ctrl,I64 cnt,Bool closed=FALSE)
{//2nd order. Clipping but no transform or pen width.
{//2nd order. Clipping but no transform or thick.
return BSpline2(dc,ctrl,cnt,&GrLinePlot,closed);
}
public Bool Gr3BSpline(CDC *dc=gr.dc,CD3I32 *ctrl,I64 cnt,Bool closed=FALSE)
{//3rd order. Clipping but no transform or pen width.
{//3rd order. Clipping but no transform or thick.
return BSpline3(dc,ctrl,cnt,&GrLinePlot,closed);
}
@ -769,7 +769,7 @@ I64 GrLineFat3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,I64 x2,I64 y2,I64 z2,
public Bool GrLine3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,I64 x2,I64 y2,I64 z2,
I64 step=1,I64 start=0)
{//3D. Transformation with pen width.
{//3D. Transformation with thick.
I64 _x1,_y1,_z1,_x2,_y2,_z2;
Bool res=FALSE,was_transform=FALSE,was_symmetry=FALSE;
if (dc->flags & DCF_TRANSFORMATION) {
@ -785,11 +785,11 @@ public Bool GrLine3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,I64 x2,I64 y2,I64 z2,
DCReflect(dc,&_x2,&_y2,&_z2);
dc->flags&=~DCF_SYMMETRY;
if (step==1 && !dc->brush) {
if (!start && dc->pen_width<2 && !dc->depth_buf) {//TODO: clip z depbuf
if (!start && dc->thick<2 && !dc->depth_buf) {//TODO: clip z depbuf
if (DCClipLine(dc,&_x1,&_y1,&_x2,&_y2))
res=Line(dc,_x1,_y1,0,_x2,_y2,0,&GrLinePlot0,step,start);
} else {
if (GrLineFat3(dc,_x1,_y1,_z1,_x2,_y2,_z2,dc->pen_width,start))
if (GrLineFat3(dc,_x1,_y1,_z1,_x2,_y2,_z2,dc->thick,start))
res=TRUE;
}
} else
@ -799,11 +799,11 @@ public Bool GrLine3(CDC *dc=gr.dc,I64 x1,I64 y1,I64 z1,I64 x2,I64 y2,I64 z2,
goto gr_done;
}
if (step==1 && !dc->brush) {
if (!start && dc->pen_width<2 && !dc->depth_buf) {//TODO: clip z depbuf
if (!start && dc->thick<2 && !dc->depth_buf) {//TODO: clip z depbuf
if (DCClipLine(dc,&x1,&y1,&x2,&y2))
res|=Line(dc,x1,y1,0,x2,y2,0,&GrLinePlot0,step,start);
} else {
if (GrLineFat3(dc,x1,y1,z1,x2,y2,z2,dc->pen_width,start))
if (GrLineFat3(dc,x1,y1,z1,x2,y2,z2,dc->thick,start))
res=TRUE;
}
} else
@ -856,7 +856,7 @@ public Bool GrEllipse3(CDC *dc=gr.dc,
I64 step=1,
F64 start_radians=0,
F64 len_radians=2*ã)
{//3D. Transformation with pen width.
{//3D. Transformation with thick.
Bool res;
I64 x,y,z,xx,yy,zz;
F64 m1,arg1,m2,arg2,s,c;
@ -905,7 +905,7 @@ public Bool GrEllipse3(CDC *dc=gr.dc,
public Bool GrCircle3(CDC *dc=gr.dc,I64 cx,I64 cy,I64 cz,I64 radius,
I64 step=1,F64 start_radians=0,F64 len_radians=2*ã)
{//3D. Transformation with pen width.
{//3D. Transformation with thick.
if (dc->flags & DCF_TRANSFORMATION)
return GrEllipse3(dc,cx,cy,cz,radius,radius,0,step,
start_radians,len_radians);
@ -921,7 +921,7 @@ public Bool GrRegPoly3(CDC *dc=gr.dc,
I64 step=1,
F64 start_radians=0,
F64 len_radians=2*ã)
{//3D. Clipping and transform and pen width.
{//3D. Clipping and transform and thick.
Bool res;
I64 x,y,z,xx,yy,zz;
F64 m1,arg1,m2,arg2,s,c;
@ -1215,7 +1215,7 @@ Option(OPTf_WARN_HEADER_MISMATCH,ON);
#help_index "Graphics"
public Bool Gr2Bezier3(CDC *dc=gr.dc,CD3I32 *ctrl)
{//2nd order. Clipping and transform and pen width.
{//2nd order. Clipping and transform and thick.
Bool res=FALSE;
I64 i,x,y,z,
old_flags=dc->flags;
@ -1260,7 +1260,7 @@ gr_done:
}
public Bool Gr3Bezier3(CDC *dc=gr.dc,CD3I32 *ctrl)
{//3rd order. Clipping and transform and pen width.
{//3rd order. Clipping and transform and thick.
Bool res=FALSE;
I64 i,x,y,z,
old_flags=dc->flags;
@ -1305,7 +1305,7 @@ gr_done:
}
public I64 Gr2BSpline3(CDC *dc=gr.dc,CD3I32 *ctrl,I64 cnt,Bool closed=FALSE)
{//2nd order. Clipping and transform and pen width.
{//2nd order. Clipping and transform and thick.
Bool res=FALSE;
I64 i,x,y,z,
old_flags=dc->flags;
@ -1350,7 +1350,7 @@ gr_done:
}
public Bool Gr3BSpline3(CDC *dc=gr.dc,CD3I32 *ctrl,I64 cnt,Bool closed=FALSE)
{//3rd order. Clipping and transform and pen width.
{//3rd order. Clipping and transform and thick.
Bool res=FALSE;
I64 i,x,y,z,
old_flags=dc->flags;

10
Adam/Gr/GrSpritePlot.HC

@ -20,7 +20,7 @@ public U0 Sprite3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,
{//Plot a sprite into a CDC.
CSprite *tmpg=elems-offset(CSprite.start);
I64 i,j,k,x1,y1,z1,x2,y2,
*old_r,*r2,old_flags=dc->flags,old_pen_width=dc->pen_width;
*old_r,*r2,old_flags=dc->flags,old_pen_width=dc->thick;
I32 *ptr;
CColorROPU32 old_color=dc->color;
CDC *img;
@ -39,9 +39,9 @@ public U0 Sprite3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,
tmpg->d.dither_color.u8[0]|
tmpg->d.dither_color.u8[1]<<COLORROP_BITS|ROPF_DITHER;
break;
case SPT_WIDTH:
dc->pen_width=tmpg->w.width;
DCPenWidthScale(dc);
case SPT_THICK:
dc->thick=tmpg->t.thick;
DCThickScale(dc);
break;
case SPT_TRANSFORM_ON:
if (!(dc->flags&DCF_TRANSFORMATION)) {
@ -237,7 +237,7 @@ public U0 Sprite3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,
}
MemCpy(&dc->sym,&old_sym,sizeof(CGrSym));
dc->color=old_color;
dc->pen_width=old_pen_width;
dc->thick=old_pen_width;
dc->flags=dc->flags&~(DCF_SYMMETRY|DCF_TRANSFORMATION) |
old_flags&(DCF_SYMMETRY|DCF_TRANSFORMATION);
}

1
Adam/Gr/MakeGr.HC

@ -23,6 +23,7 @@ Cd(__DIR__);;
#include "SpriteMesh"
#include "SpriteBitMap"
#include "SpriteCode"
#include "SpriteSideBar"
#include "SpriteEd"
#include "SpriteMain"

32
Adam/Gr/SpriteBitMap.HC

@ -42,7 +42,7 @@ GrInit4;
I64 PopUpSpriteBitMap(CColorROPU32 color,I64 width)
{
I64 i;
I64 res;
U8 *st1,*st2,buf[STR_LEN];
CDoc *doc=DocNew;
@ -86,9 +86,9 @@ I64 PopUpSpriteBitMap(CColorROPU32 color,I64 width)
"$$MU-UL,\"Exit Sprite\",LE=SPBM_EXIT$$\n"
"$$MU-UL,\"Abort Sprite\",LE=DOCM_CANCEL$$\n"
"\nRight-Click to get back to this menu.",st1,st2,width);
i=PopUpMenu(doc);
res=PopUpMenu(doc);
DocDel(doc);
return i;
return res;
}
U0 GrBitMapEdPrepPersistentDC(CDC *dc,I64 xx1,I64 yy1,CDC *img)
@ -219,7 +219,7 @@ I64 SpriteBitMapEd(CDoc *,CDocEntry *doc_e,CDC *dc,I64 *_xx1,I64 *_yy1,
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
dc->color=ROPF_DITHER+WHITE<<16+BLACK;
dc->pen_width=1;
dc->thick=1;
GrBorder(dc,xx1-1,yy1-1,xx2,yy2);//This is done little bit too often.
while (msg_code=ScanMsg(&arg1,&arg2,1<<MSG_MS_L_DOWN|1<<MSG_MS_L_UP|
@ -308,7 +308,7 @@ bm_menu:
if (i>=0) color=i;
goto bm_menu;
case SPBM_WIDTH:
i=PopUpRangeI64(1,16,1,"Pen Width\n");
i=PopUpRangeI64(1,16,1,"Thick\n");
if (i>=0) width=i;
goto bm_menu;
case SPBM_UNDO:
@ -357,7 +357,7 @@ bm_menu:
switch (mode) {
case SPBM_PT:
img->color=color;
img->pen_width=width;
img->thick=width;
GrPlot3(img,arg1-xx1,arg2-yy1,0);
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
break;
@ -367,7 +367,7 @@ bm_menu:
x1=arg1; y1=arg2;
down=TRUE;
dc->color=color;
dc->pen_width=width;
dc->thick=width;
case SPBM_LINE:
GrLine3(dc,x1,y1,0,arg1,arg2,0);
break;
@ -383,7 +383,7 @@ bm_menu:
case SPBM_COPY:
case SPBM_DELETE:
dc->color=ROPF_DITHER+WHITE<<16+BLACK;
dc->pen_width=1;
dc->thick=1;
GrBorder(dc,x1,y1,x1,y1);
break;
end:
@ -434,7 +434,7 @@ bm_menu:
x1=arg1; y1=arg2;
down=TRUE;
dc->color=color;
dc->pen_width=width;
dc->thick=width;
GrLine3(dc,x1,y1,0,arg1,arg2,0);
}
break;
@ -442,7 +442,7 @@ bm_menu:
x1=arg1; y1=arg2;
down=TRUE;
img->color=color;
img->pen_width=width;
img->thick=width;
GrLine3(img,x1-xx1,y1-yy1,0,arg1-xx1,arg2-yy1,0);
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
break;
@ -456,7 +456,7 @@ bm_menu:
if (down) {
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
dc->color=color;
dc->pen_width=width;
dc->thick=width;
if (mode==SPBM_ARROW)
GrArrow3(dc,x1,y1,0,arg1,arg2,0);
else
@ -503,7 +503,7 @@ bm_menu:
y22=y1;
}
dc->color=ROPF_DITHER+WHITE<<16+BLACK;
dc->pen_width=1;
dc->thick=1;
GrBorder(dc,x11,y11,x22,y22);
}
break;
@ -511,7 +511,7 @@ bm_menu:
if (down) {
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
dc->color=color;
dc->pen_width=width;
dc->thick=width;
GrCircle3(dc,x1,y1,0,Sqrt(SqrI64(arg1-x1)+SqrI64(arg2-y1)));
}
break;
@ -549,7 +549,7 @@ bm_menu:
case SPBM_POLYPT:
if (down) {
img->color=color;
img->pen_width=width;
img->thick=width;
GrLine3(img,x1-xx1,y1-yy1,0,arg1-xx1,arg2-yy1,0);
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
x1=arg1; y1=arg2;
@ -564,7 +564,7 @@ bm_menu:
case SPBM_POLYPT:
case SPBM_POLYLINE:
img->color=color;
img->pen_width=width;
img->thick=width;
if (mode==SPBM_ARROW)
GrArrow3(img,x1-xx1,y1-yy1,0,arg1-xx1,arg2-yy1,0);
else
@ -621,7 +621,7 @@ bm_menu:
goto bm_menu;
case SPBM_CIRCLE:
img->color=color;
img->pen_width=width;
img->thick=width;
GrCircle3(img,x1-xx1,y1-yy1,0,
Sqrt(SqrI64(arg1-x1)+SqrI64(arg2-y1)));
down=FALSE;

10
Adam/Gr/SpriteCode.HC

@ -51,8 +51,8 @@ U0 SpriteElem2Code(CDoc *doc,CSprite *tmpg)
case SPT_CIRCLE:
DocPrint(doc,"{(%d,%d):%d}",tmpg->pr.x1,tmpg->pr.y1,tmpg->pr.radius);
break;
case SPT_WIDTH:
DocPrint(doc,"{%d}",tmpg->w.width);
case SPT_THICK:
DocPrint(doc,"{%d}",tmpg->t.thick);
break;
case SPT_ELLIPSE:
DocPrint(doc,"{(%d,%d):(%d,%d),%0.4f}",tmpg->pwha.x1,tmpg->pwha.y1,
@ -280,10 +280,10 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
else
g.type=SPT_FLOOD_FILL;
break;
case SPT_WIDTH:
case SPT_THICK:
Lex(cc); //Skip {
g.w.width=LexExpressionI64(cc);
g.type=SPT_WIDTH;
g.t.thick=LexExpressionI64(cc);
g.type=SPT_THICK;
break;
case SPT_CIRCLE:
Lex(cc); //Skip {

123
Adam/Gr/SpriteEd.HC

@ -1,11 +1,11 @@
#help_index "Graphics/Sprite;Sprites"
CSprite *SpriteSetSettings(CDC *dc=NULL,CSprite *head,I64 elem_num,
I64 x=0,I64 y=0,CColorROPU32 *_color=NULL,I64 *_width=NULL,
I64 x=0,I64 y=0,CColorROPU32 *_color=NULL,I64 *_thick=NULL,
I64 *_xx=NULL,I64 *_yy=NULL)
{
CSprite *res=head->next;
I64 width=1,xx=0,yy=0;
I64 thick=1,xx=0,yy=0;
CColorROPU32 color=BLACK;
if (dc) DCRst(dc);
while (elem_num-->0 && res!=head) {
@ -19,9 +19,9 @@ CSprite *SpriteSetSettings(CDC *dc=NULL,CSprite *head,I64 elem_num,
res->d.dither_color.u8[1]<<COLORROP_BITS|ROPF_DITHER;
if (dc) dc->color=color;
break;
case SPT_WIDTH:
width=res->w.width;
if (dc) dc->pen_width=width;
case SPT_THICK:
thick=res->t.thick;
if (dc) dc->thick=thick;
break;
case SPT_SHIFT:
xx+=res->p.x1;
@ -43,7 +43,7 @@ CSprite *SpriteSetSettings(CDC *dc=NULL,CSprite *head,I64 elem_num,
res=res->next;
}
if (_color) *_color=color;
if (_width) *_width=width;
if (_thick) *_thick=thick;
if (_xx) *_xx=xx;
if (_yy) *_yy=yy;
return res;
@ -380,9 +380,9 @@ U0 SpriteTransformQue(CSprite *head,I64 *r)
while (tmpg!=head) {
if (Bt(&tmpg->type,SPf_SEL))
switch (tmpg->type&SPG_TYPE_MASK) {
case SPT_WIDTH:
tmpg->w.width*=Sqrt(Mat4x4NormSqr65536(r))/65536;
if (tmpg->w.width<0) tmpg->w.width=0;
case SPT_THICK:
tmpg->t.thick*=Sqrt(Mat4x4NormSqr65536(r))/65536;
if (tmpg->t.thick<0) tmpg->t.thick=0;
break;
case SPT_PLANAR_SYMMETRY:
case SPT_ARROW:
@ -575,105 +575,6 @@ I64 SpriteQueSelAll(CSprite *head,Bool val=TRUE)
return res;
}
CSprite *SpriteSideBar2SpriteQue(CDoc *doc,CSprite *head,I64 *_cur_elem_num)
{//For the side-bar
CSprite *res=CAlloc(sizeof(CSprite)),*tmpg;
CDocEntry *doc_e=doc->head.next;
Bool found=FALSE;
I64 num=0;
QueInit(res);
while (doc_e!=doc) {
if (doc_e->type_u8==DOCT_MENU_VAL && doc_e->left_exp>=0) {
tmpg=SpriteSetSettings(,head,doc_e->left_exp);
if (tmpg!=head) {
tmpg=MAllocIdent(tmpg);