TempleOSCD_150216.ISO
This commit is contained in:
1 parent
64f679eeb9
commit
401601816c
531 files changed
+23341
-22071
No files matched your search
Binary file not shown.
@@ -17,9 +17,7 @@ U0 HoldCourt()
|
||||
I64 accused,crime,victim;
|
||||
Bool old_form=LBts(&(DocPut)->flags,DOCf_FORM);
|
||||
|
||||
FlushMsgs;
|
||||
DocDblBufStart;
|
||||
|
||||
'\n';
|
||||
accused=RandU32%3;
|
||||
"%s",LstSub(accused,"A man \0A woman \0A child \0");
|
||||
@@ -74,7 +72,6 @@ Bool TakeTurn()
|
||||
Camp(num_people);
|
||||
Kill(Fs->song_task);
|
||||
|
||||
FlushMsgs;
|
||||
DocDblBufStart;
|
||||
"$$LM,4$$"
|
||||
"\n\n$$BT,\"Break Camp\",LE=T_BREAK_CAMP$$\n\n"
|
||||
@@ -164,7 +161,6 @@ U0 Trailer()
|
||||
Cd(Fs->parent_task->cur_dir);
|
||||
Type("AESplash.TXT");
|
||||
Sleep(500);
|
||||
FlushMsgs;
|
||||
try {
|
||||
TMsg(dc,"Leaving all behind, they fled.");
|
||||
TMsg(dc,"Found themselves in a desert.");
|
||||
@@ -181,11 +177,11 @@ U0 AfterEgypt()
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
Fs->song_task=Spawn(&SongTask,NULL,"Song",,Fs);
|
||||
WinBorder;
|
||||
WordStat;
|
||||
AutoComplete;
|
||||
DocClear;
|
||||
WinMax;
|
||||
PopUp("Trailer;",Fs);
|
||||
WordStat;
|
||||
AutoComplete;
|
||||
try //Catch <CTRL-ALT-c>.
|
||||
while (TakeTurn);
|
||||
catch
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,19 +1,18 @@
|
||||
I64 type_weights[OT_NUM_TYPES]={30,30,15,30,30,1,1,1};
|
||||
I64 type_weights[OT_NUM_TYPES]={0,30,30,15,30,30,1,1,1};
|
||||
|
||||
I64 mp_not_done_flags;
|
||||
U0 MPDrawHoreb(CDC *dc2)
|
||||
{
|
||||
CTask *task=dc2->win_task;
|
||||
CDC *dc=DCAlias(dc2,task);
|
||||
I64 lo=Gs->num*O_NUM_OBJS/mp_cnt,hi=(Gs->num+1)*O_NUM_OBJS/mp_cnt,
|
||||
i,j,dx,dy,dz,w=task->pix_width,h=task->pix_height,r[16],cx=w>>1;
|
||||
I64 i,j,dx,dy,dz,w=task->pix_width,h=task->pix_height,r[16],cx=w>>1;
|
||||
F64 s,m,a,x1,y1,x2,y2;
|
||||
Obj *tempo;
|
||||
|
||||
GrIdentEqu(r);
|
||||
GrRotYEqu(r,-é);
|
||||
GrRotXEqu(r,77*ã/180);
|
||||
for (i=lo;i<hi;i++) {
|
||||
for (i=Gs->num;i<O_NUM_OBJS+O_NUM_PEBBLES;i+=mp_cnt) {
|
||||
tempo=&objs[i];
|
||||
tempo->x1=tempo->x+vx; tempo->y1=tempo->y; tempo->z1=tempo->z+vz;
|
||||
GrRot(r,&tempo->x1,&tempo->y1,&tempo->z1);
|
||||
@@ -27,15 +26,21 @@ U0 MPDrawHoreb(CDC *dc2)
|
||||
}
|
||||
if (tempo->z1>=0) {
|
||||
s=100.0/(AbsI64(tempo->z1)+50);
|
||||
GrIdentEqu(dc->r);
|
||||
GrScaleEqu(dc->r,s*2);
|
||||
GrSetRotMat(dc,dc->r);
|
||||
dc->flags|=DCF_TRANSFORMATION;
|
||||
if (tempo->sym) {
|
||||
dc->flags|=DCF_SYMMETRY|DCF_JUST_MIRROR;
|
||||
GrSetSymmetry(dc,s*tempo->x1+cx,s*tempo->y1+h,s*tempo->x1+cx,s*tempo->y1+h+10);
|
||||
if (tempo->type) {
|
||||
GrIdentEqu(dc->r);
|
||||
GrScaleEqu(dc->r,s*2);
|
||||
GrSetRotMat(dc,dc->r);
|
||||
dc->flags|=DCF_TRANSFORMATION;
|
||||
if (tempo->sym) {
|
||||
dc->flags|=DCF_SYMMETRY|DCF_JUST_MIRROR;
|
||||
GrSetSymmetry(dc,s*tempo->x1+cx,s*tempo->y1+h,s*tempo->x1+cx,s*tempo->y1+h+10);
|
||||
}
|
||||
Sprite3B(dc,s*tempo->x1+cx,s*tempo->y1+h,tempo->z1,imgs[tempo->type]);
|
||||
} else {
|
||||
dc->flags&=~DCF_TRANSFORMATION;
|
||||
dc->color=pebble_colors[tempo->num&3];
|
||||
GrPlot3(dc,s*tempo->x1+cx,s*tempo->y1+h,tempo->z1);
|
||||
}
|
||||
Sprite3B(dc,s*tempo->x1+cx,s*tempo->y1+h,tempo->z1,imgs[tempo->type]);
|
||||
dc->flags&=~(DCF_SYMMETRY|DCF_JUST_MIRROR);
|
||||
if (tempo==&objs[O_BURNING_BUSH]) {//draw burning bush
|
||||
dc->x=s*tempo->x1+cx;
|
||||
@@ -1,4 +1,4 @@
|
||||
I64 type_weights[OT_NUM_TYPES]={30,30,15,30,3,1,1,1};
|
||||
I64 type_weights[OT_NUM_TYPES]={0,30,30,15,30,3,1,1,1};
|
||||
|
||||
I64 ObjCompare(Obj *o1,Obj *o2)
|
||||
{
|
||||
@@ -12,7 +12,7 @@ U0 DrawHoreb(CTask *task,CDC *dc)
|
||||
h=task->pix_height,r[16],
|
||||
cx=w>>1,cy=h>>1;
|
||||
F64 s,m,a,x1,y1,x2,y2;
|
||||
Obj *o_sort[O_NUM_OBJS],*tempo;
|
||||
Obj *o_sort[O_NUM_OBJS+O_NUM_PEBBLES],*tempo;
|
||||
|
||||
GrIdentEqu(r);
|
||||
GrRotYEqu(r,-é);
|
||||
@@ -29,7 +29,7 @@ U0 DrawHoreb(CTask *task,CDC *dc)
|
||||
GrFloodFill(dc,s*x+cx,15);
|
||||
}
|
||||
|
||||
for (i=0;i<O_NUM_OBJS;i++) {
|
||||
for (i=0;i<O_NUM_OBJS+O_NUM_PEBBLES;i++) {
|
||||
tempo=&objs[i];
|
||||
o_sort[i]=tempo;
|
||||
tempo->x1=tempo->x+vx; tempo->y1=tempo->y; tempo->z1=tempo->z+vz;
|
||||
@@ -43,21 +43,27 @@ U0 DrawHoreb(CTask *task,CDC *dc)
|
||||
tempo->sym=FALSE;
|
||||
}
|
||||
}
|
||||
QSortI64(o_sort,O_NUM_OBJS,&ObjCompare);
|
||||
QSortI64(o_sort,O_NUM_OBJS+O_NUM_PEBBLES,&ObjCompare);
|
||||
|
||||
for (i=0;i<O_NUM_OBJS;i++) {
|
||||
for (i=0;i<O_NUM_OBJS+O_NUM_PEBBLES;i++) {
|
||||
tempo=o_sort[i];
|
||||
if (tempo->z1<0) break;
|
||||
s=100.0/(AbsI64(tempo->z1)+50);
|
||||
GrIdentEqu(dc->r);
|
||||
GrScaleEqu(dc->r,s*2);
|
||||
GrSetRotMat(dc,dc->r);
|
||||
dc->flags|=DCF_TRANSFORMATION;
|
||||
if (tempo->sym) {
|
||||
dc->flags|=DCF_SYMMETRY|DCF_JUST_MIRROR;
|
||||
GrSetSymmetry(dc,s*tempo->x1+cx,s*tempo->y1+h,s*tempo->x1+cx,s*tempo->y1+h+10);
|
||||
if (tempo->type) {
|
||||
GrIdentEqu(dc->r);
|
||||
GrScaleEqu(dc->r,s*2);
|
||||
GrSetRotMat(dc,dc->r);
|
||||
dc->flags|=DCF_TRANSFORMATION;
|
||||
if (tempo->sym) {
|
||||
dc->flags|=DCF_SYMMETRY|DCF_JUST_MIRROR;
|
||||
GrSetSymmetry(dc,s*tempo->x1+cx,s*tempo->y1+h,s*tempo->x1+cx,s*tempo->y1+h+10);
|
||||
}
|
||||
Sprite3B(dc,s*tempo->x1+cx,s*tempo->y1+h,0,imgs[tempo->type]);
|
||||
} else {
|
||||
dc->flags&=~DCF_TRANSFORMATION;
|
||||
dc->color=pebble_colors[tempo->num&3];
|
||||
GrPlot3(dc,s*tempo->x1+cx,s*tempo->y1+h,tempo->z1);
|
||||
}
|
||||
Sprite3B(dc,s*tempo->x1+cx,s*tempo->y1+h,0,imgs[tempo->type]);
|
||||
dc->flags&=~(DCF_SYMMETRY|DCF_JUST_MIRROR);
|
||||
if (o_sort[i]==&objs[O_BURNING_BUSH]) {//draw burning bush
|
||||
dc->x=s*tempo->x1+cx;
|
||||
@@ -5,7 +5,7 @@ U0 AnimateTask(I64)
|
||||
Obj *tempo;
|
||||
while (TRUE) {
|
||||
t=tS;
|
||||
for (i=0;i<O_NUM_OBJS;i++) {
|
||||
for (i=0;i<O_NUM_OBJS+O_NUM_PEBBLES;i++) {
|
||||
tempo=&objs[i];
|
||||
if (tempo->type==OT_SHEEP || tempo->type==OT_GOAT1 || tempo->type==OT_GOAT2) {
|
||||
tempo->x+=tempo->dx;
|
||||
@@ -28,25 +28,28 @@ U0 Init()
|
||||
total+=type_weights[i];
|
||||
|
||||
MemSet(objs,0,sizeof(objs));
|
||||
for (i=0;i<O_NUM_OBJS;i++) {
|
||||
for (i=0;i<O_NUM_OBJS+O_NUM_PEBBLES;i++) {
|
||||
tempo=&objs[i];
|
||||
tempo->num=i;
|
||||
tempo->x=RandU32&0x1FFF-0x1000;
|
||||
tempo->y=0;
|
||||
tempo->z=RandU32&0x1FFF-0x1000;
|
||||
tempo->é=2*ã*Rand;
|
||||
tempo->sym=RandU16&1;
|
||||
|
||||
k=0;
|
||||
j=RandU32%total;
|
||||
while (TRUE) {
|
||||
j-=type_weights[k];
|
||||
if (j<0)
|
||||
break;
|
||||
else
|
||||
k++;
|
||||
}
|
||||
|
||||
tempo->type=k;
|
||||
if (i<O_NUM_OBJS) {
|
||||
k=0;
|
||||
j=RandU32%total;
|
||||
while (TRUE) {
|
||||
j-=type_weights[k];
|
||||
if (j<0)
|
||||
break;
|
||||
else
|
||||
k++;
|
||||
}
|
||||
tempo->type=k;
|
||||
} else
|
||||
tempo->type=OT_PEBBLE;
|
||||
}
|
||||
objs[O_BURNING_BUSH].type=OT_BUSH1;
|
||||
|
||||
@@ -54,14 +57,14 @@ U0 Init()
|
||||
horeb_done=FALSE;
|
||||
}
|
||||
|
||||
#define ANIMATE_STEPS 10
|
||||
#define ANIMATE_STEPS 5
|
||||
|
||||
U0 AnimateéTask(F64 a)
|
||||
{
|
||||
I64 i;
|
||||
for (i=0;i<ANIMATE_STEPS;i++) {
|
||||
é+=a/ANIMATE_STEPS;
|
||||
Sleep(10);
|
||||
Sleep(20);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,31 +74,31 @@ U0 AnimateVTask(F64 v)
|
||||
for (i=0;i<ANIMATE_STEPS;i++) {
|
||||
vx+=v/ANIMATE_STEPS*Sin(é);
|
||||
vz+=v/ANIMATE_STEPS*Cos(é);
|
||||
Sleep(10);
|
||||
Sleep(20);
|
||||
}
|
||||
}
|
||||
|
||||
U0 Horeb()
|
||||
{
|
||||
I64 ch,sc;
|
||||
I64 sc;
|
||||
MenuPush(
|
||||
"File {"
|
||||
" Abort(,CH_SHIFT_ESC);"
|
||||
" Exit(,CH_ESC);"
|
||||
"}"
|
||||
"Play {"
|
||||
" Restart(,'\n');"
|
||||
" Fwd(,,SC_CURSOR_UP);"
|
||||
" Bwd(,,SC_CURSOR_DOWN);"
|
||||
" Left(,,SC_CURSOR_LEFT);"
|
||||
" Right(,,SC_CURSOR_RIGHT);"
|
||||
"}"
|
||||
);
|
||||
"File {"
|
||||
" Abort(,CH_SHIFT_ESC);"
|
||||
" Exit(,CH_ESC);"
|
||||
"}"
|
||||
"Play {"
|
||||
" Restart(,'\n');"
|
||||
" Fwd(,,SC_CURSOR_UP);"
|
||||
" Bwd(,,SC_CURSOR_DOWN);"
|
||||
" Left(,,SC_CURSOR_LEFT);"
|
||||
" Right(,,SC_CURSOR_RIGHT);"
|
||||
"}"
|
||||
);
|
||||
SettingsPush(Fs,TSF_SAME_SONG); //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
try {
|
||||
Fs->text_attr=YELLOW<<4+BLUE;
|
||||
Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_FOCUS-WIF_SELF_GRAB_SCROLL-WIF_FOCUS_TASK_MENU;
|
||||
WordStat;
|
||||
AutoComplete;
|
||||
WinMax;
|
||||
WinBorder;
|
||||
Preempt(OFF);
|
||||
@@ -107,34 +110,31 @@ U0 Horeb()
|
||||
Init;
|
||||
Fs->animate_task=Spawn(&AnimateTask,NULL,"Animate",,Fs);
|
||||
Fs->draw_it=&DrawHoreb;
|
||||
while (!horeb_done) {
|
||||
while (ScanKey(&ch,&sc))
|
||||
switch (ch) {
|
||||
case 0:
|
||||
switch (sc.u8[0]) {
|
||||
case SC_CURSOR_LEFT:
|
||||
Spawn(&AnimateéTask,(-ã/100)(I64),"Animate é",,Fs);
|
||||
break;
|
||||
case SC_CURSOR_RIGHT:
|
||||
Spawn(&AnimateéTask,( ã/100)(I64),"Animate é",,Fs);
|
||||
break;
|
||||
case SC_CURSOR_UP:
|
||||
Spawn(&AnimateVTask,(-40.0 )(I64),"Animate V",,Fs);
|
||||
break;
|
||||
case SC_CURSOR_DOWN:
|
||||
Spawn(&AnimateVTask,( 40.0 )(I64),"Animate V",,Fs);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case '\n':
|
||||
Init;
|
||||
break;
|
||||
case CH_SHIFT_ESC:
|
||||
case CH_ESC:
|
||||
goto hr_done;
|
||||
}
|
||||
WinMgrSync;
|
||||
}
|
||||
while (!horeb_done)
|
||||
switch (GetKey(&sc)) {
|
||||
case 0:
|
||||
switch (sc.u8[0]) {
|
||||
case SC_CURSOR_LEFT:
|
||||
Spawn(&AnimateéTask,(-ã/100)(I64),"Animate é",,Fs);
|
||||
break;
|
||||
case SC_CURSOR_RIGHT:
|
||||
Spawn(&AnimateéTask,( ã/100)(I64),"Animate é",,Fs);
|
||||
break;
|
||||
case SC_CURSOR_UP:
|
||||
Spawn(&AnimateVTask,(-40.0 )(I64),"Animate V",,Fs);
|
||||
break;
|
||||
case SC_CURSOR_DOWN:
|
||||
Spawn(&AnimateVTask,( 40.0 )(I64),"Animate V",,Fs);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case '\n':
|
||||
Init;
|
||||
break;
|
||||
case CH_SHIFT_ESC:
|
||||
case CH_ESC:
|
||||
goto hr_done;
|
||||
}
|
||||
hr_done: //Don't goto out of try
|
||||
} catch
|
||||
Fs->catch_except=TRUE;
|
||||
@@ -1,6 +1,6 @@
|
||||
#help_index "Games"
|
||||
|
||||
Cd("/Apps/AfterEgypt");;
|
||||
Cd(__DIR__);;
|
||||
#include "Comics"
|
||||
#include "/Demo/Graphics/Camp"
|
||||
#include "/Demo/MultiCore/Clouds"
|
||||
@@ -9,15 +9,15 @@ Cd("/Apps/AfterEgypt");;
|
||||
#include "Battle"
|
||||
#include "WaterRock"
|
||||
#include "Quail"
|
||||
#include "Horeb1"
|
||||
#include "HorebA"
|
||||
|
||||
#if mp_cnt>=4
|
||||
#include "Horeb2MP"
|
||||
#include "HorebBMP"
|
||||
#else
|
||||
#include "Horeb2SP"
|
||||
#include "HorebBSP"
|
||||
#endif
|
||||
|
||||
#include "Horeb3"
|
||||
#include "HorebC"
|
||||
#include "GodTalking"
|
||||
#include "AfterEgypt"
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
Cd("/Apps/AfterEgypt");;
|
||||
Cd(__DIR__);;
|
||||
#include "Load"
|
||||
AfterEgypt;
|
||||
Binary file not shown.
+17
-13
@@ -5,15 +5,15 @@ U0 BgtAcctsUpdate()
|
||||
tempb=b_root.next;
|
||||
while (tempb!=&b_root) {
|
||||
if (tempb->type!=BE_TEMPLATE_COPY) {
|
||||
tempb->credit_index =StrFileAdd(tempb->credit,accts_table);
|
||||
tempb->debit_index =StrFileAdd(tempb->debit,accts_table);
|
||||
tempb->credit_index =StrFileAdd(tempb->credit,&accts_table_strs,accts_table);
|
||||
tempb->debit_index =StrFileAdd(tempb->debit,&accts_table_strs,accts_table);
|
||||
}
|
||||
tempb=tempb->next;
|
||||
}
|
||||
tempt=t_root.next;
|
||||
while (tempt!=&t_root) {
|
||||
tempt->b.credit_index =StrFileAdd(tempt->b.credit,accts_table);
|
||||
tempt->b.debit_index =StrFileAdd(tempt->b.debit,accts_table);
|
||||
tempt->b.credit_index =StrFileAdd(tempt->b.credit,&accts_table_strs,accts_table);
|
||||
tempt->b.debit_index =StrFileAdd(tempt->b.debit,&accts_table_strs,accts_table);
|
||||
tempt=tempt->next;
|
||||
}
|
||||
}
|
||||
@@ -29,10 +29,11 @@ U0 BgtAcctsRead()
|
||||
I64 i,max_num;
|
||||
U8 *colors,**s=StrFileRead(BGT_ACCTS_FILE,&max_num,&colors,TRUE);
|
||||
StrFileDel(accts_table);
|
||||
accts_table=HashTableNew(0x200);
|
||||
accts_table=HashTableNew(512);
|
||||
accts_table_strs=0;
|
||||
for (i=0;i<=max_num;i++)
|
||||
if (s[i])
|
||||
StrFileAdd(s[i],accts_table,colors[i]);
|
||||
StrFileAdd(s[i],&accts_table_strs,accts_table,colors[i]);
|
||||
StrFileArrDel(s,max_num);
|
||||
Free(colors);
|
||||
}
|
||||
@@ -48,6 +49,7 @@ I64 BgtAcctColor(U8 *st)
|
||||
|
||||
U8 *BgtPopUpAcct(U8 *header=NULL,U8 *dft=NULL)
|
||||
{
|
||||
I64 i;
|
||||
U8 *result;
|
||||
CDoc *doc=DocNew;
|
||||
CDocEntry *doc_e,*doc_dft=NULL;
|
||||
@@ -56,13 +58,15 @@ U8 *BgtPopUpAcct(U8 *header=NULL,U8 *dft=NULL)
|
||||
if (header)
|
||||
DocPrint(doc,"%s",header);
|
||||
|
||||
temph=accts_table->next_added;
|
||||
while (temph!=accts_table) {
|
||||
doc_e=DocPrint(doc,"$$FG,%d$$$$MU-UL,\"%s\",LE=0x%X$$\n",
|
||||
temph->user_data1,temph->str,temph->str);
|
||||
if (dft && !StrCmp(dft,temph->str))
|
||||
doc_dft=doc_e;
|
||||
temph=temph->next_added;
|
||||
for (i=0;i<=accts_table->mask;i++) {
|
||||
temph=accts_table->body[i];
|
||||
while (temph) {
|
||||
doc_e=DocPrint(doc,"$$FG,%d$$$$MU-UL,\"%s\",LE=0x%X$$\n",
|
||||
temph->user_data1,temph->str,temph->str);
|
||||
if (dft && !StrCmp(dft,temph->str))
|
||||
doc_dft=doc_e;
|
||||
temph=temph->next;
|
||||
}
|
||||
}
|
||||
|
||||
if (doc_dft) {
|
||||
|
||||
@@ -62,8 +62,8 @@ CBgtEntry *BgtEntryPmt(CBgtEntry *dft=NULL)
|
||||
tempb->debit =StrNew(b.debit);
|
||||
tempb->desc =StrNew(b.desc);
|
||||
tempb->type =BE_NORMAL;
|
||||
StrFileAdd(tempb->credit,accts_table);
|
||||
StrFileAdd(tempb->debit,accts_table);
|
||||
StrFileAdd(tempb->credit,&accts_table_strs,accts_table);
|
||||
StrFileAdd(tempb->debit,&accts_table_strs,accts_table);
|
||||
return tempb;
|
||||
}
|
||||
} else
|
||||
|
||||
+15
-12
@@ -48,26 +48,28 @@ U0 BgtDataRead()
|
||||
|
||||
U0 BgtDataWrite()
|
||||
{
|
||||
I64 size,cnt1,cnt2;
|
||||
CHashTable *table=HashTableNew(0x1000);
|
||||
I64 i,num=0,size,cnt1,cnt2;
|
||||
CHashTable *table=HashTableNew(1024);
|
||||
CBgtEntry *tempb;
|
||||
CBgtTemplate *tempt;
|
||||
CHashGeneric *temph;
|
||||
U8 *buf,*ptr;
|
||||
|
||||
temph=accts_table->next_added;
|
||||
while (temph!=accts_table) {
|
||||
StrFileAdd(temph->str,table); //Make so accts come first. (Cosmetic)
|
||||
temph=temph->next_added;
|
||||
for (i=0;i<=accts_table->mask;i++) {
|
||||
temph=accts_table->body[i];
|
||||
while (temph) {
|
||||
StrFileAdd(temph->str,&num,table); //Cosmetics -- make accts appear first.
|
||||
temph=temph->next;
|
||||
}
|
||||
}
|
||||
|
||||
tempb=b_root.next;
|
||||
cnt1=0;
|
||||
while (tempb!=&b_root) {
|
||||
if (tempb->type!=BE_TEMPLATE_COPY) {
|
||||
tempb->credit_index =StrFileAdd(tempb->credit,table);
|
||||
tempb->debit_index =StrFileAdd(tempb->debit,table);
|
||||
tempb->desc_index =StrFileAdd(tempb->desc,table);
|
||||
tempb->credit_index =StrFileAdd(tempb->credit,&num,table);
|
||||
tempb->debit_index =StrFileAdd(tempb->debit,&num,table);
|
||||
tempb->desc_index =StrFileAdd(tempb->desc,&num,table);
|
||||
cnt1++;
|
||||
}
|
||||
tempb=tempb->next;
|
||||
@@ -76,9 +78,9 @@ U0 BgtDataWrite()
|
||||
tempt=t_root.next;
|
||||
cnt2=0;
|
||||
while (tempt!=&t_root) {
|
||||
tempt->b.credit_index =StrFileAdd(tempt->b.credit,table);
|
||||
tempt->b.debit_index =StrFileAdd(tempt->b.debit,table);
|
||||
tempt->b.desc_index =StrFileAdd(tempt->b.desc,table);
|
||||
tempt->b.credit_index =StrFileAdd(tempt->b.credit,&num,table);
|
||||
tempt->b.debit_index =StrFileAdd(tempt->b.debit,&num,table);
|
||||
tempt->b.desc_index =StrFileAdd(tempt->b.desc,&num,table);
|
||||
cnt2++;
|
||||
tempt=tempt->next;
|
||||
}
|
||||
@@ -134,4 +136,5 @@ U0 BgtDel()
|
||||
}
|
||||
StrFileDel(accts_table);
|
||||
accts_table=NULL;
|
||||
accts_table_strs=0;
|
||||
}
|
||||
@@ -49,7 +49,7 @@ Bool BgtPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
|
||||
case 'a':
|
||||
PopUpOk( "Set the name and color of your accounts.\n"
|
||||
"To delete accounts, manually edit\n"
|
||||
"$$GREEN$$HOME/Budget/Accts.TXT.Z$$FG$$.");
|
||||
"$$GREEN$$/Home/Budget/Accts.TXT.Z$$FG$$.");
|
||||
if (PopUpEd(BGT_ACCTS_FILE,Fs)) {
|
||||
BgtAcctsRead;
|
||||
BgtRegen;
|
||||
@@ -163,7 +163,7 @@ U0 Budget()
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
WinMax;
|
||||
WinBorder;
|
||||
WordStat;
|
||||
AutoComplete;
|
||||
MenuPush(
|
||||
"File {"
|
||||
" Abort(,CH_SHIFT_ESC);"
|
||||
|
||||
+34
-16
@@ -53,7 +53,7 @@ public U0 StrFileArrDel(U8 **a,I64 max_num)
|
||||
Free(a);
|
||||
}
|
||||
|
||||
public I64 StrFileAdd(U8 *st,CHashTable *table,I64 color=COLOR_INVALID)
|
||||
public I64 StrFileAdd(U8 *st,I64 *_num,CHashTable *table,I64 color=COLOR_INVALID)
|
||||
{
|
||||
CHashGeneric *temph;
|
||||
if (!st) return 0;
|
||||
@@ -61,10 +61,7 @@ public I64 StrFileAdd(U8 *st,CHashTable *table,I64 color=COLOR_INVALID)
|
||||
temph=CAlloc(sizeof(CHashGeneric));
|
||||
temph->type=SFT_GENERIC;
|
||||
temph->str=StrNew(st);
|
||||
if (table->last_added==table)
|
||||
temph->user_data0=1;
|
||||
else
|
||||
temph->user_data0=table->last_added(CHashGeneric *)->user_data0+1;
|
||||
temph->user_data0=(*_num)++;
|
||||
HashAdd(temph,table);
|
||||
}
|
||||
if (color!=COLOR_INVALID)
|
||||
@@ -72,14 +69,32 @@ public I64 StrFileAdd(U8 *st,CHashTable *table,I64 color=COLOR_INVALID)
|
||||
return temph->user_data0;
|
||||
}
|
||||
|
||||
I64 StrEntriesCompare(CHashGeneric *h1,CHashGeneric *h2)
|
||||
{
|
||||
return h1->user_data0-h2->user_data0;
|
||||
}
|
||||
|
||||
public U0 StrFileWrite(U8 *name,CHashTable *table,Bool no_nums=FALSE)
|
||||
{
|
||||
I64 color=BLACK;
|
||||
I64 i,j,cnt,color=BLACK;
|
||||
CDoc *doc=DocNew(name);
|
||||
CHashGeneric *temph;
|
||||
CHashGeneric *temph,**a;
|
||||
if (table) {
|
||||
temph=table->next_added;
|
||||
while (temph!=table) {
|
||||
cnt=0; //Count Strings
|
||||
for (i=0;i<=table->mask;i++)
|
||||
cnt+=LinkedLstCnt(table->body[i]);
|
||||
a=MAlloc(cnt*sizeof(CHashGeneric *));
|
||||
j=0; //Load Strings
|
||||
for (i=0;i<=table->mask;i++) {
|
||||
temph=table->body[i];
|
||||
while (temph) {
|
||||
a[j++]=temph;
|
||||
temph=temph->next;
|
||||
}
|
||||
}
|
||||
QSortI64(a,cnt,&StrEntriesCompare);
|
||||
for (i=0;i<cnt;i++) {
|
||||
temph=a[i];
|
||||
if (temph->user_data1&15!=color) {
|
||||
DocPrint(doc,"$$FG,%d$$",temph->user_data1&15);
|
||||
color=temph->user_data1&15;
|
||||
@@ -88,8 +103,8 @@ public U0 StrFileWrite(U8 *name,CHashTable *table,Bool no_nums=FALSE)
|
||||
DocPrint(doc,"%s\n",temph->str);
|
||||
else
|
||||
DocPrint(doc,"%d,%s\n",temph->user_data0,temph->str);
|
||||
temph=temph->next_added;
|
||||
}
|
||||
Free(a);
|
||||
}
|
||||
doc->flags|=DOCF_NO_CURSOR;
|
||||
DocWrite(doc);
|
||||
@@ -98,14 +113,17 @@ public U0 StrFileWrite(U8 *name,CHashTable *table,Bool no_nums=FALSE)
|
||||
|
||||
public U0 StrFileDel(CHashTable *table)
|
||||
{
|
||||
I64 i;
|
||||
CHashGeneric *temph,*temph1;
|
||||
if (!table) return;
|
||||
temph=table->next_added;
|
||||
while (temph!=table) {
|
||||
temph1=temph->next_added;
|
||||
Free(temph->str);
|
||||
Free(temph);
|
||||
temph=temph1;
|
||||
for (i=0;i<=table->mask;i++) {
|
||||
temph=table->body[i];
|
||||
while (temph) {
|
||||
temph1=temph->next;
|
||||
Free(temph->str);
|
||||
Free(temph);
|
||||
temph=temph1;
|
||||
}
|
||||
}
|
||||
Free(table->body);
|
||||
Free(table);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#define BGT_STRINGS_FILE "HOME/Budget/Strs.TXT.Z"
|
||||
#define BGT_ACCTS_FILE "HOME/Budget/Accts.TXT.Z"
|
||||
#define BGT_DATA_FILE "HOME/Budget/Bgt.DAT.Z"
|
||||
#define BGT_STRINGS_FILE "::/Home/Budget/Strs.TXT.Z"
|
||||
#define BGT_ACCTS_FILE "::/Home/Budget/Accts.TXT.Z"
|
||||
#define BGT_DATA_FILE "::/Home/Budget/Bgt.DAT.Z"
|
||||
|
||||
#define BE_NORMAL 0
|
||||
#define BE_GAS 1
|
||||
@@ -55,6 +55,7 @@ class CBgtTemplate
|
||||
|
||||
U8 view_acct[512];
|
||||
CHashTable *accts_table=NULL;
|
||||
I64 accts_table_strs=0;
|
||||
|
||||
CDate MyStr2Date(U8 *st)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
if (!FileFind("HOME/Budget",,FUF_JUST_DIRS)) {
|
||||
MkDir("HOME/Budget");
|
||||
Copy("/Apps/Budget/Accts.TXT.Z","HOME/Budget");
|
||||
Cd(__DIR__);;
|
||||
if (!FileFind("::/Home/Budget",,FUF_JUST_DIRS)) {
|
||||
MkDir("::/Home/Budget");
|
||||
Copy("Accts.TXT.Z","::/Home/Budget");
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
#help_index "Finance"
|
||||
|
||||
#include "/Apps/Budget/BgtStrs"
|
||||
#include "/Apps/Budget/Budget"
|
||||
#include "/Apps/Budget/BgtAccts"
|
||||
#include "/Apps/Budget/BgtEntry"
|
||||
#include "/Apps/Budget/BgtTemplate"
|
||||
#include "/Apps/Budget/BgtFile"
|
||||
#include "/Apps/Budget/BgtMain"
|
||||
Cd(__DIR__);;
|
||||
#include "BgtStrs"
|
||||
#include "Budget"
|
||||
#include "BgtAccts"
|
||||
#include "BgtEntry"
|
||||
#include "BgtTemplate"
|
||||
#include "BgtFile"
|
||||
#include "BgtMain"
|
||||
|
||||
#help_index ""
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
Cd("/Apps/Budget");;
|
||||
Cd(__DIR__);;
|
||||
#include "Load"
|
||||
#include "Install" //Might as well always install
|
||||
Budget;
|
||||
@@ -58,17 +58,17 @@ I64 AddTri(BallDefineStruct *,I64 c,I64 n0,I64 n1,I64 n2)
|
||||
U8 *Ball2CSprite()
|
||||
{
|
||||
//See $LK,"::/Adam/Gr/GrSpritePlot.CPP",A="FL:::/Adam/Gr/GrSpritePlot.CPP,1"$ for how CSprite are stored.
|
||||
U8 *result=MAlloc(sizeof(U8)+2*sizeof(I32)+
|
||||
U8 *result=MAlloc(sizeof(CSpriteMeshU8s)+
|
||||
b->vertex_cnt*sizeof(CD3I32)+b->tri_cnt*sizeof(CMeshTri)+sprite_elem_base_sizes[SPT_END]),
|
||||
*dst=result;
|
||||
*dst(U8 *)++ =SPT_MESH;
|
||||
*dst++ =SPT_MESH;
|
||||
*dst(I32 *)++ =b->vertex_cnt;
|
||||
*dst(I32 *)++ =b->tri_cnt;
|
||||
MemCpy(dst,&b->v,b->vertex_cnt*sizeof(CD3I32));
|
||||
dst+=b->vertex_cnt*sizeof(CD3I32);
|
||||
MemCpy(dst,&b->t,b->tri_cnt*sizeof(CMeshTri));
|
||||
dst+=b->tri_cnt*sizeof(CMeshTri);
|
||||
*dst(U8 *)++ =SPT_END;
|
||||
*dst++ =SPT_END;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#help_index "Misc"
|
||||
|
||||
#include "/Apps/GrModels/ManGen"
|
||||
#include "/Apps/GrModels/BallGen"
|
||||
#include "/Apps/GrModels/Models"
|
||||
Cd(__DIR__);;
|
||||
#include "ManGen"
|
||||
#include "BallGen"
|
||||
#include "Models"
|
||||
|
||||
#help_index ""
|
||||
@@ -7,7 +7,7 @@ class Man
|
||||
{
|
||||
I32 vertex_cnt;
|
||||
I32 tri_cnt;
|
||||
CD3I32 v[MAX_VERTICES];
|
||||
CD3I32 v[MAX_VERTICES];
|
||||
CMeshTri t[MAX_TRIS];
|
||||
} *m;
|
||||
|
||||
@@ -182,17 +182,17 @@ U0 AddBox(ManDefineStruct *md,I64 c,I64 x1,I64 y1,I64 z1,F64 w,F64 h,F64 d,F64 h
|
||||
U8 *Man2CSprite()
|
||||
{
|
||||
//See $LK,"::/Adam/Gr/GrSpritePlot.CPP",A="FL:::/Adam/Gr/GrSpritePlot.CPP,1"$ for how CSprite are stored.
|
||||
U8 *result=MAlloc(sizeof(U8)+2*sizeof(I32)+
|
||||
U8 *result=MAlloc(sizeof(CSpriteMeshU8s)+
|
||||
m->vertex_cnt*sizeof(CD3I32)+m->tri_cnt*sizeof(CMeshTri)+sprite_elem_base_sizes[SPT_END]),
|
||||
*dst=result;
|
||||
*dst(U8 *)++ =SPT_MESH;
|
||||
*dst++ =SPT_MESH;
|
||||
*dst(I32 *)++ =m->vertex_cnt;
|
||||
*dst(I32 *)++ =m->tri_cnt;
|
||||
MemCpy(dst,&m->v,m->vertex_cnt*sizeof(CD3I32));
|
||||
dst+=m->vertex_cnt*sizeof(CD3I32);
|
||||
MemCpy(dst,&m->t,m->tri_cnt*sizeof(CMeshTri));
|
||||
dst+=m->tri_cnt*sizeof(CMeshTri);
|
||||
*dst(U8 *)++ =SPT_END;
|
||||
*dst++ =SPT_END;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
#include "/Apps/GrModels/Load"
|
||||
Cd(__DIR__);;
|
||||
#include "Load"
|
||||
Models;
|
||||
@@ -618,7 +618,7 @@ U0 KeepAway()
|
||||
Preempt(OFF);
|
||||
|
||||
Fs->win_inhibit|=WIG_DBL_CLICK;
|
||||
WordStat;
|
||||
AutoComplete;
|
||||
|
||||
MenuPush(
|
||||
"File {"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#help_index "Games"
|
||||
|
||||
#include "/Apps/KeepAway/KeepAway"
|
||||
Cd(__DIR__);;
|
||||
#include "KeepAway"
|
||||
|
||||
#help_index ""
|
||||
@@ -1,2 +1,3 @@
|
||||
#include "/Apps/KeepAway/Load"
|
||||
Cd(__DIR__);;
|
||||
#include "Load"
|
||||
KeepAway;
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
#help_index "Misc"
|
||||
|
||||
#include "/Apps/Logic/Logic"
|
||||
Cd(__DIR__);;
|
||||
#include "Logic"
|
||||
|
||||
#help_index ""
|
||||
@@ -568,7 +568,7 @@ U0 DigitalLogic()
|
||||
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
WinMax;
|
||||
WordStat;
|
||||
AutoComplete;
|
||||
WinBorder(ON);
|
||||
DocClear;
|
||||
GetGates;
|
||||
@@ -588,5 +588,5 @@ U0 DigitalLogic()
|
||||
SettingsPop;
|
||||
CleanUp;
|
||||
}
|
||||
| ||||