Nightly update (ISO SHA-1 38ac12b)

This commit is contained in:
TempleOS-bot committed 2017-01-31 00:27:25 -05:00
1 parent 49ec7c2650
commit 307163a8ad
7 files changed
+100 -37

No files matched your search

Binary file not shown.
+1 -1
View File
@@ -18,7 +18,7 @@ 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","120,312");
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","120,374");
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","82,012");
$ID,-4$
DefinePrint("DD_MP_VECT","%08X",MP_VECT_ADDR);
Binary file not shown.
+1
View File
@@ -61,6 +61,7 @@ public extern I64 MemberMetaData(U8 *st,CMemberLst *ml);
public extern CMemberLstMeta *MemberMetaFind(U8 *st,CMemberLst *ml);
public extern CHashClass *OptClassFwd(CHashClass *tmpc);
public extern I64 PrsKeyWord(CCmpCtrl *cc);
#help_index "Compiler;Cmd Line (Typically)"
extern I64 Cmp(U8 *filename,
U8 *map_name=NULL,U8 *out_name=NULL,U8 mapfile_drv_let=0);
+1 -1
View File
@@ -62,7 +62,7 @@ $ID,-2$$TR,"Titanium"$
$ID,2$I64 best_score=16469;
$ID,-2$$TR,"TOSRegen"$
$ID,2$progress1_tf=0.000;progress2_tf=0.000;
progress3_tf=0.000;progress4_tf=192.403;
progress3_tf=0.000;progress4_tf=188.159;
$ID,-2$$ID,-2$$TR,"Once"$
$ID,2$$TR,"Adam"$
$ID,2$$ID,-2$$TR,"User"$
+96 -34
View File
@@ -1,14 +1,17 @@
class Photon
{
Photon *next,*last;
CD3 p,v;
} p_root;
CD3 p,v,p_snell_inhibit;
} p_root[mp_cnt];
I64 p_root_locks;
CTask *animate_tasks[mp_cnt];
CDC *map;
F64 ts;
I64 photon_cnt,snell_cnt;
U8 *bmp;
F64 bmp_scale;
F64 bmp_scale,bmp_scale_sqr;
I64 bmp_mem,bmp_width,bmp_height,bmp_norm_radius;
I64 BmpPeek(I64 x,I64 y)
@@ -28,22 +31,40 @@ U0 BmpPlot(U8 *bmp,I64 x,I64 y,I64)
Bts(bmp,y*bmp_width+x);
}
Photon *PhotonNew()
{
I64 num=photon_cnt++%mp_cnt;
Photon *res=CAlloc(sizeof(Photon));
while (!LBts(&p_root_locks,num))
Yield;
QueIns(res,p_root[num].last);
LBtr(&p_root_locks,num);
return res;
}
#define TAIL 20
U0 DrawIt(CTask *,CDC *dc)
{
I64 i;
Photon *tmpp;
GrBlot(dc,0,0,map);
dc->color=WHITE;
GrPrint(dc,0,0,"Mem:0x%X %,dMeg Scale:%0.3f (%d,%d)-->(%d,%d)",
bmp_mem,bmp_mem/1024/1024,bmp_scale,
map->width,map->height,bmp_width,bmp_height);
tmpp=p_root.next;
while (tmpp!=&p_root) {
GrPrint(dc,0,FONT_HEIGHT,"PhotonCnt:%d SnellCnt:%d",photon_cnt,snell_cnt);
for (i=0;i<mp_cnt;i++) {
while (!LBts(&p_root_locks,i))
Yield;
tmpp=p_root[i].next;
while (tmpp!=&p_root[i]) {
dc->color=LTRED;
GrLine(dc,tmpp->p.x-TAIL*tmpp->v.x,tmpp->p.y-TAIL*tmpp->v.y,
tmpp->p.x,tmpp->p.y);
tmpp=tmpp->next;
}
LBtr(&p_root_locks,i);
}
}
U0 RayBurst(I64 x1,I64 y1,I64 x2,I64 y2)
@@ -56,23 +77,20 @@ U0 RayBurst(I64 x1,I64 y1,I64 x2,I64 y2)
D3Unit(&v);
D3Equ(&n,v.y,-v.x);
tmpp=CAlloc(sizeof(Photon));
tmpp=PhotonNew;
D3Copy(&tmpp->p,&p);
D3Copy(&tmpp->v,&v);
QueIns(tmpp,p_root.last);
for (i=2;i<=9;i+=3) {
D3Mul(&n2,i,&n);
tmpp=CAlloc(sizeof(Photon));
tmpp=PhotonNew;
D3Add(&tmpp->p,&p,&n2);
D3Copy(&tmpp->v,&v);
QueIns(tmpp,p_root.last);
tmpp=CAlloc(sizeof(Photon));
tmpp=PhotonNew;
D3Sub(&tmpp->p,&p,&n2);
D3Copy(&tmpp->v,&v);
QueIns(tmpp,p_root.last);
}
}
@@ -82,27 +100,31 @@ U0 RandomBurst()
F64 é;
Photon *tmpp;
for (i=0;i<256;i++) {
tmpp=CAlloc(sizeof(Photon));
tmpp=PhotonNew;
D3Equ(&tmpp->p,Fs->pix_width*Rand,Fs->pix_height*Rand);
é=2*ã*Rand;
D3Equ(&tmpp->v,Cos(é),Sin(é));
QueIns(tmpp,p_root.last);
}
}
U0 FindNormal(Photon *tmpp,I64 last,I64,CD3 *_normal)
U0 FindNormal(Photon *tmpp,CD3 *_normal)
{
CD3 p1,p2,v,s,bmp_p;
CD3 p,p1,p2,v,s;
F64 é=Arg(tmpp->v.x,tmpp->v.y),è;
D3Mul(&bmp_p,bmp_scale,&tmpp->p);
while (BmpPeek(bmp_p.x,bmp_p.y)==last)
D3AddEqu(&bmp_p,&tmpp->v);
D3Copy(&tmpp->p_snell_inhibit,&tmpp->p);
D3SubEqu(&tmpp->p,&tmpp->v);
D3Mul(&p,bmp_scale,&tmpp->p);
D3Copy(&p1,&p);
while (BmpPeek(p1.x,p1.y)==BLACK && D3DistSqr(&p,&p1)<bmp_scale_sqr*2)
D3AddEqu(&p1,&tmpp->v);
D3Copy(&p,&p1);
D3Div(&tmpp->p,&p,bmp_scale);
for (è=0;è<ã/2;è+=ã/bmp_norm_radius) {
D3Equ(&s,Cos(é+ã-ã/4-è),Sin(é+ã-ã/4-è));
D3Mul(&v,bmp_norm_radius,&s);
D3Add(&p1,&bmp_p,&v);
D3Add(&p1,&p,&v);
if (BmpPeek(p1.x,p1.y)!=BLACK)
break;
}
@@ -112,7 +134,7 @@ U0 FindNormal(Photon *tmpp,I64 last,I64,CD3 *_normal)
for (è=0;è<ã/2;è+=ã/bmp_norm_radius) {
D3Equ(&s,Cos(é+ã+ã/4+è),Sin(é+ã+ã/4+è));
D3Mul(&v,bmp_norm_radius,&s);
D3Add(&p2,&bmp_p,&v);
D3Add(&p2,&p,&v);
if (BmpPeek(p2.x,p2.y)!=BLACK)
break;
}
@@ -141,7 +163,7 @@ U0 SnellsLaw(Photon *tmpp,I64 last,I64 next)
n2=1.5;
else
n2=1.0;
FindNormal(tmpp,last,next,&normal);
FindNormal(tmpp,&normal);
én=Arg(normal.x,normal.y);
//dot=m1m2Cos(é);
é1=ACos(D3Dot(&normal,&tmpp->v));
@@ -155,43 +177,73 @@ U0 SnellsLaw(Photon *tmpp,I64 last,I64 next)
else
é=éb;
D3Equ(&tmpp->v,Cos(é),Sin(é));
lock {snell_cnt++;}
}
U0 AnimateTask(I64)
{
Photon *tmpp;
Photon *tmpp,*root=&p_root[Gs->num];
I64 last,next;
while (TRUE) {
tmpp=p_root.next;
while (tmpp!=&p_root) {
while (!LBts(&p_root_locks,Gs->num))
Yield;
tmpp=root->next;
while (tmpp!=root) {
last=GrPeek(map,tmpp->p.x,tmpp->p.y);
D3AddEqu(&tmpp->p,&tmpp->v);
if (tmpp->p.x<=0) tmpp->v.x=-tmpp->v.x;
if (tmpp->p.x>=map->width) tmpp->v.x=-tmpp->v.x;
if (tmpp->p.y<=0) tmpp->v.y=-tmpp->v.y;
if (tmpp->p.y>=map->height) tmpp->v.y=-tmpp->v.y;
if (tmpp->p.x<0) {
tmpp->p.x=-tmpp->p.x;
tmpp->v.x=-tmpp->v.x;
}
if (tmpp->p.x>=map->width) {
tmpp->p.x-=tmpp->p.x-map->width;
tmpp->v.x=-tmpp->v.x;
}
if (tmpp->p.y<0) {
tmpp->p.y=-tmpp->p.y;
tmpp->v.y=-tmpp->v.y;
}
if (tmpp->p.y>=map->height) {
tmpp->p.y-=tmpp->p.y-map->height;
tmpp->v.y=-tmpp->v.y;
}
next=GrPeek(map,tmpp->p.x,tmpp->p.y);
if (last!=next &&
(last==BLACK && next==WHITE) || (last==WHITE && next==BLACK))
if (last!=next && (last==BLACK && next==WHITE) ||
(last==WHITE && next==BLACK) &&
D3DistSqr(&tmpp->p_snell_inhibit,&tmpp->p)>=4.0)
SnellsLaw(tmpp,last,next);
tmpp=tmpp->next;
}
LBtr(&p_root_locks,Gs->num);
if (ts)
Sleep(1000*ts);
else {
Yield;
Yield; //Give a more time unlocked.
}
}
}
U0 Init()
{
I64 i;
ts=0.01;
photon_cnt=snell_cnt=0;
map=DCNew(Fs->pix_width,Fs->pix_height);
QueInit(&p_root);
//x*y=bmp_mem*8
for (i=0;i<mp_cnt;i++) {
while (!LBts(&p_root_locks,i))
Yield;
QueInit(&p_root[i]);
LBtr(&p_root_locks,i);
}
//x*y=bmp_mem*8
//x/y=640/480
//x=640/480*y
//640/480*y^2=bmp_mem*8
//y=Sqrt(bmp_mem*8*480/640)
//bmp_scale=Sqrt(bmp_mem*8*480/640)/480
bmp_scale=Sqrt(bmp_mem*8*Fs->pix_height/Fs->pix_width)/Fs->pix_height;
bmp_scale_sqr=Sqr(bmp_scale);
bmp_width =bmp_scale*Fs->pix_width;
bmp_height=bmp_scale*Fs->pix_height;
bmp=CAlloc(bmp_width*bmp_height/8);
@@ -200,7 +252,13 @@ U0 Init()
U0 CleanUp()
{
QueDel(&p_root,TRUE);
I64 i;
for (i=0;i<mp_cnt;i++) {
while (!LBts(&p_root_locks,i))
Yield;
QueDel(&p_root[i],TRUE);
LBtr(&p_root_locks,i);
}
DCDel(map);
Free(bmp);
}
@@ -211,6 +269,7 @@ U0 LightTable()
I64 msg_code,i,cnt,arg1,arg2,ray_x1,ray_y1,ray_x2,ray_y2;
CD3I32 *c=MAlloc(PTS_NUM*sizeof(CD3I32));
p_root_locks=0;
MenuPush(
"File {"
" Restart(,'\n');"
@@ -250,7 +309,8 @@ U0 LightTable()
DocClear;
Init;
Fs->draw_it=&DrawIt;
Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs);
for (i=0;i<mp_cnt;i++)
animate_tasks[i]=Spawn(&AnimateTask,NULL,"Animate",i);
try {
while (TRUE) {
msg_code=GetMsg(&arg1,&arg2,
@@ -318,6 +378,8 @@ lt_done:
} catch
PutExcept;
Free(c);
for (i=0;i<mp_cnt;i++)
Kill(animate_tasks[i]);
SettingsPop;
CleanUp;
MenuPop;
+1 -1
View File
@@ -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.
$IV,1$----01/30/17 18:21:26----$IV,0$
$IV,1$----01/30/17 20:37:28----$IV,0$
* Added $LK,"::/Demo/Graphics/LightTable.HC"$.
$IV,1$----01/27/17 08:13:37----$IV,0$