TempleOSCDV4.10.ISO
This commit is contained in:
1 parent
c5954d3371
commit
9206246147
181 files changed
+4468
-4313
No files matched your search
@@ -2,8 +2,8 @@ U0 BgtAcctsUpdate()
|
||||
{
|
||||
CBgtEntry *tempb;
|
||||
CBgtTemplate *tempt;
|
||||
tempb=b_root.next;
|
||||
while (tempb!=&b_root) {
|
||||
tempb=b_head.next;
|
||||
while (tempb!=&b_head) {
|
||||
if (tempb->type!=BE_TEMPLATE_COPY) {
|
||||
tempb->credit_idx=StrFileAdd(tempb->credit,
|
||||
&accts_table_strs,accts_table);
|
||||
@@ -12,8 +12,8 @@ U0 BgtAcctsUpdate()
|
||||
}
|
||||
tempb=tempb->next;
|
||||
}
|
||||
tempt=t_root.next;
|
||||
while (tempt!=&t_root) {
|
||||
tempt=t_head.next;
|
||||
while (tempt!=&t_head) {
|
||||
tempt->b.credit_idx=StrFileAdd(tempt->b.credit,
|
||||
&accts_table_strs,accts_table);
|
||||
tempt->b.debit_idx =StrFileAdd(tempt->b.debit,
|
||||
|
||||
@@ -15,8 +15,8 @@ U0 BgtEntryDel(CBgtEntry *tempb)
|
||||
|
||||
U0 BgtIns(CBgtEntry *tempb)
|
||||
{
|
||||
CBgtEntry *tempb1=b_root.next;
|
||||
while (tempb1!=&b_root && tempb1->date<tempb->date)
|
||||
CBgtEntry *tempb1=b_head.next;
|
||||
while (tempb1!=&b_head && tempb1->date<tempb->date)
|
||||
tempb1=tempb1->next;
|
||||
QueIns(tempb,tempb1->last);
|
||||
}
|
||||
|
||||
+20
-20
@@ -7,12 +7,12 @@ U0 BgtDataRead()
|
||||
I64 max_num;
|
||||
U8 **s=StrFileRead(BGT_STRINGS_FILE,&max_num);
|
||||
|
||||
MemSet(&b_root,0,sizeof(CBgtEntry));
|
||||
QueInit(&b_root);
|
||||
b_root.date=Now;
|
||||
MemSet(&t_root,0,sizeof(CBgtTemplate));
|
||||
QueInit(&t_root);
|
||||
t_root.b.date=Now;
|
||||
MemSet(&b_head,0,sizeof(CBgtEntry));
|
||||
QueInit(&b_head);
|
||||
b_head.date=Now;
|
||||
MemSet(&t_head,0,sizeof(CBgtTemplate));
|
||||
QueInit(&t_head);
|
||||
t_head.b.date=Now;
|
||||
|
||||
if (ptr=b=FileRead(BGT_DATA_FILE,&size)) {
|
||||
cnt=*ptr(I64 *)++;
|
||||
@@ -22,7 +22,7 @@ U0 BgtDataRead()
|
||||
tempb->credit=StrNew(s[tempb->credit_idx]);
|
||||
tempb->debit =StrNew(s[tempb->debit_idx]);
|
||||
tempb->desc =StrNew(s[tempb->desc_idx]);
|
||||
QueIns(tempb,b_root.last);
|
||||
QueIns(tempb,b_head.last);
|
||||
ptr+=BE_SIZE;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ U0 BgtDataRead()
|
||||
tempt->b.credit=StrNew(s[tempt->b.credit_idx]);
|
||||
tempt->b.debit =StrNew(s[tempt->b.debit_idx]);
|
||||
tempt->b.desc =StrNew(s[tempt->b.desc_idx]);
|
||||
QueIns(tempt,t_root.last);
|
||||
QueIns(tempt,t_head.last);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,9 +63,9 @@ U0 BgtDataWrite()
|
||||
}
|
||||
}
|
||||
|
||||
tempb=b_root.next;
|
||||
tempb=b_head.next;
|
||||
cnt1=0;
|
||||
while (tempb!=&b_root) {
|
||||
while (tempb!=&b_head) {
|
||||
if (tempb->type!=BE_TEMPLATE_COPY) {
|
||||
tempb->credit_idx =StrFileAdd(tempb->credit,&num,table);
|
||||
tempb->debit_idx =StrFileAdd(tempb->debit,&num,table);
|
||||
@@ -75,9 +75,9 @@ U0 BgtDataWrite()
|
||||
tempb=tempb->next;
|
||||
}
|
||||
|
||||
tempt=t_root.next;
|
||||
tempt=t_head.next;
|
||||
cnt2=0;
|
||||
while (tempt!=&t_root) {
|
||||
while (tempt!=&t_head) {
|
||||
tempt->b.credit_idx =StrFileAdd(tempt->b.credit,&num,table);
|
||||
tempt->b.debit_idx =StrFileAdd(tempt->b.debit,&num,table);
|
||||
tempt->b.desc_idx =StrFileAdd(tempt->b.desc,&num,table);
|
||||
@@ -92,8 +92,8 @@ U0 BgtDataWrite()
|
||||
|
||||
MemCpy(ptr,&cnt1,sizeof(I64));
|
||||
ptr+=sizeof(I64);
|
||||
tempb=b_root.next;
|
||||
while (tempb!=&b_root) {
|
||||
tempb=b_head.next;
|
||||
while (tempb!=&b_head) {
|
||||
if (tempb->type!=BE_TEMPLATE_COPY) {
|
||||
MemCpy(ptr,&tempb->start,BE_SIZE);
|
||||
ptr+=BE_SIZE;
|
||||
@@ -103,8 +103,8 @@ U0 BgtDataWrite()
|
||||
|
||||
MemCpy(ptr,&cnt2,sizeof(I64));
|
||||
ptr+=sizeof(I64);
|
||||
tempt=t_root.next;
|
||||
while (tempt!=&t_root) {
|
||||
tempt=t_head.next;
|
||||
while (tempt!=&t_head) {
|
||||
MemCpy(ptr,&tempt->start,BT_SIZE);
|
||||
ptr+=BT_SIZE;
|
||||
MemCpy(ptr,&tempt->b.start,BE_SIZE);
|
||||
@@ -120,15 +120,15 @@ U0 BgtDel()
|
||||
{
|
||||
CBgtEntry *tempb,*tempb1;
|
||||
CBgtTemplate *tempt,*tempt1;
|
||||
tempb=b_root.next;
|
||||
while (tempb!=&b_root) {
|
||||
tempb=b_head.next;
|
||||
while (tempb!=&b_head) {
|
||||
tempb1=tempb->next;
|
||||
BgtEntryDel2(tempb);
|
||||
Free(tempb);
|
||||
tempb=tempb1;
|
||||
}
|
||||
tempt=t_root.next;
|
||||
while (tempt!=&t_root) {
|
||||
tempt=t_head.next;
|
||||
while (tempt!=&t_head) {
|
||||
tempt1=tempt->next;
|
||||
BgtEntryDel2(&tempt->b);
|
||||
Free(tempt);
|
||||
|
||||
@@ -18,7 +18,7 @@ Bool BgtPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
|
||||
BgtTemplatePurge(tempt);
|
||||
BgtEntryDel2(&tempt->b);
|
||||
Free(tempt);
|
||||
QueIns(tempt1,t_root.last);
|
||||
QueIns(tempt1,t_head.last);
|
||||
BgtTemplateExpand(tempt1);
|
||||
BgtRegen;
|
||||
}
|
||||
@@ -71,7 +71,7 @@ Bool BgtPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
|
||||
return TRUE;
|
||||
case 't':
|
||||
if (tempt1=BgtTemplatePmt) {
|
||||
QueIns(tempt1,t_root.last);
|
||||
QueIns(tempt1,t_head.last);
|
||||
BgtTemplateExpand(tempt1);
|
||||
BgtRegen;
|
||||
}
|
||||
@@ -97,10 +97,10 @@ U0 BgtRegen()
|
||||
F64 balance=0;
|
||||
CDoc *doc,*pdoc,*ddoc;
|
||||
CDocEntry *doc_ce;
|
||||
CBgtEntry *tempb=b_root.next,*tempb_ce;
|
||||
CBgtEntry *tempb=b_head.next,*tempb_ce;
|
||||
doc=DocNew;
|
||||
doc->flags|=DOCF_FORM;
|
||||
while (tempb!=&b_root) {
|
||||
while (tempb!=&b_head) {
|
||||
if (!StrCmp(view_acct,tempb->credit))
|
||||
balance-=tempb->amount;
|
||||
if (!StrCmp(view_acct,tempb->debit))
|
||||
@@ -111,7 +111,7 @@ U0 BgtRegen()
|
||||
DocPrint(doc,"$$FG,%d$$",color);
|
||||
}
|
||||
tempb->doc_e=DocPrint(doc,
|
||||
"$$MU-UL,\"%D %8ts %8ts:%8.2f %8.2f:%Q\",U=0x%X$$\n",
|
||||
"$$MU-UL,\"%D %8ts %8ts:%8.2f %8.2f:%$$Q\",U=0x%X$$\n",
|
||||
tempb->date,tempb->credit,tempb->debit,balance,
|
||||
tempb->amount,tempb->desc,tempb);
|
||||
tempb=tempb->next;
|
||||
@@ -134,8 +134,8 @@ U0 BgtRegen()
|
||||
doc_ce=doc_ce->next;
|
||||
if (doc_ce==pdoc) goto br_cont;
|
||||
}
|
||||
tempb=b_root.next;
|
||||
while (tempb!=&b_root) {
|
||||
tempb=b_head.next;
|
||||
while (tempb!=&b_head) {
|
||||
if (tempb==tempb_ce) {
|
||||
doc->cur_entry=tempb->doc_e;
|
||||
doc->cur_col=0;
|
||||
|
||||
@@ -4,7 +4,7 @@ public U8 **StrFileRead(U8 *name,I64 *_max_num=NULL,
|
||||
U8 **_colors=NULL,Bool no_nums=FALSE)
|
||||
{
|
||||
CDoc *doc=DocRead(name,DOCF_DBL_DOLLARS|DOCF_NO_CURSOR);
|
||||
CDocEntry *doc_e=doc->root.next;
|
||||
CDocEntry *doc_e=doc->head.next;
|
||||
I64 i,max_num=0;
|
||||
U8 *ptr,**res,*colors;
|
||||
|
||||
@@ -27,7 +27,7 @@ public U8 **StrFileRead(U8 *name,I64 *_max_num=NULL,
|
||||
|
||||
res=CAlloc(sizeof(U8 *)*(max_num+1));
|
||||
colors=CAlloc(sizeof(U8)*(max_num+1));
|
||||
doc_e=doc->root.next;
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_TEXT && 0<=doc_e->user_data<=max_num) {
|
||||
res[doc_e->user_data]=doc_e->tag;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
U0 BgtTemplatePurge(CBgtTemplate *tempt)
|
||||
{
|
||||
CBgtEntry *tempb,*tempb1;
|
||||
tempb=b_root.next;
|
||||
while (tempb!=&b_root) {
|
||||
tempb=b_head.next;
|
||||
while (tempb!=&b_head) {
|
||||
tempb1=tempb->next;
|
||||
if (tempb->template==tempt) {
|
||||
QueRem(tempb);
|
||||
@@ -110,8 +110,8 @@ U0 BgtTemplateExpand(CBgtTemplate *tempt)
|
||||
|
||||
U0 CBgtTemplatesExpand()
|
||||
{
|
||||
CBgtTemplate *tempt=t_root.next;
|
||||
while (tempt!=&t_root) {
|
||||
CBgtTemplate *tempt=t_head.next;
|
||||
while (tempt!=&t_head) {
|
||||
BgtTemplateExpand(tempt);
|
||||
tempt=tempt->next;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ class CBgtEntry
|
||||
U8 *credit,*debit,*desc;
|
||||
CBgtTemplate *template;
|
||||
CDocEntry *doc_e;
|
||||
} b_root;
|
||||
} b_head;
|
||||
#define BE_SIZE (offset(CBgtEntry.end)-offset(CBgtEntry.start))
|
||||
|
||||
#define BT_NULL 0
|
||||
@@ -50,7 +50,7 @@ class CBgtTemplate
|
||||
U0 end;
|
||||
|
||||
CBgtEntry b;
|
||||
} t_root;
|
||||
} t_head;
|
||||
#define BT_SIZE (offset(CBgtTemplate.end)-offset(CBgtTemplate.start))
|
||||
|
||||
U8 view_acct[512];
|
||||
@@ -63,9 +63,9 @@ CDate MyStr2Date(U8 *st)
|
||||
CDate res;
|
||||
if (st&&*st) {
|
||||
if (StrOcc(st,'['))
|
||||
res=b_root.next->date;
|
||||
res=b_head.next->date;
|
||||
else if (StrOcc(st,']'))
|
||||
res=b_root.last->date;
|
||||
res=b_head.last->date;
|
||||
else
|
||||
res=Str2Date(st);
|
||||
} else
|
||||
|
||||
@@ -32,7 +32,7 @@ Bool JBPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
|
||||
if (StrLen(doc_ce->tag)>1)
|
||||
doc_ce->tag[0]=ch;
|
||||
s=DocRead(tempde->full_name);
|
||||
doc_e=s->root.next;
|
||||
doc_e=s->head.next;
|
||||
while (doc_e!=s && doc_e->type_u8!=DOCT_TEXT)
|
||||
doc_e=doc_e->next;
|
||||
if (doc_e!=s && doc_e->type_u8==DOCT_TEXT && StrLen(doc_e->tag)>=3) {
|
||||
@@ -77,7 +77,7 @@ public U0 JukeBox(U8 *dirname="~/Psalmody",U8 **_filename=NULL)
|
||||
st=StrNew(tempde->name);
|
||||
FileExtRem(st);
|
||||
s=DocRead(tempde->full_name);
|
||||
doc_e=s->root.next;
|
||||
doc_e=s->head.next;
|
||||
while (doc_e!=s && doc_e->type_u8!=DOCT_TEXT)
|
||||
doc_e=doc_e->next;
|
||||
rating='0';
|
||||
|
||||
@@ -25,7 +25,7 @@ $WW,1$$WW,0$*/
|
||||
#define NOTE_REST MIN_I64
|
||||
#define OCTAVE_REST MIN_I64
|
||||
|
||||
#define PSMT_ROOT 0
|
||||
#define PSMT_HEAD 0
|
||||
#define PSMT_NOTE 1
|
||||
#define PSMT_METER 2
|
||||
|
||||
@@ -59,7 +59,7 @@ class PsmNote
|
||||
|
||||
class PsmCtrl
|
||||
{
|
||||
PsmNote root;
|
||||
PsmNote head;
|
||||
PsmNote clipboard;
|
||||
CMenuEntry *incomplete_entry,*record_entry;
|
||||
I64 screen_x,
|
||||
|
||||
@@ -88,8 +88,8 @@ Bool PsmIsDotted(I64 duration)
|
||||
|
||||
U0 PsmMarkSel(I64 x1,I64 x2,Bool sel)
|
||||
{
|
||||
PsmNote *tempo=oc.root.next;
|
||||
while (tempo!=&oc.root) {
|
||||
PsmNote *tempo=oc.head.next;
|
||||
while (tempo!=&oc.head) {
|
||||
if (sel) {
|
||||
if (x1<=tempo->x<=x2)
|
||||
tempo->flags|=PSMF_SEL;
|
||||
@@ -150,12 +150,12 @@ U0 DrawTimeSignature(CDC *dc,I64 x,I64 y,I64 top,I64 bottom)
|
||||
U0 PsmRecalcNoteXY()
|
||||
{
|
||||
F64 measure_len=4,measure_left=measure_len;
|
||||
PsmNote *tempo=oc.root.next;
|
||||
PsmNote *tempo=oc.head.next;
|
||||
I64 x=8-oc.screen_x,note,octave;
|
||||
while (TRUE) {
|
||||
tempo->x=x;
|
||||
tempo->y=50;
|
||||
if (tempo==&oc.root)
|
||||
if (tempo==&oc.head)
|
||||
break;
|
||||
else {
|
||||
if (tempo->type!=PSMT_METER) {
|
||||
@@ -215,8 +215,8 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
PsmRecalcNoteXY;
|
||||
}
|
||||
|
||||
tempo=oc.root.next;
|
||||
while (tempo!=&oc.root) {
|
||||
tempo=oc.head.next;
|
||||
while (tempo!=&oc.head) {
|
||||
x=tempo->x;
|
||||
y=tempo->y;
|
||||
if (measure_left<0.001) {
|
||||
@@ -258,11 +258,11 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
tempo=tempo->next;
|
||||
}
|
||||
|
||||
if (oc.cur_note==&oc.root && PsmBlink)
|
||||
if (oc.cur_note==&oc.head && PsmBlink)
|
||||
dc->color=BROWN;
|
||||
else
|
||||
dc->color=BLACK;
|
||||
Sprite3(dc,oc.root.x,50,0,$IB,"<12>",BI=12$);
|
||||
Sprite3(dc,oc.head.x,50,0,$IB,"<12>",BI=12$);
|
||||
}
|
||||
|
||||
#define PSM_NOTE_BOX_X 220
|
||||
|
||||
@@ -14,24 +14,24 @@ PsmNote *PsmNoteCopy(PsmNote *tempo)
|
||||
return tempo1;
|
||||
}
|
||||
|
||||
U0 PsmSongDel(PsmNote *root)
|
||||
U0 PsmSongDel(PsmNote *head)
|
||||
{
|
||||
PsmNote *tempo,*tempo1;
|
||||
tempo=root->next;
|
||||
while (tempo!=root) {
|
||||
tempo=head->next;
|
||||
while (tempo!=head) {
|
||||
tempo1=tempo->next;
|
||||
PsmNoteDel(tempo);
|
||||
tempo=tempo1;
|
||||
}
|
||||
QueInit(root);
|
||||
QueInit(head);
|
||||
}
|
||||
|
||||
U0 PsmCutToClipboard()
|
||||
{
|
||||
PsmNote *tempo,*tempo1;
|
||||
PsmSongDel(&oc.clipboard);
|
||||
tempo=oc.root.next;
|
||||
while (tempo!=&oc.root) {
|
||||
tempo=oc.head.next;
|
||||
while (tempo!=&oc.head) {
|
||||
tempo1=tempo->next;
|
||||
if (tempo->flags&PSMF_SEL) {
|
||||
if (oc.cur_note==tempo)
|
||||
@@ -59,8 +59,8 @@ U0 PsmCopyToClipboard()
|
||||
{
|
||||
PsmNote *tempo,*tempo1;
|
||||
PsmSongDel(&oc.clipboard);
|
||||
tempo=oc.root.next;
|
||||
while (tempo!=&oc.root) {
|
||||
tempo=oc.head.next;
|
||||
while (tempo!=&oc.head) {
|
||||
if (tempo->flags&PSMF_SEL) {
|
||||
tempo->flags&=~PSMF_SEL;
|
||||
tempo1=PsmNoteCopy(tempo);
|
||||
@@ -72,10 +72,10 @@ U0 PsmCopyToClipboard()
|
||||
|
||||
PsmNote *PsmFindNote(I64 x,I64)
|
||||
{
|
||||
PsmNote *tempo=oc.root.next;
|
||||
PsmNote *tempo=oc.head.next;
|
||||
PsmRecalcNoteXY;
|
||||
x+=PSM_NOTE_SPACING/2;
|
||||
while (x>tempo->next->x && tempo!=&oc.root)
|
||||
while (x>tempo->next->x && tempo!=&oc.head)
|
||||
tempo=tempo->next;
|
||||
return tempo;
|
||||
}
|
||||
@@ -129,7 +129,7 @@ U0 PsmLoadSongStr(U8 *st,I64 *psm_octave,F64 *psm_duration)
|
||||
else
|
||||
tempo1->meter_bottom=4;
|
||||
PsmSetWidth(tempo1);
|
||||
QueIns(tempo1,oc.root.last);
|
||||
QueIns(tempo1,oc.head.last);
|
||||
}
|
||||
while (*st=='(') {
|
||||
Bts(&tempo->flags,PSMf_TIE);
|
||||
@@ -212,7 +212,7 @@ U0 PsmLoadSong(U8 *filename,I64 *psm_octave,F64 *psm_duration)
|
||||
if (!StrCmp(cc->cur_str,"Play")) {
|
||||
if (Lex(cc)=='(')
|
||||
if (Lex(cc)==TK_STR) {
|
||||
tempo=oc.root.last;
|
||||
tempo=oc.head.last;
|
||||
st=LexExtStr(cc);
|
||||
PsmLoadSongStr(st,psm_octave,psm_duration);
|
||||
if (cc->token==',') {
|
||||
@@ -220,8 +220,8 @@ U0 PsmLoadSong(U8 *filename,I64 *psm_octave,F64 *psm_duration)
|
||||
st=LexExtStr(cc);
|
||||
do {
|
||||
do tempo=tempo->next;
|
||||
while (tempo!=&oc.root && tempo->type==PSMT_METER);
|
||||
if (tempo!=&oc.root)
|
||||
while (tempo!=&oc.head && tempo->type==PSMT_METER);
|
||||
if (tempo!=&oc.head)
|
||||
tempo->word=StrNew(st);
|
||||
st+=StrLen(st)+1;
|
||||
} while (*st);
|
||||
@@ -254,10 +254,10 @@ U8 *PsmCvtSong()
|
||||
I64 i,note,octave,last_octave,last_duration;
|
||||
|
||||
i=0;
|
||||
tempo=oc.root.next;
|
||||
tempo=oc.head.next;
|
||||
last_octave=OCTAVE_REST;
|
||||
last_duration=-1;
|
||||
while (tempo!=&oc.root) {
|
||||
while (tempo!=&oc.head) {
|
||||
dst=&tempo->ascii;
|
||||
if (tempo->type==PSMT_METER) {
|
||||
*dst++='M';
|
||||
@@ -313,8 +313,8 @@ U8 *PsmCvtSong()
|
||||
|
||||
st=MAlloc(i+1);
|
||||
dst=st;
|
||||
tempo=oc.root.next;
|
||||
while (tempo!=&oc.root) {
|
||||
tempo=oc.head.next;
|
||||
while (tempo!=&oc.head) {
|
||||
StrCpy(dst,tempo->ascii);
|
||||
dst+=StrLen(tempo->ascii);
|
||||
tempo=tempo->next;
|
||||
@@ -338,8 +338,8 @@ U8 *PsmSaveSong(U8 *dirname,U8 *full_filename)
|
||||
music.stacatto_factor=0.88*tempo_state.stacatto/TEMPO_RANGE+0.12;
|
||||
|
||||
has_words=FALSE;
|
||||
tempo=oc.root.next;
|
||||
while (tempo!=&oc.root) {
|
||||
tempo=oc.head.next;
|
||||
while (tempo!=&oc.head) {
|
||||
if (PsmHasWords(tempo->word)) has_words=TRUE;
|
||||
tempo=tempo->next;
|
||||
}
|
||||
@@ -361,10 +361,10 @@ U8 *PsmSaveSong(U8 *dirname,U8 *full_filename)
|
||||
" while (!ScanKey) {\n"
|
||||
"\tPlay(\"",music.tempo+0.0005,music.stacatto_factor+0.0005);
|
||||
|
||||
tempo=oc.root.next;
|
||||
tempo=oc.head.next;
|
||||
tempo1=tempo;
|
||||
has_words=FALSE;
|
||||
while (tempo!=&oc.root) {
|
||||
while (tempo!=&oc.head) {
|
||||
DocPrint(doc,"%s",tempo->ascii);
|
||||
if (PsmHasWords(tempo->word)) has_words=TRUE;
|
||||
if (tempo->type==PSMT_METER) {
|
||||
@@ -373,7 +373,7 @@ U8 *PsmSaveSong(U8 *dirname,U8 *full_filename)
|
||||
} else
|
||||
two_measure_left-=psm_durations[tempo->duration];
|
||||
tempo=tempo->next;
|
||||
if (two_measure_left<0.001 && tempo!=&oc.root) {
|
||||
if (two_measure_left<0.001 && tempo!=&oc.head) {
|
||||
if (has_words) {
|
||||
DocPrint(doc,"\",\n\t\t\"");
|
||||
while (tempo1!=tempo) {
|
||||
|
||||
@@ -32,7 +32,7 @@ U0 PsmRightClick(I64 x,I64 y)
|
||||
I64 i,old_doc_flags;
|
||||
if (DocPut) old_doc_flags=DocPut->flags;
|
||||
oc.cur_note=tempo=PsmFindNote(x,y);
|
||||
if (tempo!=&oc.root) {
|
||||
if (tempo!=&oc.head) {
|
||||
Fs->win_inhibit=WIG_USER_TASK_DFT;
|
||||
i=PopUpDuration;
|
||||
if (0<=i<PSM_NUM_DURATIONS) {
|
||||
@@ -133,10 +133,10 @@ U0 PsmLeftClickPickNoteBox(I64 duration)
|
||||
}
|
||||
} while (msg_code!=MSG_IP_L_UP);
|
||||
if (a2<13*FONT_HEIGHT) {
|
||||
if (a1>oc.root.last->x)
|
||||
tempo1=oc.root.last;
|
||||
else if (a1<oc.root.next->x)
|
||||
tempo1=&oc.root;
|
||||
if (a1>oc.head.last->x)
|
||||
tempo1=oc.head.last;
|
||||
else if (a1<oc.head.next->x)
|
||||
tempo1=&oc.head;
|
||||
else
|
||||
tempo1=PsmFindNote(a1-PSM_NOTE_SPACING/2,a2);
|
||||
tempo=CAlloc(sizeof(PsmNote));
|
||||
@@ -172,10 +172,10 @@ U0 PsmLeftClickPickMeterBox(I64 top,I64 bottom)
|
||||
}
|
||||
} while (msg_code!=MSG_IP_L_UP);
|
||||
if (a2<13*FONT_HEIGHT) {
|
||||
if (a1>=oc.root.x)
|
||||
tempo1=oc.root.last;
|
||||
else if (a1<oc.root.next->x)
|
||||
tempo1=&oc.root;
|
||||
if (a1>=oc.head.x)
|
||||
tempo1=oc.head.last;
|
||||
else if (a1<oc.head.next->x)
|
||||
tempo1=&oc.head;
|
||||
else
|
||||
tempo1=PsmFindNote(a1-PSM_NOTE_SPACING/2,a2);
|
||||
tempo=CAlloc(sizeof(PsmNote));
|
||||
@@ -194,7 +194,7 @@ U0 PsmLeftClickStaffPtr(I64 x,I64 y)
|
||||
PsmNote *tempo,*tempo1;
|
||||
I64 o,n,msg_code,a1,a2,n_original,o_original;
|
||||
oc.cur_note=tempo=PsmFindNote(x,y);
|
||||
if (tempo!=&oc.root) {
|
||||
if (tempo!=&oc.head) {
|
||||
if (tempo->type==PSMT_NOTE) {
|
||||
n_original=tempo->note;
|
||||
o_original=tempo->octave;
|
||||
@@ -202,7 +202,7 @@ U0 PsmLeftClickStaffPtr(I64 x,I64 y)
|
||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP|1<<MSG_IP_MOVE);
|
||||
if (msg_code==MSG_IP_L_UP) {
|
||||
tempo1=PsmFindNote(a1,a2);
|
||||
if (tempo1==&oc.root || tempo1==tempo)
|
||||
if (tempo1==&oc.head || tempo1==tempo)
|
||||
goto move_note;
|
||||
else {
|
||||
Free(tempo1->word);
|
||||
@@ -420,9 +420,9 @@ U0 Psalmody(U8 *dirname="~/Psalmody")
|
||||
|
||||
MemSet(&oc,0,sizeof(PsmCtrl));
|
||||
oc.screen_x=0;
|
||||
oc.root.next=oc.root.last=&oc.root;
|
||||
oc.head.next=oc.head.last=&oc.head;
|
||||
oc.clipboard.next=oc.clipboard.last=&oc.clipboard;
|
||||
oc.cur_note=&oc.root;
|
||||
oc.cur_note=&oc.head;
|
||||
oc.dc2=DCAlias;
|
||||
|
||||
MenuPush(
|
||||
@@ -569,29 +569,29 @@ mo_got_msg:
|
||||
switch (a2.u8[0]) {
|
||||
case SC_CURSOR_LEFT:
|
||||
if (a2&SCF_CTRL) {
|
||||
while (oc.cur_note->last!=&oc.root) {
|
||||
while (oc.cur_note->last!=&oc.head) {
|
||||
oc.cur_note=oc.cur_note->last;
|
||||
if (oc.cur_note!=&oc.root)
|
||||
if (oc.cur_note!=&oc.head)
|
||||
LBEqu(&oc.cur_note->flags,PSMf_SEL,a2&SCF_SHIFT);
|
||||
}
|
||||
} else {
|
||||
if (oc.cur_note->last!=&oc.root) {
|
||||
if (oc.cur_note->last!=&oc.head) {
|
||||
oc.cur_note=oc.cur_note->last;
|
||||
if (oc.cur_note!=&oc.root)
|
||||
if (oc.cur_note!=&oc.head)
|
||||
LBEqu(&oc.cur_note->flags,PSMf_SEL,a2&SCF_SHIFT);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SC_CURSOR_RIGHT:
|
||||
if (a2&SCF_CTRL) {
|
||||
while (oc.cur_note!=&oc.root) {
|
||||
if (oc.cur_note!=&oc.root)
|
||||
while (oc.cur_note!=&oc.head) {
|
||||
if (oc.cur_note!=&oc.head)
|
||||
LBEqu(&oc.cur_note->flags,PSMf_SEL,a2&SCF_SHIFT);
|
||||
oc.cur_note=oc.cur_note->next;
|
||||
}
|
||||
} else {
|
||||
if (oc.cur_note!=&oc.root) {
|
||||
if (oc.cur_note!=&oc.root)
|
||||
if (oc.cur_note!=&oc.head) {
|
||||
if (oc.cur_note!=&oc.head)
|
||||
LBEqu(&oc.cur_note->flags,PSMf_SEL,a2&SCF_SHIFT);
|
||||
oc.cur_note=oc.cur_note->next;
|
||||
}
|
||||
@@ -603,7 +603,7 @@ mo_got_msg:
|
||||
else {
|
||||
tempo=oc.cur_note;
|
||||
oc.cur_note=tempo->next;
|
||||
if (tempo!=&oc.root) {
|
||||
if (tempo!=&oc.head) {
|
||||
QueRem(tempo);
|
||||
PsmNoteDel(tempo);
|
||||
}
|
||||
@@ -650,11 +650,11 @@ mo_got_msg:
|
||||
oc.screen_x=0;
|
||||
psm_duration=1.0;
|
||||
psm_octave=3;
|
||||
PsmSongDel(&oc.root);
|
||||
oc.cur_note=&oc.root;
|
||||
PsmSongDel(&oc.head);
|
||||
oc.cur_note=&oc.head;
|
||||
PsmLoadSong(filename,&psm_octave,&psm_duration);
|
||||
oc.record_entry->checked=FALSE;
|
||||
oc.cur_note=oc.root.next;
|
||||
oc.cur_note=oc.head.next;
|
||||
}
|
||||
PsmPushMode(psm_octave);
|
||||
col=0;
|
||||
@@ -680,12 +680,12 @@ mo_got_msg:
|
||||
filename=NULL;
|
||||
psm_duration=1.0;
|
||||
psm_octave=3;
|
||||
PsmSongDel(&oc.root);
|
||||
oc.cur_note=&oc.root;
|
||||
PsmSongDel(&oc.head);
|
||||
oc.cur_note=&oc.head;
|
||||
oc.screen_x=0;
|
||||
break;
|
||||
case '\n':
|
||||
if (oc.cur_note!=&oc.root)
|
||||
if (oc.cur_note!=&oc.head)
|
||||
PsmRightClick(oc.cur_note->x,oc.cur_note->y);
|
||||
break;
|
||||
case 'x':
|
||||
@@ -695,7 +695,7 @@ mo_got_msg:
|
||||
oc.playing=TRUE;
|
||||
PsmMenu(psm_octave);
|
||||
tempo=oc.cur_note;
|
||||
while (tempo!=&oc.root) {
|
||||
while (tempo!=&oc.head) {
|
||||
if (tempo->type!=PSMT_METER) {
|
||||
timeout_val=cnts.jiffies;
|
||||
if (ip.pos_text.y-Fs->win_top<18)
|
||||
@@ -748,7 +748,7 @@ mo_got_msg:
|
||||
}
|
||||
tempo=tempo->next;
|
||||
}
|
||||
oc.cur_note=&oc.root;
|
||||
oc.cur_note=&oc.head;
|
||||
oc.screen_x+=oc.cur_note->x-GR_WIDTH/2;
|
||||
oc.playing=FALSE;
|
||||
PsmMenu(psm_octave);
|
||||
@@ -758,7 +758,7 @@ mo_got_msg:
|
||||
break;
|
||||
case CH_BACKSPACE:
|
||||
tempo=oc.cur_note->last;
|
||||
if (tempo!=&oc.root) {
|
||||
if (tempo!=&oc.head) {
|
||||
QueRem(tempo);
|
||||
PsmNoteDel(tempo);
|
||||
}
|
||||
@@ -860,7 +860,7 @@ mo_done:
|
||||
} catch
|
||||
PutExcept;
|
||||
PsmPopMode;
|
||||
PsmSongDel(&oc.root);
|
||||
PsmSongDel(&oc.head);
|
||||
PsmSongDel(&oc.clipboard);
|
||||
TempoDel(c);
|
||||
Kill(play_task);
|
||||
|
||||
@@ -641,7 +641,7 @@ class IndirectOrders
|
||||
IndirectOrders *next,*last;
|
||||
Unit *attacker;
|
||||
I64 row,col;
|
||||
} indirect_root;
|
||||
} indirect_head;
|
||||
|
||||
U0 PlotShot(Unit *tempu,I64 row,I64 col)
|
||||
{
|
||||
@@ -653,7 +653,7 @@ U0 PlotShot(Unit *tempu,I64 row,I64 col)
|
||||
tempi->attacker=tempu;
|
||||
tempi->row=row;
|
||||
tempi->col=col;
|
||||
QueIns(tempi,indirect_root.last);
|
||||
QueIns(tempi,indirect_head.last);
|
||||
}
|
||||
|
||||
Bool firing=FALSE;
|
||||
@@ -798,8 +798,8 @@ U0 IndirectFireResolve()
|
||||
F64 x1,y1,x2,y2,d,dammage=0,range_factor;
|
||||
Unit *tempu,*target;
|
||||
Bool hit;
|
||||
IndirectOrders *tempi=indirect_root.next,*tempi1;
|
||||
while (tempi!=*indirect_root) {
|
||||
IndirectOrders *tempi=indirect_head.next,*tempi1;
|
||||
while (tempi!=*indirect_head) {
|
||||
tempi1=tempi->next;
|
||||
tempu=tempi->attacker;
|
||||
RowCol2XY(&x1,&y1,tempu->row,tempu->col);
|
||||
@@ -1303,7 +1303,7 @@ U0 Init()
|
||||
Fs->horz_scroll.pos=0;
|
||||
Fs->vert_scroll.pos=0;
|
||||
InitUnits;
|
||||
QueInit(&indirect_root);
|
||||
QueInit(&indirect_head);
|
||||
turn=0;
|
||||
fire_radius=0;
|
||||
show_visible_row=-1;
|
||||
@@ -1315,7 +1315,7 @@ U0 Init()
|
||||
|
||||
U0 CleanUp()
|
||||
{
|
||||
QueDel(&indirect_root,TRUE);
|
||||
QueDel(&indirect_head,TRUE);
|
||||
}
|
||||
|
||||
U0 HandleChar(U8 ch)
|
||||
@@ -1543,8 +1543,8 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
GrCircle(dc,fire_radius_x-h,fire_radius_y-v,fire_radius);
|
||||
}
|
||||
if (Blink(10)) {
|
||||
tempi=indirect_root.next;
|
||||
while (tempi!=&indirect_root) {
|
||||
tempi=indirect_head.next;
|
||||
while (tempi!=&indirect_head) {
|
||||
if (tempi->attacker->player==view_player) {
|
||||
RowCol2XY(&x,&y,tempi->row,tempi->col);
|
||||
Sprite3(dc,x-task->horz_scroll.pos,y-task->vert_scroll.pos,0,$IB,"<5>",BI=5$);
|
||||
|
||||
@@ -71,7 +71,7 @@ class Missile
|
||||
Ship *owner,*target;
|
||||
Bool active,launched,exploding;
|
||||
U8 label[5];
|
||||
} missile_root;
|
||||
} missile_head;
|
||||
|
||||
class Ship
|
||||
{
|
||||
@@ -86,7 +86,7 @@ class Ship
|
||||
F64 laser_temperature;
|
||||
Missile missiles[MAX_MISSILES];
|
||||
Bool lasering,exploding,laser_overheat;
|
||||
} ship_root,*human;
|
||||
} ship_head,*human;
|
||||
|
||||
F64 human_t_left,human_t_right,human_antispin;
|
||||
|
||||
@@ -97,7 +97,7 @@ class Shot
|
||||
F64 fuse_time,die_timeout;
|
||||
MyMass p;
|
||||
Bool exploding;
|
||||
} shot_root;
|
||||
} shot_head;
|
||||
|
||||
#define MAX_THRUST 200.0
|
||||
#define MAX_ANTISPIN 25.0
|
||||
@@ -211,7 +211,7 @@ U0 MissileNew(Ship *tempsp,I64 n)
|
||||
}
|
||||
tempmi->img=$IB,"<7>",BI=7$;
|
||||
tempmi->active=TRUE;
|
||||
QueIns(tempmi,missile_root.last);
|
||||
QueIns(tempmi,missile_head.last);
|
||||
}
|
||||
|
||||
Ship *ShipNew(I64 x,I64 y,I64 type)
|
||||
@@ -365,7 +365,7 @@ Ship *ShipNew(I64 x,I64 y,I64 type)
|
||||
remaining++;
|
||||
break;
|
||||
}
|
||||
QueIns(tempsp,ship_root.last);
|
||||
QueIns(tempsp,ship_head.last);
|
||||
return tempsp;
|
||||
}
|
||||
|
||||
@@ -438,14 +438,14 @@ U0 AllDel(CMathODE *ode)
|
||||
{
|
||||
Ship *tempsp,*tempsp1;
|
||||
QueRem(ode);
|
||||
tempsp=ship_root.next;
|
||||
while (tempsp!=&ship_root) {
|
||||
tempsp=ship_head.next;
|
||||
while (tempsp!=&ship_head) {
|
||||
tempsp1=tempsp->next;
|
||||
ShipDel(tempsp);
|
||||
tempsp=tempsp1;
|
||||
}
|
||||
human=NULL;
|
||||
QueDel(&shot_root,TRUE);
|
||||
QueDel(&shot_head,TRUE);
|
||||
ODEDel(ode);
|
||||
}
|
||||
|
||||
@@ -502,8 +502,8 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
tempsps=tempsps->next;
|
||||
}
|
||||
|
||||
tempmi=missile_root.next;
|
||||
while (tempmi!=&missile_root) {
|
||||
tempmi=missile_head.next;
|
||||
while (tempmi!=&missile_head) {
|
||||
if (tempmi->active) {
|
||||
if (tempmi->launched && tempmi->exploding) {
|
||||
d=(tS-tempmi->fuse_time)/(tempmi->die_timeout-tempmi->fuse_time);
|
||||
@@ -524,8 +524,8 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
tempmi=tempmi->next;
|
||||
}
|
||||
|
||||
tempsp=ship_root.next;
|
||||
while (tempsp!=&ship_root) {
|
||||
tempsp=ship_head.next;
|
||||
while (tempsp!=&ship_head) {
|
||||
if (!tempsp->exploding)
|
||||
switch (tempsp->type) {
|
||||
case ST_HUMAN1:
|
||||
@@ -678,8 +678,8 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
tempsp=tempsp->next;
|
||||
}
|
||||
|
||||
temps=shot_root.next;
|
||||
while (temps!=&shot_root) {
|
||||
temps=shot_head.next;
|
||||
while (temps!=&shot_head) {
|
||||
if (temps->exploding) {
|
||||
d=(tS-temps->fuse_time)/(temps->die_timeout-temps->fuse_time);
|
||||
d=7*Sin(ã*d)*temps->explosion_radius+1;
|
||||
@@ -715,8 +715,8 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
human->p[0].x-800*p.x,human->p[0].y-800*p.y,0,&LaserPlot);
|
||||
}
|
||||
|
||||
tempmi=missile_root.next;
|
||||
while (tempmi!=&missile_root) {
|
||||
tempmi=missile_head.next;
|
||||
while (tempmi!=&missile_head) {
|
||||
if (tempsp=tempmi->target) {
|
||||
dc->color=LTRED;
|
||||
GrCircle(dc,tempsp->p[0].x,tempsp->p[0].y,10);
|
||||
@@ -759,8 +759,8 @@ Ship TargetGet(Missile *tempmi)
|
||||
I64 i;
|
||||
CD3 p,p1,p2;
|
||||
D3Unit(D3Sub(&p,&tempmi->p_front.state->x,&tempmi->p_back.state->x));
|
||||
tempsp=ship_root.next;
|
||||
while (tempsp!=&ship_root) {
|
||||
tempsp=ship_head.next;
|
||||
while (tempsp!=&ship_head) {
|
||||
if (!tempsp->exploding && tempsp!=tempmi->owner)
|
||||
for (i=0;i<tempsp->masses;i++) {
|
||||
D3Sub(&p1,&tempsp->p[i].state->x,&tempmi->p_front.state->x);
|
||||
@@ -821,8 +821,8 @@ U0 MyDerivative(CMathODE *ode,F64,COrder2D3 *,COrder2D3 *)
|
||||
tempm=tempm->next;
|
||||
}
|
||||
|
||||
tempsp=ship_root.next;
|
||||
while (tempsp!=&ship_root) {
|
||||
tempsp=ship_head.next;
|
||||
while (tempsp!=&ship_head) {
|
||||
if (tempsp->exploding && tempsp->die_time<=tS<=tempsp->die_timeout)
|
||||
for (i=0;i<tempsp->masses;i++)
|
||||
Explosion(&tempsp->p[i],NULL,tempsp->p[i].radius/3.0);
|
||||
@@ -886,15 +886,15 @@ U0 MyDerivative(CMathODE *ode,F64,COrder2D3 *,COrder2D3 *)
|
||||
tempsp=tempsp->next;
|
||||
}
|
||||
|
||||
temps=shot_root.next;
|
||||
while (temps!=&shot_root) {
|
||||
temps=shot_head.next;
|
||||
while (temps!=&shot_head) {
|
||||
if (temps->exploding)
|
||||
Explosion(&temps->p,NULL,temps->explosion_radius);
|
||||
temps=temps->next;
|
||||
}
|
||||
|
||||
tempmi=missile_root.next;
|
||||
while (tempmi!=&missile_root) {
|
||||
tempmi=missile_head.next;
|
||||
while (tempmi!=&missile_head) {
|
||||
if (tempmi->active) {
|
||||
if (tempmi->launched) {
|
||||
if (tempmi->exploding)
|
||||
@@ -981,8 +981,8 @@ U0 CheckDamage()
|
||||
}
|
||||
}
|
||||
|
||||
tempsp=ship_root.next;
|
||||
while (tempsp!=&ship_root) {
|
||||
tempsp=ship_head.next;
|
||||
while (tempsp!=&ship_head) {
|
||||
tempsp1=tempsp->next;
|
||||
switch (tempsp->type) {
|
||||
case ST_HUMAN1:
|
||||
@@ -1071,7 +1071,7 @@ U0 FireOneGun(Ship *tempsp,I64 n,F64 r,F64 fuse_time)
|
||||
D3MulEqu(&p,temps->p.mass/tempsp->p[n].mass/100.0);
|
||||
D3SubEqu(&tempsp->p[n].DxDt,&p);
|
||||
QueIns(&temps->p,ode->last_mass);
|
||||
QueIns(temps,shot_root.last);
|
||||
QueIns(temps,shot_head.last);
|
||||
tempsp->reload_timeout=tS+r/tempsp->fire_rate;
|
||||
Noise(100,r*200,r*400);
|
||||
}
|
||||
@@ -1138,8 +1138,8 @@ U0 HumanFireLaserEnd()
|
||||
|
||||
U0 ExpireShots()
|
||||
{
|
||||
Shot *temps=shot_root.next,*temps1;
|
||||
while (temps!=&shot_root) {
|
||||
Shot *temps=shot_head.next,*temps1;
|
||||
while (temps!=&shot_head) {
|
||||
temps1=temps->next;
|
||||
if (!temps->exploding && tS>temps->fuse_time) {
|
||||
temps->exploding=TRUE;
|
||||
@@ -1157,8 +1157,8 @@ U0 ExpireMissiles()
|
||||
{
|
||||
I64 i;
|
||||
F64 dd,best_dd;
|
||||
Missile *tempmi=missile_root.next,*tempm1;
|
||||
while (tempmi!=&missile_root) {
|
||||
Missile *tempmi=missile_head.next,*tempm1;
|
||||
while (tempmi!=&missile_head) {
|
||||
tempm1=tempmi->next;
|
||||
if (tempmi->launched) {
|
||||
best_dd=MAX_F64;
|
||||
@@ -1185,9 +1185,9 @@ U0 ExpireMissiles()
|
||||
U0 AI()
|
||||
{
|
||||
CD3 p,p1,p2;
|
||||
Ship *tempsp=ship_root.next;
|
||||
Ship *tempsp=ship_head.next;
|
||||
if (human && !human->exploding) {
|
||||
while (tempsp!=&ship_root) {
|
||||
while (tempsp!=&ship_head) {
|
||||
D3Sub(&p1,&tempsp->p[0].x,&tempsp->p[1].x);
|
||||
D3Sub(&p2,&tempsp->p[0].x,&tempsp->p[2].x);
|
||||
D3Add(&p,&p1,&p2);
|
||||
@@ -1223,9 +1223,9 @@ U0 Init()
|
||||
score=0;
|
||||
level=1;
|
||||
|
||||
QueInit(&ship_root);
|
||||
QueInit(&shot_root);
|
||||
QueInit(&missile_root);
|
||||
QueInit(&ship_head);
|
||||
QueInit(&shot_head);
|
||||
QueInit(&missile_head);
|
||||
|
||||
for (i=0;i<NUM_STARS;i++) {
|
||||
stars_x[i]=RandU16%GR_WIDTH;
|
||||
|
||||
Reference in new issue
Block a user