TempleOSCDV4.06.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:47:19 +02:00
1 parent 6fe38d2d9d
commit b632ab9a4f
261 files changed
+6282 -5801

No files matched your search

+2 -2
View File
@@ -14,7 +14,7 @@ U0 MyDerivative(CMathODE *ode,F64,COrder2D3 *,COrder2D3 *)
while (tempm1!=&ode->next_mass) {
tempm2=tempm1->next;
while (tempm2!=&ode->next_mass) {
D3Sub(&tempm2->state->x,&tempm1->state->x,&p);
D3Sub(&p,&tempm2->state->x,&tempm1->state->x);
dd=D3NormSqr(&p);
if (dd<=Sqr(tempm1->radius+tempm2->radius)) {
d=Sqrt(dd)+0.0001;
@@ -39,7 +39,7 @@ U0 MyDerivative(CMathODE *ode,F64,COrder2D3 *,COrder2D3 *)
p2.x=ip.pos.x-task->pix_left-task->scroll_x;
p2.y=ip.pos.y-task->pix_top-task->scroll_y;
p2.z=0;
D3Sub(&p2,&cursor_mass->state->x,&p);
D3Sub(&p,&p2,&cursor_mass->state->x);
d=10.0*D3NormSqr(&p);
D3MulEqu(&p,d);
D3AddEqu(&cursor_mass->DstateDt->DxDt,&p);
+4 -4
View File
@@ -10,18 +10,18 @@ F64 Cost(CMathODE *ode)
{
MyMass *tempm;
MySpring *temps;
F64 result=0;
F64 res=0;
tempm=ode->next_mass;
while (tempm!=&ode->next_mass) {
result+=tempm->cost;
res+=tempm->cost;
tempm=tempm->next;
}
temps=ode->next_spring;
while (temps!=&ode->next_spring) {
result+=temps->cost;
res+=temps->cost;
temps=temps->next;
}
return result;
return res;
}
U0 DrawIt(CTask *task,CDC *dc)
+6 -6
View File
@@ -25,7 +25,7 @@ U0 SpanDel(CMathODE *ode)
U8 *SpanSave(CMathODE *ode,I64 *_size=NULL)
{
I64 cnt;
U8 *result,*ptr;
U8 *res,*ptr;
MyMass *tempm;
MySpring *temps;
SpanHeader h;
@@ -43,7 +43,7 @@ U8 *SpanSave(CMathODE *ode,I64 *_size=NULL)
cnt=sizeof(SpanHeader)+h.num_masses*M_SIZE+h.num_springs*S_SIZE;
ptr=result=MAlloc(cnt);
ptr=res=MAlloc(cnt);
MemCpy(ptr,&h,sizeof(SpanHeader));
ptr+=sizeof(SpanHeader);
@@ -61,25 +61,25 @@ U8 *SpanSave(CMathODE *ode,I64 *_size=NULL)
temps=temps->next;
}
if (_size) *_size=cnt;
return result;
return res;
}
Bool SpanWrite(CMathODE *ode)
{
U8 *name,*buf;
I64 size;
Bool result=FALSE,old_silent=Silent;
Bool res=FALSE,old_silent=Silent;
MkDir("::/Home/Span");
Silent(old_silent);
if (name=PopUpFileName("::/Home/Span/Game.DAT")) {
if (buf=SpanSave(ode,&size)) {
FileWrite(name,buf,size);
Free(buf);
result=TRUE;
res=TRUE;
}
Free(name);
}
return result;
return res;
}
U0 SpanLoad(CMathODE *ode,U8 *src)