Nightly update (ISO SHA-1 033e6b2)
This commit is contained in:
1 parent
307163a8ad
commit
d20c3bfec2
7 files changed
+61
-22
No files matched your search
Binary file not shown.
@@ -18,7 +18,7 @@ U0 LoadDocDefines()
|
|||||||
//$LK,"DD_BOOT_HIGH_LOC_DVD",A="FF:::/Adam/Opt/Boot/BootDVD.HC,DD_BOOT_HIGH_LOC_DVD"$
|
//$LK,"DD_BOOT_HIGH_LOC_DVD",A="FF:::/Adam/Opt/Boot/BootDVD.HC,DD_BOOT_HIGH_LOC_DVD"$
|
||||||
|
|
||||||
$TR-C,"LineRep"$
|
$TR-C,"LineRep"$
|
||||||
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","120,374");
|
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","120,414");
|
||||||
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","82,012");
|
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","82,012");
|
||||||
$ID,-4$
|
$ID,-4$
|
||||||
DefinePrint("DD_MP_VECT","%08X",MP_VECT_ADDR);
|
DefinePrint("DD_MP_VECT","%08X",MP_VECT_ADDR);
|
||||||
|
|||||||
Binary file not shown.
@@ -21,7 +21,6 @@ extern U0 StreamDir();
|
|||||||
public extern I64 StreamExePrint(U8 *fmt,...);
|
public extern I64 StreamExePrint(U8 *fmt,...);
|
||||||
public extern U0 StreamPrint(U8 *fmt,...);
|
public extern U0 StreamPrint(U8 *fmt,...);
|
||||||
public extern Bool Trace(Bool val=ON);
|
public extern Bool Trace(Bool val=ON);
|
||||||
|
|
||||||
#help_index "Compiler/Lex"
|
#help_index "Compiler/Lex"
|
||||||
#help_file "::/Doc/Lex"
|
#help_file "::/Doc/Lex"
|
||||||
extern U0 ClassMemberLstDel(CHashClass *c);
|
extern U0 ClassMemberLstDel(CHashClass *c);
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ $ID,-2$$TR,"Titanium"$
|
|||||||
$ID,2$I64 best_score=16469;
|
$ID,2$I64 best_score=16469;
|
||||||
$ID,-2$$TR,"TOSRegen"$
|
$ID,-2$$TR,"TOSRegen"$
|
||||||
$ID,2$progress1_tf=0.000;progress2_tf=0.000;
|
$ID,2$progress1_tf=0.000;progress2_tf=0.000;
|
||||||
progress3_tf=0.000;progress4_tf=188.159;
|
progress3_tf=0.000;progress4_tf=195.910;
|
||||||
$ID,-2$$ID,-2$$TR,"Once"$
|
$ID,-2$$ID,-2$$TR,"Once"$
|
||||||
$ID,2$$TR,"Adam"$
|
$ID,2$$TR,"Adam"$
|
||||||
$ID,2$$ID,-2$$TR,"User"$
|
$ID,2$$ID,-2$$TR,"User"$
|
||||||
|
|||||||
@@ -1,14 +1,24 @@
|
|||||||
|
/*
|
||||||
|
There is a coarse and a fine-grained.
|
||||||
|
The coarse gets flood-filled but the
|
||||||
|
fine grained is only outlines.
|
||||||
|
*/
|
||||||
|
|
||||||
class Photon
|
class Photon
|
||||||
{
|
{
|
||||||
Photon *next,*last;
|
Photon *next,*last;
|
||||||
CD3 p,v,p_snell_inhibit;
|
CD3 p,v,p_snell_inhibit;
|
||||||
} p_root[mp_cnt];
|
} p_root[mp_cnt];
|
||||||
I64 p_root_locks;
|
I64 p_root_locks;
|
||||||
|
|
||||||
|
#define ANIMATE_JIFFIES (JIFFY_FREQ*0.01)
|
||||||
|
I64 master_sleep_jiffy;
|
||||||
CTask *animate_tasks[mp_cnt];
|
CTask *animate_tasks[mp_cnt];
|
||||||
|
|
||||||
|
|
||||||
CDC *map;
|
CDC *map;
|
||||||
F64 ts;
|
|
||||||
I64 photon_cnt,snell_cnt;
|
I64 photon_cnt,snell_cnt;
|
||||||
|
Bool full_speed;
|
||||||
|
|
||||||
U8 *bmp;
|
U8 *bmp;
|
||||||
F64 bmp_scale,bmp_scale_sqr;
|
F64 bmp_scale,bmp_scale_sqr;
|
||||||
@@ -35,7 +45,7 @@ Photon *PhotonNew()
|
|||||||
{
|
{
|
||||||
I64 num=photon_cnt++%mp_cnt;
|
I64 num=photon_cnt++%mp_cnt;
|
||||||
Photon *res=CAlloc(sizeof(Photon));
|
Photon *res=CAlloc(sizeof(Photon));
|
||||||
while (!LBts(&p_root_locks,num))
|
while (LBts(&p_root_locks,num))
|
||||||
Yield;
|
Yield;
|
||||||
QueIns(res,p_root[num].last);
|
QueIns(res,p_root[num].last);
|
||||||
LBtr(&p_root_locks,num);
|
LBtr(&p_root_locks,num);
|
||||||
@@ -54,7 +64,7 @@ U0 DrawIt(CTask *,CDC *dc)
|
|||||||
map->width,map->height,bmp_width,bmp_height);
|
map->width,map->height,bmp_width,bmp_height);
|
||||||
GrPrint(dc,0,FONT_HEIGHT,"PhotonCnt:%d SnellCnt:%d",photon_cnt,snell_cnt);
|
GrPrint(dc,0,FONT_HEIGHT,"PhotonCnt:%d SnellCnt:%d",photon_cnt,snell_cnt);
|
||||||
for (i=0;i<mp_cnt;i++) {
|
for (i=0;i<mp_cnt;i++) {
|
||||||
while (!LBts(&p_root_locks,i))
|
while (LBts(&p_root_locks,i))
|
||||||
Yield;
|
Yield;
|
||||||
tmpp=p_root[i].next;
|
tmpp=p_root[i].next;
|
||||||
while (tmpp!=&p_root[i]) {
|
while (tmpp!=&p_root[i]) {
|
||||||
@@ -113,6 +123,12 @@ U0 FindNormal(Photon *tmpp,CD3 *_normal)
|
|||||||
F64 é=Arg(tmpp->v.x,tmpp->v.y),è;
|
F64 é=Arg(tmpp->v.x,tmpp->v.y),è;
|
||||||
|
|
||||||
D3Copy(&tmpp->p_snell_inhibit,&tmpp->p);
|
D3Copy(&tmpp->p_snell_inhibit,&tmpp->p);
|
||||||
|
|
||||||
|
//Coarse grains has black and white filled-in BSplines.
|
||||||
|
//Fine grained has only white outline without being filled-in.
|
||||||
|
|
||||||
|
//Back-up a step and move fwd to get a fined-grained value
|
||||||
|
//for the point of contact.
|
||||||
D3SubEqu(&tmpp->p,&tmpp->v);
|
D3SubEqu(&tmpp->p,&tmpp->v);
|
||||||
D3Mul(&p,bmp_scale,&tmpp->p);
|
D3Mul(&p,bmp_scale,&tmpp->p);
|
||||||
D3Copy(&p1,&p);
|
D3Copy(&p1,&p);
|
||||||
@@ -121,6 +137,7 @@ U0 FindNormal(Photon *tmpp,CD3 *_normal)
|
|||||||
D3Copy(&p,&p1);
|
D3Copy(&p,&p1);
|
||||||
D3Div(&tmpp->p,&p,bmp_scale);
|
D3Div(&tmpp->p,&p,bmp_scale);
|
||||||
|
|
||||||
|
//Draw an arc one direction, finding point of contact.
|
||||||
for (è=0;è<ã/2;è+=ã/bmp_norm_radius) {
|
for (è=0;è<ã/2;è+=ã/bmp_norm_radius) {
|
||||||
D3Equ(&s,Cos(é+ã-ã/4-è),Sin(é+ã-ã/4-è));
|
D3Equ(&s,Cos(é+ã-ã/4-è),Sin(é+ã-ã/4-è));
|
||||||
D3Mul(&v,bmp_norm_radius,&s);
|
D3Mul(&v,bmp_norm_radius,&s);
|
||||||
@@ -131,6 +148,7 @@ U0 FindNormal(Photon *tmpp,CD3 *_normal)
|
|||||||
if (BmpPeek(p1.x,p1.y)!=WHITE)
|
if (BmpPeek(p1.x,p1.y)!=WHITE)
|
||||||
D3Copy(&p1,&tmpp->p);
|
D3Copy(&p1,&tmpp->p);
|
||||||
|
|
||||||
|
//Draw an arc other direction, finding point of contact.
|
||||||
for (è=0;è<ã/2;è+=ã/bmp_norm_radius) {
|
for (è=0;è<ã/2;è+=ã/bmp_norm_radius) {
|
||||||
D3Equ(&s,Cos(é+ã+ã/4+è),Sin(é+ã+ã/4+è));
|
D3Equ(&s,Cos(é+ã+ã/4+è),Sin(é+ã+ã/4+è));
|
||||||
D3Mul(&v,bmp_norm_radius,&s);
|
D3Mul(&v,bmp_norm_radius,&s);
|
||||||
@@ -182,10 +200,22 @@ U0 SnellsLaw(Photon *tmpp,I64 last,I64 next)
|
|||||||
|
|
||||||
U0 AnimateTask(I64)
|
U0 AnimateTask(I64)
|
||||||
{
|
{
|
||||||
Photon *tmpp,*root=&p_root[Gs->num];
|
|
||||||
I64 last,next;
|
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
while (!LBts(&p_root_locks,Gs->num))
|
master_sleep_jiffy+=ANIMATE_JIFFIES;
|
||||||
|
if (cnts.jiffies>=master_sleep_jiffy)
|
||||||
|
master_sleep_jiffy=cnts.jiffies+ANIMATE_JIFFIES;
|
||||||
|
SleepUntil(master_sleep_jiffy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
U0 MPAnimateTask(I64)
|
||||||
|
{
|
||||||
|
I64 last_master_jiffy=0,
|
||||||
|
timeout_jiffy=master_sleep_jiffy+ANIMATE_JIFFIES,
|
||||||
|
last,next;
|
||||||
|
Photon *tmpp,*root=&p_root[Gs->num];
|
||||||
|
while (TRUE) {
|
||||||
|
while (LBts(&p_root_locks,Gs->num))
|
||||||
Yield;
|
Yield;
|
||||||
tmpp=root->next;
|
tmpp=root->next;
|
||||||
while (tmpp!=root) {
|
while (tmpp!=root) {
|
||||||
@@ -210,16 +240,24 @@ U0 AnimateTask(I64)
|
|||||||
next=GrPeek(map,tmpp->p.x,tmpp->p.y);
|
next=GrPeek(map,tmpp->p.x,tmpp->p.y);
|
||||||
if (last!=next && (last==BLACK && next==WHITE) ||
|
if (last!=next && (last==BLACK && next==WHITE) ||
|
||||||
(last==WHITE && next==BLACK) &&
|
(last==WHITE && next==BLACK) &&
|
||||||
|
//Don't do a snell operation too close to the last. Just ignore it.
|
||||||
D3DistSqr(&tmpp->p_snell_inhibit,&tmpp->p)>=4.0)
|
D3DistSqr(&tmpp->p_snell_inhibit,&tmpp->p)>=4.0)
|
||||||
SnellsLaw(tmpp,last,next);
|
SnellsLaw(tmpp,last,next);
|
||||||
tmpp=tmpp->next;
|
tmpp=tmpp->next;
|
||||||
|
if (cnts.jiffies>=timeout_jiffy)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
LBtr(&p_root_locks,Gs->num);
|
LBtr(&p_root_locks,Gs->num);
|
||||||
if (ts)
|
if (cnts.jiffies>=timeout_jiffy) {
|
||||||
Sleep(1000*ts);
|
Sleep(1);
|
||||||
else {
|
timeout_jiffy=master_sleep_jiffy+ANIMATE_JIFFIES;
|
||||||
Yield;
|
}
|
||||||
Yield; //Give a more time unlocked.
|
if (!full_speed) {
|
||||||
|
while (master_sleep_jiffy==last_master_jiffy)
|
||||||
|
Sleep(1);
|
||||||
|
last_master_jiffy=master_sleep_jiffy;
|
||||||
|
SleepUntil(master_sleep_jiffy);
|
||||||
|
timeout_jiffy=master_sleep_jiffy+ANIMATE_JIFFIES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -227,11 +265,12 @@ U0 AnimateTask(I64)
|
|||||||
U0 Init()
|
U0 Init()
|
||||||
{
|
{
|
||||||
I64 i;
|
I64 i;
|
||||||
ts=0.01;
|
master_sleep_jiffy=cnts.jiffies;
|
||||||
|
full_speed=FALSE;
|
||||||
photon_cnt=snell_cnt=0;
|
photon_cnt=snell_cnt=0;
|
||||||
map=DCNew(Fs->pix_width,Fs->pix_height);
|
map=DCNew(Fs->pix_width,Fs->pix_height);
|
||||||
for (i=0;i<mp_cnt;i++) {
|
for (i=0;i<mp_cnt;i++) {
|
||||||
while (!LBts(&p_root_locks,i))
|
while (LBts(&p_root_locks,i))
|
||||||
Yield;
|
Yield;
|
||||||
QueInit(&p_root[i]);
|
QueInit(&p_root[i]);
|
||||||
LBtr(&p_root_locks,i);
|
LBtr(&p_root_locks,i);
|
||||||
@@ -254,7 +293,7 @@ U0 CleanUp()
|
|||||||
{
|
{
|
||||||
I64 i;
|
I64 i;
|
||||||
for (i=0;i<mp_cnt;i++) {
|
for (i=0;i<mp_cnt;i++) {
|
||||||
while (!LBts(&p_root_locks,i))
|
while (LBts(&p_root_locks,i))
|
||||||
Yield;
|
Yield;
|
||||||
QueDel(&p_root[i],TRUE);
|
QueDel(&p_root[i],TRUE);
|
||||||
LBtr(&p_root_locks,i);
|
LBtr(&p_root_locks,i);
|
||||||
@@ -309,8 +348,9 @@ U0 LightTable()
|
|||||||
DocClear;
|
DocClear;
|
||||||
Init;
|
Init;
|
||||||
Fs->draw_it=&DrawIt;
|
Fs->draw_it=&DrawIt;
|
||||||
|
Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs);
|
||||||
for (i=0;i<mp_cnt;i++)
|
for (i=0;i<mp_cnt;i++)
|
||||||
animate_tasks[i]=Spawn(&AnimateTask,NULL,"Animate",i);
|
animate_tasks[i]=Spawn(&MPAnimateTask,NULL,"MPAnimate",i);
|
||||||
try {
|
try {
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
msg_code=GetMsg(&arg1,&arg2,
|
msg_code=GetMsg(&arg1,&arg2,
|
||||||
@@ -361,10 +401,10 @@ lt_restart:
|
|||||||
RandomBurst;
|
RandomBurst;
|
||||||
break;
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
ts=0.00;
|
full_speed=TRUE;
|
||||||
Sleep(1500);
|
Sleep(1500);
|
||||||
FlushMsgs;
|
FlushMsgs;
|
||||||
ts=0.01;
|
full_speed=FALSE;
|
||||||
break;
|
break;
|
||||||
case CH_ESC:
|
case CH_ESC:
|
||||||
case CH_SHIFT_ESC:
|
case CH_SHIFT_ESC:
|
||||||
@@ -378,9 +418,9 @@ lt_done:
|
|||||||
} catch
|
} catch
|
||||||
PutExcept;
|
PutExcept;
|
||||||
Free(c);
|
Free(c);
|
||||||
|
SettingsPop;
|
||||||
for (i=0;i<mp_cnt;i++)
|
for (i=0;i<mp_cnt;i++)
|
||||||
Kill(animate_tasks[i]);
|
Kill(animate_tasks[i]);
|
||||||
SettingsPop;
|
|
||||||
CleanUp;
|
CleanUp;
|
||||||
MenuPop;
|
MenuPop;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ $WW,1$$FG,5$$TX+CX,"Change Log"$$FG$
|
|||||||
|
|
||||||
Use $LK,"R",A="MN:R"$() to rename if I change a label.
|
Use $LK,"R",A="MN:R"$() to rename if I change a label.
|
||||||
|
|
||||||
$IV,1$----01/30/17 20:37:28----$IV,0$
|
$IV,1$----01/31/17 00:20:31----$IV,0$
|
||||||
* Added $LK,"::/Demo/Graphics/LightTable.HC"$.
|
* Added $LK,"::/Demo/Graphics/LightTable.HC"$.
|
||||||
|
|
||||||
$IV,1$----01/27/17 08:13:37----$IV,0$
|
$IV,1$----01/27/17 08:13:37----$IV,0$
|
||||||
|
|||||||
Reference in new issue
Block a user