TempleOSCDV4.10.ISO
This commit is contained in:
1 parent
c5954d3371
commit
9206246147
181 files changed
+4468
-4313
No files matched your search
Binary file not shown.
+21
-21
@@ -30,7 +30,7 @@ class CFMUncollapsedLst
|
||||
|
||||
CFMUncollapsedLst *FMCollectUncollapsedLst(CDoc *doc)
|
||||
{
|
||||
CDocEntry *doc_e=doc->root.next;
|
||||
CDocEntry *doc_e=doc->head.next;
|
||||
CFMUncollapsedLst *res=NULL,*tempc;
|
||||
CDirEntry *tempde;
|
||||
while (doc_e!=doc) {
|
||||
@@ -52,7 +52,7 @@ CFMUncollapsedLst *FMCollectUncollapsedLst(CDoc *doc)
|
||||
U0 FMMarkUncollapsed(CDoc *doc,CFMUncollapsedLst *tempc,
|
||||
U8 *cur_entry,U8 *next_entry)
|
||||
{
|
||||
CDocEntry *doc_e=doc->root.next;
|
||||
CDocEntry *doc_e=doc->head.next;
|
||||
CFMUncollapsedLst *tempc1;
|
||||
CDirEntry *tempde;
|
||||
while (doc_e!=doc) {
|
||||
@@ -112,7 +112,7 @@ U0 FMDelUncollapsedLst(CFMUncollapsedLst *tempc)
|
||||
}
|
||||
}
|
||||
|
||||
CDirEntry *FMRebuildDocDrv(U8 drv_let,CDoc *doc,CDirEntry **_root,Bool init)
|
||||
CDirEntry *FMRebuildDocDrv(U8 drv_let,CDoc *doc,CDirEntry **_head,Bool init)
|
||||
{
|
||||
CDirEntry *tempde,*tempde1;
|
||||
U8 *st;
|
||||
@@ -126,8 +126,8 @@ CDirEntry *FMRebuildDocDrv(U8 drv_let,CDoc *doc,CDirEntry **_root,Bool init)
|
||||
tempde1=NULL;
|
||||
Free(st);
|
||||
tempde->user_data=DocPrint(doc,"$$TR,\"%s\",U=0x%X$$",tempde->full_name,tempde);
|
||||
tempde->next=*_root;
|
||||
*_root=tempde;
|
||||
tempde->next=*_head;
|
||||
*_head=tempde;
|
||||
DocPrint(doc,"\n$$ID,+2$$");
|
||||
DocBottom(doc);
|
||||
if (init) {
|
||||
@@ -141,7 +141,7 @@ CDirEntry *FMRebuildDocDrv(U8 drv_let,CDoc *doc,CDirEntry **_root,Bool init)
|
||||
return tempde;
|
||||
}
|
||||
|
||||
U0 FMRebuildDoc(CDoc **_doc,CDirEntry **_root,I64 mode)
|
||||
U0 FMRebuildDoc(CDoc **_doc,CDirEntry **_head,I64 mode)
|
||||
{
|
||||
CDrv *dv;
|
||||
I64 i;
|
||||
@@ -192,9 +192,9 @@ U0 FMRebuildDoc(CDoc **_doc,CDirEntry **_root,I64 mode)
|
||||
tempc=FMCollectUncollapsedLst(doc);
|
||||
DocDel(doc);
|
||||
}
|
||||
if (*_root) {
|
||||
DirTreeDel(*_root);
|
||||
*_root=NULL;
|
||||
if (*_head) {
|
||||
DirTreeDel(*_head);
|
||||
*_head=NULL;
|
||||
}
|
||||
doc=DocNew;
|
||||
doc->desc='FileMan';
|
||||
@@ -219,13 +219,13 @@ U0 FMRebuildDoc(CDoc **_doc,CDirEntry **_root,I64 mode)
|
||||
dv=&blkdev.drvs[i];
|
||||
if (dv->bd->type==BDT_ATAPI) {
|
||||
if (dv->bd->flags&BDF_INITIALIZED)
|
||||
tempde=FMRebuildDocDrv(Drv2Let(dv),doc,_root,TRUE);
|
||||
tempde=FMRebuildDocDrv(Drv2Let(dv),doc,_head,TRUE);
|
||||
else {
|
||||
tempde=FMRebuildDocDrv(Drv2Let(dv),doc,_root,FALSE);
|
||||
tempde=FMRebuildDocDrv(Drv2Let(dv),doc,_head,FALSE);
|
||||
tempde->flags|=DEF_NOT_INITIALIZED;
|
||||
}
|
||||
} else if (dv->fs_type==FSt_REDSEA || dv->fs_type==FSt_FAT32)
|
||||
FMRebuildDocDrv(Drv2Let(dv),doc,_root,TRUE);
|
||||
FMRebuildDocDrv(Drv2Let(dv),doc,_head,TRUE);
|
||||
}
|
||||
DocTop(doc);
|
||||
FMMarkUncollapsed(doc,tempc,cur_entry,next_entry);
|
||||
@@ -437,7 +437,7 @@ U0 FMCopy(CDoc *doc)
|
||||
CDocEntry *doc_ce=doc->cur_entry,*doc_e;
|
||||
CDirEntry *tempde,*tempde1=NULL,*tempde2;
|
||||
Bool unlock_doc2=DocLock(doc2);
|
||||
doc_e=doc2->root.next;
|
||||
doc_e=doc2->head.next;
|
||||
|
||||
tempde1=doc_ce->user_data;
|
||||
if (doc_ce->type_u8==DOCT_MENU_VAL)
|
||||
@@ -580,7 +580,7 @@ U0 FMFinalScreenUpdate(CDC *dc)
|
||||
|
||||
public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
|
||||
{//File manager. Also, used to choose files and dirs.
|
||||
CDirEntry *root=NULL,*tempde,*tempde1,*tempde2;
|
||||
CDirEntry *head=NULL,*tempde,*tempde1,*tempde2;
|
||||
I64 sc,ch,a1,a2,msg_code;
|
||||
CDoc *doc=NULL,*old_put_doc=DocPut,*old_display_doc=DocDisplay;
|
||||
U8 *res=NULL,*st,*st2,*old_cur_dir=CurDir;
|
||||
@@ -590,8 +590,8 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
fp_old_final_screen_update=gr.fp_final_screen_update;
|
||||
MenuFilePush("::/Doc/FileMgrPullDown.TXT");
|
||||
FMRebuildDoc(&doc,&root,mode);
|
||||
if (tempde1=Cd2DirEntry(root,old_cur_dir))
|
||||
FMRebuildDoc(&doc,&head,mode);
|
||||
if (tempde1=Cd2DirEntry(head,old_cur_dir))
|
||||
doc->cur_entry=tempde1->user_data;
|
||||
while (tempde1) {
|
||||
if (tempde1->attr&RS_ATTR_DIR)
|
||||
@@ -636,7 +636,7 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
|
||||
Silent;
|
||||
Move(tempde->full_name,st2);
|
||||
Silent(OFF);
|
||||
FMRebuildDoc(&doc,&root,mode);
|
||||
FMRebuildDoc(&doc,&head,mode);
|
||||
} else if (st2 && doc_ce->type_u8==DOCT_TREE) {
|
||||
tempde=doc_ce->user_data;
|
||||
okay=TRUE;
|
||||
@@ -659,7 +659,7 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
|
||||
CopyTree(tempde->full_name,st);
|
||||
DelTree(tempde->full_name);
|
||||
Silent(OFF);
|
||||
FMRebuildDoc(&doc,&root,mode);
|
||||
FMRebuildDoc(&doc,&head,mode);
|
||||
}
|
||||
Free(st);
|
||||
}
|
||||
@@ -721,7 +721,7 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
|
||||
FMFmtDrv(doc);
|
||||
break;
|
||||
end:
|
||||
FMRebuildDoc(&doc,&root,mode);
|
||||
FMRebuildDoc(&doc,&head,mode);
|
||||
break;
|
||||
case CH_SHIFT_ESC:
|
||||
break;
|
||||
@@ -757,7 +757,7 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
|
||||
default:
|
||||
if (sc.u8[0]==SC_INS && sc&SCF_SHIFT && !(sc&SCF_CTRL)) {
|
||||
FMCopy(doc);
|
||||
FMRebuildDoc(&doc,&root,mode);
|
||||
FMRebuildDoc(&doc,&head,mode);
|
||||
} else if (sc.u8[0]==SC_F5) {
|
||||
if (doc->cur_entry->type_u8==DOCT_MENU_VAL) {
|
||||
tempde=doc->cur_entry->user_data;
|
||||
@@ -783,7 +783,7 @@ fm_regular_key:
|
||||
Fs->display_doc=old_display_doc;
|
||||
SettingsPop;
|
||||
DocDel(doc);
|
||||
DirTreeDel(root);
|
||||
DirTreeDel(head);
|
||||
Cd(old_cur_dir);
|
||||
Free(old_cur_dir);
|
||||
if (mode!=FM_NORMAL && !res)
|
||||
|
||||
@@ -4,7 +4,7 @@ I64 Mount2(U8 boot_drv_let,CDoc *_doc,Bool repartition)
|
||||
I64 cnt,res=0,num_hints,drv_let,type,unit;
|
||||
U8 blks_buf[STR_LEN],addr_buf[STR_LEN],base0_buf[STR_LEN],base1_buf[STR_LEN],
|
||||
*filename=NULL,*filename2=NULL;
|
||||
CATARep *root=NULL,*tempha;
|
||||
CATARep *head=NULL,*tempha;
|
||||
Bool one_drv,make_free;
|
||||
CDoc *doc;
|
||||
boot_drv_let=ToUpper(boot_drv_let);
|
||||
@@ -45,7 +45,7 @@ I64 Mount2(U8 boot_drv_let,CDoc *_doc,Bool repartition)
|
||||
break;
|
||||
case BDT_ATA:
|
||||
case BDT_ATAPI:
|
||||
num_hints=ATARep(,,&root);
|
||||
num_hints=ATARep(,,&head);
|
||||
if (type==BDT_ATAPI && boot_drv_let)
|
||||
"<ENTER> to use booted CD/DVD\n"; //Only $LK,"::/Kernel/KCfg.CPP"$
|
||||
do {
|
||||
@@ -57,7 +57,7 @@ I64 Mount2(U8 boot_drv_let,CDoc *_doc,Bool repartition)
|
||||
GetS(base0_buf,STR_LEN);
|
||||
} while (!Str2I64(base0_buf) && (type!=BDT_ATAPI || !boot_drv_let));
|
||||
if (1<=Str2I64(base0_buf)<=num_hints) {
|
||||
tempha=ATARepFind(root,Str2I64(base0_buf));
|
||||
tempha=ATARepFind(head,Str2I64(base0_buf));
|
||||
StrPrint(base0_buf,"0x%X",tempha->base0);
|
||||
StrPrint(base1_buf,"0x%X",tempha->base1);
|
||||
unit=tempha->unit;
|
||||
@@ -75,7 +75,7 @@ I64 Mount2(U8 boot_drv_let,CDoc *_doc,Bool repartition)
|
||||
} while (!(0<=unit<=1));
|
||||
'\n';
|
||||
}
|
||||
LinkedLstDel(root);
|
||||
LinkedLstDel(head);
|
||||
break;
|
||||
}
|
||||
DocPrint(doc,"bd=BlkDevNextFreeSlot(\'%C\',%d);bd->unit=%d;\n",
|
||||
|
||||
+11
-11
@@ -18,7 +18,7 @@ public I64 PrtDsk(U8 drv_let=0)
|
||||
//drv_let=0 means add new drive that
|
||||
//is not already mounted.
|
||||
CBlkDev *bd;
|
||||
CPlannedDrv root,*temppp;
|
||||
CPlannedDrv head,*temppp;
|
||||
CMasterBoot mbr;
|
||||
Bool pri=TRUE;
|
||||
I64 ext_base,drv_let2,pri_cnt=0,
|
||||
@@ -45,7 +45,7 @@ public I64 PrtDsk(U8 drv_let=0)
|
||||
return 0;
|
||||
|
||||
drv_dsk_dsk_size=bd->max_blk+1;
|
||||
QueInit(&root);
|
||||
QueInit(&head);
|
||||
drv_let2=bd->first_drv_let;
|
||||
remaining=FloorU64(bd->max_blk+1,ROUND_DRV_TO);
|
||||
while (FloorU64(remaining,ROUND_DRV_TO)>=ROUND_DRV_TO) {
|
||||
@@ -68,15 +68,15 @@ public I64 PrtDsk(U8 drv_let=0)
|
||||
temppp->size=CeilU64(GetI64("Size in Blocks :",
|
||||
remaining-DRV_HEADER)+DRV_HEADER,ROUND_DRV_TO);
|
||||
} while (!(ROUND_DRV_TO<=temppp->size<=FloorU64(remaining,ROUND_DRV_TO)));
|
||||
QueIns(temppp,root.last);
|
||||
QueIns(temppp,head.last);
|
||||
remaining-=temppp->size;
|
||||
drv_let2++;
|
||||
}
|
||||
|
||||
"\n\n!!! Repartition Drive !!!\n\n";
|
||||
temppp=root.next;
|
||||
temppp=head.next;
|
||||
drv_let2=bd->first_drv_let;
|
||||
while (temppp!=&root) {
|
||||
while (temppp!=&head) {
|
||||
"Drive %C:%08X ",drv_let2,temppp->size;
|
||||
if (temppp->pri)
|
||||
"Primary\n";
|
||||
@@ -89,7 +89,7 @@ public I64 PrtDsk(U8 drv_let=0)
|
||||
goto pd_done;
|
||||
|
||||
remaining=FloorU64(bd->max_blk+1,ROUND_DRV_TO)-ROUND_DRV_TO;
|
||||
temppp=root.next;
|
||||
temppp=head.next;
|
||||
MemSet(&mbr,0,BLK_SIZE);
|
||||
mbr.signature=0xAA55;
|
||||
offset=0;
|
||||
@@ -107,7 +107,7 @@ public I64 PrtDsk(U8 drv_let=0)
|
||||
temppp=temppp->next;
|
||||
}
|
||||
if (!i) i++;
|
||||
if (temppp!=&root) {
|
||||
if (temppp!=&head) {
|
||||
mbr.p[i].active=0x80;
|
||||
mbr.p[i].start_head=0;
|
||||
mbr.p[i].start_cyl=0x101;
|
||||
@@ -120,7 +120,7 @@ public I64 PrtDsk(U8 drv_let=0)
|
||||
}
|
||||
ATAWriteBlks(bd,&mbr,0,1);
|
||||
|
||||
while (temppp!=&root) {
|
||||
while (temppp!=&head) {
|
||||
start_offset=offset;
|
||||
MemSet(&mbr,0,BLK_SIZE);
|
||||
mbr.signature=0xAA55;
|
||||
@@ -135,7 +135,7 @@ public I64 PrtDsk(U8 drv_let=0)
|
||||
mbr.p[0].size=temppp->size-DRV_HEADER;
|
||||
offset+=temppp->size;
|
||||
temppp=temppp->next;
|
||||
if (temppp!=&root) {
|
||||
if (temppp!=&head) {
|
||||
mbr.p[1].active=0x80;
|
||||
mbr.p[1].start_head=0;
|
||||
mbr.p[1].start_cyl=0x101;
|
||||
@@ -154,8 +154,8 @@ public I64 PrtDsk(U8 drv_let=0)
|
||||
Fmt(i,,FALSE);
|
||||
|
||||
pd_done:
|
||||
while (root.next!=&root) {
|
||||
temppp=root.next;
|
||||
while (head.next!=&head) {
|
||||
temppp=head.next;
|
||||
QueRem(temppp);
|
||||
Free(temppp);
|
||||
}
|
||||
|
||||
+3
-2
@@ -11,8 +11,8 @@ U0 LoadDocDefines()
|
||||
//This is cut and replaced when I generate a distro.
|
||||
//See $LK,"DD_TEMPLEOS_LOC",A="FF:::/Demo/AcctExample/TOSDistro.CPP,DD_TEMPLEOS_LOC"$.
|
||||
$TR-C,"LineRep"$
|
||||
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","121,410");
|
||||
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","81,046");
|
||||
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","121,488");
|
||||
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","81,126");
|
||||
$ID,-4$
|
||||
DefinePrint("DD_KERNEL","%08X",bfh);
|
||||
bfh(I64)+=bfh->file_size-1;
|
||||
@@ -30,6 +30,7 @@ $ID,-4$
|
||||
DefinePrint("DD_SYS_HEAP_BASE","%08X",sys_heap_base);
|
||||
DefinePrint("DD_SYS_HEAP_LIMIT","%08X",sys_heap_limit);
|
||||
DefinePrint("DD_MEM_MIN_MEG","%d Meg",MEM_MIN_MEG);
|
||||
DefinePrint("DD_UNCACHED_ALIAS","%010X",dev.uncached_alias);
|
||||
DefinePrint("DD_MEM_MAPPED_SPACE_GIG","%d Gig",MEM_MAPPED_SPACE/0x40000000);
|
||||
DefinePrint("DD_MEM_MAPPED_SPACE_END","%010X",MEM_MAPPED_SPACE-1);
|
||||
DefinePrint("DD_JIFFY_HZ","%d Hz",JIFFY_FREQ);
|
||||
|
||||
+3
-3
@@ -248,7 +248,7 @@ U8 *idx=NULL,CDoc *doc=NULL)
|
||||
last_idx=StrNew(cur_idx);
|
||||
if (i)
|
||||
DocPrint(doc,"\n\n");
|
||||
DocPrint(doc,"$$WW,0$$$$PURPLE$$$$TX+CX,\"%Q\"$$$$FG$$\n",cur_idx);
|
||||
DocPrint(doc,"$$WW,0$$$$PURPLE$$$$TX+CX,\"%$$Q\"$$$$FG$$\n",cur_idx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -315,7 +315,7 @@ U8 *idx=NULL,CDoc *doc=NULL)
|
||||
|
||||
wh_done:
|
||||
if (doc) {
|
||||
if (doc->root.next==doc)
|
||||
if (doc->head.next==doc)
|
||||
DocPrint(doc,"No Match");
|
||||
else
|
||||
DocRecalc(doc);
|
||||
@@ -387,7 +387,7 @@ public U0 MapFileLoad(U8 *filename)
|
||||
base=temph(CHashGeneric *)->user_data0+sizeof(CBinFile);
|
||||
|
||||
if (!doc) return;
|
||||
doc_e=doc->root.next;
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_LINK) {
|
||||
if (*doc_e->tag)
|
||||
|
||||
@@ -20,7 +20,7 @@ $$ --> $$$$
|
||||
CDoc *doc;
|
||||
CDocEntry *doc_e;
|
||||
if (doc=DocRead(in_name,DOCF_PLAIN_TEXT_TABS|DOCF_DBL_DOLLARS)) {
|
||||
doc_e=doc->root.next;
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_TEXT) {
|
||||
src=dst=doc_e->tag;
|
||||
|
||||
@@ -126,7 +126,7 @@ U0 ACPutChoices(CDoc *focus_l,CDocEntry *doc_e,CTask *focus_task,
|
||||
temph->src_link) {
|
||||
if (temph->type&HTF_PUBLIC)
|
||||
"$$RED$$";
|
||||
"$$TX+UL+L+PU,\"%Q\",A=\"%s\"$$$$FG$$\n",st,temph->src_link;
|
||||
"$$TX+UL+L+PU,\"%$$Q\",A=\"%s\"$$$$FG$$\n",st,temph->src_link;
|
||||
} else
|
||||
"%s\n",st;
|
||||
}
|
||||
|
||||
+8
-8
@@ -15,7 +15,7 @@ public U0 PCIDevFileGen()
|
||||
Bool first=TRUE,del=FALSE,del2=FALSE,cont=FALSE;
|
||||
CDoc *doc=DocRead(PCI_DEV_FILE,
|
||||
DOCF_PLAIN_TEXT|DOCF_DBL_DOLLARS|DOCF_NO_CURSOR);
|
||||
CDocEntry *doc_e=doc->root.next,*doc_e2;
|
||||
CDocEntry *doc_e=doc->head.next,*doc_e2;
|
||||
while (doc_e!=doc) {
|
||||
doc_e2=doc_e->next;
|
||||
if (first) {
|
||||
@@ -53,7 +53,7 @@ U0 PCILookUpSingle(CDoc *doc,I64 m,I64 d,U8 **_vendor,U8 **_dev)
|
||||
{
|
||||
Bool first=TRUE;
|
||||
U8 buf[8],*vendor=NULL,*dev=NULL;
|
||||
CDocEntry *doc_e=doc->root.next;
|
||||
CDocEntry *doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
if (first) {
|
||||
if (doc_e->type_u8==DOCT_TEXT && doc_e->tag[0]!=';' &&
|
||||
@@ -120,7 +120,7 @@ U0 PCILookUpDevs()
|
||||
CPCIDev *temppci;
|
||||
I64 w1,w2,b,d,f,timeout=32*8*2;
|
||||
CDoc *doc;
|
||||
if (dev.pci_root.next!=&dev.pci_root)
|
||||
if (dev.pci_head.next!=&dev.pci_head)
|
||||
return;
|
||||
doc=DocRead(PCI_DEV_FILE,DOCF_PLAIN_TEXT|DOCF_NO_CURSOR);
|
||||
for (b=0;b<sys_pci_busses;b++)
|
||||
@@ -137,7 +137,7 @@ U0 PCILookUpDevs()
|
||||
temppci->sub_code=PCIReadU8(b,d,f,0xA);
|
||||
temppci->base_code=PCIReadU8(b,d,f,0xB);
|
||||
PCILookUpSingle(doc,w1,w2,&temppci->vendor_str,&temppci->dev_id_str);
|
||||
QueIns(temppci,dev.pci_root.last);
|
||||
QueIns(temppci,dev.pci_head.last);
|
||||
timeout=32*8*2;
|
||||
} else if (sys_pci_busses==256 && --timeout<=0)
|
||||
goto lud_done;
|
||||
@@ -155,8 +155,8 @@ public U0 PCIRep()
|
||||
return;
|
||||
}
|
||||
PCILookUpDevs;
|
||||
temppci=dev.pci_root.next;
|
||||
while (temppci!=&dev.pci_root) {
|
||||
temppci=dev.pci_head.next;
|
||||
while (temppci!=&dev.pci_head) {
|
||||
"%02X:%02X:%01X %02X%02X $$GREEN$$%s $$CYAN$$%s$$FG$$\n",
|
||||
temppci->bus,temppci->dev,temppci->fun,
|
||||
temppci->base_code,temppci->sub_code,
|
||||
@@ -183,8 +183,8 @@ public U0 MemBIOSRep()
|
||||
"32 Bit Device Mem\n";
|
||||
while (LBts(&sys_semas[SYS_SEMA_DEV_MEM],0))
|
||||
Yield;
|
||||
tempmr=dev.mem32_root.next;
|
||||
while (tempmr!=&dev.mem32_root) {
|
||||
tempmr=dev.mem32_head.next;
|
||||
while (tempmr!=&dev.mem32_head) {
|
||||
"%02X:0x%016X-0x%016X\n",
|
||||
tempmr->type,tempmr->base,tempmr->base+tempmr->size-1;
|
||||
tempmr=tempmr->next;
|
||||
|
||||
+10
-10
@@ -2,8 +2,8 @@
|
||||
|
||||
CDocBin *DocBinFindNum(CDoc *haystack_doc,I64 needle_num)
|
||||
{
|
||||
CDocBin *b=haystack_doc->bin_root.next;
|
||||
while (b!=&haystack_doc->bin_root) {
|
||||
CDocBin *b=haystack_doc->bin_head.next;
|
||||
while (b!=&haystack_doc->bin_head) {
|
||||
if (b->num==needle_num)
|
||||
return b;
|
||||
b=b->next;
|
||||
@@ -15,8 +15,8 @@ CDocBin *DocBinFindTag(CDoc *haystack_doc,U8 *needle_tag)
|
||||
{
|
||||
CDocBin *b;
|
||||
if (needle_tag) {
|
||||
b=haystack_doc->bin_root.next;
|
||||
while (b!=&haystack_doc->bin_root) {
|
||||
b=haystack_doc->bin_head.next;
|
||||
while (b!=&haystack_doc->bin_head) {
|
||||
if (b->tag && !StrCmp(b->tag,needle_tag))
|
||||
return b;
|
||||
b=b->next;
|
||||
@@ -31,8 +31,8 @@ U0 DocBinsValidate(CDoc *doc)
|
||||
CDocBin *b,*b1;
|
||||
CDocEntry *doc_e,*doc_e2;
|
||||
I64 renum_num=0;
|
||||
b=doc->bin_root.next;
|
||||
while (b!=&doc->bin_root) {
|
||||
b=doc->bin_head.next;
|
||||
while (b!=&doc->bin_head) {
|
||||
b->use_cnt=0;
|
||||
b->temp_use_cnt=0;
|
||||
b->renum_num=-1;
|
||||
@@ -40,7 +40,7 @@ U0 DocBinsValidate(CDoc *doc)
|
||||
b->tag=NULL;
|
||||
b=b->next;
|
||||
}
|
||||
doc_e=doc->root.next;
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
doc_e2=doc_e->next;
|
||||
if (doc_e->de_flags & DOCEF_HAS_BIN) {
|
||||
@@ -61,9 +61,9 @@ U0 DocBinsValidate(CDoc *doc)
|
||||
doc_e=doc_e2;
|
||||
}
|
||||
|
||||
b=doc->bin_root.next;
|
||||
b=doc->bin_head.next;
|
||||
doc->cur_bin_num=1;
|
||||
while (b!=&doc->bin_root) {
|
||||
while (b!=&doc->bin_head) {
|
||||
b1=b->next;
|
||||
if (!b->use_cnt) {
|
||||
QueRem(b);
|
||||
@@ -128,7 +128,7 @@ I64 DocBinPtrRst(CDoc *doc,CDocEntry *doc_e)
|
||||
tempb->tag=StrNew(doc_e->tag,doc->mem_task);
|
||||
else
|
||||
tempb->tag=NULL;
|
||||
QueIns(tempb,doc->bin_root.last);
|
||||
QueIns(tempb,doc->bin_head.last);
|
||||
} else
|
||||
bin_num=0;
|
||||
DocDel(doc2);
|
||||
|
||||
@@ -540,7 +540,7 @@ ic_overstrike:
|
||||
goto ic_done;
|
||||
}
|
||||
doc_ne=DocEntryNewTag(doc,doc_ce,&ch);
|
||||
doc_ne->type=DOCT_TEXT | doc->settings_root.dft_text_attr<<8;
|
||||
doc_ne->type=DOCT_TEXT | doc->settings_head.dft_text_attr<<8;
|
||||
doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TEXT];
|
||||
QueIns(doc_ne,doc_ce->last);
|
||||
} else if (ch=='\n') {
|
||||
@@ -557,10 +557,10 @@ ic_not_overstrike:
|
||||
if (ch=='\n') {
|
||||
if (sc&SCF_CTRL && !(sc&SCF_SHIFT)) {
|
||||
doc_ne=DocEntryNewBase(doc,
|
||||
DOCT_PAGE_BREAK|doc->settings_root.dft_text_attr<<8);
|
||||
DOCT_PAGE_BREAK|doc->settings_head.dft_text_attr<<8);
|
||||
} else {
|
||||
doc_ne=DocEntryNewBase(doc,
|
||||
DOCT_NEW_LINE|doc->settings_root.dft_text_attr<<8);
|
||||
DOCT_NEW_LINE|doc->settings_head.dft_text_attr<<8);
|
||||
}
|
||||
DocInsEntry(doc,doc_ne);
|
||||
} else if (ch=='\t') {
|
||||
@@ -574,7 +574,7 @@ ic_form_tab:
|
||||
DocFormFwd(doc);
|
||||
goto ic_done;
|
||||
} else {
|
||||
doc_ne=DocEntryNewBase(doc,DOCT_TAB|doc->settings_root.dft_text_attr<<8);
|
||||
doc_ne=DocEntryNewBase(doc,DOCT_TAB|doc->settings_head.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_ne);
|
||||
}
|
||||
} else {
|
||||
@@ -616,7 +616,7 @@ ic_form_tab:
|
||||
doc->cur_col++;
|
||||
} else {
|
||||
doc_ne=DocEntryNewTag(doc,doc_ce,&ch);
|
||||
doc_ne->type=DOCT_TEXT | doc->settings_root.dft_text_attr<<8;
|
||||
doc_ne->type=DOCT_TEXT | doc->settings_head.dft_text_attr<<8;
|
||||
doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TEXT];
|
||||
doc_ne->x=doc_ce->x+1;
|
||||
QueIns(doc_ne,doc_ce->last);
|
||||
|
||||
@@ -12,14 +12,14 @@ public U0 EdCopyToClipboard(CDoc *doc)
|
||||
CDoc *doc2=sys_clipboard_doc;
|
||||
Bool unlock_doc=DocLock(doc),
|
||||
unlock_doc2=DocLock(doc2);
|
||||
CDocEntry *doc_e=doc->root.next,*doc_ne;
|
||||
CDocEntry *doc_e=doc->head.next,*doc_ne;
|
||||
ClipboardDel;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type & DOCET_SEL) {
|
||||
doc_e->type&=~DOCET_SEL;
|
||||
if (!Bt(doldoc.type_flags_data,doc_e->type_u8)) {
|
||||
doc_ne=DocEntryCopy(doc2,doc_e);
|
||||
QueIns(doc_ne,doc2->root.last);
|
||||
QueIns(doc_ne,doc2->head.last);
|
||||
}
|
||||
}
|
||||
doc_e=doc_e->next;
|
||||
@@ -35,7 +35,7 @@ public U0 EdCutToClipboard(CDoc *doc)
|
||||
CDoc *doc2=sys_clipboard_doc;
|
||||
Bool unlock_doc=DocLock(doc),
|
||||
unlock_doc2=DocLock(doc2);
|
||||
CDocEntry *doc_e=doc->root.next,*doc_e1,*doc_ne,*doc_e2=NULL;
|
||||
CDocEntry *doc_e=doc->head.next,*doc_e1,*doc_ne,*doc_e2=NULL;
|
||||
ClipboardDel;
|
||||
while (doc_e!=doc) {
|
||||
doc_e1=doc_e->next;
|
||||
@@ -43,7 +43,7 @@ public U0 EdCutToClipboard(CDoc *doc)
|
||||
doc_e->type&=~DOCET_SEL;
|
||||
if (!Bt(doldoc.type_flags_data,doc_e->type_u8)) {
|
||||
doc_ne=DocEntryCopy(doc2,doc_e);
|
||||
QueIns(doc_ne,doc2->root.last);
|
||||
QueIns(doc_ne,doc2->head.last);
|
||||
}
|
||||
if (doc_e==doc->cur_entry || doc_e==doc_e2)
|
||||
doc_e2=doc_e->next;
|
||||
@@ -69,7 +69,7 @@ public U0 EdPasteClipboard(CDoc *doc)
|
||||
unlock_doc2=DocLock(doc2);
|
||||
CDocEntry *doc_ce=doc->cur_entry,*doc_e;
|
||||
if (doc_ce->type_u8==DOCT_DATA) {
|
||||
doc_e=doc2->root.next;
|
||||
doc_e=doc2->head.next;
|
||||
while (doc_e!=doc2) {
|
||||
if (doc_e->de_flags&DOCEF_TAG)
|
||||
DocPrintPartial(doc,"%s",doc_e->tag);
|
||||
@@ -111,7 +111,7 @@ public CDoc *DocCopy(CDoc *doc,CDocEntry *start,CDocEntry *end)
|
||||
while (start!=doc) {
|
||||
if (!Bt(doldoc.type_flags_data,start->type_u8)) {
|
||||
doc_ne=DocEntryCopy(doc2,start);
|
||||
QueIns(doc_ne,doc2->root.last);
|
||||
QueIns(doc_ne,doc2->head.last);
|
||||
}
|
||||
if (start==end)
|
||||
break;
|
||||
|
||||
@@ -343,7 +343,7 @@ I64 EdRAGetU8(CDoc *doc)
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 EdRACollect(CDoc *doc,CRenum *root)
|
||||
U0 EdRACollect(CDoc *doc,CRenum *head)
|
||||
{
|
||||
I64 ch,i;
|
||||
CRenum *tempr;
|
||||
@@ -373,7 +373,7 @@ U0 EdRACollect(CDoc *doc,CRenum *root)
|
||||
ch=EdRAGetU8(doc);
|
||||
tempr=MAlloc(sizeof(CRenum));
|
||||
StrCpy(tempr->label,buf);
|
||||
QueIns(tempr,root->last);
|
||||
QueIns(tempr,head->last);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -388,16 +388,16 @@ U0 EdRenumAsm(CDoc *doc)
|
||||
{
|
||||
Bool unlock=DocLock(doc);
|
||||
I64 num=0;
|
||||
CRenum root,*tempr,*tempr1;
|
||||
CRenum head,*tempr,*tempr1;
|
||||
U8 buf[sizeof(CEdFindText.find_text)],
|
||||
buf2[sizeof(CEdFindText.find_text)];
|
||||
|
||||
QueInit(&root);
|
||||
QueInit(&head);
|
||||
EdSelFun(doc,TRUE);
|
||||
EdRACollect(doc,&root);
|
||||
EdRACollect(doc,&head);
|
||||
|
||||
tempr=root.next;
|
||||
while (tempr!=&root) {
|
||||
tempr=head.next;
|
||||
while (tempr!=&head) {
|
||||
tempr1=tempr->next;
|
||||
num+=ASM_RENUM_SPACING;
|
||||
StrPrint(buf,"@#%02d",num);
|
||||
@@ -531,7 +531,7 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
x=doc_e->x+1;
|
||||
while (i>8) {
|
||||
doc_ne=DocEntryNewBase(doc,
|
||||
DOCT_TAB|doc->settings_root.dft_text_attr<<8,,
|
||||
DOCT_TAB|doc->settings_head.dft_text_attr<<8,,
|
||||
x,doc_e->y,doc_e->page_line_num);
|
||||
MemCpy(&doc_ne->settings,
|
||||
&doc_e->settings,sizeof(CDocSettings));
|
||||
@@ -544,7 +544,7 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
MemSet(b,CH_SPACE,i);
|
||||
b[i]=0;
|
||||
doc_ne=DocEntryNewBase(doc,
|
||||
DOCT_TEXT|doc->settings_root.dft_text_attr<<8,,
|
||||
DOCT_TEXT|doc->settings_head.dft_text_attr<<8,,
|
||||
x,doc_e->y,doc_e->page_line_num);
|
||||
doc_ne->tag=b;
|
||||
doc_ne->max_col=1;
|
||||
|
||||
@@ -159,7 +159,7 @@ public Bool DocEd(CDoc *doc,I64 dof_flags=0)
|
||||
|
||||
DocLock(doc);
|
||||
if (res) {
|
||||
doc_e=doc->root.next;
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_DATA || doc_e->type_u8==DOCT_CHECK_BOX)
|
||||
DocDataScan(doc,doc_e);
|
||||
|
||||
+27
-24
@@ -20,7 +20,7 @@ public U0 DocLoad(CDoc *doc,U8 *src2,I64 size)
|
||||
MemCpy(tempb->data,src,tempb->size);
|
||||
src+=tempb->size;
|
||||
}
|
||||
QueIns(tempb,doc->bin_root.last);
|
||||
QueIns(tempb,doc->bin_head.last);
|
||||
if (tempb->num>=doc->cur_bin_num)
|
||||
doc->cur_bin_num=tempb->num+1;
|
||||
}
|
||||
@@ -37,16 +37,19 @@ public CDoc *DocRead(U8 *name=NULL,I64 flags=0)
|
||||
CDoc *doc=DocNew;
|
||||
U8 *src,*name2;
|
||||
I64 size=0;
|
||||
CDirContext *dirc;
|
||||
if (!name) name=blkdev.temp_filename;
|
||||
doc->flags|=flags;
|
||||
name2=FileNameAbs(name);
|
||||
StrCpy(doc->filename.name,name2);
|
||||
src=FileRead(name2,&size,&doc->file_attr);
|
||||
Free(name2);
|
||||
if (src) {
|
||||
DocLoad(doc,src,size);
|
||||
if (src=FileRead(name2,&size,&doc->file_attr)) {
|
||||
if (dirc=DirContextNew(name2)) {
|
||||
DocLoad(doc,src,size);
|
||||
DirContextDel(dirc);
|
||||
}
|
||||
Free(src);
|
||||
}
|
||||
Free(name2);
|
||||
return doc;
|
||||
}
|
||||
|
||||
@@ -64,10 +67,10 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
|
||||
DocRecalc(doc);
|
||||
else {
|
||||
DocRecalc(doc,RECALCF_ADD_CURSOR);
|
||||
if (doc->root.next->type_u8==DOCT_CURSOR)
|
||||
DocEntryDel(doc,doc->root.next); //If no cursor, $LK,"DocLoad",A="MN:DocLoad"$() puts at top.
|
||||
if (doc->head.next->type_u8==DOCT_CURSOR)
|
||||
DocEntryDel(doc,doc->head.next); //If no cursor, $LK,"DocLoad",A="MN:DocLoad"$() puts at top.
|
||||
}
|
||||
for (doc_e=doc->root.next;doc_e!=doc;doc_e=doc_e->next) {
|
||||
for (doc_e=doc->head.next;doc_e!=doc;doc_e=doc_e->next) {
|
||||
if (!Bt(doldoc.type_flags_data,doc_e->type_u8)) {
|
||||
switch (doc_e->type_u8) {
|
||||
case DOCT_TAB:
|
||||
@@ -100,12 +103,12 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
|
||||
}
|
||||
}
|
||||
}
|
||||
for (b=doc->bin_root.next;b!=&doc->bin_root;b=b->next)
|
||||
for (b=doc->bin_head.next;b!=&doc->bin_head;b=b->next)
|
||||
if (b->use_cnt>b->temp_use_cnt)
|
||||
cnt+=offset(CDocBin.end)-offset(CDocBin.start)+b->size;
|
||||
res=MAlloc(cnt);
|
||||
dst=res;
|
||||
doc_e=doc->root.next;
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
doc_e1=doc_e->next;
|
||||
if (!Bt(doldoc.type_flags_data,doc_e->type_u8))
|
||||
@@ -151,8 +154,8 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
|
||||
doc_e=doc_e1;
|
||||
}
|
||||
*dst++=0;
|
||||
b=doc->bin_root.next;
|
||||
if (b!=&doc->bin_root) {
|
||||
b=doc->bin_head.next;
|
||||
if (b!=&doc->bin_head) {
|
||||
do {
|
||||
if (b->use_cnt>b->temp_use_cnt) {
|
||||
MemCpy(dst,&b->start,offset(CDocBin.end)-offset(CDocBin.start));
|
||||
@@ -161,7 +164,7 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
|
||||
dst+=b->size;
|
||||
}
|
||||
b=b->next;
|
||||
} while (b!=&doc->bin_root);
|
||||
} while (b!=&doc->bin_head);
|
||||
} else
|
||||
cnt--; //No terminator
|
||||
if (_size) *_size=cnt;
|
||||
@@ -189,7 +192,7 @@ public U0 DocInsDoc(CDoc *doc=NULL,CDoc *doc2)
|
||||
//TODO: $LK,"DocRst",A="MN:DocRst"$
|
||||
U8 *dst;
|
||||
Bool unlock_doc,unlock_doc2=DocLock(doc2);
|
||||
CDocEntry *doc_ne,*doc_e=doc2->root.next,*doc_ce;
|
||||
CDocEntry *doc_ne,*doc_e=doc2->head.next,*doc_ce;
|
||||
if (!doc) doc=DocPut;
|
||||
unlock_doc=DocLock(doc),
|
||||
DocRemSoftNewLines(doc,NULL);
|
||||
@@ -227,7 +230,7 @@ public U0 StreamDoc(CDoc *doc)
|
||||
{//Inject doc into compile stream. Use inside #exe{}.
|
||||
//TODO: $LK,"DocRst",A="MN:DocRst"$
|
||||
Bool unlock_doc=DocLock(doc);
|
||||
CDocEntry *doc_e=doc->root.next;
|
||||
CDocEntry *doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_TEXT)
|
||||
StreamPrint("%s",doc_e->tag);
|
||||
@@ -251,7 +254,7 @@ Bool DocCaptureUndo(CDoc *doc,Bool force=FALSE)
|
||||
unlock=DocLock(doc);
|
||||
time_stamp=GetTSC;
|
||||
if (doc->flags&DOCF_UNDO_DIRTY &&
|
||||
time_stamp>doc->undo_root.last->time_stamp+cnts.time_stamp_freq<<4 ||
|
||||
time_stamp>doc->undo_head.last->time_stamp+cnts.time_stamp_freq<<4 ||
|
||||
force) {
|
||||
u=CAlloc(sizeof(CDocUndo),doc->mem_task);
|
||||
u->time_stamp=time_stamp;
|
||||
@@ -259,7 +262,7 @@ Bool DocCaptureUndo(CDoc *doc,Bool force=FALSE)
|
||||
doc->flags&=~DOCF_NO_CURSOR;
|
||||
u->body=DocSave(doc,&u->size);
|
||||
doc->flags=flags;
|
||||
QueIns(u,doc->undo_root.last);
|
||||
QueIns(u,doc->undo_head.last);
|
||||
doc->flags&=~DOCF_UNDO_DIRTY;
|
||||
doc->undo_cnt++;
|
||||
u->doc_flags=doc->flags;
|
||||
@@ -274,19 +277,19 @@ Bool DocCaptureUndo(CDoc *doc,Bool force=FALSE)
|
||||
U0 DocUndoRestore(CDoc *doc)
|
||||
{
|
||||
Bool unlock=DocLock(doc);
|
||||
CDocUndo *u=doc->undo_root.last,*u_next,*u_last;
|
||||
if (u!=&doc->undo_root) {
|
||||
CDocUndo *u=doc->undo_head.last,*u_next,*u_last;
|
||||
if (u!=&doc->undo_head) {
|
||||
QueRem(u);
|
||||
u_next=doc->undo_root.next;
|
||||
u_last=doc->undo_root.last;
|
||||
QueInit(&doc->undo_root);
|
||||
u_next=doc->undo_head.next;
|
||||
u_last=doc->undo_head.last;
|
||||
QueInit(&doc->undo_head);
|
||||
DocRst(doc,TRUE);
|
||||
doc->flags=u->doc_flags&~DOCF_NO_CURSOR;
|
||||
DocLoad(doc,u->body,u->size);
|
||||
doc->flags=u->doc_flags;
|
||||
DocUndoDel(doc,u);
|
||||
doc->undo_root.next=u_next;
|
||||
doc->undo_root.last=u_last;
|
||||
doc->undo_head.next=u_next;
|
||||
doc->undo_head.last=u_last;
|
||||
}
|
||||
DocUndoCntSet(doc);
|
||||
doc->flags&=~DOCF_UNDO_DIRTY;
|
||||
|
||||
@@ -28,7 +28,7 @@ U8 *needle,I64 match=1)
|
||||
unlock=DocLock(haystack_doc);
|
||||
if (start_line_num==MIN_I64) {
|
||||
res=TRUE;
|
||||
doc_e=haystack_doc->root.next;
|
||||
doc_e=haystack_doc->head.next;
|
||||
} else {
|
||||
res=DocLineNumGoTo(haystack_doc,start_line_num);
|
||||
doc_e=haystack_doc->cur_entry;
|
||||
@@ -69,7 +69,7 @@ public Bool DocAnchorFind(CDoc *haystack_doc,U8 *needle_str)
|
||||
CDocEntry *doc_e;
|
||||
if (haystack_doc) {
|
||||
unlock=DocLock(haystack_doc);
|
||||
doc_e=haystack_doc->root.next;
|
||||
doc_e=haystack_doc->head.next;
|
||||
if (needle_str)
|
||||
while (doc_e!=haystack_doc) {
|
||||
if (doc_e->type_u8==DOCT_ANCHOR && doc_e->de_flags & DOCEF_AUX_STR) {
|
||||
@@ -170,7 +170,7 @@ fn_skip:
|
||||
public U0 EdSelAll(CDoc *doc,Bool sel)
|
||||
{//Set state of $LK,"DOCET_SEL",A="MN:DOCET_SEL"$ on all entries.
|
||||
Bool unlock=DocLock(doc);
|
||||
CDocEntry *doc_e=doc->root.next;
|
||||
CDocEntry *doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
BEqu(&doc_e->type,DOCEt_SEL,sel);
|
||||
doc_e=doc_e->next;
|
||||
@@ -401,7 +401,7 @@ I64 EdFindReplace(CDoc *doc)
|
||||
sf_flags|=SFG_WHOLE_LABELS;
|
||||
|
||||
if (i=doc->find_replace->filter_lines) {
|
||||
doc_ce=doc->root.next;
|
||||
doc_ce=doc->head.next;
|
||||
while (doc_ce!=doc) {
|
||||
if (doc_ce->de_flags&DOCEF_TAG && doc_ce->tag &&
|
||||
!(doc_ce->de_flags&DOCEF_FILTER_SKIP) &&
|
||||
@@ -413,7 +413,7 @@ I64 EdFindReplace(CDoc *doc)
|
||||
doc_ce=doc_ce->next;
|
||||
}
|
||||
|
||||
doc_ce=doc->root.next;
|
||||
doc_ce=doc->head.next;
|
||||
while (doc_ce!=doc) {
|
||||
if (!(doc_ce->de_flags&DOCEF_FILTER_SKIP)) {
|
||||
found=FALSE;
|
||||
@@ -459,7 +459,7 @@ I64 EdFindReplace(CDoc *doc)
|
||||
if (!plen)
|
||||
goto fr_unlock_done;
|
||||
rlen=StrLen(doc->find_replace->replace_text);
|
||||
if (doc->root.next!=doc) {
|
||||
if (doc->head.next!=doc) {
|
||||
doc_e=doc_marker=DocSplitTag(doc,doc->cur_entry,doc->cur_col,
|
||||
doc->cur_entry->x+doc->cur_col,doc->cur_entry->y,DOCT_MARKER);
|
||||
do {
|
||||
|
||||
@@ -260,7 +260,7 @@ public Bool DocForm(U8 *_d,U8 *class_name=lastclass,
|
||||
ml=ml->next;
|
||||
}
|
||||
if (footer) DocPrint(doc,"%s",footer);
|
||||
if (doc->root.next!=doc) {
|
||||
if (doc->head.next!=doc) {
|
||||
Fs->border_src=BDS_CONST;
|
||||
DocRecalc(doc);
|
||||
if (DocEd(doc,dof_flags)) {
|
||||
@@ -273,7 +273,7 @@ public Bool DocForm(U8 *_d,U8 *class_name=lastclass,
|
||||
}
|
||||
}
|
||||
}
|
||||
doc_e=doc->root.next;
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->de_flags&DOCEF_REMALLOC_DATA) {
|
||||
*doc_e->user_data(U8 **)=doc_e->data;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
U0 EdUndoFilter(CDoc *doc)
|
||||
{
|
||||
Bool unlock=DocLock(doc);
|
||||
CDocEntry *doc_ce=doc->root.next;
|
||||
CDocEntry *doc_ce=doc->head.next;
|
||||
while (doc_ce!=doc) {
|
||||
doc_ce->de_flags&=~DOCEF_FILTER_SKIP;
|
||||
doc_ce=doc_ce->next;
|
||||
|
||||
+25
-8
@@ -7,9 +7,9 @@ U0 DocInit()
|
||||
CHashGeneric *temph;
|
||||
|
||||
DefineLstLoad("ST_DOC_CMDS",
|
||||
"TX\0CR\0SR\0CU\0MK\0TB\0CL\0PB\0PL\0LM\0RM\0HD\0FO\0ID\0FG\0"
|
||||
"BG\0FD\0BD\0PT\0WW\0UL\0IV\0BK\0SX\0SY\0CM\0AN\0LK\0BT\0"
|
||||
"DA\0CB\0LS\0MA\0MU\0HX\0TR\0SP\0IB\0IS\0SO\0HL\0HC\0ER\0");
|
||||
"TX\0CR\0SR\0TB\0PB\0CU\0MK\0PT\0CL\0PL\0LM\0RM\0HD\0FO\0ID\0FG\0"
|
||||
"BG\0FD\0BD\0WW\0HL\0BK\0IV\0UL\0SX\0SY\0CM\0AN\0LK\0BT\0"
|
||||
"DA\0CB\0LS\0MA\0MU\0HX\0TR\0SP\0IB\0IS\0SO\0HC\0ER\0");
|
||||
DefineLstLoad("ST_DOC_FLAGS",
|
||||
"T\0LEN\0A\0D\0HTML\0LE\0LM\0RE\0RM\0BI\0BP\0RT\0SX\0SY\0SCX\0U\0"
|
||||
"LC\0LA\0RC\0RA\0LX\0CX\0RX\0TY\0CY\0BY\0"
|
||||
@@ -52,6 +52,7 @@ U0 DocInit()
|
||||
|
||||
//Don't forget $LK,"cmp_type_flags_src_code",A="MN:cmp_type_flags_src_code"$.
|
||||
doldoc.type_flags_nontag_invisible[0]=
|
||||
1<<DOCT_PMT|
|
||||
1<<DOCT_PAGE_LEN|
|
||||
1<<DOCT_LEFT_MARGIN|
|
||||
1<<DOCT_RIGHT_MARGIN|
|
||||
@@ -62,18 +63,34 @@ U0 DocInit()
|
||||
1<<DOCT_BACKGROUND|
|
||||
1<<DOCT_DFT_FOREGROUND|
|
||||
1<<DOCT_DFT_BACKGROUND|
|
||||
1<<DOCT_PMT|
|
||||
1<<DOCT_WORD_WRAP|
|
||||
1<<DOCT_UNDERLINE|
|
||||
1<<DOCT_INVERT|
|
||||
1<<DOCT_HIGHLIGHT|
|
||||
1<<DOCT_BLINK|
|
||||
1<<DOCT_INVERT|
|
||||
1<<DOCT_UNDERLINE|
|
||||
1<<DOCT_SHIFTED_X|
|
||||
1<<DOCT_SHIFTED_Y|
|
||||
1<<DOCT_SPRITE|
|
||||
1<<DOCT_HIGHLIGHT;
|
||||
1<<DOCT_SPRITE;
|
||||
|
||||
doldoc.type_flags_data[0]=1<<DOCT_DATA|1<<DOCT_HEX_ED|1<<DOCT_CHECK_BOX;
|
||||
|
||||
doldoc.type_flags_chk_dup[0]=
|
||||
1<<DOCT_LEFT_MARGIN|
|
||||
1<<DOCT_RIGHT_MARGIN|
|
||||
1<<DOCT_HEADER|
|
||||
1<<DOCT_FOOTER|
|
||||
1<<DOCT_FOREGROUND|
|
||||
1<<DOCT_BACKGROUND|
|
||||
1<<DOCT_DFT_FOREGROUND|
|
||||
1<<DOCT_DFT_BACKGROUND|
|
||||
1<<DOCT_WORD_WRAP|
|
||||
1<<DOCT_HIGHLIGHT|
|
||||
1<<DOCT_BLINK|
|
||||
1<<DOCT_INVERT|
|
||||
1<<DOCT_UNDERLINE|
|
||||
1<<DOCT_SHIFTED_X|
|
||||
1<<DOCT_SHIFTED_Y;
|
||||
|
||||
Bts(doldoc.clean_scan_codes,SC_CURSOR_RIGHT);
|
||||
Bts(doldoc.clean_scan_codes,SC_CURSOR_LEFT);
|
||||
Bts(doldoc.clean_scan_codes,SC_CURSOR_UP);
|
||||
|
||||
+16
-16
@@ -5,11 +5,11 @@ StrCpy(captured_macro_name,"Test");
|
||||
|
||||
I64 sys_macro_repeat_n=1;
|
||||
|
||||
U0 SysMacroStripKey(CSrvCmd *macro_root,I64 a1,I64 a2)
|
||||
U0 SysMacroStripKey(CSrvCmd *macro_head,I64 a1,I64 a2)
|
||||
{
|
||||
CSrvCmd *tempc,*tempc1;
|
||||
tempc=macro_root->next;
|
||||
while (tempc!=macro_root) {
|
||||
tempc=macro_head->next;
|
||||
while (tempc!=macro_head) {
|
||||
tempc1=tempc->next;
|
||||
if (tempc->cmd_code==SVCT_MSG &&
|
||||
(tempc->msg_code==MSG_KEY_DOWN || tempc->msg_code==MSG_KEY_UP ||
|
||||
@@ -50,20 +50,20 @@ CMacroTemp *Cmd2MT(CSrvCmd *tempc)
|
||||
return tempmt;
|
||||
}
|
||||
|
||||
U8 *SysMacro2Str(CSrvCmd *macro_root)
|
||||
U8 *SysMacro2Str(CSrvCmd *macro_head)
|
||||
{
|
||||
CSrvCmd *tempc;
|
||||
I64 cnt=1; //terminating zero
|
||||
U8 *ptr,*m;
|
||||
CMacroTemp *tempmt,*tempmt1,root;
|
||||
CMacroTemp *tempmt,*tempmt1,head;
|
||||
LBtr(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
|
||||
|
||||
QueInit(&root);
|
||||
root.type=MT_NULL;
|
||||
tempc=macro_root->next;
|
||||
while (tempc!=macro_root) {
|
||||
QueInit(&head);
|
||||
head.type=MT_NULL;
|
||||
tempc=macro_head->next;
|
||||
while (tempc!=macro_head) {
|
||||
tempmt=Cmd2MT(tempc);
|
||||
QueIns(tempmt,root.last);
|
||||
QueIns(tempmt,head.last);
|
||||
cnt+=StrLen(tempmt->buf);
|
||||
if (tempmt->type==MT_CHAR) {
|
||||
if (tempmt->last->type!=MT_CHAR)
|
||||
@@ -77,8 +77,8 @@ U8 *SysMacro2Str(CSrvCmd *macro_root)
|
||||
m=MAlloc(cnt);
|
||||
ptr=m;
|
||||
|
||||
tempmt=root.next;
|
||||
while (tempmt!=&root) {
|
||||
tempmt=head.next;
|
||||
while (tempmt!=&head) {
|
||||
tempmt1=tempmt->next;
|
||||
if (tempmt->type==MT_MSG) {
|
||||
StrCpy(ptr, tempmt->buf);
|
||||
@@ -108,7 +108,7 @@ U0 PlaySysMacro(I64 n=1)
|
||||
U8 *m;
|
||||
if (TaskValidate(task)) {
|
||||
LBtr(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
|
||||
m=SysMacro2Str(&sys_macro_root);
|
||||
m=SysMacro2Str(&sys_macro_head);
|
||||
while (n-- && TaskValidate(task)) {
|
||||
if (task==Fs)
|
||||
AutoStr("%s",m);
|
||||
@@ -121,9 +121,9 @@ U0 PlaySysMacro(I64 n=1)
|
||||
|
||||
U0 EdInsCapturedMacro()
|
||||
{
|
||||
U8 *st=SysMacro2Str(&sys_macro_root);
|
||||
U8 *st=SysMacro2Str(&sys_macro_head);
|
||||
if (sys_focus_task) {
|
||||
XTalk(sys_focus_task,"$$MA+LA,T=\"%s\",LM=\"%Q\"$$",
|
||||
XTalk(sys_focus_task,"$$MA+LA,T=\"%s\",LM=\"%$$Q\"$$",
|
||||
captured_macro_name,st);
|
||||
Free(st);
|
||||
}
|
||||
@@ -184,7 +184,7 @@ U0 MacroTask(I64)
|
||||
switch (i) {
|
||||
case SM_RECORD:
|
||||
LBtr(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
|
||||
QueDel(&sys_macro_root,TRUE);
|
||||
QueDel(&sys_macro_head,TRUE);
|
||||
LBts(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
|
||||
break;
|
||||
case SM_PLAY:
|
||||
|
||||
+20
-20
@@ -123,9 +123,9 @@ U0 DocUndoDel(CDoc *,CDocUndo *u)
|
||||
U0 DocUndoCntSet(CDoc *doc)
|
||||
{
|
||||
Bool unlock=DocLock(doc);
|
||||
CDocUndo *u=doc->undo_root.next;
|
||||
CDocUndo *u=doc->undo_head.next;
|
||||
doc->undo_cnt=0;
|
||||
while (u!=&doc->undo_root) {
|
||||
while (u!=&doc->undo_head) {
|
||||
doc->undo_cnt++;
|
||||
u=u->next;
|
||||
}
|
||||
@@ -165,7 +165,7 @@ public CDocEntry *DocEntryCopy(CDoc *doc,CDocEntry *doc_e)
|
||||
tempb->tag=StrNew(doc_e->tag,task);
|
||||
else
|
||||
tempb->tag=NULL;
|
||||
QueIns(tempb,doc->bin_root.last);
|
||||
QueIns(tempb,doc->bin_head.last);
|
||||
}
|
||||
if (doc_e->de_flags & DOCEF_REMALLOC_DATA)
|
||||
doc_ne->data=MAllocIdent(doc_e->data,task);
|
||||
@@ -179,7 +179,7 @@ U0 DocRemSoftNewLines(CDoc *doc=NULL,CDocEntry *doc_e=NULL)
|
||||
if (!doc && !(doc=DocPut))
|
||||
return;
|
||||
unlock=DocLock(doc);
|
||||
if (!doc_e) doc_e=doc->root.next;
|
||||
if (!doc_e) doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
doc_e2=doc_e->next;
|
||||
if (doc_e->type_u8==DOCT_SOFT_NEW_LINE) {
|
||||
@@ -244,20 +244,20 @@ public U0 DocRst(CDoc *doc,Bool is_old)
|
||||
return;
|
||||
unlock=DocLock(doc);
|
||||
if (is_old) {
|
||||
doc_e=doc->root.next;
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
doc_e2=doc_e->next;
|
||||
DocEntryDel(doc,doc_e);
|
||||
doc_e=doc_e2;
|
||||
}
|
||||
u=doc->undo_root.next;
|
||||
while (u!=&doc->undo_root) {
|
||||
u=doc->undo_head.next;
|
||||
while (u!=&doc->undo_head) {
|
||||
u8=u->next;
|
||||
DocUndoDel(doc,u);
|
||||
u=u8;
|
||||
}
|
||||
b=doc->bin_root.next;
|
||||
while (b!=&doc->bin_root) {
|
||||
b=doc->bin_head.next;
|
||||
while (b!=&doc->bin_head) {
|
||||
b1=b->next;
|
||||
QueRem(b);
|
||||
Free(b->data);
|
||||
@@ -267,10 +267,10 @@ public U0 DocRst(CDoc *doc,Bool is_old)
|
||||
}
|
||||
//Check $LK,"DocInsDoc",A="MN:DocInsDoc"$
|
||||
doc->flags&=DOCF_BREAK_UNLOCKED;
|
||||
doc->root.next=doc->root.last=doc;
|
||||
QueInit(&doc->bin_root);
|
||||
QueInit(&doc->undo_root);
|
||||
doc->undo_root.time_stamp=0;
|
||||
doc->head.next=doc->head.last=doc;
|
||||
QueInit(&doc->bin_head);
|
||||
QueInit(&doc->undo_head);
|
||||
doc->undo_head.time_stamp=0;
|
||||
doc->undo_cnt=0;
|
||||
doc->cur_bin_num=1;
|
||||
doc->dollar_buf_ptr=0;
|
||||
@@ -278,7 +278,7 @@ public U0 DocRst(CDoc *doc,Bool is_old)
|
||||
doc->page_line_num=0;
|
||||
doc->best_d=MAX_I64;
|
||||
|
||||
s=&doc->settings_root;
|
||||
s=&doc->settings_head;
|
||||
s->left_margin=DOC_DFT;
|
||||
s->right_margin=DOC_DFT;
|
||||
s->indent=0;
|
||||
@@ -293,7 +293,7 @@ public U0 DocRst(CDoc *doc,Bool is_old)
|
||||
s->shifted_y=0;
|
||||
s->cur_text_attr=s->dft_text_attr=DOC_ATTR_DFT_TEXT;
|
||||
|
||||
doc_e=&doc->root;
|
||||
doc_e=&doc->head;
|
||||
doc_e->type=DOCT_ERROR;
|
||||
doc_e->de_flags=0;
|
||||
doc_e->x=0;
|
||||
@@ -331,21 +331,21 @@ public I64 DocSize(CDoc *doc)
|
||||
if (!doc || doc->doc_signature!=DOC_SIGNATURE_VAL) return 0;
|
||||
unlock=DocLock(doc);
|
||||
|
||||
doc_e=doc->root.next;
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
res+=DocEntrySize(doc,doc_e);
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
|
||||
u=doc->undo_root.next;
|
||||
while (u!=&doc->undo_root) {
|
||||
u=doc->undo_head.next;
|
||||
while (u!=&doc->undo_head) {
|
||||
res+=MSize2(u->body);
|
||||
res+=MSize2(u);
|
||||
u=u->next;
|
||||
}
|
||||
|
||||
b=doc->bin_root.next;
|
||||
while (b!=&doc->bin_root) {
|
||||
b=doc->bin_head.next;
|
||||
while (b!=&doc->bin_head) {
|
||||
res+=MSize2(b->data);
|
||||
res+=MSize2(b);
|
||||
b=b->next;
|
||||
|
||||
+13
-3
@@ -53,13 +53,23 @@ I64 DocOptDoc(CDoc *doc,I64 fuf_flags)
|
||||
{//Optimize Doc.
|
||||
Bool unlock=DocLock(doc);
|
||||
I64 res=0;
|
||||
CDocEntry *doc_e;
|
||||
CDocEntry *doc_e,*doc_e1,*doc_e_last;
|
||||
DocRecalc(doc);
|
||||
doc_e=doc->root.next;
|
||||
doc_e_last=NULL;
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
doc_e1=doc_e->next;
|
||||
if (res+=DocOptEntry(doc,doc_e,fuf_flags))
|
||||
res+=DocOptEntry(doc,doc_e,fuf_flags);
|
||||
doc_e=doc_e->next;
|
||||
if (doc_e_last && doc_e_last->type&~0xFF00==doc_e->type&~0xFF00 &&
|
||||
doc_e_last->de_flags==doc_e->de_flags &&
|
||||
Bt(doldoc.type_flags_chk_dup,doc_e->type_u8) &&
|
||||
doc_e_last->attr==doc_e->attr) {
|
||||
DocEntryDel(doc,doc_e);
|
||||
res++;
|
||||
} else
|
||||
doc_e_last=doc_e;
|
||||
doc_e=doc_e1;
|
||||
}
|
||||
DocRecalc(doc);
|
||||
if (unlock)
|
||||
|
||||
+13
-13
@@ -10,10 +10,10 @@ I64 PrsDocFlagSingle(CCmpCtrl *cc,I64 *_de_flags,U32 *_type,Bool turn_on)
|
||||
if (res<64) {
|
||||
BEqu(_de_flags,res,turn_on);
|
||||
switch (res) {
|
||||
case DOCEf_SEL:
|
||||
case DOCEf_UNDERLINE:
|
||||
case DOCEf_INVERT:
|
||||
case DOCEf_BLINK:
|
||||
case DOCEf_INVERT:
|
||||
case DOCEf_UNDERLINE:
|
||||
case DOCEf_SEL:
|
||||
BEqu(_type,res,turn_on);
|
||||
break;
|
||||
}
|
||||
@@ -105,9 +105,9 @@ U8 *Doc2PlainText(CDoc *doc,CDocEntry *doc_e)
|
||||
case DOCT_INDENT:
|
||||
case DOCT_WORD_WRAP:
|
||||
case DOCT_HIGHLIGHT:
|
||||
case DOCT_UNDERLINE:
|
||||
case DOCT_INVERT:
|
||||
case DOCT_BLINK:
|
||||
case DOCT_INVERT:
|
||||
case DOCT_UNDERLINE:
|
||||
case DOCT_SHIFTED_X:
|
||||
case DOCT_SHIFTED_Y:
|
||||
if (attr!=DOC_DFT) {
|
||||
@@ -273,9 +273,9 @@ CDocEntry *PrsDollarCmd(CDoc *doc,U8 *st)
|
||||
case DOCT_DFT_BACKGROUND:
|
||||
case DOCT_WORD_WRAP:
|
||||
case DOCT_HIGHLIGHT:
|
||||
case DOCT_UNDERLINE:
|
||||
case DOCT_INVERT:
|
||||
case DOCT_BLINK:
|
||||
case DOCT_INVERT:
|
||||
case DOCT_UNDERLINE:
|
||||
case DOCT_SHIFTED_X:
|
||||
case DOCT_SHIFTED_Y:
|
||||
while (cc->token==',')
|
||||
@@ -575,7 +575,7 @@ U0 DocEntryToggle(CDoc *doc)
|
||||
st=Doc2PlainText(doc,doc_ce);
|
||||
LBEqu(&doc->flags,DOCf_COLOR_NAMES,old_color_names);
|
||||
DocEntryDel(doc,doc_ce);
|
||||
DocPrint(doc,"$$$$%Q$$$$",st);
|
||||
DocPrint(doc,"$$$$%$$Q$$$$",st);
|
||||
}
|
||||
DocRecalc(doc);
|
||||
}
|
||||
@@ -593,13 +593,13 @@ U0 DocFlagsToggle(CDoc *doc,I64 tog_flags)
|
||||
doc->flags=doc->flags&~DOCF_NO_CURSOR|DOCF_COLOR_NAMES;
|
||||
st=DocSave(doc,&size);
|
||||
|
||||
u_next=doc->undo_root.next;
|
||||
u_last=doc->undo_root.last;
|
||||
doc->undo_root.next=doc->undo_root.last=&doc->undo_root;
|
||||
u_next=doc->undo_head.next;
|
||||
u_last=doc->undo_head.last;
|
||||
doc->undo_head.next=doc->undo_head.last=&doc->undo_head;
|
||||
|
||||
DocRst(doc,TRUE);
|
||||
doc->undo_root.next=u_next;
|
||||
doc->undo_root.last=u_last;
|
||||
doc->undo_head.next=u_next;
|
||||
doc->undo_head.last=u_last;
|
||||
DocUndoCntSet(doc);
|
||||
doc->flags=flags&~(DOCF_NO_CURSOR|DOCG_BL_IV_UL|DOCF_WORD_WRAP);
|
||||
DocLoad(doc,st,size);
|
||||
|
||||
@@ -97,7 +97,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
BEqu(&doc_ce->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||
doc_ce=doc->cur_entry=doc_ce->last;
|
||||
}
|
||||
doc_ce=doc->cur_entry=doc->root.next;
|
||||
doc_ce=doc->cur_entry=doc->head.next;
|
||||
doc->cur_col=doc_ce->min_col;
|
||||
DocFormFwd(doc);
|
||||
}
|
||||
@@ -142,7 +142,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
(doc_ce->type_u8!=DOCT_HEX_ED && doc_ce->y>i ||
|
||||
doc_ce->type_u8==DOCT_HEX_ED &&
|
||||
doc_ce->y+doc->cur_col/3/doc_ce->hex_ed_width>i) &&
|
||||
doc_ce->y!=doc->root.next->y) {
|
||||
doc_ce->y!=doc->head.next->y) {
|
||||
EdLineUp(doc,sc);
|
||||
//paranoid check for stuck on same node
|
||||
if (doc->cur_entry==doc_ce && doc_ce->type_u8!=DOCT_HEX_ED)
|
||||
@@ -256,7 +256,7 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
if (TaskValidate(sys_macro_task))
|
||||
PostMsgWait(sys_macro_task,
|
||||
MSG_KEY_DOWN_UP,CH_SHIFT_ESC,0);
|
||||
SysMacroStripKey(&sys_macro_root,ch,sc);
|
||||
SysMacroStripKey(&sys_macro_head,ch,sc);
|
||||
PlaySysMacro;
|
||||
} else
|
||||
EdMacroUtil;
|
||||
|
||||
+12
-12
@@ -27,7 +27,7 @@ CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
if (!ch) {
|
||||
if (j=ptr-ptr2) {
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_TEXT|doc->settings_root.dft_text_attr<<8);
|
||||
DOCT_TEXT|doc->settings_head.dft_text_attr<<8);
|
||||
if (doc->flags & DOCF_NO_CURSOR) {
|
||||
src=MAlloc(j+1);
|
||||
MemCpy(src,ptr2,j+1);
|
||||
@@ -46,7 +46,7 @@ CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
if (j=ptr-ptr2) {
|
||||
*ptr=0;
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_TEXT|doc->settings_root.dft_text_attr<<8);
|
||||
DOCT_TEXT|doc->settings_head.dft_text_attr<<8);
|
||||
if (doc->flags & DOCF_NO_CURSOR) {
|
||||
src=MAlloc(j+1);
|
||||
MemCpy(src,ptr2,j+1);
|
||||
@@ -72,19 +72,19 @@ CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
switch (ch) {
|
||||
case CH_CURSOR:
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_CURSOR|doc->settings_root.dft_text_attr<<8);
|
||||
DOCT_CURSOR|doc->settings_head.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_e);
|
||||
ptr++;
|
||||
break;
|
||||
case CH_FORM_FEED:
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_PAGE_BREAK|doc->settings_root.dft_text_attr<<8);
|
||||
DOCT_PAGE_BREAK|doc->settings_head.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_e);
|
||||
ptr++;
|
||||
break;
|
||||
case '\t':
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_TAB|doc->settings_root.dft_text_attr<<8);
|
||||
DOCT_TAB|doc->settings_head.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_e);
|
||||
ptr++;
|
||||
break;
|
||||
@@ -97,13 +97,13 @@ CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
*ptr=0; //zero second dollar
|
||||
if (ptr-1==ptr2 && *ptr2==CH_CURSOR) {
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_CURSOR|doc->settings_root.dft_text_attr<<8);
|
||||
DOCT_CURSOR|doc->settings_head.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_e);
|
||||
ptr2++;
|
||||
}
|
||||
if (ptr==ptr2) {
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_TEXT|doc->settings_root.dft_text_attr<<8);
|
||||
DOCT_TEXT|doc->settings_head.dft_text_attr<<8);
|
||||
doc_e->max_col=1;
|
||||
if (doc->flags & DOCF_DBL_DOLLARS)
|
||||
doc_e->tag=StrNew("$$$$",doc->mem_task);
|
||||
@@ -117,11 +117,11 @@ CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
while (ch=*ptr3++) {
|
||||
if (ch==CH_CURSOR) {
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_CURSOR|doc->settings_root.dft_text_attr<<8);
|
||||
DOCT_CURSOR|doc->settings_head.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_e);
|
||||
} else if (ch==CH_FORM_FEED) {
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_PAGE_BREAK|doc->settings_root.dft_text_attr<<8);
|
||||
DOCT_PAGE_BREAK|doc->settings_head.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_e);
|
||||
} else
|
||||
*ptr4++=ch;
|
||||
@@ -138,7 +138,7 @@ CDocEntry *DocPutS(CDoc *doc,U8 *st)
|
||||
break;
|
||||
default:
|
||||
doc_e=DocEntryNewBase(doc,
|
||||
DOCT_NEW_LINE|doc->settings_root.dft_text_attr<<8);
|
||||
DOCT_NEW_LINE|doc->settings_head.dft_text_attr<<8);
|
||||
DocInsEntry(doc,doc_e);
|
||||
if (ch=='\r')
|
||||
while (*ptr=='\r')
|
||||
@@ -214,7 +214,7 @@ public U0 DocPrintPartial(CDoc *doc=NULL,U8 *fmt,...)
|
||||
doc_ce->tag=st;
|
||||
} else {
|
||||
doc_ne=DocEntryNewTag(doc,doc_ce,ptr2);
|
||||
doc_ne->type=DOCT_TEXT|doc->settings_root.dft_text_attr<<8;
|
||||
doc_ne->type=DOCT_TEXT|doc->settings_head.dft_text_attr<<8;
|
||||
doc_ne->de_flags=doldoc.dft_de_flags[DOCT_TEXT];
|
||||
QueIns(doc_ne,doc_ce->last);
|
||||
doc->cur_entry=doc_ne;
|
||||
@@ -263,7 +263,7 @@ U0 DocDump(CDoc *doc,I64 uS_delay=0)
|
||||
U8 *st;
|
||||
CDocEntry *doc_e,*doc_e2;
|
||||
Bool unlock=DocLock(doc);
|
||||
doc_e=doc->root.next;
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
st=DocScanLine(doc,doc_e,NULL,&doc_e2);
|
||||
"%s",st;
|
||||
|
||||
+93
-93
@@ -353,8 +353,8 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
doc->line_start_col=0;
|
||||
recalc_flags&=~RECALCF_HAS_CURSOR;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN)
|
||||
doc->settings_root.cur_text_attr=
|
||||
doc->settings_root.dft_text_attr=win_task->border_attr;
|
||||
doc->settings_head.cur_text_attr=
|
||||
doc->settings_head.dft_text_attr=win_task->border_attr;
|
||||
} else {
|
||||
if (recalc_flags&RECALCF_HAS_CURSOR && full_refresh) {
|
||||
if (Bt(&hss->flags,WSSf_SET_TO_POS)||Bt(&vss->flags,WSSf_SET_TO_POS)) {
|
||||
@@ -374,8 +374,8 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
}
|
||||
}
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN)
|
||||
doc->settings_root.cur_text_attr=
|
||||
doc->settings_root.dft_text_attr=win_task->text_attr;
|
||||
doc->settings_head.cur_text_attr=
|
||||
doc->settings_head.dft_text_attr=win_task->text_attr;
|
||||
}
|
||||
x0=doc->line_start_col;
|
||||
y0=doc->top_line_num;
|
||||
@@ -395,16 +395,16 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
|
||||
if (doc->cur_col<=doc->cur_entry->min_col)
|
||||
doc->cur_col=doc->cur_entry->min_col;
|
||||
doc_e=doc->root.next;
|
||||
doc_e=doc->head.next;
|
||||
doc_e->de_flags&=~(DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT);
|
||||
if (doc_e==doc->root.next)
|
||||
s=&doc->settings_root;
|
||||
if (doc_e==doc->head.next)
|
||||
s=&doc->settings_head;
|
||||
else
|
||||
s=&doc_e->last->settings;
|
||||
doc->flags=doc_e->de_flags& (DOCG_BL_IV_UL|DOCEF_WORD_WRAP) |
|
||||
doc->flags&~(DOCG_BL_IV_UL|DOCEF_WORD_WRAP);
|
||||
cur_u8_attr=s->cur_text_attr;
|
||||
if (doc_e==doc->root.next) {
|
||||
if (doc_e==doc->head.next) {
|
||||
doc->flags&=~DOCF_BWD_MOVEMENT;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && full_refresh)
|
||||
doc->flags&=~DOCF_HAS_SONG;
|
||||
@@ -412,14 +412,14 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
doc->flags=doc_e->de_flags& DOCEF_HIGHLIGHT |
|
||||
doc->flags&~DOCEF_HIGHLIGHT;
|
||||
|
||||
if (doc->root.next==doc) {
|
||||
if (doc->head.next==doc) {
|
||||
best_doc_e=doc;
|
||||
best_col=0;
|
||||
doc->cur_entry=doc;
|
||||
doc->cur_col=0;
|
||||
doc_e=doc;
|
||||
}
|
||||
skipped_update= doc_e==doc && doc->root.next!=doc;
|
||||
skipped_update= doc_e==doc && doc->head.next!=doc;
|
||||
|
||||
if (full_refresh) {
|
||||
doc->min_x=MAX_I32; doc->min_y=MAX_I32;
|
||||
@@ -716,41 +716,6 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
x-=doc_e->hex_ed_width*3+k+9;
|
||||
}
|
||||
break;
|
||||
case DOCT_TAB:
|
||||
k=(x+8) & ~7;
|
||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) {
|
||||
while (x<k) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW))
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,temp_u32_attr+CH_SPACE);
|
||||
if (find_cursor) {
|
||||
d2=DocCharDist(doc,x,y);
|
||||
if (d2<D)
|
||||
D=d2;
|
||||
}
|
||||
x++;
|
||||
}
|
||||
} else {
|
||||
k-=x;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||
if (y_plot_top<=y<=y_plot_bottom)
|
||||
TextLenStr(win_task,x-x0,y-y0,k,temp_u32_attr," ");
|
||||
x+=k;
|
||||
} else {
|
||||
if (find_cursor) {
|
||||
while (k--) {
|
||||
d2=DocCharDist(doc,x,y);
|
||||
if (d2<D)
|
||||
D=d2;
|
||||
x++;
|
||||
}
|
||||
} else
|
||||
x+=k;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DOCT_NEW_LINE:
|
||||
case DOCT_SOFT_NEW_LINE:
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
@@ -809,34 +774,68 @@ rc_adjust_xy:
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DOCT_CURSOR_MOVEMENT:
|
||||
doc->flags|=DOCF_BWD_MOVEMENT;
|
||||
x+=doc_e->cursor_x_offset;
|
||||
if (doc_e->de_flags & DOCEF_PAGE_REL_Y) {
|
||||
i=doc->page_line_num;
|
||||
if (doc_e->de_flags & DOCEF_TOP_Y)
|
||||
doc->page_line_num=0;
|
||||
else if (doc_e->de_flags & DOCEF_BOTTOM_Y)
|
||||
doc->page_line_num=s->page_len-1;
|
||||
else if (doc_e->de_flags & DOCEF_CENTER_Y)
|
||||
doc->page_line_num=s->page_len>>1;
|
||||
y+=doc->page_line_num-i;
|
||||
case DOCT_TAB:
|
||||
k=(x+8) & ~7;
|
||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) {
|
||||
while (x<k) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW))
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,temp_u32_attr+CH_SPACE);
|
||||
if (find_cursor) {
|
||||
d2=DocCharDist(doc,x,y);
|
||||
if (d2<D)
|
||||
D=d2;
|
||||
}
|
||||
x++;
|
||||
}
|
||||
} else {
|
||||
k-=x;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||
if (y_plot_top<=y<=y_plot_bottom)
|
||||
TextLenStr(win_task,x-x0,y-y0,k,temp_u32_attr," ");
|
||||
x+=k;
|
||||
} else {
|
||||
if (find_cursor) {
|
||||
while (k--) {
|
||||
d2=DocCharDist(doc,x,y);
|
||||
if (d2<D)
|
||||
D=d2;
|
||||
x++;
|
||||
}
|
||||
} else
|
||||
x+=k;
|
||||
}
|
||||
}
|
||||
y+=doc_e->cursor_y_offset;
|
||||
doc->page_line_num+=doc_e->cursor_y_offset;
|
||||
goto rc_adjust_xy;
|
||||
break;
|
||||
case DOCT_PAGE_BREAK:
|
||||
doc->flags|=DOCF_BWD_MOVEMENT;
|
||||
y+=s->page_len-doc_e->page_line_num;
|
||||
doc->page_line_num=0;
|
||||
goto rc_start_of_line;
|
||||
case DOCT_INDENT:
|
||||
if (doc_e->de_flags & DOCEF_LEFT_X)
|
||||
i=doc_e->attr;
|
||||
case DOCT_CURSOR:
|
||||
if (!find_cursor && !(doc->flags & DOCF_NO_CURSOR)) {
|
||||
doc->cur_entry=doc_e->next;
|
||||
doc->cur_col=doc->cur_entry->min_col;
|
||||
}
|
||||
if (doc_e!=added_cursor)
|
||||
del_doc_e=TRUE;
|
||||
break;
|
||||
case DOCT_PMT:
|
||||
cur_u8_attr=cur_u8_attr&0xF0|DOC_COLOR_PMT;
|
||||
if (y==cursor_y) {
|
||||
doc->cur_entry=doc_e->next;
|
||||
doc->cur_col=doc->cur_entry->min_col;
|
||||
}
|
||||
break;
|
||||
case DOCT_CLEAR:
|
||||
next_clear_found=doc_e;
|
||||
if (doc_e->de_flags&DOCEF_HOLD)
|
||||
clear_holds=TRUE;
|
||||
else
|
||||
i=s->indent+doc_e->attr;
|
||||
s->indent=i;
|
||||
goto rc_start_of_line;
|
||||
clear_holds=FALSE;
|
||||
break;
|
||||
case DOCT_PAGE_LEN:
|
||||
s->page_len=doc_e->attr;
|
||||
if (doc_e->de_flags & DOCEF_WIN_REL)
|
||||
@@ -861,6 +860,13 @@ rc_adjust_xy:
|
||||
case DOCT_FOOTER:
|
||||
s->footer=doc_e->attr;
|
||||
goto rc_adjust_xy;
|
||||
case DOCT_INDENT:
|
||||
if (doc_e->de_flags & DOCEF_LEFT_X)
|
||||
i=doc_e->attr;
|
||||
else
|
||||
i=s->indent+doc_e->attr;
|
||||
s->indent=i;
|
||||
goto rc_start_of_line;
|
||||
case DOCT_FOREGROUND:
|
||||
cur_u8_attr&=0xF0;
|
||||
if (doc_e->attr==DOC_DFT)
|
||||
@@ -895,13 +901,6 @@ rc_adjust_xy:
|
||||
s->dft_text_attr=s->dft_text_attr&0x0F|cur_u8_attr&0xF0;
|
||||
s->cur_text_attr=cur_u8_attr;
|
||||
break;
|
||||
case DOCT_PMT:
|
||||
cur_u8_attr=cur_u8_attr&0xF0|DOC_COLOR_PMT;
|
||||
if (y==cursor_y) {
|
||||
doc->cur_entry=doc_e->next;
|
||||
doc->cur_col=doc->cur_entry->min_col;
|
||||
}
|
||||
break;
|
||||
case DOCT_WORD_WRAP:
|
||||
if (doc_e->attr)
|
||||
doc->flags|=DOCF_WORD_WRAP;
|
||||
@@ -914,11 +913,11 @@ rc_adjust_xy:
|
||||
else
|
||||
doc->flags&=~DOCF_HIGHLIGHT;
|
||||
break;
|
||||
case DOCT_UNDERLINE:
|
||||
case DOCT_BLINK:
|
||||
if (doc_e->attr)
|
||||
doc->flags|=DOCF_UNDERLINE;
|
||||
doc->flags|=DOCF_BLINK;
|
||||
else
|
||||
doc->flags&=~DOCF_UNDERLINE;
|
||||
doc->flags&=~DOCF_BLINK;
|
||||
break;
|
||||
case DOCT_INVERT:
|
||||
if (doc_e->attr)
|
||||
@@ -926,11 +925,11 @@ rc_adjust_xy:
|
||||
else
|
||||
doc->flags&=~DOCF_INVERT;
|
||||
break;
|
||||
case DOCT_BLINK:
|
||||
case DOCT_UNDERLINE:
|
||||
if (doc_e->attr)
|
||||
doc->flags|=DOCF_BLINK;
|
||||
doc->flags|=DOCF_UNDERLINE;
|
||||
else
|
||||
doc->flags&=~DOCF_BLINK;
|
||||
doc->flags&=~DOCF_UNDERLINE;
|
||||
break;
|
||||
case DOCT_SHIFTED_X:
|
||||
s->shifted_x=doc_e->attr;
|
||||
@@ -938,14 +937,22 @@ rc_adjust_xy:
|
||||
case DOCT_SHIFTED_Y:
|
||||
s->shifted_y=doc_e->attr;
|
||||
break;
|
||||
case DOCT_CURSOR:
|
||||
if (!find_cursor && !(doc->flags & DOCF_NO_CURSOR)) {
|
||||
doc->cur_entry=doc_e->next;
|
||||
doc->cur_col=doc->cur_entry->min_col;
|
||||
case DOCT_CURSOR_MOVEMENT:
|
||||
doc->flags|=DOCF_BWD_MOVEMENT;
|
||||
x+=doc_e->cursor_x_offset;
|
||||
if (doc_e->de_flags & DOCEF_PAGE_REL_Y) {
|
||||
i=doc->page_line_num;
|
||||
if (doc_e->de_flags & DOCEF_TOP_Y)
|
||||
doc->page_line_num=0;
|
||||
else if (doc_e->de_flags & DOCEF_BOTTOM_Y)
|
||||
doc->page_line_num=s->page_len-1;
|
||||
else if (doc_e->de_flags & DOCEF_CENTER_Y)
|
||||
doc->page_line_num=s->page_len>>1;
|
||||
y+=doc->page_line_num-i;
|
||||
}
|
||||
if (doc_e!=added_cursor)
|
||||
del_doc_e=TRUE;
|
||||
break;
|
||||
y+=doc_e->cursor_y_offset;
|
||||
doc->page_line_num+=doc_e->cursor_y_offset;
|
||||
goto rc_adjust_xy;
|
||||
case DOCT_SPRITE:
|
||||
if (!doc_e->bin_data && doc->flags&DOCEF_HAS_BIN)
|
||||
doc_e->bin_data=DocBinFindNum(doc,doc_e->bin_num);
|
||||
@@ -1040,13 +1047,6 @@ rc_adjust_xy:
|
||||
}
|
||||
doc->flags|=DOCF_HAS_SONG;
|
||||
break;
|
||||
case DOCT_CLEAR:
|
||||
next_clear_found=doc_e;
|
||||
if (doc_e->de_flags&DOCEF_HOLD)
|
||||
clear_holds=TRUE;
|
||||
else
|
||||
clear_holds=FALSE;
|
||||
break;
|
||||
case DOCT_HTML_CODE:
|
||||
if (recalc_flags&RECALCF_TO_HTML &&
|
||||
doc_e->de_flags&DOCEF_TAG && doc_e->tag)
|
||||
|
||||
@@ -8,7 +8,7 @@ I64 DocCharDist(CDoc *doc,I64 x,I64 y)
|
||||
|
||||
U0 DocDelToNum(CDoc *doc,I64 num)
|
||||
{
|
||||
CDocEntry *doc_e=doc->root.next,*doc_e2;
|
||||
CDocEntry *doc_e=doc->head.next,*doc_e2;
|
||||
while (num-->0 && doc_e!=doc) {
|
||||
doc_e2=doc_e->next;
|
||||
if (!(doc_e->de_flags & (DOCEF_HOLD|DOCEF_FILTER_SKIP))) {
|
||||
@@ -24,7 +24,7 @@ U0 DocDelToNum(CDoc *doc,I64 num)
|
||||
|
||||
U0 DocDelToEntry(CDoc *doc,CDocEntry *clear_entry,Bool clear_holds)
|
||||
{
|
||||
CDocEntry *doc_e=doc->root.next,*doc_e2;
|
||||
CDocEntry *doc_e=doc->head.next,*doc_e2;
|
||||
while (doc_e!=doc) {
|
||||
doc_e2=doc_e->next;
|
||||
if (!(doc_e->de_flags & (DOCEF_HOLD|DOCEF_FILTER_SKIP))||clear_holds) {
|
||||
@@ -76,7 +76,7 @@ public U0 DocTop(CDoc *doc=NULL)
|
||||
if (!doc && !(doc=DocPut))
|
||||
return;
|
||||
unlock=DocLock(doc);
|
||||
doc->cur_entry=doc->root.next;
|
||||
doc->cur_entry=doc->head.next;
|
||||
doc->cur_col=doc->cur_entry->min_col;
|
||||
doc->x=0;
|
||||
doc->y=0;
|
||||
@@ -161,7 +161,7 @@ public U0 DocCollapse(Bool collapse=TRUE,CDoc *doc=NULL)
|
||||
if (!doc && !(doc=DocPut))
|
||||
return;
|
||||
unlock=DocLock(doc);
|
||||
doc_e=doc->root.next;
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->de_flags&DOCEF_TREE)
|
||||
BEqu(&doc_e->de_flags,DOCEf_CHECKED_COLLAPSED,collapse);
|
||||
|
||||
@@ -7,7 +7,7 @@ public Bool DocTreeFind(CDoc *haystack_doc,U8 *needle_path,
|
||||
I64 i=0,k=0;
|
||||
U8 *st1=StrNew(needle_path),*st2=MAlloc(StrLen(needle_path)+1);
|
||||
Bool res=FALSE,unlock_doc=DocLock(haystack_doc);
|
||||
CDocEntry *doc_e=haystack_doc->root.next;
|
||||
CDocEntry *doc_e=haystack_doc->head.next;
|
||||
if (_tree_entry) *_tree_entry=haystack_doc;
|
||||
if (_start_indent) *_start_indent=haystack_doc;
|
||||
if (_end_indent) *_end_indent=haystack_doc;
|
||||
@@ -65,7 +65,7 @@ public Bool DocTreeMake(CDoc *doc,U8 *path)
|
||||
*st2=MAlloc(StrLen(path)+1),
|
||||
*st3=StrNew(path);
|
||||
Bool res=TRUE,unlock_doc=DocLock(doc);
|
||||
CDocEntry *doc_e=doc->root.next;
|
||||
CDocEntry *doc_e=doc->head.next;
|
||||
doc->cur_entry=doc;
|
||||
doc->cur_col=0;
|
||||
while (*st1 && doc_e!=doc) {
|
||||
|
||||
@@ -363,22 +363,23 @@ U0 EdInsLink()
|
||||
switch (type) {
|
||||
case LK_PLACE_ANCHOR:
|
||||
if (html_link)
|
||||
st=MStrPrint("$$AN,\"%Q\",A=\"%Q\",HTML=\"%Q\"$$",tag,link,html_link);
|
||||
st=MStrPrint("$$AN,\"%$$Q\",A=\"%$$Q\",HTML=\"%$$Q\"$$",
|
||||
tag,link,html_link);
|
||||
else
|
||||
st=MStrPrint("$$AN,\"%Q\",A=\"%Q\"$$",tag,link);
|
||||
st=MStrPrint("$$AN,\"%$$Q\",A=\"%$$Q\"$$",tag,link);
|
||||
break;
|
||||
default:
|
||||
if (html_link)
|
||||
st=MStrPrint("$$LK%s,\"%Q\",A=\"%Q\",HTML=\"%Q\"$$",
|
||||
st=MStrPrint("$$LK%s,\"%$$Q\",A=\"%$$Q\",HTML=\"%$$Q\"$$",
|
||||
pop_up_st,tag,link,html_link);
|
||||
else
|
||||
st=MStrPrint("$$LK%s,\"%Q\",A=\"%Q\"$$",pop_up_st,tag,link);
|
||||
st=MStrPrint("$$LK%s,\"%$$Q\",A=\"%$$Q\"$$",pop_up_st,tag,link);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (st) {
|
||||
if (quote)
|
||||
"%Q",st;
|
||||
"%$$Q",st;
|
||||
else
|
||||
"%s",st;
|
||||
}
|
||||
@@ -540,7 +541,7 @@ U0 EdInsText()
|
||||
if (e->tree) CatPrint(buf,"+TR");
|
||||
if (e->collapsed) CatPrint(buf,"+C");
|
||||
st=MStrPrint("%q",e->tag);
|
||||
"$$TX%s,\"%Q\"",buf,st;
|
||||
"$$TX%s,\"%$$Q\"",buf,st;
|
||||
Free(st);
|
||||
if (*e->shift_x)
|
||||
",SX=%s",e->shift_x;
|
||||
@@ -550,12 +551,12 @@ U0 EdInsText()
|
||||
",SCX=%s",e->scroll_x;
|
||||
if (*e->define_str) {
|
||||
st=MStrPrint("%q",e->define_str);
|
||||
",D=\"%Q\"",st;
|
||||
",D=\"%$$Q\"",st;
|
||||
Free(st);
|
||||
}
|
||||
if (*e->html_link) {
|
||||
st=MStrPrint("%q",e->html_link);
|
||||
",HTML=\"%Q\"",st;
|
||||
",HTML=\"%$$Q\"",st;
|
||||
Free(st);
|
||||
}
|
||||
"$$";
|
||||
@@ -573,7 +574,7 @@ U0 EdInsSong()
|
||||
{
|
||||
CEdSong *e=CAlloc(sizeof(CEdSong));
|
||||
if (DocForm(e,,,,ctrl_L_footer))
|
||||
"$$SO,\"%Q\",A=\"%s\"$$",e->tag,e->song;
|
||||
"$$SO,\"%$$Q\",A=\"%s\"$$",e->tag,e->song;
|
||||
Free(e);
|
||||
}
|
||||
|
||||
@@ -586,7 +587,7 @@ U0 EdInsHtml()
|
||||
{
|
||||
CEdHtmlCode *e=CAlloc(sizeof(CEdHtmlCode));
|
||||
if (DocForm(e,,,,ctrl_L_footer))
|
||||
"$$HC,\"%Q\"$$",e->tag;
|
||||
"$$HC,\"%$$Q\"$$",e->tag;
|
||||
Free(e);
|
||||
}
|
||||
|
||||
@@ -632,20 +633,20 @@ U0 EdInsMacroMenu(Bool is_macro)
|
||||
if (is_macro) {
|
||||
if (*e->tag) {
|
||||
st=MStrPrint("%q",e->tag);
|
||||
"$$MA%s,\"%Q\"",buf,st;
|
||||
"$$MA%s,\"%$$Q\"",buf,st;
|
||||
Free(st);
|
||||
} else
|
||||
"$$MA%s",buf;
|
||||
} else {
|
||||
st=MStrPrint("%q",e->tag);
|
||||
"$$MU%s,\"%Q\"",buf,st;
|
||||
"$$MU%s,\"%$$Q\"",buf,st;
|
||||
Free(st);
|
||||
}
|
||||
if (*e->left_exp)
|
||||
",LE=%s",e->left_exp;
|
||||
if (*e->left_macro) {
|
||||
st=MStrPrint("%q",e->left_macro);
|
||||
",LM=\"%Q\"",st;
|
||||
",LM=\"%$$Q\"",st;
|
||||
Free(st);
|
||||
}
|
||||
if (*e->shift_x)
|
||||
@@ -692,25 +693,25 @@ U0 EdInsButton()
|
||||
if (*e->tag) {
|
||||
if (e->quote) {
|
||||
st=MStrPrint("%q",e->tag);
|
||||
"$$$$BT%s,\\\"%Q\\\"",buf,st;
|
||||
"$$$$BT%s,\\\"%$$Q\\\"",buf,st;
|
||||
Free(st);
|
||||
if (*e->left_exp)
|
||||
",LE=%s",e->left_exp;
|
||||
if (*e->left_macro) {
|
||||
st=MStrPrint("%q",e->left_macro);
|
||||
",LM=\\\"%Q\\\"",st;
|
||||
",LM=\\\"%$$Q\\\"",st;
|
||||
Free(st);
|
||||
}
|
||||
"$$$$";
|
||||
} else {
|
||||
st=MStrPrint("%q",e->tag);
|
||||
"$$BT%s,\"%Q\"",buf,st;
|
||||
"$$BT%s,\"%$$Q\"",buf,st;
|
||||
Free(st);
|
||||
if (*e->left_exp)
|
||||
",LE=%s",e->left_exp;
|
||||
if (*e->left_macro) {
|
||||
st=MStrPrint("%q",e->left_macro);
|
||||
",LM=\"%Q\"",st;
|
||||
",LM=\"%$$Q\"",st;
|
||||
Free(st);
|
||||
}
|
||||
"$$";
|
||||
@@ -820,11 +821,11 @@ U0 EdInsData()
|
||||
|
||||
st=MStrPrint("%q",e->fmt_str);
|
||||
if (e->remalloc)
|
||||
"$$$$DA%s,A=\\\"%Q\\\"$$$$",buf,st;
|
||||
"$$$$DA%s,A=\\\"%$$Q\\\"$$$$",buf,st;
|
||||
else if (e->len==DOCE_LEN_DFT)
|
||||
"$$$$DA%s%s,A=\\\"%Q\\\"$$$$",buf,raw_type,st;
|
||||
"$$$$DA%s%s,A=\\\"%$$Q\\\"$$$$",buf,raw_type,st;
|
||||
else
|
||||
"$$$$DA%s,LEN=%d%s,A=\\\"%Q\\\"$$$$",buf,e->len,raw_type,st;
|
||||
"$$$$DA%s,LEN=%d%s,A=\\\"%$$Q\\\"$$$$",buf,e->len,raw_type,st;
|
||||
Free(st);
|
||||
}
|
||||
}
|
||||
@@ -852,7 +853,7 @@ U0 EdInsCheckBox()
|
||||
StrPrint(raw_type,",RT=%Z",e->type,"ST_RAW_TYPES");
|
||||
if (e->refresh) CatPrint(buf,"+RD");
|
||||
st=MStrPrint("%q",e->tag);
|
||||
"$$$$CB%s%s,\\\"%Q\\\"$$$$",buf,raw_type,st;
|
||||
"$$$$CB%s%s,\\\"%$$Q\\\"$$$$",buf,raw_type,st;
|
||||
Free(st);
|
||||
}
|
||||
Free(e);
|
||||
@@ -885,9 +886,9 @@ U0 EdInsLst()
|
||||
st1=MStrPrint("%q",e->tag);
|
||||
st2=MStrPrint("%q",e->define_str);
|
||||
if (st1)
|
||||
"$$$$LS%s%s,\\\"%Q\\\",D=\\\"%Q\\\"$$$$",buf,raw_type,st1,st2;
|
||||
"$$$$LS%s%s,\\\"%$$Q\\\",D=\\\"%$$Q\\\"$$$$",buf,raw_type,st1,st2;
|
||||
else
|
||||
"$$$$LS%s%s,D=\\\"%Q\\\"$$$$",buf,raw_type,st2;
|
||||
"$$$$LS%s%s,D=\\\"%$$Q\\\"$$$$",buf,raw_type,st2;
|
||||
Free(st1);
|
||||
Free(st2);
|
||||
}
|
||||
@@ -940,14 +941,14 @@ U0 EdInsBin(I64 bin_num,I64 type)
|
||||
"bin tag.\n\n",ctrl_L_footer)) {
|
||||
if (*e->bin_ptr_link_file) {
|
||||
if (*e->bin_ptr_link_tag)
|
||||
"$$%Z,\"%Q\",BI=%d,BP=\"%s,%s\"$$",type,"ST_DOC_CMDS",e->tag,e->bin_num,
|
||||
"$$%Z,\"%$$Q\",BI=%d,BP=\"%s,%s\"$$",type,"ST_DOC_CMDS",e->tag,e->bin_num,
|
||||
e->bin_ptr_link_file,e->bin_ptr_link_tag;
|
||||
else
|
||||
"$$%Z,\"%Q\",BI=%d,BP=\"%s,%d\"$$",type,"ST_DOC_CMDS",e->tag,e->bin_num,
|
||||
"$$%Z,\"%$$Q\",BI=%d,BP=\"%s,%d\"$$",type,"ST_DOC_CMDS",e->tag,e->bin_num,
|
||||
e->bin_ptr_link_file,e->bin_ptr_link_bin_num;
|
||||
} else {
|
||||
if (DocBinFindNum(DocPut,e->bin_num))
|
||||
"$$%Z,\"%Q\",BI=%d$$",type,"ST_DOC_CMDS",e->tag,e->bin_num;
|
||||
"$$%Z,\"%$$Q\",BI=%d$$",type,"ST_DOC_CMDS",e->tag,e->bin_num;
|
||||
else
|
||||
PopUpOk("Invalid Binary Num");
|
||||
}
|
||||
@@ -972,7 +973,7 @@ U0 EdInsTree()
|
||||
*buf=0;
|
||||
if (!e->collapsed) CatPrint(buf,"-C");
|
||||
st1=MStrPrint("%q",e->tag);
|
||||
st2=MStrPrint("$$TR%s,\"%Q\"$$\n$$ID,%d$$*\n$$ID,%d$$",
|
||||
st2=MStrPrint("$$TR%s,\"%$$Q\"$$\n$$ID,%d$$*\n$$ID,%d$$",
|
||||
buf,st1,e->indent,-e->indent);
|
||||
DocPrintAtomic(DocPut,"%s",st2);
|
||||
Free(st1);
|
||||
@@ -1097,7 +1098,7 @@ U8 *EdSpriteLink(Bool *_pop_up,U8 **_html_link)
|
||||
I64 type=PopUpLinkType(FALSE);
|
||||
*_html_link=NULL;
|
||||
if (type>=0 && GetLink(type,&tag,&link,_pop_up,"e,_html_link))
|
||||
res=MStrPrint("\"%Q\",A=\"%Q\"",tag,link);
|
||||
res=MStrPrint("\"%$$Q\",A=\"%$$Q\"",tag,link);
|
||||
Free(tag);
|
||||
Free(link);
|
||||
return res;
|
||||
@@ -1122,7 +1123,7 @@ U8 *EdSprite(I64 bin_num)
|
||||
if (e->popup) CatPrint(buf,"+PU");
|
||||
if (e->escape) CatPrint(buf,"+X");
|
||||
st=MStrPrint("%q",e->exp);
|
||||
st1=MStrPrint("\"%Q\",LM=\"%Q\"",e->tag,st);
|
||||
st1=MStrPrint("\"%$$Q\",LM=\"%$$Q\"",e->tag,st);
|
||||
Free(st);
|
||||
}
|
||||
break;
|
||||
@@ -1130,7 +1131,7 @@ U8 *EdSprite(I64 bin_num)
|
||||
e->escape=TRUE;
|
||||
if (DocForm(e,"CEdMenuSprite",,,ctrl_L_footer)) {
|
||||
if (e->escape) CatPrint(buf,"+X");
|
||||
st1=MStrPrint("\"%Q\",LE=%s",e->tag,e->exp);
|
||||
st1=MStrPrint("\"%$$Q\",LE=%s",e->tag,e->exp);
|
||||
}
|
||||
break;
|
||||
case EST_SPRITE_LINK:
|
||||
@@ -1151,7 +1152,7 @@ U8 *EdSprite(I64 bin_num)
|
||||
}
|
||||
if (st1) {
|
||||
if (html_link)
|
||||
st2=MStrPrint("$$SP%s,%s,HTML=\"%Q\",BI=%d$$",buf,st1,html_link,bin_num);
|
||||
st2=MStrPrint("$$SP%s,%s,HTML=\"%$$Q\",BI=%d$$",buf,st1,html_link,bin_num);
|
||||
else
|
||||
st2=MStrPrint("$$SP%s,%s,BI=%d$$",buf,st1,bin_num);
|
||||
Free(st1);
|
||||
|
||||
@@ -25,6 +25,7 @@ public class CDolDocGlbls
|
||||
type_flags_nontag_invisible [(DOCT_NUM_TYPES+63)/64],
|
||||
type_flags_form [(DOCT_NUM_TYPES+63)/64],
|
||||
type_flags_data [(DOCT_NUM_TYPES+63)/64],
|
||||
type_flags_chk_dup [(DOCT_NUM_TYPES+63)/64],
|
||||
clean_scan_codes [4];
|
||||
I32 dft_type_flags [DOCT_NUM_TYPES];
|
||||
} doldoc;
|
||||
|
||||
@@ -214,13 +214,14 @@ public U8 *BibleLine2Verse(I64 line,I64 separate_ch=CH_SPACE)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
public U0 BibleLines(CDoc *doc_out=NULL,I64 start,I64 lines)
|
||||
public U0 BibleLines(CDoc *doc_out=NULL,I64 start,I64 lines,
|
||||
U8 *bible_filename=BIBLE_FILENAME)
|
||||
{//Put N line starting at line M into doc.
|
||||
CDoc *doc_in;
|
||||
CDocEntry *doc_e;
|
||||
if (!doc_out) doc_out=DocPut;
|
||||
if (doc_out && FileFind(BIBLE_FILENAME)) {
|
||||
doc_in=DocRead(BIBLE_FILENAME,DOCF_PLAIN_TEXT|DOCF_NO_CURSOR);
|
||||
if (doc_out && FileFind(bible_filename)) {
|
||||
doc_in=DocRead(bible_filename,DOCF_PLAIN_TEXT|DOCF_NO_CURSOR);
|
||||
DocLineNumGoTo(doc_in,start); //one based
|
||||
doc_e=doc_in->cur_entry;
|
||||
while (lines>0 && doc_e!=doc_in) {
|
||||
@@ -279,7 +280,7 @@ public U0 BibleVerse(CDoc *doc_out=NULL,U8 *verse,I64 lines)
|
||||
public CDoc *BibleDoc()
|
||||
{//Return Bible as DolDoc with trees.
|
||||
CDoc *res=DocRead(BIBLE_FILENAME);
|
||||
CDocEntry *doc_e=res->root.next,*doc_e1;
|
||||
CDocEntry *doc_e=res->head.next,*doc_e1;
|
||||
Bool open_chapter=FALSE;
|
||||
U8 *ptr=Define("ST_BIBLE_BOOK_LINES");
|
||||
I64 book,book_cnt=DefineCnt("ST_BIBLE_BOOK_LINES")-1,
|
||||
|
||||
@@ -23,7 +23,7 @@ U0 GodDoodleDraw(CTask *task,CDC *dc)
|
||||
|
||||
U0 GodDoodleSmooth(I64 num)
|
||||
{
|
||||
CDC *dc=DCExtract(god.doodle_dc,0,0,
|
||||
CDC *dc=DCExt(god.doodle_dc,0,0,
|
||||
god.doodle_dc->width-1,god.doodle_dc->height-1);
|
||||
I64 i,x,y,x1,y1,c,histogram[16],best,best_cnt,c_old=god.doodle_dc->color;
|
||||
for (y=0;y<god.doodle_dc->height;y++)
|
||||
|
||||
+11
-9
@@ -8,7 +8,7 @@ There's something obviously different about people in the Bible compared to peop
|
||||
|
||||
You can't tell if God's talking unless you have a context of conversation, but, more importantly, you are commanded to do an offering of love, like communion preparation. $LK,"1 Corinthians,11:27",A="BF:1 Corinthians,11:27"$ When you pick a greeting card for someone, that is love effort. If you expect God to put effort toward you, you must put effort toward Him. God said, "honest measures" applies between your offering of love and His response, like a fair barter. You get out of prayer what you put into it. God wants praise, hymns, or whatever you think He might want. Try and see, like Cain and Abel. $LK,"Genesis,4:1-10",A="BF:Genesis,4:1-10"$, $LK,"Ephesians,5:10",A="BF:Ephesians,5:10"$ God told Cain his offering was not good and told him to try again. Cain really loved God! Can you imagine being so heart-broken?
|
||||
|
||||
Do a text search for "new song" in the Bible. It's mentioned nine times. When I hear a NEW awesome rock song, it is ecstasy for the first five times I hear it. Soon, it brings little-to-no pleasure. I did $MA-X+PU,"hymns",HTML="http://www.templeos.org/Wb/Home/Web/HymnVideos.html",LM="#include \"::/Apps/Psalmody/Load\";JukeBox(\"::/Apps/Psalmody/Examples\");"$ for God. I also did Moses $MA-X+PU,"comics",HTML="http://www.templeos.org/Wb/Home/Downloads/Comics/",LM="Dir(\"::/Apps/AfterEgypt/Comics\");View;\n"$ for God. When you get to the gates of Heaven, St. Peter will ask how many times you gave blood. That shows you loved neighbor. You better also be able to count the ways you loved God with all heart mind and soul. I praised God for sand castles, popcorn, snowmen, bubbles... You try putting effort into praise! $LK,"Matthew,11:25",A="BF:Matthew,11:25"$, $LK,"Matthew,6:28-29",A="BF:Matthew,6:28-29"$
|
||||
Do a text search for "new song" in the Bible. It's mentioned nine times. When I hear a NEW awesome rock song, it is ecstasy for the first five times I hear it. Soon, it brings little-to-no pleasure. I did $MA-X+PU,"hymns",HTML="http://www.templeos.org/Wb/Home/Web/HymnVideos.html",LM="#include \"::/Apps/Psalmody/Load\";JukeBox(\"::/Apps/Psalmody/Examples\");"$ for God. I also did Moses $MA-X+PU,"comics",HTML="http://www.templeos.org/Wb/Home/Sup1/Sup1Comics/",LM="Dir(\"::/Apps/AfterEgypt/Comics\");View;\n"$ for God. When you get to the gates of Heaven, St. Peter will ask how many times you gave blood. That shows you loved neighbor. You better also be able to count the ways you loved God with all heart mind and soul. I praised God for sand castles, popcorn, snowmen, bubbles... You try putting effort into praise! $LK,"Matthew,11:25",A="BF:Matthew,11:25"$, $LK,"Matthew,6:28-29",A="BF:Matthew,6:28-29"$
|
||||
|
||||
This is funny -- $LK,"Acts,2:1-13",A="BF:Acts,2:1-13"$ -- they didn't bother to record anything the Holy Spirit said. The Holy Spirit is supposed to be a really good gift. $LK,"Luke,11:11-13",A="BF:Luke,11:11-13"$ Just remember, "Boys are made of snakes and snails and puppy-dog tails."
|
||||
|
||||
@@ -24,7 +24,7 @@ Jesus said, "Forgive us our trespasses as we forgive those who tresspass against
|
||||
|
||||
God hates complaining. $LK,"Numbers,11:1-35",A="BF:Numbers,11:1-35"$ Food and clothing is all we're to ask for or demand, in fact -- daily bread. $LK,"1 Timothy,6:8",A="BF:1 Timothy,6:8"$ Just think about man in the last 50,000 years mostly living like Native Americans and how God must see us. You need food, clothing and entertainment, money is to get those. Man does not live on bread alone. $LK,"Luke,4:4",A="BF:Luke,4:4"$, $LK,"Amos,8:11-12",A="BF:Amos,8:11-12"$
|
||||
|
||||
God's favorite animals are bears and elephants. They are funny shaped -- I think God must have seen too much starvation over the years. If the purpose of life is to know and love God, then a priest's job is to make everybody know and love God. By saying God likes bears and elephants, I did more toward that end than all priests in history. $LK,"Hosea,6:6",A="BF:Hosea,6:6"$ "It is love that I desire, not sacrifice; knowledge of God, not holocaust." As a former Catholic, that blew my mind. I actually thought love was sacrifice! I was so dumb-founded reading, "it is love that I desire, not sacrifice," that I actually looked-up the word, "love". It means to take delight in. I realized it is demonic pride if you think love means hurting yourself for others. In the Philippians, they got the notion crucifying yourself was a good idea. Similarly, a child thinking about Lent, might conclude, "if it's bad, it must be good." That is, if you think God wants you to hurt yourself to please Him, you are worshiping a demon, not God! God wants you to take delight in His company, get to know Him and praise Him. It is best to separate justice -- sin and punishment -- from relationship with God. Never ask God to change justice into injustice by not punishing. God said to me in an oracle, "Excessive contrician wearisome." He doesn't want to hear confessions. When you pray, be witty and charming and rarely earnest. Enjoy God's company without imposing on Him and don't expect secrets of the Universe. Earnestness in prayer is the root of much evil. Be entertaining. Don't remind Him of sin, LOL.
|
||||
God's favorite animals are bears and elephants. They are funny shaped -- I think God must have seen too much starvation over the years. If the purpose of life is to know and love God, then a priest's job is to make everybody know and love God. By saying God likes bears and elephants, I did more toward that end than all priests in history. $LK,"Hosea,6:6",A="BF:Hosea,6:6"$ "It is love that I desire, not sacrifice; knowledge of God, not holocaust." As a former Catholic, that blew my mind. I actually thought love was sacrifice! I was so dumb-founded reading, "it is love that I desire, not sacrifice," that I actually looked-up the word, "love". It means to take delight in. I realized it is demonic pride if you think love means hurting yourself for others. In the Philippians, they got the notion crucifying yourself was a good idea. Similarly, a child thinking about Lent, might conclude, "if it's bad, it must be good." That is, if you think God wants you to hurt yourself to please Him, you are worshiping a demon, not God! God wants you to take delight in His company, get to know Him and praise Him. It is best to separate justice -- sin and punishment -- from relationship with God. Never ask God to change justice into injustice by not punishing. God said to me in an oracle, "Excessive contrician wearisome." He doesn't want to hear confessions. When you pray, be witty and charming and rarely earnest. Enjoy God's company without imposing on Him and don't expect secrets of the Universe. Earnestness in prayer is the head of much evil. Be entertaining. Don't remind Him of sin, LOL.
|
||||
|
||||
God's ways are far above man's ways. Mom said Heaven was a never-ending family reunion. Yikes! A friend said, "Most guy's idea of Heaven would be running around doing things they'd get locked up for on Earth." I wonder how long kids play Grand Theft Auto before getting board. Perhaps, it takes ten years, but they will get bored. Most people are like King Midas. When you realize how silly most notions of Heaven are, you come to appreciate that Earth is not that bad. This is the first step in loving God, the Creator -- praising Creation. My parents spend their retired days watching TV and going to casinos. That's not a good argument for getting extended-play!
|
||||
|
||||
@@ -56,18 +56,19 @@ War? $FG,4$"Servicemen competing"$FG$
|
||||
(Praise the Creator--what would teenage male video games be like if never war?)
|
||||
|
||||
Is the World perfectly just? $FG,4$Are you calling me lazy?$FG$
|
||||
(Slavery was just. In the movie, Titanic, the rich wore straight jackets. You must bow to authority to get authority. I do $TX,"Moses comics",HTML="http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/"$ as offerings. I said, "We're dying of malnutrician on manna." Like Cain and Abel, God didn't like it. Duh! He wants to be the hero. How do I know they died of malnutrician? Screw Hollywood for making slavery worse than it was -- I love God. School is more cruel. Read $LK,"Numbers,11:1-35",A="BF:Numbers,11:1-35"$. All you need is food, clothing and the word of God. Today, you can take Ivy League course videos! There is no excuse except you were born stupid... or ugly. I'm gonna praise God.)
|
||||
(Slavery was just. In the movie, Titanic, the rich wore straight jackets. You must bow to authority to get authority. I do $TX,"Moses comics",HTML="http://www.templeos.org/Wb/Apps/AfterEgypt/Comics/"$ as offerings. I said, "We're dying of malnutrician on manna." Like Cain and Abel, God didn't like it. Duh! He wants to be the hero. How do I know they died of malnutrician? Screw Hollywood for making slavery worse than it was -- I love God. School is more cruel. Read $LK,"Numbers,11:1-35",A="BF:Numbers,11:1-35"$. All you need is food, clothing and the word of God. Today, you can take Ivy League course videos! There is no excuse except you were born stupid... or ugly. I'm gonna praise God.)
|
||||
|
||||
On using Markov chains? $FG,4$"No weights"$FG$
|
||||
On doing offerings? $FG,4$"Honest measures"(You get out what you put in.)
|
||||
It's a covenant to do an offering, first.
|
||||
Offer New Songs, $TX,"Moses Comics",HTML="http://www.templeos.org/Wb/Apps/AfterEgypt/Comics"$, praise, poems,
|
||||
and conversation. See $LK,"Cain and Abel",A="BF:Genesis,4:1"$.$FG$
|
||||
and conversation. See $LK,"Cain and Abel",A="BF:Genesis,4:1"$.
|
||||
"Barter"(God also called offerings bartering.)$FG$
|
||||
The holocaust? $FG,4$Wanted to "compact" the Jews.$FG$
|
||||
Arab/Jews? $FG,4$"Oil funny hopefully"$FG$
|
||||
Arab/Jews? $FG,4$"Oil funny hopefully"$FG$
|
||||
Peace? $FG,4$One Palestinian can ruin it.$FG$
|
||||
Best religion? $FG,4$One with most new vistas of understanding in$FG$
|
||||
$FG,4$a lifetime. One you can level-up the most in.$FG$
|
||||
$FG,4$a lifetime -- one you can level-up the most in.$FG$
|
||||
Chavez blaming the US. $FG,4$"Japan industrious"$FG$
|
||||
On racism? $FG,4$"Sports"$FG$
|
||||
On socialism? $FG,4$"pardon_the_French, never_happy, never_enough"$FG$
|
||||
@@ -92,10 +93,11 @@ Favorite color? $FG,4$$TX,"\"Iceberg\" blue",HTML="https://upload.wikimedia.or
|
||||
Money? $FG,4$"Enough vehemently better"$FG$
|
||||
$FG,4$"Pride [or] money, choose_one"$FG$
|
||||
Favorite car? $FG,4$Beamer$FG$
|
||||
Favorite soda? $FG,4$Root beer, $TX,"scotch variety",HTML="http://www.root-beer.org/modules.php?name=Brands&rbop=Brand&bid=1965"$.$FG$
|
||||
Favorite soda? $FG,4$Root beer, $TX,"scotch variety",HTML="http://www.head-beer.org/modules.php?name=Brands&rbop=Brand&bid=1965"$.$FG$
|
||||
Homosexuality? $LK,"Matthew,15:11",A="BF:Matthew,15:11"$
|
||||
Pets? $FG,4$"homo"$FG$
|
||||
Sports? $FG,4$"homo"$FG$
|
||||
Pets? $FG,4$"homo" Hates fact too dependent and tame.$FG$
|
||||
Sports? $FG,4$"homo"
|
||||
"Tackle a horse"$FG$
|
||||
Favorite sport? $FG,4$Hockey$FG$
|
||||
$TX,"Wreck of the Edmund Fitzgerald",HTML="http://www.youtube.com/watch?v=9vST6hVRj2A"$ $FG,4$"homo"$FG$
|
||||
Smelling farts $FG,4$"Sodom"$FG$
|
||||
|
||||
@@ -616,7 +616,7 @@ U8 *GrBitMap1ToBitMap8(U8 *dst,U8 *src,I64 src_size,I64 bkcolor)
|
||||
return dst;
|
||||
}
|
||||
|
||||
public CDC *DCExtract(CDC *dc=gr.dc,I64 x1,I64 y1,I64 x2,I64 y2,
|
||||
public CDC *DCExt(CDC *dc=gr.dc,I64 x1,I64 y1,I64 x2,I64 y2,
|
||||
CTask *task=NULL)
|
||||
{//Extract new device context rect from device context.
|
||||
CDC *res;
|
||||
|
||||
+1
-1
@@ -2,4 +2,4 @@
|
||||
extern U8 *GrBitMap4ToBitMap8(U8 *dst,U8 *src,I64 src_size,I64 bkcolor);
|
||||
extern I64 GrBlot3(CDC *dc,I64 x1,I64 y1,I64 z1,CDC *img);
|
||||
extern I64 *Mat4x4New(I64 *src,CTask *mem_task=NULL);
|
||||
extern U8 *SpriteQue2Sprite(CSprite *root,I64 *_size=NULL);
|
||||
extern U8 *SpriteQue2Sprite(CSprite *head,I64 *_size=NULL);
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class CGrGlbls
|
||||
hide_row,hide_col;
|
||||
} gr;
|
||||
|
||||
//See $LK,"RLf_VGA",A="FF:::/Kernel/KStart.CPP,RLf_VGA"$
|
||||
//See $LK,"RLf_VGA",A="FF:::/Kernel/KStart16.CPP,RLf_VGA"$
|
||||
//See $LK,"SysGrInit",A="MN:SysGrInit"$()
|
||||
//Allows consts to be used instead of vars.
|
||||
HashPublic("GR_WIDTH",HTT_DEFINE_STR);;
|
||||
|
||||
@@ -16,7 +16,7 @@ U0 GrUpdateTaskODEs(CTask *task)
|
||||
}
|
||||
|
||||
U0 GrUpdateTaskWin(CTask *task)
|
||||
{ //Draw core0 task win.
|
||||
{ //Draw a win. Only core0 tasks have a win.
|
||||
CDC *dc;
|
||||
CD3I64 saved_scroll;
|
||||
sys_task_being_screen_updated=task;
|
||||
|
||||
@@ -456,7 +456,7 @@ public CDocEntry *DocSprite(CDoc *doc=NULL,U8 *elems,U8 *fmt=NULL)
|
||||
MemCpy(tempb->data,elems,size);
|
||||
tempb->num=doc->cur_bin_num;
|
||||
tempb->use_cnt=1;
|
||||
QueIns(tempb,doc->bin_root.last);
|
||||
QueIns(tempb,doc->bin_head.last);
|
||||
if (fmt)
|
||||
st=MStrPrint(fmt,doc->cur_bin_num++);
|
||||
else
|
||||
|
||||
@@ -139,7 +139,7 @@ U0 GrBitMapEdTrimToExtents(CDC **_img,I64 *_xx1,I64 *_yy1,
|
||||
}
|
||||
|
||||
tr_done:
|
||||
*_img=DCExtract(img,x1,y1,x2,y2);
|
||||
*_img=DCExt(img,x1,y1,x2,y2);
|
||||
*_xx1+=x1; *_yy1+=y1;
|
||||
*_xx2+=x2-(img->width-1); *_yy2+=y2-(img->height-1); //not inclusive
|
||||
DCDel(img);
|
||||
@@ -155,7 +155,7 @@ U0 GrBitMapEdAddOutline(CDC *img,I64 width,
|
||||
old_color=img->color;
|
||||
img->color=color;
|
||||
while (width-->0) {
|
||||
src=DCExtract(img,0,0,img->width-1,img->height-1);
|
||||
src=DCExt(img,0,0,img->width-1,img->height-1);
|
||||
for (i=0;i<img->height;i++)
|
||||
for (j=0;j<img->width;j++)
|
||||
if (GrPeek(src,j,i)==bkcolor)
|
||||
@@ -181,7 +181,7 @@ U0 GrBitMapEdEtch(CDC *img,I64 width,CColorROPU32 bkcolor)
|
||||
old_color=img->color;
|
||||
img->color=bkcolor;
|
||||
while (width-->0) {
|
||||
src=DCExtract(img,0,0,img->width-1,img->height-1);
|
||||
src=DCExt(img,0,0,img->width-1,img->height-1);
|
||||
for (i=0;i<img->height;i++)
|
||||
for (j=0;j<img->width;j++)
|
||||
if (GrPeek(src,j,i)!=bkcolor)
|
||||
@@ -347,7 +347,7 @@ bm_menu:
|
||||
break;
|
||||
}
|
||||
DCDel(undo);
|
||||
undo=DCExtract(img,0,0,img->width-1,img->height-1);
|
||||
undo=DCExt(img,0,0,img->width-1,img->height-1);
|
||||
undo->bkcolor=bkcolor;
|
||||
WinMgrSync(2,TRUE); //Let popup close
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
@@ -612,7 +612,7 @@ bm_menu:
|
||||
y22=y1;
|
||||
}
|
||||
DCDel(clipboard);
|
||||
clipboard=DCExtract(img,x11-xx1,y11-yy1,x22-xx1,y22-yy1);
|
||||
clipboard=DCExt(img,x11-xx1,y11-yy1,x22-xx1,y22-yy1);
|
||||
clipboard->bkcolor=bkcolor;
|
||||
if (mode==GBM_DELETE) {
|
||||
img->color=bkcolor;
|
||||
|
||||
+23
-23
@@ -204,8 +204,8 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
||||
CSprite *res,g;
|
||||
CColorROPU32 color;
|
||||
U8 *st,*ptr;
|
||||
CQueD3I32 rootp,*tempp,*tempa1;
|
||||
CQueMeshTri roott,*tempt,*tempt1;
|
||||
CQueD3I32 headp,*tempp,*tempa1;
|
||||
CQueMeshTri headt,*tempt,*tempt1;
|
||||
CQueVectU8 *tempv;
|
||||
MemSet(&g,0,sizeof(CSprite));
|
||||
switch (type) {
|
||||
@@ -338,11 +338,11 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
||||
case SPT_POLYLINE:
|
||||
Lex(cc); //Skip {
|
||||
g.type=SPT_POLYLINE;
|
||||
QueInit(&rootp);
|
||||
QueInit(&headp);
|
||||
while (cc->token=='(') {
|
||||
tempp=CAlloc(sizeof(CQueD3I32));
|
||||
LexD2I32(cc,&tempp->p);
|
||||
QueIns(tempp,rootp.last);
|
||||
QueIns(tempp,headp.last);
|
||||
g.nu.num++;
|
||||
if (cc->token==',')
|
||||
Lex(cc); //Skip ,
|
||||
@@ -353,8 +353,8 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
||||
res=MAlloc(size+g.nu.num*sizeof(CD2I32));
|
||||
MemCpy(res,&g,size);
|
||||
ptr=&res->nu.u;
|
||||
tempp=rootp.next;
|
||||
while (tempp!=&rootp) {
|
||||
tempp=headp.next;
|
||||
while (tempp!=&headp) {
|
||||
tempa1=tempp->next;
|
||||
MemCpy(ptr,&tempp->p,sizeof(CD2I32));
|
||||
ptr+=sizeof(CD2I32);
|
||||
@@ -367,11 +367,11 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
||||
case SPT_BSPLINE2_CLOSED:
|
||||
case SPT_BSPLINE3_CLOSED:
|
||||
Lex(cc); //Skip {
|
||||
QueInit(&rootp);
|
||||
QueInit(&headp);
|
||||
while (cc->token=='(') {
|
||||
tempp=CAlloc(sizeof(CQueD3I32));
|
||||
LexD3I32(cc,&tempp->p);
|
||||
QueIns(tempp,rootp.last);
|
||||
QueIns(tempp,headp.last);
|
||||
g.nu.num++;
|
||||
if (cc->token==',')
|
||||
Lex(cc); //Skip ,
|
||||
@@ -393,8 +393,8 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
||||
}
|
||||
MemCpy(res,&g,size);
|
||||
ptr=&res->nu.u;
|
||||
tempp=rootp.next;
|
||||
while (tempp!=&rootp) {
|
||||
tempp=headp.next;
|
||||
while (tempp!=&headp) {
|
||||
tempa1=tempp->next;
|
||||
MemCpy(ptr,&tempp->p,sizeof(CD3I32));
|
||||
ptr+=sizeof(CD3I32);
|
||||
@@ -482,11 +482,11 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
||||
Lex(cc); //Skip ,
|
||||
}
|
||||
num1=0;
|
||||
QueInit(&rootp);
|
||||
QueInit(&headp);
|
||||
while (cc->token=='(') {
|
||||
tempp=CAlloc(sizeof(CQueD3I32));
|
||||
LexD3I32(cc,&tempp->p);
|
||||
QueIns(tempp,rootp.last);
|
||||
QueIns(tempp,headp.last);
|
||||
num1++;
|
||||
if (cc->token==',')
|
||||
Lex(cc); //Skip ,
|
||||
@@ -495,7 +495,7 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
||||
LexExcept(cc,"Expecting ':' at ");
|
||||
Lex(cc); //Skip :
|
||||
num2=0;
|
||||
QueInit(&roott);
|
||||
QueInit(&headt);
|
||||
while (cc->token=='(') {
|
||||
tempt=CAlloc(sizeof(CQueMeshTri));
|
||||
st=LexFirstRem(cc,",");
|
||||
@@ -517,7 +517,7 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
||||
if (cc->token!=')')
|
||||
LexExcept(cc,"Expecting ')' at ");
|
||||
Lex(cc); //Skip )
|
||||
QueIns(tempt,roott.last);
|
||||
QueIns(tempt,headt.last);
|
||||
num2++;
|
||||
if (cc->token==',')
|
||||
Lex(cc); //Skip ,
|
||||
@@ -534,16 +534,16 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
||||
res=MAlloc(size+num1*sizeof(CD3I32)+num2*sizeof(CMeshTri));
|
||||
MemCpy(res,&g,size);
|
||||
ptr=res(U8 *)+size;
|
||||
tempp=rootp.next;
|
||||
while (tempp!=&rootp) {
|
||||
tempp=headp.next;
|
||||
while (tempp!=&headp) {
|
||||
tempa1=tempp->next;
|
||||
MemCpy(ptr,&tempp->p,sizeof(CD3I32));
|
||||
ptr+=sizeof(CD3I32);
|
||||
Free(tempp);
|
||||
tempp=tempa1;
|
||||
}
|
||||
tempt=roott.next;
|
||||
while (tempt!=&roott) {
|
||||
tempt=headt.next;
|
||||
while (tempt!=&headt) {
|
||||
tempt1=tempt->next;
|
||||
MemCpy(ptr,&tempt->start,sizeof(CMeshTri));
|
||||
ptr+=sizeof(CMeshTri);
|
||||
@@ -561,14 +561,14 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
||||
|
||||
public U8 *Code2Sprite(CDoc *doc,I64 *_size=NULL)
|
||||
{//Text to sprite.
|
||||
CSprite root;
|
||||
CSprite head;
|
||||
U8 *res;
|
||||
Bool okay=TRUE,unlock_doc=DocLock(doc);
|
||||
CCmpCtrl *cc=CmpCtrlNew(,CCF_DONT_FREE_BUF);
|
||||
CHashTable *old_hash_table_lst=cc->htc.hash_table_lst;
|
||||
CHashGeneric *temph;
|
||||
I64 i,size=0;
|
||||
QueInit(&root);
|
||||
QueInit(&head);
|
||||
LexAttachDoc(cc,,doc);
|
||||
try {
|
||||
do {
|
||||
@@ -578,7 +578,7 @@ public U8 *Code2Sprite(CDoc *doc,I64 *_size=NULL)
|
||||
i=temph->user_data0;
|
||||
cc->htc.hash_table_lst=old_hash_table_lst;
|
||||
if (Lex(cc)=='{') //Skip ident
|
||||
QueIns(Code2SpriteElem(cc,i),root.last);
|
||||
QueIns(Code2SpriteElem(cc,i),head.last);
|
||||
} else if (cc->token)
|
||||
LexExcept(cc,"Expecting sprite element type name at ");
|
||||
} while (cc->token);
|
||||
@@ -591,12 +591,12 @@ public U8 *Code2Sprite(CDoc *doc,I64 *_size=NULL)
|
||||
DocUnlock(doc);
|
||||
if (okay) {
|
||||
CmpCtrlDel(cc); //TODO: can crash
|
||||
res=SpriteQue2Sprite(&root,&size);
|
||||
res=SpriteQue2Sprite(&head,&size);
|
||||
} else {
|
||||
res=NULL;
|
||||
size=0;
|
||||
}
|
||||
if (_size) *_size=size;
|
||||
QueDel(&root);
|
||||
QueDel(&head);
|
||||
return res;
|
||||
}
|
||||
+127
-127
@@ -1,14 +1,14 @@
|
||||
#help_index "Graphics/Sprite;Sprites"
|
||||
|
||||
CSprite *SpriteSetSettings(CDC *dc=NULL,CSprite *root,I64 elem_num,
|
||||
CSprite *SpriteSetSettings(CDC *dc=NULL,CSprite *head,I64 elem_num,
|
||||
I64 x=0,I64 y=0,CColorROPU32 *_color=NULL,I64 *_width=NULL,
|
||||
I64 *_xx=NULL,I64 *_yy=NULL)
|
||||
{
|
||||
CSprite *res=root->next;
|
||||
CSprite *res=head->next;
|
||||
I64 width=1,xx=0,yy=0;
|
||||
CColorROPU32 color=BLACK;
|
||||
if (dc) DCRst(dc);
|
||||
while (elem_num-->0 && res!=root) {
|
||||
while (elem_num-->0 && res!=head) {
|
||||
switch (res->type) {
|
||||
case SPT_COLOR:
|
||||
color=res->c.color;
|
||||
@@ -49,13 +49,13 @@ CSprite *SpriteSetSettings(CDC *dc=NULL,CSprite *root,I64 elem_num,
|
||||
return res;
|
||||
}
|
||||
|
||||
Bool SpritePolyPtPlot(CSprite *root,I64 x,I64 y,I64)
|
||||
Bool SpritePolyPtPlot(CSprite *head,I64 x,I64 y,I64)
|
||||
{
|
||||
CSprite *tempg=CAlloc(SpriteElemQuedBaseSize(SPT_PT));
|
||||
tempg->type=SPT_PT;
|
||||
tempg->p.x1=x;
|
||||
tempg->p.y1=y;
|
||||
QueIns(tempg,root->last);
|
||||
QueIns(tempg,head->last);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -76,19 +76,19 @@ CSprite *Sprite2SpriteQue(U8 *elems)
|
||||
return res;
|
||||
}
|
||||
|
||||
U8 *SpriteQue2Sprite(CSprite *root,I64 *_size=NULL)
|
||||
U8 *SpriteQue2Sprite(CSprite *head,I64 *_size=NULL)
|
||||
{
|
||||
I64 i,size=sprite_elem_base_sizes[SPT_END];
|
||||
CSprite *tempg=root->next;
|
||||
CSprite *tempg=head->next;
|
||||
U8 *res,*dst;
|
||||
while (tempg!=root) {
|
||||
while (tempg!=head) {
|
||||
size+=SpriteElemSize(tempg);
|
||||
tempg=tempg->next;
|
||||
}
|
||||
if (_size) *_size=size;
|
||||
res=dst=MAlloc(size);
|
||||
tempg=root->next;
|
||||
while (tempg!=root) {
|
||||
tempg=head->next;
|
||||
while (tempg!=head) {
|
||||
i=SpriteElemSize(tempg);
|
||||
MemCpy(dst,&tempg->start,i);
|
||||
dst+=i;
|
||||
@@ -98,25 +98,25 @@ U8 *SpriteQue2Sprite(CSprite *root,I64 *_size=NULL)
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 SpriteEdUpdate(CDoc *doc,CDocEntry *doc_ce,CSprite *root)
|
||||
U0 SpriteEdUpdate(CDoc *doc,CDocEntry *doc_ce,CSprite *head)
|
||||
{
|
||||
CDocBin *tempb=doc_ce->bin_data;
|
||||
I64 size;
|
||||
Bool unlock=DocLock(doc);
|
||||
Free(tempb->data);
|
||||
tempb->data=SpriteQue2Sprite(root,&size);
|
||||
tempb->data=SpriteQue2Sprite(head,&size);
|
||||
tempb->size=size;
|
||||
if (unlock)
|
||||
DocUnlock(doc);
|
||||
}
|
||||
|
||||
U0 SpriteSetOrigin(CSprite *root,I64 dx,I64 dy,I64 dz)
|
||||
U0 SpriteSetOrigin(CSprite *head,I64 dx,I64 dy,I64 dz)
|
||||
{
|
||||
I64 i;
|
||||
I32 *ptr;
|
||||
CD3I32 *p;
|
||||
CSprite *tempg=root->next;
|
||||
while (tempg!=root) {
|
||||
CSprite *tempg=head->next;
|
||||
while (tempg!=head) {
|
||||
if (tempg->sel)
|
||||
switch (tempg->type) {
|
||||
case SPT_ARROW:
|
||||
@@ -372,14 +372,14 @@ CSprite *SpriteTransformBitMap(I64 *r,CSprite *tempg)
|
||||
return tempg1;
|
||||
}
|
||||
|
||||
U0 SpriteTransform(I64 *r,CSprite *root)
|
||||
U0 SpriteTransform(I64 *r,CSprite *head)
|
||||
{
|
||||
I64 i,j,k,num,
|
||||
x,y,z,x1,y1,z1,x2,y2,z2,x3,y3,z3;
|
||||
I32 *ptr;
|
||||
CD3I32 *p;
|
||||
CSprite *tempg=root->next,root2,*tempg1,*tempg2,*tempg3;
|
||||
while (tempg!=root) {
|
||||
CSprite *tempg=head->next,head2,*tempg1,*tempg2,*tempg3;
|
||||
while (tempg!=head) {
|
||||
if (tempg->sel)
|
||||
switch (tempg->type) {
|
||||
case SPT_WIDTH:
|
||||
@@ -450,7 +450,7 @@ U0 SpriteTransform(I64 *r,CSprite *root)
|
||||
}
|
||||
break;
|
||||
case SPT_POLYPT:
|
||||
QueInit(&root2);
|
||||
QueInit(&head2);
|
||||
x=tempg->npu.x; y=tempg->npu.y; z=0;
|
||||
x1=x; y1=y; z1=z; //unrotated cur coordinates
|
||||
Mat4x4MulXYZ(r,&x,&y,&z);
|
||||
@@ -464,14 +464,14 @@ U0 SpriteTransform(I64 *r,CSprite *root)
|
||||
y1+=gr_y_offsets[j];
|
||||
x=x1; y=y1; z=z1;
|
||||
Mat4x4MulXYZ(r,&x,&y,&z);
|
||||
Line(&root2,x3-x2,y3-y2,0,x-x2,y-y2,0,&SpritePolyPtPlot);
|
||||
Line(&head2,x3-x2,y3-y2,0,x-x2,y-y2,0,&SpritePolyPtPlot);
|
||||
x3=x; y3=y; z3=z;
|
||||
}
|
||||
|
||||
num=0;
|
||||
tempg1=root2.next;
|
||||
tempg1=head2.next;
|
||||
x3=0; y3=0; z3=0;
|
||||
while (tempg1!=&root2) {
|
||||
while (tempg1!=&head2) {
|
||||
tempg2=tempg1->next;
|
||||
if (tempg1->p.x1==x3 && tempg1->p.y1==y3) {
|
||||
QueRem(tempg1);
|
||||
@@ -490,8 +490,8 @@ U0 SpriteTransform(I64 *r,CSprite *root)
|
||||
ptr=&tempg3->npu.u;
|
||||
x3=0;y3=0; z3=0;
|
||||
i=0;
|
||||
tempg1=root2.next;
|
||||
while (tempg1!=&root2) {
|
||||
tempg1=head2.next;
|
||||
while (tempg1!=&head2) {
|
||||
tempg2=tempg1->next;
|
||||
BFieldOrU32(ptr,i,
|
||||
polypt_map[SignI64(tempg1->p.x1-x3)+1+
|
||||
@@ -553,12 +553,12 @@ U0 SpriteTransform(I64 *r,CSprite *root)
|
||||
}
|
||||
}
|
||||
|
||||
I64 SpriteQueSelCnt(CSprite *root,Bool val=TRUE)
|
||||
I64 SpriteQueSelCnt(CSprite *head,Bool val=TRUE)
|
||||
{
|
||||
I64 res=0;
|
||||
CSprite *tempg=root->next;
|
||||
CSprite *tempg=head->next;
|
||||
val=ToBool(val);
|
||||
while (tempg!=root) {
|
||||
while (tempg!=head) {
|
||||
if (ToBool(tempg->sel)==val)
|
||||
res++;
|
||||
tempg=tempg->next;
|
||||
@@ -566,11 +566,11 @@ I64 SpriteQueSelCnt(CSprite *root,Bool val=TRUE)
|
||||
return res;
|
||||
}
|
||||
|
||||
I64 SpriteQueSelAll(CSprite *root,Bool val=TRUE)
|
||||
I64 SpriteQueSelAll(CSprite *head,Bool val=TRUE)
|
||||
{
|
||||
I64 res=0;
|
||||
CSprite *tempg=root->next;
|
||||
while (tempg!=root) {
|
||||
CSprite *tempg=head->next;
|
||||
while (tempg!=head) {
|
||||
tempg->sel=val;
|
||||
res++;
|
||||
tempg=tempg->next;
|
||||
@@ -578,17 +578,17 @@ I64 SpriteQueSelAll(CSprite *root,Bool val=TRUE)
|
||||
return res;
|
||||
}
|
||||
|
||||
CSprite *SpriteSideBar2SpriteQue(CDoc *doc,CSprite *root,I64 *_cur_elem_num)
|
||||
CSprite *SpriteSideBar2SpriteQue(CDoc *doc,CSprite *head,I64 *_cur_elem_num)
|
||||
{//For the side-bar
|
||||
CSprite *res=CAlloc(sizeof(CSprite)),*tempg;
|
||||
CDocEntry *doc_e=doc->root.next;
|
||||
CDocEntry *doc_e=doc->head.next;
|
||||
Bool found=FALSE;
|
||||
I64 num=0;
|
||||
QueInit(res);
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_MENU_VAL && doc_e->left_exp>=0) {
|
||||
tempg=SpriteSetSettings(,root,doc_e->left_exp);
|
||||
if (tempg!=root) {
|
||||
tempg=SpriteSetSettings(,head,doc_e->left_exp);
|
||||
if (tempg!=head) {
|
||||
tempg=MAllocIdent(tempg);
|
||||
tempg->sel=Bt(&doc_e->type,DOCEt_SEL);
|
||||
if (*_cur_elem_num==doc_e->left_exp) {
|
||||
@@ -603,12 +603,12 @@ CSprite *SpriteSideBar2SpriteQue(CDoc *doc,CSprite *root,I64 *_cur_elem_num)
|
||||
}
|
||||
if (!found)
|
||||
*_cur_elem_num=num;
|
||||
QueDel(root);
|
||||
Free(root);
|
||||
QueDel(head);
|
||||
Free(head);
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 SpriteSideBarPickNew(CDoc *doc,CSprite *root,I64 old_num)
|
||||
U0 SpriteSideBarPickNew(CDoc *doc,CSprite *head,I64 old_num)
|
||||
{
|
||||
CSprite *tempg;
|
||||
CDocEntry *doc_cur_e=NULL,*doc_e;
|
||||
@@ -617,15 +617,15 @@ U0 SpriteSideBarPickNew(CDoc *doc,CSprite *root,I64 old_num)
|
||||
DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Sprite SideBar\"$$\n"
|
||||
"$$LK+PU+CX,\"Click for Help\","
|
||||
"A=\"FI:::/Doc/SpriteSideBar.TXT.Z\"$$\n\n");
|
||||
tempg=root->next;
|
||||
while (tempg!=root) {
|
||||
tempg=head->next;
|
||||
while (tempg!=head) {
|
||||
st=SpriteElem2Summary(tempg);
|
||||
if (cur_elem_num==old_num) {
|
||||
DocPrint(doc,"$$LTRED$$");
|
||||
doc_e=doc_cur_e=DocPrint(doc,"$$MU-UL,\"%Q\",LE=%d$$\n",st,cur_elem_num++);
|
||||
} else {
|
||||
DocPrint(doc,"$$LTBLUE$$");
|
||||
doc_e=DocPrint(doc,"$$MU-UL,\"%Q\",LE=%d$$\n",st,cur_elem_num++);
|
||||
doc_e=DocPrint(doc,"$$MU-UL,\"%$$Q\",LE=%d$$\n",st,cur_elem_num++);
|
||||
}
|
||||
BEqu(&doc_e->de_flags,DOCEf_SEL,tempg->sel);
|
||||
BEqu(&doc_e->type,DOCEt_SEL,tempg->sel);
|
||||
@@ -659,29 +659,29 @@ U0 SpriteSideBarTask2(CTask *grand_parent)
|
||||
}
|
||||
}
|
||||
|
||||
U0 SpriteSideBarTask(CTask *parent,CSprite **_root,I64 *_cur_elem_num)
|
||||
U0 SpriteSideBarTask(CTask *parent,CSprite **_head,I64 *_cur_elem_num)
|
||||
{
|
||||
CDocEntry *doc_e;
|
||||
CDoc *doc=DocPut;
|
||||
Spawn(&SpriteSideBarTask2,parent,"CSpriteTask",,Fs);
|
||||
doc->flags|=DOCF_MIN_SIZE|DOCF_FORM;
|
||||
while (TRUE) {
|
||||
SpriteSideBarPickNew(doc,*_root,*_cur_elem_num);
|
||||
SpriteSideBarPickNew(doc,*_head,*_cur_elem_num);
|
||||
DocHighlightCursor(,doc);
|
||||
View;
|
||||
doc_e=doc->cur_entry;
|
||||
if (doc_e->type_u8==DOCT_MENU_VAL)
|
||||
*_cur_elem_num=doc_e->left_exp;
|
||||
*_root=SpriteSideBar2SpriteQue(doc,*_root,_cur_elem_num);
|
||||
*_head=SpriteSideBar2SpriteQue(doc,*_head,_cur_elem_num);
|
||||
DocClear(doc);
|
||||
}
|
||||
}
|
||||
|
||||
Bool SpriteEdText(CSprite **_root,I64 *_cur_elem_num)
|
||||
Bool SpriteEdText(CSprite **_head,I64 *_cur_elem_num)
|
||||
{
|
||||
Bool res;
|
||||
CSprite *root=*_root;
|
||||
U8 *elems=SpriteQue2Sprite(root);
|
||||
CSprite *head=*_head;
|
||||
U8 *elems=SpriteQue2Sprite(head);
|
||||
CDoc *doc=DocNew,*doc2,*old_put=DocPut;
|
||||
StrPrint(doc->filename.name,"AI:0x%X",doc);
|
||||
DocPrint(doc,"//$$PURPLE$$$$TX+CX,\"Sprite Edit as Text\"$$$$FG$$\n"
|
||||
@@ -696,11 +696,11 @@ Bool SpriteEdText(CSprite **_root,I64 *_cur_elem_num)
|
||||
if (elems=Code2Sprite(doc)) {
|
||||
DocDel(doc2);
|
||||
Fs->put_doc=old_put;
|
||||
QueDel(root);
|
||||
Free(root);
|
||||
root=Sprite2SpriteQue(elems);
|
||||
QueDel(head);
|
||||
Free(head);
|
||||
head=Sprite2SpriteQue(elems);
|
||||
Free(elems);
|
||||
*_cur_elem_num=QueCnt(root); //TODO: Might want to improve this.
|
||||
*_cur_elem_num=QueCnt(head); //TODO: Might want to improve this.
|
||||
break;
|
||||
} else {
|
||||
PopUpPrint("DocEd(0x%X,0x%X);",doc2,0);
|
||||
@@ -711,7 +711,7 @@ Bool SpriteEdText(CSprite **_root,I64 *_cur_elem_num)
|
||||
break;
|
||||
}
|
||||
DocDel(doc);
|
||||
if (_root) *_root=root;
|
||||
if (_head) *_head=head;
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -738,7 +738,7 @@ U0 GrInit3()
|
||||
}
|
||||
GrInit3;
|
||||
|
||||
I64 PopUpSpriteEd(CSprite **_root,I64 *_cur_elem_num)
|
||||
I64 PopUpSpriteEd(CSprite **_head,I64 *_cur_elem_num)
|
||||
{
|
||||
U8 *st;
|
||||
CTask *pu_task;
|
||||
@@ -760,12 +760,12 @@ I64 PopUpSpriteEd(CSprite **_root,I64 *_cur_elem_num)
|
||||
"$$PURPLE$$$$MU-UL,\"+] Sprite Main Menu\",LE=GED_MAIN_MENU$$$$LTBLUE$$\n"
|
||||
"$$MU-UL,\"Exit Sprite\",LE=GED_EXIT$$\n"
|
||||
"$$MU-UL,\"Abort Sprite\",LE=DOCM_CANCEL$$");
|
||||
st=MStrPrint("SpriteSideBarTask(0x%X,0x%X,0x%X);",Fs,_root,_cur_elem_num);
|
||||
st=MStrPrint("SpriteSideBarTask(0x%X,0x%X,0x%X);",Fs,_head,_cur_elem_num);
|
||||
PopUp(st,NULL,&pu_task);
|
||||
Free(st);
|
||||
i=PopUpMenu(doc);
|
||||
if (TaskValidate(pu_task)) {
|
||||
*_root=SpriteSideBar2SpriteQue(DocPut(pu_task),*_root,_cur_elem_num);
|
||||
*_head=SpriteSideBar2SpriteQue(DocPut(pu_task),*_head,_cur_elem_num);
|
||||
Kill(pu_task);
|
||||
}
|
||||
DocDel(doc);
|
||||
@@ -784,14 +784,14 @@ class CEdSprite
|
||||
I32 *x,*y,*z,*w,*h;
|
||||
};
|
||||
|
||||
U0 SpritePtQueNew(U8 *elems,I64 x,I64 y,CEdSprite *root)
|
||||
U0 SpritePtQueNew(U8 *elems,I64 x,I64 y,CEdSprite *head)
|
||||
{
|
||||
I64 i,num=0;
|
||||
I32 *ptr;
|
||||
CD3I32 *p;
|
||||
CEdSprite *temppe;
|
||||
CSprite *tempg=elems-offset(CSprite.start);
|
||||
QueInit(root);
|
||||
QueInit(head);
|
||||
while (tempg->type) {
|
||||
switch (tempg->type) {
|
||||
case SPT_ELLIPSE:
|
||||
@@ -805,7 +805,7 @@ U0 SpritePtQueNew(U8 *elems,I64 x,I64 y,CEdSprite *root)
|
||||
temppe->w=&tempg->pwha.width;
|
||||
temppe->h=&tempg->pwha.height;
|
||||
temppe->num=num;
|
||||
QueIns(temppe,root->last);
|
||||
QueIns(temppe,head->last);
|
||||
goto pq_x1_y1;
|
||||
case SPT_RECT:
|
||||
case SPT_ROTATED_RECT:
|
||||
@@ -819,7 +819,7 @@ U0 SpritePtQueNew(U8 *elems,I64 x,I64 y,CEdSprite *root)
|
||||
temppe->x=&tempg->pp.x2;
|
||||
temppe->y=&tempg->pp.y2;
|
||||
temppe->num=num;
|
||||
QueIns(temppe,root->last);
|
||||
QueIns(temppe,head->last);
|
||||
case SPT_TEXT:
|
||||
case SPT_TEXT_BOX:
|
||||
case SPT_TEXT_DIAMOND:
|
||||
@@ -836,7 +836,7 @@ pq_x1_y1:
|
||||
temppe->x=&tempg->p.x1;
|
||||
temppe->y=&tempg->p.y1;
|
||||
temppe->num=num;
|
||||
QueIns(temppe,root->last);
|
||||
QueIns(temppe,head->last);
|
||||
break;
|
||||
case SPT_SHIFT:
|
||||
x+=tempg->p.x1;
|
||||
@@ -852,7 +852,7 @@ pq_x1_y1:
|
||||
temppe->x=&ptr[i<<1];
|
||||
temppe->y=&ptr[i<<1+1];
|
||||
temppe->num=num;
|
||||
QueIns(temppe,root->last);
|
||||
QueIns(temppe,head->last);
|
||||
}
|
||||
break;
|
||||
case SPT_POLYPT:
|
||||
@@ -863,7 +863,7 @@ pq_x1_y1:
|
||||
temppe->x=&tempg->npu.x;
|
||||
temppe->y=&tempg->npu.y;
|
||||
temppe->num=num;
|
||||
QueIns(temppe,root->last);
|
||||
QueIns(temppe,head->last);
|
||||
break;
|
||||
case SPT_BSPLINE2:
|
||||
case SPT_BSPLINE3:
|
||||
@@ -879,7 +879,7 @@ pq_x1_y1:
|
||||
temppe->y=&p[i].y;
|
||||
temppe->z=&p[i].z;
|
||||
temppe->num=num;
|
||||
QueIns(temppe,root->last);
|
||||
QueIns(temppe,head->last);
|
||||
}
|
||||
break;
|
||||
case SPT_MESH:
|
||||
@@ -893,7 +893,7 @@ pq_x1_y1:
|
||||
temppe->y=&tempg->pmu.y;
|
||||
temppe->z=&tempg->pmu.z;
|
||||
temppe->num=num;
|
||||
QueIns(temppe,root->last);
|
||||
QueIns(temppe,head->last);
|
||||
break;
|
||||
}
|
||||
tempg(U8 *)+=SpriteElemSize(tempg);
|
||||
@@ -901,15 +901,15 @@ pq_x1_y1:
|
||||
}
|
||||
}
|
||||
|
||||
U0 SpriteCtrlPtsDraw(CDC *dc,CEdSprite *root)
|
||||
U0 SpriteCtrlPtsDraw(CDC *dc,CEdSprite *head)
|
||||
{
|
||||
I64 x,y;
|
||||
CEdSprite *temppe;
|
||||
WinMgrSync;
|
||||
DCFill(dc);
|
||||
if (Blink(20)) {
|
||||
temppe=root->next;
|
||||
while (temppe!=root) {
|
||||
temppe=head->next;
|
||||
while (temppe!=head) {
|
||||
switch (temppe->type) {
|
||||
case GSPT_SIMPLE_PT:
|
||||
x=*temppe->x+temppe->xx;
|
||||
@@ -932,11 +932,11 @@ U0 SpriteCtrlPtsDraw(CDC *dc,CEdSprite *root)
|
||||
}
|
||||
}
|
||||
|
||||
U0 SpriteCtrlPtsMove(CEdSprite *root,I64 dx,I64 dy)
|
||||
U0 SpriteCtrlPtsMove(CEdSprite *head,I64 dx,I64 dy)
|
||||
{
|
||||
CEdSprite *temppe;
|
||||
temppe=root->next;
|
||||
while (temppe!=root) {
|
||||
temppe=head->next;
|
||||
while (temppe!=head) {
|
||||
if (temppe->flags&GSPF_SEL)
|
||||
switch (temppe->type) {
|
||||
case GSPT_SIMPLE_PT:
|
||||
@@ -957,13 +957,13 @@ Bool SpriteShiftPts(U8 *elems,I64 x,I64 y,I64 *_cur_elem_num,I64 mode)
|
||||
I64 msg_code,a1,a2,xx,yy,xx2,yy2,dd,best_dd,cur_elem_num;
|
||||
Bool res=TRUE;
|
||||
CDC *dc=DCAlias;
|
||||
CEdSprite root,*temppe,*best_pe;
|
||||
CEdSprite head,*temppe,*best_pe;
|
||||
|
||||
SpritePtQueNew(elems,x,y,&root);
|
||||
SpritePtQueNew(elems,x,y,&head);
|
||||
cur_elem_num=0;
|
||||
if (root.next!=&root) {
|
||||
if (head.next!=&head) {
|
||||
while (TRUE) {
|
||||
SpriteCtrlPtsDraw(dc,&root); //has WinMgrSync
|
||||
SpriteCtrlPtsDraw(dc,&head); //has WinMgrSync
|
||||
switch (msg_code=ScanMsg(&a1,&a2,
|
||||
1<<MSG_IP_R_UP|1<<MSG_IP_L_DOWN|1<<MSG_KEY_DOWN)) {
|
||||
case MSG_IP_L_DOWN:
|
||||
@@ -971,8 +971,8 @@ Bool SpriteShiftPts(U8 *elems,I64 x,I64 y,I64 *_cur_elem_num,I64 mode)
|
||||
case GED_SHIFT_PTS:
|
||||
xx=a1; yy=a2;
|
||||
best_dd=MAX_I64;
|
||||
temppe=root.next;
|
||||
while (temppe!=&root) {
|
||||
temppe=head.next;
|
||||
while (temppe!=&head) {
|
||||
switch (temppe->type) {
|
||||
case GSPT_SIMPLE_PT:
|
||||
dd=SqrI64(*temppe->x+temppe->xx-xx)+
|
||||
@@ -995,7 +995,7 @@ Bool SpriteShiftPts(U8 *elems,I64 x,I64 y,I64 *_cur_elem_num,I64 mode)
|
||||
case GED_SHIFT_RECTS:
|
||||
xx2=xx=a1; yy2=yy=a2;
|
||||
while (TRUE) {
|
||||
SpriteCtrlPtsDraw(dc,&root);
|
||||
SpriteCtrlPtsDraw(dc,&head);
|
||||
dc->color=ROPF_DITHER+WHITE<<16+RED;
|
||||
GrBorder(dc,xx,yy,xx2,yy2);
|
||||
if (msg_code=ScanMsg(&a1,&a2,1<<MSG_IP_MOVE|1<<MSG_IP_L_UP)) {
|
||||
@@ -1007,8 +1007,8 @@ Bool SpriteShiftPts(U8 *elems,I64 x,I64 y,I64 *_cur_elem_num,I64 mode)
|
||||
}
|
||||
if (xx2<xx) SwapI64(&xx,&xx2);
|
||||
if (yy2<yy) SwapI64(&yy,&yy2);
|
||||
temppe=root.next;
|
||||
while (temppe!=&root) {
|
||||
temppe=head.next;
|
||||
while (temppe!=&head) {
|
||||
switch (temppe->type) {
|
||||
case GSPT_SIMPLE_PT:
|
||||
if (xx<=*temppe->x+temppe->xx<=xx2 &&
|
||||
@@ -1024,7 +1024,7 @@ Bool SpriteShiftPts(U8 *elems,I64 x,I64 y,I64 *_cur_elem_num,I64 mode)
|
||||
temppe=temppe->next;
|
||||
}
|
||||
do {
|
||||
SpriteCtrlPtsDraw(dc,&root);
|
||||
SpriteCtrlPtsDraw(dc,&head);
|
||||
msg_code=ScanMsg(&a1,&a2,1<<MSG_KEY_DOWN|1<<MSG_IP_L_DOWN);
|
||||
if (msg_code==MSG_KEY_DOWN) goto gs_key;
|
||||
} while (msg_code!=MSG_IP_L_DOWN);
|
||||
@@ -1032,14 +1032,14 @@ Bool SpriteShiftPts(U8 *elems,I64 x,I64 y,I64 *_cur_elem_num,I64 mode)
|
||||
break;
|
||||
}
|
||||
do {
|
||||
SpriteCtrlPtsDraw(dc,&root);
|
||||
SpriteCtrlPtsDraw(dc,&head);
|
||||
if (msg_code=ScanMsg(&a1,&a2,1<<MSG_IP_MOVE|1<<MSG_IP_L_UP)) {
|
||||
SpriteCtrlPtsMove(&root,a1-xx,a2-yy);
|
||||
SpriteCtrlPtsMove(&head,a1-xx,a2-yy);
|
||||
xx=a1;yy=a2;
|
||||
}
|
||||
} while (msg_code!=MSG_IP_L_UP);
|
||||
temppe=root.next;
|
||||
while (temppe!=&root) {
|
||||
temppe=head.next;
|
||||
while (temppe!=&head) {
|
||||
temppe->flags&=~GSPF_SEL;
|
||||
temppe=temppe->next;
|
||||
}
|
||||
@@ -1067,7 +1067,7 @@ gs_key:
|
||||
}
|
||||
}
|
||||
gs_done:
|
||||
QueDel(&root,TRUE);
|
||||
QueDel(&head,TRUE);
|
||||
}
|
||||
DCFill(dc);
|
||||
DCDel(dc);
|
||||
@@ -1077,33 +1077,33 @@ gs_done:
|
||||
}
|
||||
|
||||
I64 SpriteEd(CDoc *doc,CDocEntry *doc_ce,I64 x,I64 y,
|
||||
CSprite **_root,I64 *_cur_elem_num)
|
||||
CSprite **_head,I64 *_cur_elem_num)
|
||||
{
|
||||
CDocEntry *doc_e2;
|
||||
CDocBin *tempb;
|
||||
Bool unlock;
|
||||
I64 i,r[16],msg_code,a1,a2,xx,yy,
|
||||
old_de_flags;
|
||||
CSprite *cur_elem,*root2,*next,*last,*tempg,*insert_pt;
|
||||
CSprite *cur_elem,*head2,*next,*last,*tempg,*insert_pt;
|
||||
|
||||
old_de_flags=doc_ce->de_flags;
|
||||
tempb=doc_ce->bin_data;
|
||||
DocUnlock(doc);
|
||||
SpriteQueSelAll(*_root,FALSE);
|
||||
SpriteQueSelAll(*_head,FALSE);
|
||||
do {
|
||||
if (winmgr.fps<10)
|
||||
doc_ce->de_flags|=DOCEF_DONT_DRAW;
|
||||
StrCpy(Fs->task_title,"Sprite Edit Menu");
|
||||
i=PopUpSpriteEd(_root,_cur_elem_num);
|
||||
SpriteEdUpdate(doc,doc_ce,*_root);
|
||||
i=PopUpSpriteEd(_head,_cur_elem_num);
|
||||
SpriteEdUpdate(doc,doc_ce,*_head);
|
||||
if (0<=i<GED_EXIT) {
|
||||
StrCpy(Fs->task_title,DefineSub(i,"ST_SPRITE_ED_MENU"));
|
||||
switch (i) {
|
||||
case GED_SEL_UNSEL_ALL:
|
||||
if (!SpriteQueSelCnt(*_root))
|
||||
SpriteQueSelAll(*_root);
|
||||
if (!SpriteQueSelCnt(*_head))
|
||||
SpriteQueSelAll(*_head);
|
||||
else
|
||||
SpriteQueSelAll(*_root,FALSE);
|
||||
SpriteQueSelAll(*_head,FALSE);
|
||||
break;
|
||||
case GED_SEL:
|
||||
case GED_UNSEL:
|
||||
@@ -1115,7 +1115,7 @@ I64 SpriteEd(CDoc *doc,CDocEntry *doc_ce,I64 x,I64 y,
|
||||
WinMgrSync(2);
|
||||
if (msg_code==MSG_IP_L_DOWN) {
|
||||
*_cur_elem_num=doc->nearest_sprite_elem_num;
|
||||
cur_elem=SpriteSetSettings(,*_root,*_cur_elem_num);
|
||||
cur_elem=SpriteSetSettings(,*_head,*_cur_elem_num);
|
||||
cur_elem->sel=ToBool(i==GED_SEL);
|
||||
GetMsg(,,1<<MSG_IP_L_UP);
|
||||
}
|
||||
@@ -1123,28 +1123,28 @@ I64 SpriteEd(CDoc *doc,CDocEntry *doc_ce,I64 x,I64 y,
|
||||
doc->cur_sprite=NULL;
|
||||
break;
|
||||
case GED_SET_ORIGIN:
|
||||
SpriteQueSelAll(*_root);
|
||||
SpriteQueSelAll(*_head);
|
||||
doc_ce->de_flags=old_de_flags;
|
||||
GetMsg(&a1,&a2,1<<MSG_IP_L_UP);
|
||||
SpriteSetOrigin(*_root,x-a1,y-a2,0);
|
||||
SpriteEdUpdate(doc,doc_ce,*_root);
|
||||
SpriteQueSelAll(*_root,FALSE);
|
||||
SpriteSetOrigin(*_head,x-a1,y-a2,0);
|
||||
SpriteEdUpdate(doc,doc_ce,*_head);
|
||||
SpriteQueSelAll(*_head,FALSE);
|
||||
break;
|
||||
case GED_SHIFT_SEL:
|
||||
if (!SpriteQueSelCnt(*_root))
|
||||
SpriteQueSelAll(*_root);
|
||||
if (!SpriteQueSelCnt(*_head))
|
||||
SpriteQueSelAll(*_head);
|
||||
doc_ce->de_flags=old_de_flags;
|
||||
GetMsg(&a1,&a2,1<<MSG_IP_L_DOWN);
|
||||
xx=a1; yy=a2;
|
||||
do {
|
||||
msg_code=GetMsg(&a1,&a2,
|
||||
1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
||||
SpriteSetOrigin(*_root,a1-xx,a2-yy,0);
|
||||
SpriteSetOrigin(*_head,a1-xx,a2-yy,0);
|
||||
xx=a1; yy=a2;
|
||||
SpriteEdUpdate(doc,doc_ce,*_root);
|
||||
SpriteEdUpdate(doc,doc_ce,*_head);
|
||||
} while (msg_code!=MSG_IP_L_UP);
|
||||
if (!SpriteQueSelCnt(*_root,FALSE))
|
||||
SpriteQueSelAll(*_root,FALSE);
|
||||
if (!SpriteQueSelCnt(*_head,FALSE))
|
||||
SpriteQueSelAll(*_head,FALSE);
|
||||
break;
|
||||
case GED_SHIFT_PTS:
|
||||
case GED_SHIFT_RECTS:
|
||||
@@ -1155,25 +1155,25 @@ I64 SpriteEd(CDoc *doc,CDocEntry *doc_ce,I64 x,I64 y,
|
||||
"to OR another rectangle.\n");
|
||||
doc_ce->de_flags=old_de_flags;
|
||||
if (SpriteShiftPts(tempb->data,x,y,_cur_elem_num,i)) {
|
||||
QueDel(*_root);
|
||||
Free(*_root);
|
||||
*_root=Sprite2SpriteQue(tempb->data);
|
||||
QueDel(*_head);
|
||||
Free(*_head);
|
||||
*_head=Sprite2SpriteQue(tempb->data);
|
||||
} else
|
||||
SpriteEdUpdate(doc,doc_ce,*_root);
|
||||
SpriteEdUpdate(doc,doc_ce,*_head);
|
||||
break;
|
||||
case GED_TRANSFORM_SEL:
|
||||
if (!SpriteQueSelCnt(*_root))
|
||||
SpriteQueSelAll(*_root);
|
||||
if (!SpriteQueSelCnt(*_head))
|
||||
SpriteQueSelAll(*_head);
|
||||
if (PopUpTransform(r)) {
|
||||
SpriteTransform(r,*_root);
|
||||
SpriteEdUpdate(doc,doc_ce,*_root);
|
||||
SpriteTransform(r,*_head);
|
||||
SpriteEdUpdate(doc,doc_ce,*_head);
|
||||
}
|
||||
if (!SpriteQueSelCnt(*_root,FALSE))
|
||||
SpriteQueSelAll(*_root,FALSE);
|
||||
if (!SpriteQueSelCnt(*_head,FALSE))
|
||||
SpriteQueSelAll(*_head,FALSE);
|
||||
break;
|
||||
case GED_SHIFT_SUB_ORIGIN:
|
||||
doc_ce->de_flags=old_de_flags;
|
||||
insert_pt=SpriteSetSettings(,*_root,*_cur_elem_num);
|
||||
insert_pt=SpriteSetSettings(,*_head,*_cur_elem_num);
|
||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_SHIFT));
|
||||
tempg->type=SPT_SHIFT;
|
||||
tempg->p.x1=0;
|
||||
@@ -1186,7 +1186,7 @@ I64 SpriteEd(CDoc *doc,CDocEntry *doc_ce,I64 x,I64 y,
|
||||
1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
||||
tempg->p.x1=a1-xx;
|
||||
tempg->p.y1=a2-yy;
|
||||
SpriteEdUpdate(doc,doc_ce,*_root);
|
||||
SpriteEdUpdate(doc,doc_ce,*_head);
|
||||
} while (msg_code!=MSG_IP_L_UP);
|
||||
*_cur_elem_num+=1;
|
||||
break;
|
||||
@@ -1197,36 +1197,36 @@ I64 SpriteEd(CDoc *doc,CDocEntry *doc_ce,I64 x,I64 y,
|
||||
"'Insert shift sub-origin' after picking the\n"
|
||||
"element to insert before. Or,\n"
|
||||
"use 'shift points'.\n");
|
||||
insert_pt=SpriteSetSettings(,*_root,*_cur_elem_num);
|
||||
insert_pt=SpriteSetSettings(,*_head,*_cur_elem_num);
|
||||
unlock=DocLock(sys_clipboard_doc);
|
||||
doc_e2=sys_clipboard_doc->root.next;
|
||||
doc_e2=sys_clipboard_doc->head.next;
|
||||
while (doc_e2!=sys_clipboard_doc) {
|
||||
if (doc_e2->type_u8==DOCT_SPRITE) {
|
||||
root2=Sprite2SpriteQue(doc_e2->bin_data->data);
|
||||
if (root2->next!=root2) {
|
||||
tempg=root2->next;
|
||||
while (tempg!=root2) {
|
||||
head2=Sprite2SpriteQue(doc_e2->bin_data->data);
|
||||
if (head2->next!=head2) {
|
||||
tempg=head2->next;
|
||||
while (tempg!=head2) {
|
||||
*_cur_elem_num+=1;
|
||||
tempg=tempg->next;
|
||||
}
|
||||
next=root2->next;
|
||||
last=root2->last;
|
||||
next=head2->next;
|
||||
last=head2->last;
|
||||
insert_pt->last->next=next;
|
||||
next->last=insert_pt->last;
|
||||
insert_pt->last=last;
|
||||
last->next=insert_pt;
|
||||
}
|
||||
Free(root2);
|
||||
Free(head2);
|
||||
}
|
||||
doc_e2=doc_e2->next;
|
||||
}
|
||||
if (unlock)
|
||||
DocUnlock(sys_clipboard_doc);
|
||||
SpriteEdUpdate(doc,doc_ce,*_root);
|
||||
SpriteEdUpdate(doc,doc_ce,*_head);
|
||||
break;
|
||||
case GED_TEXT_ED:
|
||||
if (SpriteEdText(_root,_cur_elem_num))
|
||||
SpriteEdUpdate(doc,doc_ce,*_root);
|
||||
if (SpriteEdText(_head,_cur_elem_num))
|
||||
SpriteEdUpdate(doc,doc_ce,*_head);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+68
-68
@@ -6,7 +6,7 @@
|
||||
#define SPT_ED_MENU -5
|
||||
#define SPT_EXIT -6
|
||||
|
||||
I64 PopUpSpriteMain(CSprite **_root,I64 *_cur_elem_num,
|
||||
I64 PopUpSpriteMain(CSprite **_head,I64 *_cur_elem_num,
|
||||
CDoc *_doc,CDocEntry *_doc_e)
|
||||
{
|
||||
CTask *pu_task;
|
||||
@@ -60,12 +60,12 @@ I64 PopUpSpriteMain(CSprite **_root,I64 *_cur_elem_num,
|
||||
"$$MU-UL,\"Exit Sprite\",LE=SPT_EXIT$$\n"
|
||||
"$$MU-UL,\"Abort Sprite\",LE=DOCM_CANCEL$$\n"
|
||||
"\nRight-Click to get back to this menu.");
|
||||
st=MStrPrint("SpriteSideBarTask(0x%X,0x%X,0x%X);",Fs,_root,_cur_elem_num);
|
||||
st=MStrPrint("SpriteSideBarTask(0x%X,0x%X,0x%X);",Fs,_head,_cur_elem_num);
|
||||
PopUp(st,NULL,&pu_task);
|
||||
Free(st);
|
||||
i=PopUpMenu(doc);
|
||||
if (TaskValidate(pu_task)) {
|
||||
*_root=SpriteSideBar2SpriteQue(DocPut(pu_task),*_root,_cur_elem_num);
|
||||
*_head=SpriteSideBar2SpriteQue(DocPut(pu_task),*_head,_cur_elem_num);
|
||||
Kill(pu_task);
|
||||
}
|
||||
Free(_doc_e->tag);
|
||||
@@ -269,7 +269,7 @@ CSprite *SMScreenBitMap(I64 eletype,CDC *dc,CDC *dc2,I64 x,I64 y,I64 a1,I64 a2,
|
||||
WinMgrSync(2,TRUE);
|
||||
|
||||
dc3=DCScreenCapture;
|
||||
img=DCExtract(dc3,Fs->pix_left+Fs->scroll_x+xx1,Fs->pix_top+Fs->scroll_y+yy1,
|
||||
img=DCExt(dc3,Fs->pix_left+Fs->scroll_x+xx1,Fs->pix_top+Fs->scroll_y+yy1,
|
||||
Fs->pix_left+Fs->scroll_x+xx2-1,Fs->pix_top+Fs->scroll_y+yy2-1);
|
||||
if (eletype==SPT_INS_TRANSPARENT_SCREEN_BITMAP)
|
||||
DCColorChg(img,bm_bkcolor);
|
||||
@@ -405,9 +405,9 @@ CSprite *SMPolyLineFamily(I64 eletype,CDC *dc,I64 x,I64 y,I64 a1,I64 a2,
|
||||
I64 i,num=0,msg_code,x1=a1,y1=a2,x2=a1,y2=a2;
|
||||
I32 *ptr;
|
||||
CD3I32 *p;
|
||||
CSprite *res,*tempg,*tempg1,root2;
|
||||
CSprite *res,*tempg,*tempg1,head2;
|
||||
|
||||
QueInit(&root2);
|
||||
QueInit(&head2);
|
||||
do {
|
||||
do {
|
||||
dc->color=color&COLORROP_NO_ROP0_MASK;
|
||||
@@ -427,7 +427,7 @@ CSprite *SMPolyLineFamily(I64 eletype,CDC *dc,I64 x,I64 y,I64 a1,I64 a2,
|
||||
res->type=SPT_PT;
|
||||
res->p.x1=x2-x;
|
||||
res->p.y1=y2-y;
|
||||
QueIns(res,root2.last);
|
||||
QueIns(res,head2.last);
|
||||
x1=x2;y1=y2;
|
||||
num++;
|
||||
}
|
||||
@@ -438,7 +438,7 @@ CSprite *SMPolyLineFamily(I64 eletype,CDC *dc,I64 x,I64 y,I64 a1,I64 a2,
|
||||
if (num>1) {
|
||||
res=CAlloc(SpriteElemQuedBaseSize(SPT_POLYLINE)+num*sizeof(CD2I32));
|
||||
ptr=&res->nu.u;
|
||||
tempg1=root2.next;
|
||||
tempg1=head2.next;
|
||||
for (i=0;i<num;i++) {
|
||||
tempg=tempg1->next;
|
||||
ptr[i<<1]=tempg1->p.x1;
|
||||
@@ -449,7 +449,7 @@ CSprite *SMPolyLineFamily(I64 eletype,CDC *dc,I64 x,I64 y,I64 a1,I64 a2,
|
||||
res->type=SPT_POLYLINE;
|
||||
res->nu.num=num;
|
||||
} else {
|
||||
tempg1=root2.next;
|
||||
tempg1=head2.next;
|
||||
for (i=0;i<num;i++) {
|
||||
tempg=tempg1->next;
|
||||
Free(tempg1);
|
||||
@@ -465,7 +465,7 @@ CSprite *SMPolyLineFamily(I64 eletype,CDC *dc,I64 x,I64 y,I64 a1,I64 a2,
|
||||
if (num>2) {
|
||||
res=CAlloc(SpriteElemQuedBaseSize(eletype)+num*sizeof(CD3I32));
|
||||
p=&res->nu.u;
|
||||
tempg1=root2.next;
|
||||
tempg1=head2.next;
|
||||
for (i=0;i<num;i++) {
|
||||
tempg=tempg1->next;
|
||||
p[i].x=tempg1->p.x1;
|
||||
@@ -476,7 +476,7 @@ CSprite *SMPolyLineFamily(I64 eletype,CDC *dc,I64 x,I64 y,I64 a1,I64 a2,
|
||||
res->type=eletype;
|
||||
res->nu.num=num;
|
||||
} else {
|
||||
tempg1=root2.next;
|
||||
tempg1=head2.next;
|
||||
for (i=0;i<num;i++) {
|
||||
tempg=tempg1->next;
|
||||
Free(tempg1);
|
||||
@@ -493,23 +493,23 @@ CSprite *SMPolyPoint(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color)
|
||||
{
|
||||
I64 i,num=0,msg_code,x1=a1,y1=a2,x2=a1,y2=a2,x3,y3;
|
||||
I32 *ptr;
|
||||
CSprite *res,*tempg,*tempg1,root2;
|
||||
CSprite *res,*tempg,*tempg1,head2;
|
||||
|
||||
QueInit(&root2);
|
||||
QueInit(&head2);
|
||||
x3=a1-x; y3=a2-y;
|
||||
dc->color=color&COLORROP_NO_ROP0_MASK;
|
||||
do {
|
||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
||||
x2=a1; y2=a2;
|
||||
GrLine3(dc,x1,y1,0,x2,y2,0);
|
||||
Line(&root2,x1-x,y1-y,0,x2-x,y2-y,0,&SpritePolyPtPlot);
|
||||
Line(&head2,x1-x,y1-y,0,x2-x,y2-y,0,&SpritePolyPtPlot);
|
||||
x1=x2;y1=y2;
|
||||
} while (msg_code!=MSG_IP_L_UP);
|
||||
|
||||
num=0;
|
||||
res=root2.next;
|
||||
res=head2.next;
|
||||
x1=x3; y1=y3;
|
||||
while (res!=&root2) {
|
||||
while (res!=&head2) {
|
||||
tempg=res->next;
|
||||
if (res->p.x1==x1 && res->p.y1==y1) {
|
||||
QueRem(res);
|
||||
@@ -528,8 +528,8 @@ CSprite *SMPolyPoint(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color)
|
||||
ptr=&res->npu.u;
|
||||
x1=x3; y1=y3;
|
||||
i=0;
|
||||
tempg1=root2.next;
|
||||
while (tempg1!=&root2) {
|
||||
tempg1=head2.next;
|
||||
while (tempg1!=&head2) {
|
||||
tempg=tempg1->next;
|
||||
BFieldOrU32(ptr,i,polypt_map[SignI64(tempg1->p.x1-x1)+1+
|
||||
3*(SignI64(tempg1->p.y1-y1)+1)]);
|
||||
@@ -544,11 +544,11 @@ CSprite *SMPolyPoint(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color)
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 SMTextFamily(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *root,CDC *dc,
|
||||
U0 SMTextFamily(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *head,CDC *dc,
|
||||
I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color,I64 *_cur_elem_num,
|
||||
I64 old_de_flags)
|
||||
{
|
||||
CSprite *tempg,*insert_pt=SpriteSetSettings(,root,*_cur_elem_num);
|
||||
CSprite *tempg,*insert_pt=SpriteSetSettings(,head,*_cur_elem_num);
|
||||
I64 msg_code,x1,y1;
|
||||
U8 *st;
|
||||
doc_ce->de_flags|=DOCEF_DONT_DRAW;
|
||||
@@ -573,13 +573,13 @@ U0 SMTextFamily(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *root,CDC *dc,
|
||||
tempg->ps.y1=y1-y;
|
||||
StrCpy(tempg->ps.st,st);
|
||||
QueIns(tempg,insert_pt->last);
|
||||
SpriteEdUpdate(doc,doc_ce,root);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
*_cur_elem_num+=1;
|
||||
}
|
||||
Free(st);
|
||||
}
|
||||
|
||||
I64 SMBitMap(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *root,
|
||||
I64 SMBitMap(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *head,
|
||||
CDC *dc,I64 xx,I64 yy,I64 a1,I64 a2,CColorROPU32 bm_bkcolor,
|
||||
Bool sel,I64 xx1=0,I64 yy1=0,I64 xx2=0,I64 yy2=0,I64 *_cur_elem_num)
|
||||
{
|
||||
@@ -587,7 +587,7 @@ I64 SMBitMap(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *root,
|
||||
CSprite *tempg,*tempg1,*insert_pt;
|
||||
CDC *img;
|
||||
|
||||
insert_pt=SpriteSetSettings(,root,*_cur_elem_num,xx,yy,,,&x,&y);
|
||||
insert_pt=SpriteSetSettings(,head,*_cur_elem_num,xx,yy,,,&x,&y);
|
||||
x+=xx; y+=yy;
|
||||
|
||||
if (sel) {
|
||||
@@ -627,15 +627,15 @@ I64 SMBitMap(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *root,
|
||||
img->color=bm_bkcolor;
|
||||
GrRect(img,0,0,tempg->pwhu.width,tempg->pwhu.height);
|
||||
tempg1=insert_pt;
|
||||
if (tempg1==root || tempg1->type!=SPT_BITMAP) {
|
||||
SpriteSetSettings(img,root,0,-(xx1-x),-(yy1-y));
|
||||
if (tempg1==head || tempg1->type!=SPT_BITMAP) {
|
||||
SpriteSetSettings(img,head,0,-(xx1-x),-(yy1-y));
|
||||
x=xx; y=yy;
|
||||
Sprite3(img,-(xx1-x),-(yy1-y),0,doc_ce->bin_data->data);
|
||||
QueDel(root);
|
||||
insert_pt=root->next=root->last=root;
|
||||
QueDel(head);
|
||||
insert_pt=head->next=head->last=head;
|
||||
*_cur_elem_num=1;
|
||||
} else {
|
||||
SpriteSetSettings(img,root,*_cur_elem_num,-(xx1-x),-(yy1-y));
|
||||
SpriteSetSettings(img,head,*_cur_elem_num,-(xx1-x),-(yy1-y));
|
||||
Sprite3(img,-(xx1-x),-(yy1-y),0,&tempg1->start,TRUE);
|
||||
insert_pt=tempg1->next;
|
||||
QueRem(tempg1);
|
||||
@@ -660,20 +660,20 @@ I64 SMBitMap(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *root,
|
||||
}
|
||||
QueIns(tempg,insert_pt->last);
|
||||
DCDel(img);
|
||||
SpriteEdUpdate(doc,doc_ce,root);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
return i;
|
||||
}
|
||||
|
||||
U0 SMMesh(CDoc *doc,CDocEntry *doc_ce,CSprite *root,I64 *_cur_elem_num)
|
||||
U0 SMMesh(CDoc *doc,CDocEntry *doc_ce,CSprite *head,I64 *_cur_elem_num)
|
||||
{
|
||||
CSprite *tempg,*insert_pt=SpriteSetSettings(,root,*_cur_elem_num),
|
||||
CSprite *tempg,*insert_pt=SpriteSetSettings(,head,*_cur_elem_num),
|
||||
*tempg1=insert_pt;
|
||||
CD3I32 *p;
|
||||
I64 i,size,x1,y1,z1;
|
||||
I32 *mesh,*old_mesh;
|
||||
if (tempg1!=root && tempg1->type==SPT_MESH)
|
||||
if (tempg1!=head && tempg1->type==SPT_MESH)
|
||||
old_mesh=&tempg1->mu.vertex_cnt;
|
||||
else if (tempg1!=root && tempg1->type==SPT_SHIFTABLE_MESH) {
|
||||
else if (tempg1!=head && tempg1->type==SPT_SHIFTABLE_MESH) {
|
||||
x1=tempg1->pmu.x;
|
||||
y1=tempg1->pmu.y;
|
||||
z1=tempg1->pmu.z;
|
||||
@@ -692,12 +692,12 @@ U0 SMMesh(CDoc *doc,CDocEntry *doc_ce,CSprite *root,I64 *_cur_elem_num)
|
||||
MemCpy(&tempg->mu.vertex_cnt,mesh,size);
|
||||
Free(mesh);
|
||||
QueIns(tempg,insert_pt->last);
|
||||
SpriteEdUpdate(doc,doc_ce,root);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
if (old_mesh) {
|
||||
insert_pt=tempg;
|
||||
QueRem(tempg1);
|
||||
Free(tempg1);
|
||||
SpriteEdUpdate(doc,doc_ce,root);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
} else
|
||||
*_cur_elem_num+=1;
|
||||
} else if (old_mesh && tempg1->type==SPT_SHIFTABLE_MESH) {
|
||||
@@ -713,15 +713,15 @@ U0 SMMesh(CDoc *doc,CDocEntry *doc_ce,CSprite *root,I64 *_cur_elem_num)
|
||||
}
|
||||
}
|
||||
|
||||
U0 SMShiftableMesh(CDoc *doc,CDocEntry *doc_ce,CSprite *root,
|
||||
U0 SMShiftableMesh(CDoc *doc,CDocEntry *doc_ce,CSprite *head,
|
||||
I64 x,I64 y,I64 a1,I64 a2,I64 *_cur_elem_num)
|
||||
{
|
||||
CSprite *tempg,*insert_pt=SpriteSetSettings(,root,*_cur_elem_num),
|
||||
CSprite *tempg,*insert_pt=SpriteSetSettings(,head,*_cur_elem_num),
|
||||
*tempg1=insert_pt;
|
||||
CD3I32 *p;
|
||||
I64 i,size,z,x1,y1,z1;
|
||||
I32 *mesh,*old_mesh;
|
||||
if (tempg1!=root && tempg1->type==SPT_MESH) {
|
||||
if (tempg1!=head && tempg1->type==SPT_MESH) {
|
||||
z=0;
|
||||
x1=-(a1-x);
|
||||
y1=-(a2-y);
|
||||
@@ -733,7 +733,7 @@ U0 SMShiftableMesh(CDoc *doc,CDocEntry *doc_ce,CSprite *root,
|
||||
p->z+=z1;
|
||||
}
|
||||
old_mesh=&tempg1->mu.vertex_cnt;
|
||||
} else if (tempg1!=root && tempg1->type==SPT_SHIFTABLE_MESH) {
|
||||
} else if (tempg1!=head && tempg1->type==SPT_SHIFTABLE_MESH) {
|
||||
z=-tempg1->pmu.z;
|
||||
x1=tempg1->pmu.x-(a1-x);
|
||||
y1=tempg1->pmu.y-(a2-y);
|
||||
@@ -758,12 +758,12 @@ U0 SMShiftableMesh(CDoc *doc,CDocEntry *doc_ce,CSprite *root,
|
||||
tempg->pmu.y=a2-y;
|
||||
tempg->pmu.z=-z;
|
||||
QueIns(tempg,insert_pt->last);
|
||||
SpriteEdUpdate(doc,doc_ce,root);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
if (old_mesh) {
|
||||
insert_pt=tempg;
|
||||
QueRem(tempg1);
|
||||
Free(tempg1);
|
||||
SpriteEdUpdate(doc,doc_ce,root);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
} else
|
||||
*_cur_elem_num+=1;
|
||||
} else if (old_mesh && tempg1->type==SPT_SHIFTABLE_MESH) {
|
||||
@@ -813,7 +813,7 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
cur_elem_num,old_border_src=Fs->border_src,old_title_src=Fs->title_src,
|
||||
old_de_flags=doc_ce->de_flags;
|
||||
CColorROPU32 bm_bkcolor,color;
|
||||
CSprite *root,*tempg,*insert_pt;
|
||||
CSprite *head,*tempg,*insert_pt;
|
||||
CDC *dc=DCAlias(,Fs),*dc2=DCAlias(,sys_winmgr_task),*dc3;
|
||||
U8 *old_task_title=StrNew(Fs->task_title);
|
||||
|
||||
@@ -821,13 +821,13 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
AutoComplete;
|
||||
WinMgrSync(2,TRUE);
|
||||
dc2->flags|=DCF_ON_TOP;
|
||||
root=Sprite2SpriteQue(doc_ce->bin_data->data);
|
||||
cur_elem_num=QueCnt(root);
|
||||
head=Sprite2SpriteQue(doc_ce->bin_data->data);
|
||||
cur_elem_num=QueCnt(head);
|
||||
xx=(doc_ce->x+doc_ce->max_col-doc->line_start_col)*FONT_WIDTH;
|
||||
yy=(doc_ce->y-doc->top_line_num)*FONT_HEIGHT;
|
||||
|
||||
while (TRUE) {
|
||||
insert_pt=SpriteSetSettings(dc,root,cur_elem_num,xx,yy,
|
||||
insert_pt=SpriteSetSettings(dc,head,cur_elem_num,xx,yy,
|
||||
&color,&width,&x,&y);
|
||||
x+=xx; y+=yy;
|
||||
DCFill;
|
||||
@@ -841,13 +841,13 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
Fs->title_src =old_title_src;
|
||||
|
||||
xx-=StrLen(doc_ce->tag)*FONT_WIDTH;
|
||||
eletype=PopUpSpriteMain(&root,&cur_elem_num,doc,doc_ce);
|
||||
eletype=PopUpSpriteMain(&head,&cur_elem_num,doc,doc_ce);
|
||||
xx+=StrLen(doc_ce->tag)*FONT_WIDTH;
|
||||
insert_pt=SpriteSetSettings(dc,root,cur_elem_num,x,y,
|
||||
insert_pt=SpriteSetSettings(dc,head,cur_elem_num,x,y,
|
||||
&color,&width,&x,&y);
|
||||
x+=xx; y+=yy;
|
||||
|
||||
SpriteEdUpdate(doc,doc_ce,root);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
switch (eletype) {
|
||||
case SPT_FLOOD_FILL:
|
||||
case SPT_FLOOD_FILL_NOT:
|
||||
@@ -877,7 +877,7 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
tempg->type=SPT_COLOR;
|
||||
tempg->c.color=color;
|
||||
QueIns(tempg,insert_pt->last);
|
||||
SpriteEdUpdate(doc,doc_ce,root);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
cur_elem_num++;
|
||||
}
|
||||
doc_ce->de_flags=old_de_flags;
|
||||
@@ -892,14 +892,14 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
tempg->type=SPT_DITHER_COLOR;
|
||||
tempg->d.dither_color=color.c0.color|color.c1.color<<8;
|
||||
QueIns(tempg,insert_pt->last);
|
||||
SpriteEdUpdate(doc,doc_ce,root);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
cur_elem_num++;
|
||||
}
|
||||
doc_ce->de_flags=old_de_flags;
|
||||
eletype=SPT_MENU;
|
||||
break;
|
||||
case SPT_ED_MENU:
|
||||
switch (SpriteEd(doc,doc_ce,x,y,&root,&cur_elem_num)) {
|
||||
switch (SpriteEd(doc,doc_ce,x,y,&head,&cur_elem_num)) {
|
||||
case GE_ABORT: eletype=DOCM_CANCEL; break;
|
||||
case GE_EXIT: eletype=SPT_EXIT; break;
|
||||
case GE_CONT: eletype=SPT_MENU; break;
|
||||
@@ -907,7 +907,7 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
break;
|
||||
case SPT_MESH:
|
||||
doc_ce->de_flags|=DOCEF_DONT_DRAW;
|
||||
SMMesh(doc,doc_ce,root,&cur_elem_num);
|
||||
SMMesh(doc,doc_ce,head,&cur_elem_num);
|
||||
doc_ce->de_flags=old_de_flags;
|
||||
eletype=SPT_MENU;
|
||||
break;
|
||||
@@ -928,7 +928,7 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
"shift the mesh origin point in the sprite edit menu.\n")) {
|
||||
doc_ce->de_flags=old_de_flags;
|
||||
a1=x; a2=y;
|
||||
SMShiftableMesh(doc,doc_ce,root,x,y,a1,a2,&cur_elem_num);
|
||||
SMShiftableMesh(doc,doc_ce,head,x,y,a1,a2,&cur_elem_num);
|
||||
eletype=SPT_MENU;
|
||||
} else
|
||||
PopUpOk("Select Origin.\n");
|
||||
@@ -948,7 +948,7 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
eletype=SPT_MENU;
|
||||
else {
|
||||
bm_bkcolor=i;
|
||||
SpriteEdUpdate(doc,doc_ce,root);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
SpriteExtents(doc_ce->bin_data->data,&xx1,&xx2,&yy1,&yy2);
|
||||
if (!(xx1<=xx2 && yy1<=yy2))
|
||||
xx1=xx2=yy1=yy2=0;
|
||||
@@ -956,7 +956,7 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
doc_ce->de_flags=old_de_flags;
|
||||
xx1+=xx; yy1+=yy;
|
||||
xx2+=xx; yy2+=yy;
|
||||
if (SMBitMap(eletype,doc,doc_ce,root,dc,xx,yy,a1,a2,bm_bkcolor,
|
||||
if (SMBitMap(eletype,doc,doc_ce,head,dc,xx,yy,a1,a2,bm_bkcolor,
|
||||
FALSE,xx1,yy1,xx2,yy2,&cur_elem_num)==GE_EXIT) {
|
||||
res=GE_EXIT;
|
||||
goto ei_done;
|
||||
@@ -988,7 +988,7 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
tempg->type=SPT_WIDTH;
|
||||
tempg->w.width=width;
|
||||
QueIns(tempg,insert_pt->last);
|
||||
SpriteEdUpdate(doc,doc_ce,root);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
cur_elem_num++;
|
||||
}
|
||||
doc_ce->de_flags=old_de_flags;
|
||||
@@ -1002,7 +1002,7 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
else
|
||||
tempg->type=SPT_TRANSFORM_OFF;
|
||||
QueIns(tempg,insert_pt->last);
|
||||
SpriteEdUpdate(doc,doc_ce,root);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
cur_elem_num++;
|
||||
eletype=SPT_MENU;
|
||||
break;
|
||||
@@ -1016,14 +1016,14 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
case SPT_TEXT:
|
||||
case SPT_TEXT_BOX:
|
||||
case SPT_TEXT_DIAMOND:
|
||||
SMTextFamily(eletype,doc,doc_ce,root,dc,xx,yy,a1,a2,
|
||||
SMTextFamily(eletype,doc,doc_ce,head,dc,xx,yy,a1,a2,
|
||||
color,&cur_elem_num,old_de_flags);
|
||||
eletype=SPT_MENU;
|
||||
break;
|
||||
}
|
||||
|
||||
if (eletype!=SPT_MENU) {
|
||||
insert_pt=SpriteSetSettings(dc,root,cur_elem_num,xx,yy,
|
||||
insert_pt=SpriteSetSettings(dc,head,cur_elem_num,xx,yy,
|
||||
&color,&width,&x,&y);
|
||||
x+=xx; y+=yy;
|
||||
SpriteScreenInit(dc,x,y);
|
||||
@@ -1051,7 +1051,7 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
tempg->type=SPT_COLOR;
|
||||
tempg->c.color=color;
|
||||
QueIns(tempg,insert_pt->last);
|
||||
SpriteEdUpdate(doc,doc_ce,root);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
cur_elem_num++;
|
||||
break;
|
||||
case 't': //Set to transparent color
|
||||
@@ -1059,7 +1059,7 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
tempg->type=SPT_COLOR;
|
||||
tempg->c.color=TRANSPARENT;
|
||||
QueIns(tempg,insert_pt->last);
|
||||
SpriteEdUpdate(doc,doc_ce,root);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
cur_elem_num++;
|
||||
break;
|
||||
}
|
||||
@@ -1069,7 +1069,7 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_PLANAR_SYMMETRY));
|
||||
tempg->type=SPT_PLANAR_SYMMETRY;
|
||||
QueIns(tempg,insert_pt->last);
|
||||
SpriteEdUpdate(doc,doc_ce,root);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
cur_elem_num++;
|
||||
eletype=SPT_MENU;
|
||||
} else
|
||||
@@ -1127,12 +1127,12 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
end:
|
||||
if (tempg) {
|
||||
QueIns(tempg,insert_pt->last);
|
||||
SpriteEdUpdate(doc,doc_ce,root);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
cur_elem_num++;
|
||||
}
|
||||
break;
|
||||
case SPT_BITMAP:
|
||||
if (SMBitMap(eletype,doc,doc_ce,root,dc,xx,yy,a1,a2,bm_bkcolor,
|
||||
if (SMBitMap(eletype,doc,doc_ce,head,dc,xx,yy,a1,a2,bm_bkcolor,
|
||||
TRUE,,,,,&cur_elem_num)==GE_EXIT) {
|
||||
res=GE_EXIT;
|
||||
goto ei_done;
|
||||
@@ -1143,7 +1143,7 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
case SPT_SHIFTABLE_MESH:
|
||||
GetMsg(NULL,NULL,1<<MSG_IP_L_UP);
|
||||
doc_ce->de_flags|=DOCEF_DONT_DRAW;
|
||||
SMShiftableMesh(doc,doc_ce,root,x,y,a1,a2,&cur_elem_num);
|
||||
SMShiftableMesh(doc,doc_ce,head,x,y,a1,a2,&cur_elem_num);
|
||||
doc_ce->de_flags=old_de_flags;
|
||||
eletype=SPT_MENU;
|
||||
break;
|
||||
@@ -1162,8 +1162,8 @@ ei_done:
|
||||
Free(old_task_title);
|
||||
Fs->border_src=old_border_src;
|
||||
Fs->title_src =old_title_src;
|
||||
QueDel(root);
|
||||
Free(root);
|
||||
QueDel(head);
|
||||
Free(head);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -1182,7 +1182,7 @@ U0 EdSpriteIns(CDoc *doc)
|
||||
tempb->data=CAlloc(tempb->size,doc->mem_task);
|
||||
tempb->num=doc->cur_bin_num++;
|
||||
tempb->use_cnt=1;
|
||||
QueIns(tempb,doc->bin_root.last);
|
||||
QueIns(tempb,doc->bin_head.last);
|
||||
doc_e=DocPrint(doc,"%s",st);
|
||||
doc_e->bin_data=tempb;
|
||||
Free(st);
|
||||
|
||||
+113
-112
@@ -44,8 +44,8 @@ class CMeshFrame
|
||||
I32 *depth_buf;
|
||||
I64 *w2s,*s2w; //Screen-to-world and world-to-screen transform matrices.
|
||||
I64 vertex_cnt,tri_cnt; //Set by MeshSize
|
||||
CMeshEdVertex vertex_root,*cur_vertex,*chain_pred;
|
||||
CMeshEdTri tri_root,*cur_tri;
|
||||
CMeshEdVertex vertex_head,*cur_vertex,*chain_pred;
|
||||
CMeshEdTri tri_head,*cur_tri;
|
||||
I64 x1,y1,x2,y2,cur_snap;
|
||||
};
|
||||
|
||||
@@ -55,7 +55,7 @@ CMeshEdVertex *MeshVertexNew(CMeshFrame *e,I64 x,I64 y,I64 z)
|
||||
tempv->p.x=x;
|
||||
tempv->p.y=y;
|
||||
tempv->p.z=z;
|
||||
QueIns(tempv,e->vertex_root.last);
|
||||
QueIns(tempv,e->vertex_head.last);
|
||||
return tempv;
|
||||
}
|
||||
|
||||
@@ -69,15 +69,15 @@ CMeshEdTri *MeshTriNew(CMeshFrame *e,CColorROPU32 color,
|
||||
tempt->t[0]=v1;
|
||||
tempt->t[1]=v2;
|
||||
tempt->t[2]=v3;
|
||||
QueIns(tempt,e->tri_root.last);
|
||||
QueIns(tempt,e->tri_head.last);
|
||||
return tempt;
|
||||
}
|
||||
|
||||
CMeshEdVertex *MeshVertexFindScrPt(CMeshFrame *e,I64 x,I64 y)
|
||||
{//Screen coordinates
|
||||
CMeshEdVertex *res=NULL,*tempv=e->vertex_root.next;
|
||||
CMeshEdVertex *res=NULL,*tempv=e->vertex_head.next;
|
||||
I64 dd,dz,best_dd=MAX_I64,best_dz=MAX_I64;
|
||||
while (tempv!=&e->vertex_root) {
|
||||
while (tempv!=&e->vertex_head) {
|
||||
if (!(tempv->flags&VF_IGNORE)) {
|
||||
dd=SqrI64(x-tempv->pt.x)+SqrI64(y-tempv->pt.y);
|
||||
dz=AbsI64(e->ip_z-tempv->p.z);
|
||||
@@ -94,8 +94,8 @@ CMeshEdVertex *MeshVertexFindScrPt(CMeshFrame *e,I64 x,I64 y)
|
||||
|
||||
CMeshEdVertex *MeshVertexFindNum(CMeshFrame *haystack_e,I64 needle_num)
|
||||
{
|
||||
CMeshEdVertex *tempv=haystack_e->vertex_root.next;
|
||||
while (tempv!=&haystack_e->vertex_root) {
|
||||
CMeshEdVertex *tempv=haystack_e->vertex_head.next;
|
||||
while (tempv!=&haystack_e->vertex_head) {
|
||||
if (tempv->num==needle_num)
|
||||
return tempv;
|
||||
tempv=tempv->next;
|
||||
@@ -118,8 +118,8 @@ U0 MeshVertexDel(CMeshFrame *e,CMeshEdVertex *tempv)
|
||||
I64 i;
|
||||
CMeshEdTri *tempt,*tempt1;
|
||||
if (tempv) {
|
||||
tempt=e->tri_root.next;
|
||||
while (tempt!=&e->tri_root) {
|
||||
tempt=e->tri_head.next;
|
||||
while (tempt!=&e->tri_head) {
|
||||
tempt1=tempt->next;
|
||||
for (i=0;i<3;i++)
|
||||
if (tempt->t[i]==tempv)
|
||||
@@ -140,7 +140,7 @@ U0 MeshVertexDel(CMeshFrame *e,CMeshEdVertex *tempv)
|
||||
U0 MeshFence(CMeshFrame *e)
|
||||
{
|
||||
CMeshEdVertex *tempv,*tempv1,*tempv_last=NULL,*tempv1_last=NULL,
|
||||
*start=e->chain_pred->next,*end=e->vertex_root.last;
|
||||
*start=e->chain_pred->next,*end=e->vertex_head.last;
|
||||
tempv=start;
|
||||
while (TRUE) {
|
||||
tempv1=MeshVertexNew(e,tempv->p.x,tempv->p.y,tempv->p.z+e->thickness);
|
||||
@@ -179,16 +179,16 @@ U0 MeshPolygon(CMeshFrame *e,CMeshEdVertex *start,CMeshEdVertex *end,Bool rev)
|
||||
|
||||
U0 MeshPrism(CMeshFrame *e)
|
||||
{
|
||||
CMeshEdVertex *start=e->chain_pred->next,*end=e->vertex_root.last;
|
||||
CMeshEdVertex *start=e->chain_pred->next,*end=e->vertex_head.last;
|
||||
MeshFence(e);
|
||||
MeshPolygon(e,start,end,FALSE);
|
||||
MeshPolygon(e,end->next,e->vertex_root.last,TRUE);
|
||||
MeshPolygon(e,end->next,e->vertex_head.last,TRUE);
|
||||
}
|
||||
|
||||
U0 MeshVertexSelAll(CMeshFrame *e,Bool val)
|
||||
{
|
||||
CMeshEdVertex *tempv=e->vertex_root.next;
|
||||
while (tempv!=&e->vertex_root) {
|
||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
||||
while (tempv!=&e->vertex_head) {
|
||||
if (val)
|
||||
tempv->flags|=VF_SEL;
|
||||
else
|
||||
@@ -199,8 +199,8 @@ U0 MeshVertexSelAll(CMeshFrame *e,Bool val)
|
||||
|
||||
U0 MeshTriSelAll(CMeshFrame *e,Bool val)
|
||||
{
|
||||
CMeshEdTri *tempt=e->tri_root.next;
|
||||
while (tempt!=&e->tri_root) {
|
||||
CMeshEdTri *tempt=e->tri_head.next;
|
||||
while (tempt!=&e->tri_head) {
|
||||
if (val)
|
||||
tempt->flags|=TF_SEL;
|
||||
else
|
||||
@@ -211,8 +211,8 @@ U0 MeshTriSelAll(CMeshFrame *e,Bool val)
|
||||
|
||||
U0 MeshVertexIgnoreSet(CMeshFrame *e,Bool val)
|
||||
{
|
||||
CMeshEdVertex *tempv=e->vertex_root.next;
|
||||
while (tempv!=&e->vertex_root) {
|
||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
||||
while (tempv!=&e->vertex_head) {
|
||||
tempv->flags&=~VF_IGNORE;
|
||||
if (tempv->flags&VF_SEL && val)
|
||||
tempv->flags|=VF_IGNORE;
|
||||
@@ -222,8 +222,8 @@ U0 MeshVertexIgnoreSet(CMeshFrame *e,Bool val)
|
||||
|
||||
U0 MeshP0Capture(CMeshFrame *e)
|
||||
{
|
||||
CMeshEdVertex *tempv=e->vertex_root.next;
|
||||
while (tempv!=&e->vertex_root) {
|
||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
||||
while (tempv!=&e->vertex_head) {
|
||||
MemCpy(&tempv->p0,&tempv->p,sizeof(CD3I32));
|
||||
tempv=tempv->next;
|
||||
}
|
||||
@@ -231,8 +231,8 @@ U0 MeshP0Capture(CMeshFrame *e)
|
||||
|
||||
U0 MeshP0Offset(CMeshFrame *e,I64 dx,I64 dy,I64 dz)
|
||||
{
|
||||
CMeshEdVertex *tempv=e->vertex_root.next;
|
||||
while (tempv!=&e->vertex_root) {
|
||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
||||
while (tempv!=&e->vertex_head) {
|
||||
if (tempv->flags&VF_SEL) {
|
||||
tempv->p.x=tempv->p0.x+dx;
|
||||
tempv->p.y=tempv->p0.y+dy;
|
||||
@@ -248,10 +248,10 @@ U0 MeshP0Offset(CMeshFrame *e,I64 dx,I64 dy,I64 dz)
|
||||
|
||||
U0 MeshVertexSelRect(CMeshFrame *e,I64 sel_mode,I64 x1,I64 x2,I64 y1,I64 y2)
|
||||
{
|
||||
CMeshEdVertex *tempv=e->vertex_root.next;
|
||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
||||
if (x1>x2) SwapI64(&x1,&x2);
|
||||
if (y1>y2) SwapI64(&y1,&y2);
|
||||
while (tempv!=&e->vertex_root) {
|
||||
while (tempv!=&e->vertex_head) {
|
||||
if (x1<=tempv->pt.x<=x2 &&
|
||||
y1<=tempv->pt.y<=y2) {
|
||||
if (sel_mode==SEL_MESH_AND)
|
||||
@@ -266,10 +266,10 @@ U0 MeshVertexSelRect(CMeshFrame *e,I64 sel_mode,I64 x1,I64 x2,I64 y1,I64 y2)
|
||||
|
||||
U0 MeshTriSelRect(CMeshFrame *e,I64 sel_mode,I64 x1,I64 x2,I64 y1,I64 y2)
|
||||
{
|
||||
CMeshEdTri *tempt=e->tri_root.next;
|
||||
CMeshEdTri *tempt=e->tri_head.next;
|
||||
if (x1>x2) SwapI64(&x1,&x2);
|
||||
if (y1>y2) SwapI64(&y1,&y2);
|
||||
while (tempt!=&e->tri_root) {
|
||||
while (tempt!=&e->tri_head) {
|
||||
if (x1<=tempt->t[0]->pt.x<=x2 &&
|
||||
y1<=tempt->t[0]->pt.y<=y2 &&
|
||||
x1<=tempt->t[1]->pt.x<=x2 &&
|
||||
@@ -300,14 +300,14 @@ U0 MeshTriSelRect(CMeshFrame *e,I64 sel_mode,I64 x1,I64 x2,I64 y1,I64 y2)
|
||||
I64 MeshSelCnt(CMeshFrame *e)
|
||||
{
|
||||
I64 res=0;
|
||||
CMeshEdVertex *tempv=e->vertex_root.next;
|
||||
CMeshEdTri *tempt=e->tri_root.next;
|
||||
while (tempv!=&e->vertex_root) {
|
||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
||||
CMeshEdTri *tempt=e->tri_head.next;
|
||||
while (tempv!=&e->vertex_head) {
|
||||
if (tempv->flags&VF_SEL)
|
||||
res++;
|
||||
tempv=tempv->next;
|
||||
}
|
||||
while (tempt!=&e->tri_root) {
|
||||
while (tempt!=&e->tri_head) {
|
||||
if (tempt->flags&TF_SEL)
|
||||
res++;
|
||||
tempt=tempt->next;
|
||||
@@ -318,13 +318,13 @@ I64 MeshSelCnt(CMeshFrame *e)
|
||||
U0 MeshSwapAxes(CMeshFrame *e,I64 o1,I64 o2)
|
||||
{
|
||||
Bool unsel;
|
||||
CMeshEdVertex *tempv=e->vertex_root.next;
|
||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
||||
if (!MeshSelCnt(e)) {
|
||||
MeshVertexSelAll(e,TRUE);
|
||||
unsel=TRUE;
|
||||
} else
|
||||
unsel=FALSE;
|
||||
while (tempv!=&e->vertex_root) {
|
||||
while (tempv!=&e->vertex_head) {
|
||||
if (tempv->flags&VF_SEL)
|
||||
SwapU32((&tempv->p)(U8 *)+o1,(&tempv->p)(U8 *)+o2);
|
||||
tempv=tempv->next;
|
||||
@@ -336,13 +336,13 @@ U0 MeshSwapAxes(CMeshFrame *e,I64 o1,I64 o2)
|
||||
U0 MeshInvertAxis(CMeshFrame *e,I64 o)
|
||||
{
|
||||
Bool unsel;
|
||||
CMeshEdVertex *tempv=e->vertex_root.next;
|
||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
||||
if (!MeshSelCnt(e)) {
|
||||
MeshVertexSelAll(e,TRUE);
|
||||
unsel=TRUE;
|
||||
} else
|
||||
unsel=FALSE;
|
||||
while (tempv!=&e->vertex_root) {
|
||||
while (tempv!=&e->vertex_head) {
|
||||
if (tempv->flags&VF_SEL)
|
||||
*((&tempv->p)(U8 *)+o)(I32 *)=-*((&tempv->p)(U8 *)+o)(I32 *);
|
||||
tempv=tempv->next;
|
||||
@@ -355,14 +355,14 @@ U0 MeshTransformSel(CMeshFrame *e)
|
||||
{
|
||||
Bool unsel;
|
||||
I64 r[16],x,y,z;
|
||||
CMeshEdVertex *tempv=e->vertex_root.next;
|
||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
||||
if (PopUpTransform(r)) {
|
||||
if (!MeshSelCnt(e)) {
|
||||
MeshVertexSelAll(e,TRUE);
|
||||
unsel=TRUE;
|
||||
} else
|
||||
unsel=FALSE;
|
||||
while (tempv!=&e->vertex_root) {
|
||||
while (tempv!=&e->vertex_head) {
|
||||
if (tempv->flags&VF_SEL) {
|
||||
x=tempv->p.x; y=tempv->p.y; z=tempv->p.z;
|
||||
Mat4x4MulXYZ(r,&x,&y,&z);
|
||||
@@ -378,13 +378,13 @@ U0 MeshTransformSel(CMeshFrame *e)
|
||||
U0 MeshColorTris(CMeshFrame *e)
|
||||
{
|
||||
Bool unsel;
|
||||
CMeshEdTri *tempt=e->tri_root.next;
|
||||
CMeshEdTri *tempt=e->tri_head.next;
|
||||
if (!MeshSelCnt(e)) {
|
||||
MeshTriSelAll(e,TRUE);
|
||||
unsel=TRUE;
|
||||
} else
|
||||
unsel=FALSE;
|
||||
while (tempt!=&e->tri_root) {
|
||||
while (tempt!=&e->tri_head) {
|
||||
if (tempt->flags & TF_SEL)
|
||||
tempt->mt.color=e->cur_color;
|
||||
tempt=tempt->next;
|
||||
@@ -396,13 +396,13 @@ U0 MeshColorTris(CMeshFrame *e)
|
||||
U0 MeshRevTris(CMeshFrame *e)
|
||||
{
|
||||
Bool unsel;
|
||||
CMeshEdTri *tempt=e->tri_root.next;
|
||||
CMeshEdTri *tempt=e->tri_head.next;
|
||||
if (!MeshSelCnt(e)) {
|
||||
MeshTriSelAll(e,TRUE);
|
||||
unsel=TRUE;
|
||||
} else
|
||||
unsel=FALSE;
|
||||
while (tempt!=&e->tri_root) {
|
||||
while (tempt!=&e->tri_head) {
|
||||
if (tempt->flags & TF_SEL)
|
||||
SwapI64(&tempt->t[1],&tempt->t[2]);
|
||||
tempt=tempt->next;
|
||||
@@ -451,7 +451,7 @@ U0 MPDrawIt(CMeshFrame *e)
|
||||
//Makes a copy of e->dc so we can change dc->color member and stuff.
|
||||
CDC *dc=DCAlias(e->dc,e->dc->win_task);
|
||||
|
||||
CMeshEdTri *tempt=e->tri_root.next;
|
||||
CMeshEdTri *tempt=e->tri_head.next;
|
||||
I64 i,*old_r=dc->r;
|
||||
|
||||
//$LK,"DCAlias",A="MN:DCAlias"$() allocs a new identity rotation matrix.
|
||||
@@ -493,7 +493,7 @@ U0 MPDrawIt(CMeshFrame *e)
|
||||
GrLine3(dc,0,0,-500,0,0,0);
|
||||
}
|
||||
|
||||
while (tempt!=&e->tri_root) {
|
||||
while (tempt!=&e->tri_head) {
|
||||
if (tempt->cpu_num==Gs->num) {
|
||||
if (tempt->flags & TF_SEL) {
|
||||
if (Blink)
|
||||
@@ -588,33 +588,33 @@ U0 MeshCursorW(CMeshFrame *e,CTask *task,I64 *_x,I64 *_y,I64 *_z)
|
||||
*_x=x; *_y=y; *_z=z;
|
||||
}
|
||||
|
||||
CMeshEdVertex sys_clipboard_vertex_root;
|
||||
CMeshEdTri sys_clipboard_tri_root;
|
||||
CMeshEdVertex sys_clipboard_vertex_head;
|
||||
CMeshEdTri sys_clipboard_tri_head;
|
||||
|
||||
U0 MeshClipboardInit()
|
||||
{
|
||||
QueInit(&sys_clipboard_vertex_root);
|
||||
QueInit(&sys_clipboard_tri_root);
|
||||
QueInit(&sys_clipboard_vertex_head);
|
||||
QueInit(&sys_clipboard_tri_head);
|
||||
}
|
||||
|
||||
U0 MeshClipboardRst()
|
||||
{
|
||||
QueDel(&sys_clipboard_vertex_root,TRUE);
|
||||
QueDel(&sys_clipboard_tri_root,TRUE);
|
||||
QueDel(&sys_clipboard_vertex_head,TRUE);
|
||||
QueDel(&sys_clipboard_tri_head,TRUE);
|
||||
MeshClipboardInit;
|
||||
}
|
||||
|
||||
U0 MeshClipboardCopy(CMeshFrame *e)
|
||||
{
|
||||
CMeshEdVertex *tempv=e->vertex_root.next,*tempv2;
|
||||
CMeshEdTri *tempt=e->tri_root.next,*tempt2;
|
||||
CMeshEdVertex *tempv=e->vertex_head.next,*tempv2;
|
||||
CMeshEdTri *tempt=e->tri_head.next,*tempt2;
|
||||
|
||||
MeshClipboardRst;
|
||||
while (tempv!=&e->vertex_root) {
|
||||
while (tempv!=&e->vertex_head) {
|
||||
if (tempv->flags&VF_SEL) {
|
||||
tempv->copy=tempv2=ACAlloc(sizeof(CMeshEdVertex));
|
||||
MemCpy(&tempv2->p,&tempv->p,sizeof(CD3I32));
|
||||
QueIns(tempv2,sys_clipboard_vertex_root.last);
|
||||
QueIns(tempv2,sys_clipboard_vertex_head.last);
|
||||
tempv->flags|=VF_COPIED;
|
||||
tempv->flags&=~VF_SEL;
|
||||
} else {
|
||||
@@ -623,7 +623,7 @@ U0 MeshClipboardCopy(CMeshFrame *e)
|
||||
}
|
||||
tempv=tempv->next;
|
||||
}
|
||||
while (tempt!=&e->tri_root) {
|
||||
while (tempt!=&e->tri_head) {
|
||||
if (tempt->flags&TF_SEL &&
|
||||
tempt->t[0]->copy && tempt->t[1]->copy && tempt->t[2]->copy) {
|
||||
tempt2=ACAlloc(sizeof(CMeshEdTri));
|
||||
@@ -631,7 +631,7 @@ U0 MeshClipboardCopy(CMeshFrame *e)
|
||||
tempt2->t[1]=tempt->t[1]->copy;
|
||||
tempt2->t[2]=tempt->t[2]->copy;
|
||||
tempt2->mt.color=tempt->mt.color;
|
||||
QueIns(tempt2,sys_clipboard_tri_root.last);
|
||||
QueIns(tempt2,sys_clipboard_tri_head.last);
|
||||
tempt->flags|=TF_COPIED;
|
||||
tempt->flags&=~TF_SEL;
|
||||
} else
|
||||
@@ -642,16 +642,16 @@ U0 MeshClipboardCopy(CMeshFrame *e)
|
||||
|
||||
U0 MeshClipboardCut(CMeshFrame *e)
|
||||
{
|
||||
CMeshEdVertex *tempv=e->vertex_root.next,*tempv1;
|
||||
CMeshEdTri *tempt=e->tri_root.next,*tempt1;
|
||||
CMeshEdVertex *tempv=e->vertex_head.next,*tempv1;
|
||||
CMeshEdTri *tempt=e->tri_head.next,*tempt1;
|
||||
MeshClipboardCopy(e);
|
||||
while (tempt!=&e->tri_root) {
|
||||
while (tempt!=&e->tri_head) {
|
||||
tempt1=tempt->next;
|
||||
if (tempt->flags&TF_COPIED)
|
||||
MeshTriDel(e,tempt);
|
||||
tempt=tempt1;
|
||||
}
|
||||
while (tempv!=&e->vertex_root) {
|
||||
while (tempv!=&e->vertex_head) {
|
||||
tempv1=tempv->next;
|
||||
if (tempv->flags&VF_COPIED)
|
||||
MeshVertexDel(e,tempv);
|
||||
@@ -661,15 +661,15 @@ U0 MeshClipboardCut(CMeshFrame *e)
|
||||
|
||||
U0 MeshClipboardDel(CMeshFrame *e)
|
||||
{//Technically not clipboard
|
||||
CMeshEdVertex *tempv=e->vertex_root.next,*tempv1;
|
||||
CMeshEdTri *tempt=e->tri_root.next,*tempt1;
|
||||
while (tempt!=&e->tri_root) {
|
||||
CMeshEdVertex *tempv=e->vertex_head.next,*tempv1;
|
||||
CMeshEdTri *tempt=e->tri_head.next,*tempt1;
|
||||
while (tempt!=&e->tri_head) {
|
||||
tempt1=tempt->next;
|
||||
if (tempt->flags&TF_SEL)
|
||||
MeshTriDel(e,tempt);
|
||||
tempt=tempt1;
|
||||
}
|
||||
while (tempv!=&e->vertex_root) {
|
||||
while (tempv!=&e->vertex_head) {
|
||||
tempv1=tempv->next;
|
||||
if (tempv->flags&VF_SEL)
|
||||
MeshVertexDel(e,tempv);
|
||||
@@ -679,20 +679,20 @@ U0 MeshClipboardDel(CMeshFrame *e)
|
||||
|
||||
U0 MeshClipboardPaste(CMeshFrame *e)
|
||||
{
|
||||
CMeshEdVertex *tempv2=sys_clipboard_vertex_root.next,*tempv;
|
||||
CMeshEdTri *tempt2=sys_clipboard_tri_root.next,*tempt;
|
||||
CMeshEdVertex *tempv2=sys_clipboard_vertex_head.next,*tempv;
|
||||
CMeshEdTri *tempt2=sys_clipboard_tri_head.next,*tempt;
|
||||
|
||||
MeshVertexSelAll(e,FALSE);
|
||||
MeshTriSelAll(e,FALSE);
|
||||
while (tempv2!=&sys_clipboard_vertex_root) {
|
||||
while (tempv2!=&sys_clipboard_vertex_head) {
|
||||
tempv2->copy=tempv=CAlloc(sizeof(CMeshEdVertex));
|
||||
MemCpy(&tempv->p,&tempv2->p,sizeof(CD3I32));
|
||||
QueIns(tempv,e->vertex_root.last);
|
||||
QueIns(tempv,e->vertex_head.last);
|
||||
tempv->flags|=VF_SEL;
|
||||
tempv2=tempv2->next;
|
||||
}
|
||||
|
||||
while (tempt2!=&sys_clipboard_tri_root) {
|
||||
while (tempt2!=&sys_clipboard_tri_head) {
|
||||
tempt=MeshTriNew(e,tempt2->mt.color,tempt2->t[0]->copy,
|
||||
tempt2->t[1]->copy,tempt2->t[2]->copy);
|
||||
tempt->flags|=TF_SEL;
|
||||
@@ -741,8 +741,8 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
|
||||
DCDepthBufAlloc(dc);
|
||||
|
||||
tempv=e->vertex_root.next;
|
||||
while (tempv!=&e->vertex_root) {
|
||||
tempv=e->vertex_head.next;
|
||||
while (tempv!=&e->vertex_head) {
|
||||
x=tempv->p.x; y=tempv->p.y; z=tempv->p.z;
|
||||
(*dc->transform)(dc,&x,&y,&z);
|
||||
tempv->pt.x=x; tempv->pt.y=y; tempv->pt.z=z;
|
||||
@@ -755,8 +755,8 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
for (i=0;i<mp_cnt;i++)
|
||||
JobQue(&MPDrawIt,e,i);
|
||||
|
||||
tempv=e->vertex_root.next;
|
||||
while (tempv!=&e->vertex_root) {
|
||||
tempv=e->vertex_head.next;
|
||||
while (tempv!=&e->vertex_head) {
|
||||
x=tempv->pt.x; y=tempv->pt.y; z=tempv->pt.z;
|
||||
if (e->vertex_on) {
|
||||
if (Blink(10)) //This blinks at 10 Hz.
|
||||
@@ -823,8 +823,8 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
U0 MeshInit(CMeshFrame *e,Bool flip_y)
|
||||
{
|
||||
MemSet(e,0,sizeof(CMeshFrame));
|
||||
e->vertex_root.next=e->vertex_root.last=&e->vertex_root;
|
||||
e->tri_root.next=e->tri_root.last=&e->tri_root;
|
||||
QueInit(&e->vertex_head);
|
||||
QueInit(&e->tri_head);
|
||||
e->ed_mode='v';
|
||||
e->grid_on=TRUE;
|
||||
e->vertex_on=TRUE;
|
||||
@@ -849,8 +849,8 @@ U0 MeshLoad(CMeshFrame *e,U8 *src)
|
||||
CColorROPU32 color;
|
||||
CMeshEdVertex *tempv,*va[3];
|
||||
|
||||
e->vertex_root.next=e->vertex_root.last=&e->vertex_root;
|
||||
e->tri_root.next=e->tri_root.last=&e->tri_root;
|
||||
QueInit(&e->vertex_head);
|
||||
QueInit(&e->tri_head);
|
||||
|
||||
e->vertex_cnt =*src(I32 *)++;
|
||||
e->tri_cnt=*src(I32 *)++;
|
||||
@@ -872,17 +872,17 @@ U0 MeshLoad(CMeshFrame *e,U8 *src)
|
||||
I64 MeshSize(CMeshFrame *e)
|
||||
{
|
||||
I64 i;
|
||||
CMeshEdVertex *tempv=e->vertex_root.next;
|
||||
CMeshEdTri *tempt=e->tri_root.next;
|
||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
||||
CMeshEdTri *tempt=e->tri_head.next;
|
||||
|
||||
e->vertex_cnt=0;
|
||||
while (tempv!=&e->vertex_root) {
|
||||
while (tempv!=&e->vertex_head) {
|
||||
tempv->num=e->vertex_cnt++;
|
||||
tempv=tempv->next;
|
||||
}
|
||||
|
||||
e->tri_cnt=0;
|
||||
while (tempt!=&e->tri_root) {
|
||||
while (tempt!=&e->tri_head) {
|
||||
e->tri_cnt++;
|
||||
for (i=0;i<3;i++)
|
||||
tempt->mt.nums[i]=tempt->t[i]->num;
|
||||
@@ -897,14 +897,14 @@ I32 *MeshSave(CMeshFrame *e,I64 *_size=NULL)
|
||||
{
|
||||
I64 size=MeshSize(e);
|
||||
U8 *res=MAlloc(size),*dst=res;
|
||||
CMeshEdVertex *tempv=e->vertex_root.next;
|
||||
CMeshEdTri *tempt=e->tri_root.next;
|
||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
||||
CMeshEdTri *tempt=e->tri_head.next;
|
||||
|
||||
*dst(I32 *)++=e->vertex_cnt;
|
||||
*dst(I32 *)++=e->tri_cnt;
|
||||
|
||||
e->vertex_cnt=0;
|
||||
while (tempv!=&e->vertex_root) {
|
||||
while (tempv!=&e->vertex_head) {
|
||||
MemCpy(dst,&tempv->start,offset(CMeshEdVertex.end)
|
||||
-offset(CMeshEdVertex.start));
|
||||
dst+=offset(CMeshEdVertex.end)-offset(CMeshEdVertex.start);
|
||||
@@ -912,7 +912,7 @@ I32 *MeshSave(CMeshFrame *e,I64 *_size=NULL)
|
||||
}
|
||||
|
||||
e->tri_cnt=0;
|
||||
while (tempt!=&e->tri_root) {
|
||||
while (tempt!=&e->tri_head) {
|
||||
MemCpy(dst,&tempt->start,offset(CMeshEdTri.end)-offset(CMeshEdTri.start));
|
||||
dst+=offset(CMeshEdTri.end)-offset(CMeshEdTri.start);
|
||||
tempt=tempt->next;
|
||||
@@ -923,8 +923,8 @@ I32 *MeshSave(CMeshFrame *e,I64 *_size=NULL)
|
||||
|
||||
U0 MeshCleanUp(CMeshFrame *e)
|
||||
{
|
||||
QueDel(&e->vertex_root,TRUE);
|
||||
QueDel(&e->tri_root,TRUE);
|
||||
QueDel(&e->vertex_head,TRUE);
|
||||
QueDel(&e->tri_head,TRUE);
|
||||
Free(e->w2s);
|
||||
Free(e->s2w);
|
||||
}
|
||||
@@ -954,7 +954,7 @@ U0 MeshUpdateMenu(CMeshFrame *e)
|
||||
tempse->checked=ToBool(e->flip_y);
|
||||
}
|
||||
|
||||
I32 *SpriteMeshEd(I32 *root=NULL,I64 *_size=NULL,Bool flip_y=FALSE)
|
||||
I32 *SpriteMeshEd(I32 *head=NULL,I64 *_size=NULL,Bool flip_y=FALSE)
|
||||
{/*Fmt for mesh:
|
||||
{
|
||||
I32 vertex_cnt;
|
||||
@@ -963,7 +963,7 @@ CD3I32 vertices[];
|
||||
CMeshTri tris[];
|
||||
}
|
||||
|
||||
If root points to a mesh, it will load it.
|
||||
If head points to a mesh, it will load it.
|
||||
|
||||
Returns a newly malloced mesh or NULL.
|
||||
|
||||
@@ -1067,8 +1067,8 @@ $WW,0$*/
|
||||
Fs->horz_scroll.pos=0;
|
||||
Fs->vert_scroll.pos=0;
|
||||
MeshInit(&e,flip_y);
|
||||
if (root)
|
||||
MeshLoad(&e,root);
|
||||
if (head)
|
||||
MeshLoad(&e,head);
|
||||
FramePtrAdd("CMeshFrame",&e);
|
||||
Fs->draw_it=&DrawIt;
|
||||
MeshCurSnap(&e);
|
||||
@@ -1134,7 +1134,7 @@ me_restart:
|
||||
else
|
||||
e.closed=PopUpNoYes("Closed?\n");
|
||||
me_chain:
|
||||
e.chain_pred=e.vertex_root.last;
|
||||
e.chain_pred=e.vertex_head.last;
|
||||
case 't':
|
||||
MeshVertexSelAll(&e,FALSE);
|
||||
MeshTriSelAll(&e,FALSE);
|
||||
@@ -1416,8 +1416,9 @@ me_clipboard_cut:
|
||||
}
|
||||
break;
|
||||
case MSG_IP_R_DOWN:
|
||||
if (e.ed_mode!='M' && e.ed_mode!='n' && e.ed_mode!='f' &&
|
||||
e.ed_mode!='p' && !adjusting_z) {
|
||||
if (!adjusting_z && e.ed_mode!='M' &&
|
||||
(e.chain_pred==e.vertex_head.last ||
|
||||
e.ed_mode!='n' && e.ed_mode!='f' && e.ed_mode!='p')) {
|
||||
if (moving) {
|
||||
MeshCursorW(&e,Fs,&x,&y,&z);
|
||||
MeshP0Offset(&e,x-p0a.x,y-p0a.y,z-p0a.z);
|
||||
@@ -1434,22 +1435,7 @@ me_clipboard_cut:
|
||||
}
|
||||
break;
|
||||
case MSG_IP_R_UP:
|
||||
if (e.ed_mode=='n') {
|
||||
if (e.chain_pred && e.chain_pred!=e.vertex_root.last)
|
||||
MeshPolygon(&e,e.chain_pred->next,e.vertex_root.last,FALSE);
|
||||
a1=e.ed_mode;
|
||||
goto me_chain;
|
||||
} else if (e.ed_mode=='f') {
|
||||
if (e.chain_pred && e.chain_pred!=e.vertex_root.last)
|
||||
MeshFence(&e);
|
||||
a1=e.ed_mode;
|
||||
goto me_chain;
|
||||
} else if (e.ed_mode=='p') {
|
||||
if (e.chain_pred && e.chain_pred!=e.vertex_root.last)
|
||||
MeshPrism(&e);
|
||||
a1=e.ed_mode;
|
||||
goto me_chain;
|
||||
} else if (e.ed_mode!='M' && adjusting_z) {
|
||||
if (adjusting_z) {
|
||||
e.ip_z=RoundI64(Sign(p0b.y-ip.presnap.y)
|
||||
*Sqrt(Sqr(p0b.x-ip.presnap.x)+Sqr(p0b.y-ip.presnap.y))
|
||||
+p0b.z,e.cur_snap);
|
||||
@@ -1463,6 +1449,21 @@ me_clipboard_cut:
|
||||
p0a.z=z;
|
||||
MeshP0Capture(&e);
|
||||
}
|
||||
} else if (e.ed_mode=='n') {
|
||||
if (e.chain_pred && e.chain_pred!=e.vertex_head.last)
|
||||
MeshPolygon(&e,e.chain_pred->next,e.vertex_head.last,FALSE);
|
||||
a1=e.ed_mode;
|
||||
goto me_chain;
|
||||
} else if (e.ed_mode=='f') {
|
||||
if (e.chain_pred && e.chain_pred!=e.vertex_head.last)
|
||||
MeshFence(&e);
|
||||
a1=e.ed_mode;
|
||||
goto me_chain;
|
||||
} else if (e.ed_mode=='p') {
|
||||
if (e.chain_pred && e.chain_pred!=e.vertex_head.last)
|
||||
MeshPrism(&e);
|
||||
a1=e.ed_mode;
|
||||
goto me_chain;
|
||||
}
|
||||
break;
|
||||
case MSG_IP_MOVE:
|
||||
@@ -1492,9 +1493,9 @@ me_done:
|
||||
SettingsPop;
|
||||
MenuPop;
|
||||
if (save_and_exit)
|
||||
root=MeshSave(&e,_size);
|
||||
head=MeshSave(&e,_size);
|
||||
else
|
||||
root=NULL;
|
||||
head=NULL;
|
||||
MeshCleanUp(&e);
|
||||
FramePtrDel("CMeshFrame");
|
||||
if (old_s) {
|
||||
@@ -1502,5 +1503,5 @@ me_done:
|
||||
Free(old_s);
|
||||
} else
|
||||
ViewAnglesDel;
|
||||
return root;
|
||||
return head;
|
||||
}
|
||||
@@ -61,7 +61,7 @@ BDVD_SHIFT_BLKS:: DU16 0;
|
||||
BDVD_PROGRESS_STEP:: DU32 0;
|
||||
BDVD_PROGRESS_VAL:: DU32 0;
|
||||
|
||||
BDVD_PUTCHAR::
|
||||
BDVD_PUT_CHAR::
|
||||
MOV AH,0xE
|
||||
MOV BL,7 //Might be foreground color on some BIOS's
|
||||
MOV BH,U8 [BDVD_PAGE-BDVD_START]
|
||||
@@ -72,7 +72,7 @@ BDVD_PUTS::
|
||||
@@1: LODSB
|
||||
TEST AL,AL
|
||||
JZ BDVD_RET
|
||||
CALL BDVD_PUTCHAR
|
||||
CALL BDVD_PUT_CHAR
|
||||
JMP @@1
|
||||
|
||||
BDVD_MAIN::
|
||||
@@ -80,7 +80,7 @@ BDVD_MAIN::
|
||||
|
||||
MOV AH,0xF
|
||||
INT 0x10
|
||||
MOV U8 [BDVD_PAGE-BDVD_START],BH //video page
|
||||
MOV U8 [BDVD_PAGE-BDVD_START],BH //Video page
|
||||
|
||||
MOV EAX,0x80000000
|
||||
CPUID
|
||||
@@ -143,7 +143,7 @@ BDVD_MAIN::
|
||||
CMP U16 [BDVD_PROGRESS_VAL+2-BDVD_START],BX
|
||||
JE @@30
|
||||
MOV AL,'.'
|
||||
CALL BDVD_PUTCHAR
|
||||
CALL BDVD_PUT_CHAR
|
||||
@@30: POP AX
|
||||
|
||||
POP CX
|
||||
@@ -173,7 +173,7 @@ BDVD_MAIN::
|
||||
LOOP @@35
|
||||
POP DS
|
||||
|
||||
//See $LK,"BootDVDProve",A="MN:BootDVDProve"$().
|
||||
//See $LK,"BootDVDProbe",A="MN:BootDVDProbe"$().
|
||||
MOV EBX,U32 [BDVD_BLK_LO-BDVD_START]
|
||||
MOV AX,U16 [BDVD_SHIFT_BLKS-BDVD_START]
|
||||
SHL EAX,16
|
||||
@@ -182,7 +182,7 @@ BDVD_MAIN::
|
||||
//My assembler doesn't support 16-bit very well.
|
||||
DU8 0xEA; //JMP BOOT_RAM_BASE:0000
|
||||
DU16 0,BOOT_RAM_BASE/16;
|
||||
//Continues here $LK,"::/Kernel/KStart.CPP",A="FL:::/Kernel/KStart.CPP,1"$
|
||||
//Continues here $LK,"::/Kernel/KStart16.CPP",A="FL:::/Kernel/KStart16.CPP,1"$
|
||||
BDVD_END::
|
||||
#assert BDVD_END-BDVD_START<DVD_BOOT_LOADER_SIZE
|
||||
}
|
||||
@@ -13,10 +13,6 @@ BHD_CODE::
|
||||
|
||||
CLD
|
||||
|
||||
MOV AX,VGAM_TEXT/16
|
||||
MOV FS,AX
|
||||
MOV U32 FS:[0],'B'+GREEN<<12+('2'+GREEN<<12)<<16
|
||||
|
||||
MOV AX,BOOT_HIGH_LOC_HD
|
||||
MOV ES,AX
|
||||
|
||||
@@ -91,7 +87,7 @@ BHD_HISTART:
|
||||
//My assembler doesn't support 16-bit very well.
|
||||
DU8 0xEA; //JMP BOOT_RAM_BASE:0000
|
||||
DU16 0,BOOT_RAM_BASE/16;
|
||||
//Continues here $LK,"::/Kernel/KStart.CPP",A="FL:::/Kernel/KStart.CPP,1"$
|
||||
//Continues here $LK,"::/Kernel/KStart16.CPP",A="FL:::/Kernel/KStart16.CPP,1"$
|
||||
BHD_END::
|
||||
#assert BHD_END-BHD_START<MODULE_SIZE-2
|
||||
}
|
||||
@@ -30,9 +30,6 @@ BMHD_CODE::
|
||||
|
||||
MOV ES,AX
|
||||
|
||||
MOV AX,VGAM_TEXT/16
|
||||
MOV FS,AX
|
||||
MOV U32 FS:[0],'B'+GREEN<<12+('1'+GREEN<<12)<<16
|
||||
CALL BMHD_GET_IP
|
||||
BMHD_GET_IP:
|
||||
POP BX
|
||||
|
||||
@@ -43,7 +43,7 @@ BMHD2_DAP_BLK:: //64-bit
|
||||
BMHD2_DAP_BLK_LO: DU32 0;
|
||||
BMHD2_DAP_BLK_HI: DU32 0;
|
||||
|
||||
BMHD2_PUTCHAR::
|
||||
BMHD2_PUT_CHAR::
|
||||
MOV AH,0xE
|
||||
MOV BL,7 //Might be foreground color on some BIOS's
|
||||
MOV BH,U8 [BMHD2_PAGE-BMHD2_START]
|
||||
@@ -54,7 +54,7 @@ BMHD2_PUTS::
|
||||
@@1: LODSB
|
||||
TEST AL,AL
|
||||
JZ BMHD2_RET
|
||||
CALL BMHD2_PUTCHAR
|
||||
CALL BMHD2_PUT_CHAR
|
||||
JMP @@1
|
||||
|
||||
BMHD2_GETCHAR:
|
||||
@@ -70,7 +70,7 @@ BMHD2_GETCHAR:
|
||||
BMHD2_HISTART:
|
||||
MOV AH,0xF
|
||||
INT 0x10
|
||||
MOV U8 [BMHD2_PAGE-BMHD2_START],BH //video page
|
||||
MOV U8 [BMHD2_PAGE-BMHD2_START],BH //Video page
|
||||
|
||||
MOV U32 FS:[0],0
|
||||
@@5: MOV SI,BMHD2_BOOT_MSG-BMHD2_START
|
||||
|
||||
@@ -310,7 +310,7 @@ public I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask,
|
||||
*iso_boot=CAlloc(DVD_BLK_SIZE),
|
||||
*iso_sup=CAlloc(DVD_BLK_SIZE),
|
||||
*iso_term=CAlloc(DVD_BLK_SIZE);
|
||||
CDirEntry *rootdir=CAlloc(sizeof(CDirEntry));
|
||||
CDirEntry *headdir=CAlloc(sizeof(CDirEntry));
|
||||
I64 i,j,stage2_blk=(20<<2+1<<2+DVD_BOOT_LOADER_SIZE/BLK_SIZE)>>2,
|
||||
stage2_size,cur_blk=0,tabsize,tabsize2,first_free,max_depth,fuf_flags=0;
|
||||
U32 *d;
|
||||
@@ -335,22 +335,22 @@ public I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask,
|
||||
else
|
||||
stage2_filename=NULL;
|
||||
|
||||
rootdir->attr=RS_ATTR_DIR;
|
||||
rootdir->sub=FilesFind(src_files_find_mask,fuf_flags);
|
||||
rootdir->datetime=Now;
|
||||
rootdir->user_data=CAlloc(sizeof(CCDVDUserData));
|
||||
tempc=rootdir->user_data;
|
||||
headdir->attr=RS_ATTR_DIR;
|
||||
headdir->sub=FilesFind(src_files_find_mask,fuf_flags);
|
||||
headdir->datetime=Now;
|
||||
headdir->user_data=CAlloc(sizeof(CCDVDUserData));
|
||||
tempc=headdir->user_data;
|
||||
tempc->path_entry_num=1;
|
||||
|
||||
cur_blk=20<<2>>2;
|
||||
if (stage2_filename) //preboot and bootloader
|
||||
cur_blk+=1+DVD_BOOT_LOADER_SIZE/DVD_BLK_SIZE;
|
||||
DVDFileCreate2(out_file,rootdir,&iso_pri->root_dir_record,
|
||||
&iso_sup->root_dir_record,&cur_blk,rootdir,FALSE,
|
||||
DVDFileCreate2(out_file,headdir,&iso_pri->root_dir_record,
|
||||
&iso_sup->root_dir_record,&cur_blk,headdir,FALSE,
|
||||
stage2_filename,&stage2_blk);
|
||||
tabsize=sizeof(CISO1PathEntry);
|
||||
tabsize2=sizeof(CISO1PathEntry);
|
||||
max_depth=DVDTableLen(rootdir,&tabsize,&tabsize2,1);
|
||||
max_depth=DVDTableLen(headdir,&tabsize,&tabsize2,1);
|
||||
FillU32Palindrome(&iso_pri->path_table_size,tabsize);
|
||||
FillU32Palindrome(&iso_sup->path_table_size,tabsize2);
|
||||
tabsize=(tabsize+DVD_BLK_SIZE-1)/DVD_BLK_SIZE;
|
||||
@@ -412,8 +412,8 @@ public I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask,
|
||||
cur_blk+=DVD_BOOT_LOADER_SIZE/DVD_BLK_SIZE;
|
||||
}
|
||||
|
||||
DVDFileCreate2(out_file,rootdir,&iso_pri->root_dir_record,
|
||||
&iso_sup->root_dir_record,&cur_blk,rootdir,TRUE,
|
||||
DVDFileCreate2(out_file,headdir,&iso_pri->root_dir_record,
|
||||
&iso_sup->root_dir_record,&cur_blk,headdir,TRUE,
|
||||
stage2_filename,&stage2_blk);
|
||||
|
||||
tabbuf=CAlloc(tabsize*DVD_BLK_SIZE);
|
||||
@@ -432,7 +432,7 @@ public I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask,
|
||||
itabbuf2=tabbuf2+1;
|
||||
first_free=2;
|
||||
for (i=1;i<=max_depth;i++)
|
||||
DVDFillPathTable(rootdir,&itabbuf,&itabbuf2,1,FALSE,&first_free,1,i);
|
||||
DVDFillPathTable(headdir,&itabbuf,&itabbuf2,1,FALSE,&first_free,1,i);
|
||||
"%X: Path Table 0\n",cur_blk;
|
||||
FWBlks(out_file,tabbuf,cur_blk<<2,tabsize<<2);
|
||||
cur_blk+=tabsize;
|
||||
@@ -456,7 +456,7 @@ public I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask,
|
||||
itabbuf2=tabbuf2+1;
|
||||
first_free=2;
|
||||
for (i=1;i<=max_depth;i++)
|
||||
DVDFillPathTable(rootdir,&itabbuf,&itabbuf2,1,TRUE,&first_free,1,i);
|
||||
DVDFillPathTable(headdir,&itabbuf,&itabbuf2,1,TRUE,&first_free,1,i);
|
||||
"%X: Path Table 2\n",cur_blk;
|
||||
FWBlks(out_file,tabbuf,cur_blk<<2,tabsize<<2);
|
||||
cur_blk+=tabsize;
|
||||
@@ -464,7 +464,7 @@ public I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask,
|
||||
FWBlks(out_file,tabbuf2,cur_blk<<2,tabsize2<<2);
|
||||
cur_blk+=tabsize2;
|
||||
|
||||
DirTreeDel2(rootdir);
|
||||
DirTreeDel2(headdir);
|
||||
FillU32Palindrome(&iso_pri->vol_space_size,cur_blk);
|
||||
FillU32Palindrome(&iso_sup->vol_space_size,cur_blk);
|
||||
FWBlks(out_file,iso_pri,16<<2,4);
|
||||
|
||||
@@ -142,7 +142,7 @@ public I64 RedSeaISO(U8 *_iso_filename=NULL,U8 *_src_dir,
|
||||
stage2_filename=FileNameAbs(_stage2_filename);
|
||||
*stage2_filename=dv->drv_let;
|
||||
i=StrLen(src_dir);
|
||||
if (i!=3) //If not root
|
||||
if (i!=3) //If not head
|
||||
i++; //Skip slash
|
||||
StrCpy(stage2_filename+3,stage2_filename+i);
|
||||
} else
|
||||
|
||||
@@ -219,12 +219,12 @@ Bool DiffSub(CDoc *doc,I64 *_df_flags,I64 j1_lo,I64 j1_hi,I64 j2_lo,I64 j2_hi,
|
||||
|
||||
Bool DiffBins(CDoc *doc1,CDoc *doc2)
|
||||
{
|
||||
CDocBin *tempb1=doc1->bin_root.next,
|
||||
*tempb2=doc2->bin_root.next;
|
||||
CDocBin *tempb1=doc1->bin_head.next,
|
||||
*tempb2=doc2->bin_head.next;
|
||||
|
||||
if (tempb1->last->last->num!=tempb2->last->last->num)
|
||||
return TRUE;
|
||||
while (tempb1!=&doc1->bin_root) {
|
||||
while (tempb1!=&doc1->bin_head) {
|
||||
if (tempb1->size!=tempb2->size ||
|
||||
MemCmp(tempb1->data,tempb2->data,tempb1->size))
|
||||
return TRUE;
|
||||
@@ -249,14 +249,14 @@ public Bool Diff(U8 *dst_file,U8 *src_file,I64 *_df_flags=NULL)
|
||||
df_flags=0;
|
||||
df_flags&=DF_ABORT_ALL_FILES;
|
||||
|
||||
doc_e=doc1->root.next;
|
||||
doc_e=doc1->head.next;
|
||||
while (doc_e!=doc1) {
|
||||
if (doc_e->type_u8==DOCT_TEXT)
|
||||
doc_e->user_data=cnt1++; //user_data is the new y
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
|
||||
doc_e=doc2->root.next;
|
||||
doc_e=doc2->head.next;
|
||||
while (doc_e!=doc2) {
|
||||
if (doc_e->type_u8==DOCT_TEXT)
|
||||
doc_e->user_data=cnt2++; //user_data is the new y
|
||||
@@ -266,7 +266,7 @@ public Bool Diff(U8 *dst_file,U8 *src_file,I64 *_df_flags=NULL)
|
||||
doc_sorted1=MAlloc(cnt1*sizeof(CDocEntry *));
|
||||
doc_unsorted1=MAlloc((cnt1+1)*sizeof(CDocEntry *));
|
||||
i=0;
|
||||
doc_e=doc1->root.next;
|
||||
doc_e=doc1->head.next;
|
||||
while (doc_e!=doc1) {
|
||||
if (doc_e->type_u8==DOCT_TEXT) {
|
||||
doc_sorted1[i]=doc_e;
|
||||
@@ -280,7 +280,7 @@ public Bool Diff(U8 *dst_file,U8 *src_file,I64 *_df_flags=NULL)
|
||||
doc_sorted2=MAlloc(cnt2*sizeof(CDocEntry *));
|
||||
doc_unsorted2=MAlloc((cnt2+1)*sizeof(CDocEntry *));
|
||||
i=0;
|
||||
doc_e=doc2->root.next;
|
||||
doc_e=doc2->head.next;
|
||||
while (doc_e!=doc2) {
|
||||
if (doc_e->type_u8==DOCT_TEXT) {
|
||||
doc_sorted2[i]=doc_e;
|
||||
|
||||
@@ -47,7 +47,7 @@ I64 FindFile(U8 *needle_str,U8 *haystack_filename,
|
||||
plen=StrLen(needle_str);
|
||||
if (replace_text)
|
||||
rlen=StrLen(replace_text);
|
||||
doc_e=doc->root.next;
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc && cont) {
|
||||
if (doc_e->type_u8==DOCT_TEXT) {
|
||||
src=doc_e->tag;
|
||||
|
||||
+20
-20
@@ -21,7 +21,7 @@ class CHeapLogHash
|
||||
};
|
||||
|
||||
CHeapCtrl *heaplog_hc_watched,*heaplog_hc=NULL;
|
||||
CHeapLogHash *heaplog_root=NULL;
|
||||
CHeapLogHash *heaplog_head=NULL;
|
||||
|
||||
U0 HeapLogMAlloc(U8 *addr)
|
||||
{
|
||||
@@ -37,7 +37,7 @@ U0 HeapLogMAlloc(U8 *addr)
|
||||
CLI
|
||||
while (LBts(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0))
|
||||
PAUSE
|
||||
QueIns(temphl,heaplog_root[i].last);
|
||||
QueIns(temphl,heaplog_head[i].last);
|
||||
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
|
||||
POPFD
|
||||
}
|
||||
@@ -54,8 +54,8 @@ U0 HeapLogFree(U8 *addr)
|
||||
CLI
|
||||
while (LBts(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0))
|
||||
PAUSE
|
||||
temphl=heaplog_root[i].next;
|
||||
while (temphl!=&heaplog_root[i]) {
|
||||
temphl=heaplog_head[i].next;
|
||||
while (temphl!=&heaplog_head[i]) {
|
||||
if (addr==temphl->addr) {
|
||||
QueRem(temphl);
|
||||
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
|
||||
@@ -90,9 +90,9 @@ public Bool HeapLog(Bool val=ON,CTask *task=NULL)
|
||||
heaplog_hc=HeapCtrlInit(,,sys_data_bp);
|
||||
ext[EXT_HEAPLOG_MALLOC]=&HeapLogMAlloc;
|
||||
ext[EXT_HEAPLOG_FREE]=&HeapLogFree;
|
||||
heaplog_root=MAlloc(sizeof(CHeapLogHash)*HL_HASH_SIZE,heaplog_hc);
|
||||
heaplog_head=MAlloc(sizeof(CHeapLogHash)*HL_HASH_SIZE,heaplog_hc);
|
||||
for (i=0;i<HL_HASH_SIZE;i++)
|
||||
QueInit(&heaplog_root[i]);
|
||||
QueInit(&heaplog_head[i]);
|
||||
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
|
||||
POPFD
|
||||
LBts(&sys_semas[SYS_SEMA_HEAPLOG_ACTIVE],0);
|
||||
@@ -104,7 +104,7 @@ public Bool HeapLog(Bool val=ON,CTask *task=NULL)
|
||||
return FALSE;
|
||||
} else {
|
||||
HeapCtrlDel(heaplog_hc);
|
||||
heaplog_root=heaplog_hc=NULL;
|
||||
heaplog_head=heaplog_hc=NULL;
|
||||
ext[EXT_HEAPLOG_MALLOC]=NULL;
|
||||
ext[EXT_HEAPLOG_FREE]=NULL;
|
||||
return TRUE;
|
||||
@@ -124,8 +124,8 @@ public U0 HeapLogAddrRep(Bool leave_it=OFF)
|
||||
while (LBts(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0))
|
||||
PAUSE
|
||||
for (i=0;i<HL_HASH_SIZE;i++) {
|
||||
temphl=heaplog_root[i].next;
|
||||
while (temphl!=&heaplog_root[i]) {
|
||||
temphl=heaplog_head[i].next;
|
||||
while (temphl!=&heaplog_head[i]) {
|
||||
//Take snapshot in case modified. (while we work)
|
||||
MemCpy(&hl,temphl,sizeof(CHeapLog));
|
||||
"$$PURPLE$$%08X$$FG$$ %08X",MSize(hl.addr),hl.addr;
|
||||
@@ -147,27 +147,27 @@ public U0 HeapLogSizeRep(Bool leave_it=OFF)
|
||||
{//Call $LK,"HeapLog",A="MN:HeapLog"$() first and collect data.
|
||||
I64 i,j,k,total=0;
|
||||
CHeapLog *temphla,hla,*temphls,*temphls1;
|
||||
CHeapLogHash *size_root;
|
||||
CHeapLogHash *size_head;
|
||||
if (!LBtr(&sys_semas[SYS_SEMA_HEAPLOG_ACTIVE],0)) {
|
||||
"HeapLog Not Active\n";
|
||||
return;
|
||||
}
|
||||
|
||||
size_root=MAlloc(sizeof(CHeapLogHash)*HL_HASH_SIZE,heaplog_hc);
|
||||
size_head=MAlloc(sizeof(CHeapLogHash)*HL_HASH_SIZE,heaplog_hc);
|
||||
for (i=0;i<HL_HASH_SIZE;i++)
|
||||
QueInit(&size_root[i]);
|
||||
QueInit(&size_head[i]);
|
||||
|
||||
"$$WW,0$$";
|
||||
while (LBts(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0))
|
||||
PAUSE
|
||||
for (i=0;i<HL_HASH_SIZE;i++) {
|
||||
temphla=heaplog_root[i].next;
|
||||
while (temphla!=&heaplog_root[i]) {
|
||||
temphla=heaplog_head[i].next;
|
||||
while (temphla!=&heaplog_head[i]) {
|
||||
//Take snapshot in case modified. (while we work)
|
||||
MemCpy(&hla,temphla,sizeof(CHeapLog));
|
||||
k=(MSize(hla.addr)>>3+hla.caller[0])&(HL_HASH_SIZE-1);
|
||||
temphls=size_root[k].next;
|
||||
while (temphls!=&size_root[k]) {
|
||||
temphls=size_head[k].next;
|
||||
while (temphls!=&size_head[k]) {
|
||||
if (MSize(hla.addr)==temphls->size) {
|
||||
for (j=0;j<HL_CALLER_DEPTH;j++)
|
||||
if (hla.caller[j]!=temphls->caller[j])
|
||||
@@ -182,7 +182,7 @@ hl_next:
|
||||
MemCpy(temphls,&hla,sizeof(CHeapLog));
|
||||
temphls->cnt=1;
|
||||
temphls->size=MSize(hla.addr);
|
||||
QueIns(temphls,size_root[k].last);
|
||||
QueIns(temphls,size_head[k].last);
|
||||
hl_found:
|
||||
temphla=hla.next;
|
||||
}
|
||||
@@ -190,8 +190,8 @@ hl_found:
|
||||
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
|
||||
|
||||
for (i=0;i<HL_HASH_SIZE;i++) {
|
||||
temphls=size_root[i].next;
|
||||
while (temphls!=&size_root[i]) {
|
||||
temphls=size_head[i].next;
|
||||
while (temphls!=&size_head[i]) {
|
||||
temphls1=temphls->next;
|
||||
"%08X*%08X=%08X",temphls->size,temphls->cnt,temphls->size*temphls->cnt;
|
||||
for (j=0;j<HL_CALLER_DEPTH;j++)
|
||||
@@ -202,7 +202,7 @@ hl_found:
|
||||
temphls=temphls1;
|
||||
}
|
||||
}
|
||||
Free(size_root);
|
||||
Free(size_head);
|
||||
|
||||
"\n$$LTRED$$Total:%08X$$FG$$\n",total;
|
||||
LBts(&sys_semas[SYS_SEMA_HEAPLOG_ACTIVE],0);
|
||||
|
||||
@@ -10,8 +10,8 @@ I64 LineRep1(CDirEntry *tempde)
|
||||
i=LineRep1(tempde->sub);
|
||||
else {
|
||||
doc=DocRead(tempde->full_name);
|
||||
if (doc->root.next!=doc)
|
||||
i=doc->root.last->y+2;
|
||||
if (doc->head.next!=doc)
|
||||
i=doc->head.last->y+2;
|
||||
DocDel(doc);
|
||||
}
|
||||
tempde->user_data=i;
|
||||
|
||||
@@ -5,7 +5,7 @@ I64 LinkChkDoc(CDoc *doc,I64 *_fuf_flags)
|
||||
U8 *st;
|
||||
Bool found,unlock=DocLock(doc);
|
||||
CDoc *old_doc;
|
||||
CDocEntry *doc_e=doc->root.next;
|
||||
CDocEntry *doc_e=doc->head.next;
|
||||
I64 res=0;
|
||||
while (doc_e!=doc) {
|
||||
if (ScanKey) {
|
||||
@@ -38,8 +38,9 @@ I64 LinkChkDoc(CDoc *doc,I64 *_fuf_flags)
|
||||
|
||||
I64 LinkChkFile(U8 *filename,I64 *_fuf_flags)
|
||||
{
|
||||
I64 res;
|
||||
CDoc *doc=DocRead(filename,DOCF_NO_CURSOR);
|
||||
I64 res=LinkChkDoc(doc,_fuf_flags);
|
||||
res=LinkChkDoc(doc,_fuf_flags);
|
||||
DocDel(doc);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -21,14 +21,14 @@ public I64 Sort(U8 *_in_name,U8 *_out_name=NULL,
|
||||
out_name=StrNew(in_name);
|
||||
|
||||
doc=DocRead(in_name,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR);
|
||||
doc_e=doc->root.next;
|
||||
doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_TEXT)
|
||||
cnt++;
|
||||
doc_e=doc_e->next;
|
||||
}
|
||||
a=MAlloc(cnt*sizeof(CDocEntry *));
|
||||
doc_e=doc->root.next;
|
||||
doc_e=doc->head.next;
|
||||
i=0;
|
||||
while (doc_e!=doc) {
|
||||
doc_e1=doc_e->next;
|
||||
@@ -47,15 +47,15 @@ public I64 Sort(U8 *_in_name,U8 *_out_name=NULL,
|
||||
if (!unique || !st || StrCmp(a[i]->tag,st)) {
|
||||
st=a[i]->tag;
|
||||
for (j=0;j<entry_lines && i<cnt;j++,i++) {
|
||||
QueIns(a[i],doc->root.last);
|
||||
doc->cur_entry=&doc->root;
|
||||
QueIns(a[i],doc->head.last);
|
||||
doc->cur_entry=&doc->head;
|
||||
doc->cur_col=0;
|
||||
DocPrint(doc,"\n");
|
||||
}
|
||||
res++;
|
||||
} else
|
||||
for (j=0;j<entry_lines && i<cnt;j++,i++) {
|
||||
QueIns(a[i],doc->root.last);
|
||||
QueIns(a[i],doc->head.last);
|
||||
DocEntryDel(doc,a[i]);
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ I64 DocWordsFile(CDoc *doc_out=NULL,U8 *filename,U32 *chars_bmp)
|
||||
U8 *ptr,*ptr2;
|
||||
I64 res=0,ch;
|
||||
CDoc *doc_in=DocRead(filename);
|
||||
CDocEntry *doc_e=doc_in->root.next;
|
||||
CDocEntry *doc_e=doc_in->head.next;
|
||||
while (doc_e!=doc_in) {
|
||||
if (doc_e->de_flags & DOCEF_TAG) {
|
||||
ptr=doc_e->tag;
|
||||
@@ -123,7 +123,7 @@ I64 LongLinesFile(U8 *filename,I64 cols)
|
||||
{
|
||||
I64 res=0;
|
||||
CDoc *doc=DocRead(filename);
|
||||
CDocEntry *doc_e=doc->root.next;
|
||||
CDocEntry *doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_NEW_LINE && doc_e->x>=cols+1)
|
||||
res++;
|
||||
@@ -160,7 +160,7 @@ U0 SUFile(U8 *filename,I64 suf_flags,F64 indent_scale_factor)
|
||||
Bool chged=FALSE;
|
||||
I64 reduced=0;
|
||||
CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR);
|
||||
CDocEntry *doc_e=doc->root.next;
|
||||
CDocEntry *doc_e=doc->head.next;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_TEXT) {
|
||||
dst=MStrUtil(doc_e->tag,suf_flags,indent_scale_factor);
|
||||
|
||||
@@ -46,7 +46,7 @@ public CDoc *Doc2TXT(CDoc *doc_in)
|
||||
|
||||
doc_out->flags|=DOCF_PLAIN_TEXT|DOCF_NO_CURSOR;
|
||||
|
||||
doc_e=doc_in->root.next;
|
||||
doc_e=doc_in->head.next;
|
||||
col=doc_e->x;
|
||||
y=doc_e->y;
|
||||
while (doc_e!=doc_in) {
|
||||
@@ -93,7 +93,7 @@ public CDoc *Doc2TXT(CDoc *doc_in)
|
||||
y++;
|
||||
col=0;
|
||||
}
|
||||
doc_out->cur_entry=&doc_out->root;
|
||||
doc_out->cur_entry=&doc_out->head;
|
||||
DocRecalc(doc_out);
|
||||
|
||||
if (unlock_doc_in)
|
||||
|
||||
@@ -32,7 +32,7 @@ public I64 SndFileCreate(U8 *base_filename,F64 normalized_vol=1.0,
|
||||
|
||||
snd.record=FALSE;
|
||||
|
||||
dt=snd.record_root.last->time-snd.record_root.next->time;
|
||||
dt=snd.record_head.last->time-snd.record_head.next->time;
|
||||
if (!dt) return 0;
|
||||
cnt=dt*SNDFILE_SAMPLE_RATE;
|
||||
cnt++; //Terminator
|
||||
@@ -48,9 +48,9 @@ public I64 SndFileCreate(U8 *base_filename,F64 normalized_vol=1.0,
|
||||
s->channels=EndianU32(1);
|
||||
|
||||
if (time_shift) {
|
||||
d=snd.record_root.next;
|
||||
d=snd.record_head.next;
|
||||
d->time-=time_shift;
|
||||
while (d->next!=&snd.record_root) {
|
||||
while (d->next!=&snd.record_head) {
|
||||
d1=d->next;
|
||||
dt=d1->time-d->time;
|
||||
if (dt<0) {
|
||||
@@ -61,9 +61,9 @@ public I64 SndFileCreate(U8 *base_filename,F64 normalized_vol=1.0,
|
||||
}
|
||||
}
|
||||
|
||||
d=snd.record_root.next;
|
||||
d=snd.record_head.next;
|
||||
k=0;
|
||||
while (d->next!=&snd.record_root) {
|
||||
while (d->next!=&snd.record_head) {
|
||||
d1=d->next;
|
||||
dt=d1->time-d->time;
|
||||
cnt2=dt*SNDFILE_SAMPLE_RATE;
|
||||
@@ -103,8 +103,8 @@ public I64 SndFileCreate(U8 *base_filename,F64 normalized_vol=1.0,
|
||||
|
||||
s->body[cnt-1]=0;
|
||||
|
||||
d=snd.record_root.next;
|
||||
while (d!=&snd.record_root) {
|
||||
d=snd.record_head.next;
|
||||
while (d!=&snd.record_head) {
|
||||
d1=d->next;
|
||||
QueRem(d);
|
||||
Free(d);
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ U0 TaskRepTask(CTask *task,I64 indent)
|
||||
CTask *task1;
|
||||
U8 *st,*desc=MStrUtil(task->task_title,SUF_SAFE_DOLLAR);
|
||||
st=MStrPrint("$$MA,T=\"%08X\",LM=\"Kill(0x%X);\n\",$$",task,task,task);
|
||||
"%h*c%s $$TX,\"%Q...\",SCX=16$$\n",indent,CH_SPACE,
|
||||
"%h*c%s $$TX,\"%$$Q...\",SCX=16$$\n",indent,CH_SPACE,
|
||||
st,desc;
|
||||
"%h*c%08X %04X:%04X:%08X\n",indent+2,CH_SPACE,TaskMemAlloced(task),
|
||||
task->task_flags,task->display_flags,task->win_inhibit;
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ U8 *KeyMapKeyMStrPrint(I64 sc,U0 (*fp_handler)(I64 sc),
|
||||
else if (k=='Cmd ') c=RED;
|
||||
else c=BLACK;
|
||||
|
||||
res=MStrPrint("%-*s $$FG,%d$$$$TX+UL+L+PU,\"%Q\",A=\"%s\"$$$$FG$$\n",
|
||||
res=MStrPrint("%-*s $$FG,%d$$$$TX+UL+L+PU,\"%$$Q\",A=\"%s\"$$$$FG$$\n",
|
||||
i,st,c,desc,st2);
|
||||
Free(st);
|
||||
Free(st2);
|
||||
@@ -162,7 +162,7 @@ public U0 TipOfDay(U8 *tip_file="::/Doc/Tips.TXT")
|
||||
{//Print random tip-of-day from ::/Doc/Tips.TXT.
|
||||
I64 i=RandU16;
|
||||
CDoc *doc=DocRead(tip_file),*doc2=DocNew;
|
||||
CDocEntry *doc_e=doc->root.next;
|
||||
CDocEntry *doc_e=doc->head.next;
|
||||
"$$WW,1$$\n";
|
||||
while (TRUE) {
|
||||
if (doc_e->type_u8==DOCT_TEXT && *doc_e->tag=='*')
|
||||
|
||||
@@ -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;
|
||||
|
||||
+1
-1
@@ -119,7 +119,7 @@ U0 MapFileWrite(CHashTable *h,U8 *map_name,U8 drv_let)
|
||||
MemCpy(tempb->data,dbg_info,size);
|
||||
tempb->num=doc->cur_bin_num++;
|
||||
tempb->use_cnt=1;
|
||||
QueIns(tempb,doc->bin_root.last);
|
||||
QueIns(tempb,doc->bin_head.last);
|
||||
} else
|
||||
dbg_info=NULL;
|
||||
}
|
||||
|
||||
@@ -133,7 +133,6 @@ CIntermediateStruct intermediate_code_table[IC_NUM_ENTRIES]={
|
||||
{IS_1_ARG,0,IST_NULL,FALSE,TRUE,0,0,0,"SET_RSP"},
|
||||
{IS_0_ARG,1,IST_NULL,FALSE,TRUE,0,0,0,"RIP"},
|
||||
{IS_0_ARG,0,IST_NULL,FALSE,TRUE,0,0,0,"RDTSC"},
|
||||
{IS_0_ARG,0,IST_NULL,FALSE,TRUE,0,0,0,"HPET"},
|
||||
{IS_2_ARG,0,IST_NULL,FALSE,TRUE,0,0,0,"BT"},
|
||||
{IS_2_ARG,0,IST_NULL,FALSE,TRUE,0,0,0,"BTS"},
|
||||
{IS_2_ARG,0,IST_NULL,FALSE,TRUE,0,0,0,"BTR"},
|
||||
|
||||
+3
-3
@@ -8,8 +8,8 @@ U8 *LexStmt2Bin(CCmpCtrl *cc,I64 *_type,I64 cmp_flags=0)
|
||||
COCPush(cc);
|
||||
COCInit(cc);
|
||||
if (!PrsStmt(cc,,,cmp_flags)) {
|
||||
if (cc->coc.coc_root.next!=&cc->coc.coc_root) {
|
||||
cc->coc.coc_root.last->ic_flags&=~ICF_RES_NOT_USED;
|
||||
if (cc->coc.coc_head.next!=&cc->coc.coc_head) {
|
||||
cc->coc.coc_head.last->ic_flags&=~ICF_RES_NOT_USED;
|
||||
ICAdd(cc,IC_RETURN_VAL2,0,0);
|
||||
ICAdd(cc,IC_RET,0,0);
|
||||
if (res=COCCompile(cc,&size,NULL,_type)) {
|
||||
@@ -24,7 +24,7 @@ U8 *LexStmt2Bin(CCmpCtrl *cc,I64 *_type,I64 cmp_flags=0)
|
||||
}
|
||||
} //TODO: else del misc?
|
||||
} else //TODO: too dangerous to del Misc?
|
||||
QueDel(&cc->coc.coc_root.next);
|
||||
QueDel(&cc->coc.coc_head.next);
|
||||
if (cc->aot_depth==2) {
|
||||
tempcbh=COCPopNoFree(cc);
|
||||
COCAppend(cc,tempcbh);
|
||||
|
||||
Binary file not shown.
+107
-112
@@ -42,7 +42,7 @@ $LK,"ICU32",A="FL:::/Compiler/BackLib.CPP.Z,47",BI=33$
|
||||
$LK,"ICU24",A="FL:::/Compiler/BackLib.CPP.Z,41",BI=34$
|
||||
$LK,"ICU16",A="FL:::/Compiler/BackLib.CPP.Z,35",BI=35$
|
||||
$LK,"SLASH_OP_DIV",A="FL:::/Compiler/BackLib.CPP.Z,250"$
|
||||
$LK,"CmpFillTables",A="FL:::/Compiler/CInit.CPP.Z,240",BI=36$
|
||||
$LK,"CmpFillTables",A="FL:::/Compiler/CInit.CPP.Z,239",BI=36$
|
||||
$LK,"AOTStoreCodeU32",A="FL:::/Compiler/AsmLib.CPP.Z,30",BI=37$
|
||||
$LK,"ICU64",A="FL:::/Compiler/BackLib.CPP.Z,53",BI=38$
|
||||
$LK,"SLASH_OP_INC",A="FL:::/Compiler/BackLib.CPP.Z,244"$
|
||||
@@ -96,7 +96,7 @@ $LK,"ICDiv",A="FL:::/Compiler/BackA.CPP.Z,391",BI=72$
|
||||
$LK,"ICDeref",A="FL:::/Compiler/BackLib.CPP.Z,709",BI=73$
|
||||
$LK,"ICLea",A="FL:::/Compiler/BackLib.CPP.Z,677",BI=74$
|
||||
$LK,"CmpBuf",A="FL:::/Compiler/CMain.CPP.Z,157",BI=75$
|
||||
$LK,"CMP_TEMPLATES_DONT_PUSH_POP",A="FL:::/Compiler/Templates.CPP.Z,394"$
|
||||
$LK,"CMP_TEMPLATES_DONT_PUSH_POP",A="FL:::/Compiler/Templates.CPP.Z,385"$
|
||||
$LK,"ICAddEct",A="FL:::/Compiler/BackA.CPP.Z,1",BI=76$
|
||||
$LK,"ICToF64",A="FL:::/Compiler/BackB.CPP.Z,283",BI=77$
|
||||
$LK,"PrsBinFile",A="FL:::/Compiler/Asm.CPP.Z,888",BI=78$
|
||||
@@ -130,7 +130,7 @@ $LK,"ICPut",A="FL:::/Compiler/CExcept.CPP.Z,184",BI=102$
|
||||
$LK,"PrsArrayDims",A="FL:::/Compiler/PrsVar.CPP.Z,247",BI=103$
|
||||
$LK,"ICSqr",A="FL:::/Compiler/BackC.CPP.Z,453",BI=104$
|
||||
$LK,"FBO1_NOT_CONST",A="FL:::/Compiler/OptLib.CPP.Z,92"$
|
||||
$LK,"CMP_TEMPLATES_DONT_POP",A="FL:::/Compiler/Templates.CPP.Z,178"$
|
||||
$LK,"CMP_TEMPLATES_DONT_POP",A="FL:::/Compiler/Templates.CPP.Z,173"$
|
||||
$LK,"PrsClass",A="FL:::/Compiler/PrsStmt.CPP.Z,1",BI=105$
|
||||
$LK,"MemberMetaData",A="FL:::/Compiler/LexLib.CPP.Z,45",BI=106$
|
||||
$LK,"ICSwitch",A="FL:::/Compiler/BackC.CPP.Z,599",BI=107$
|
||||
@@ -206,7 +206,7 @@ $LK,"ICFSub",A="FL:::/Compiler/BackFB.CPP.Z,540",BI=162$
|
||||
$LK,"ICFModEqu",A="FL:::/Compiler/BackFA.CPP.Z,545",BI=163$
|
||||
$LK,"CmpF1PushPop",A="FL:::/Compiler/OptLib.CPP.Z,535",BI=164$
|
||||
$LK,"OptFree",A="FL:::/Compiler/OptLib.CPP.Z,33",BI=165$
|
||||
$LK,"CMP_TEMPLATES_DONT_PUSH2",A="FL:::/Compiler/Templates.CPP.Z,458"$
|
||||
$LK,"CMP_TEMPLATES_DONT_PUSH2",A="FL:::/Compiler/Templates.CPP.Z,447"$
|
||||
$LK,"CInternalType",A="FL:::/Compiler/CInit.CPP.Z,3"$
|
||||
$LK,"LexDollar",A="FL:::/Compiler/Lex.CPP.Z,93",BI=166$
|
||||
$LK,"AsmUnresolvedAdd",A="FL:::/Compiler/AsmResolve.CPP.Z,188",BI=167$
|
||||
@@ -228,7 +228,7 @@ $LK,"ICCmpAndBranch",A="FL:::/Compiler/BackB.CPP.Z,468",BI=180$
|
||||
$LK,"ICDivEqu",A="FL:::/Compiler/BackA.CPP.Z,408",BI=181$
|
||||
$LK,"PrsWhile",A="FL:::/Compiler/PrsStmt.CPP.Z,486",BI=182$
|
||||
$LK,"ICFCmpAndBranch",A="FL:::/Compiler/BackFB.CPP.Z,219",BI=183$
|
||||
$LK,"Lex",A="FL:::/Compiler/Lex.CPP.Z,443",BI=184$
|
||||
$LK,"Lex",A="FL:::/Compiler/Lex.CPP.Z,447",BI=184$
|
||||
$LK,"ICTestAndBranch",A="FL:::/Compiler/BackB.CPP.Z,634",BI=185$
|
||||
$LK,"uasm",A="FL:::/Compiler/Compiler.PRJ.Z,21"$
|
||||
$LK,"MODR_INDIRECT_REG",A="FL:::/Compiler/BackLib.CPP.Z,127"$
|
||||
@@ -263,7 +263,7 @@ $LK,"ICAddSubEctEqu",A="FL:::/Compiler/BackA.CPP.Z,478",BI=206$
|
||||
$LK,"ICAddSubEctImm",A="FL:::/Compiler/BackA.CPP.Z,56",BI=207$
|
||||
$LK,"ICPush",A="FL:::/Compiler/BackLib.CPP.Z,293",BI=208$
|
||||
$LK,"ICSwap",A="FL:::/Compiler/BackC.CPP.Z,487",BI=209$
|
||||
$LK,"CMP_TEMPLATES_DONT_PUSH",A="FL:::/Compiler/Templates.CPP.Z,267"$
|
||||
$LK,"CMP_TEMPLATES_DONT_PUSH",A="FL:::/Compiler/Templates.CPP.Z,260"$
|
||||
$LK,"intermediate_code_table",A="FL:::/Compiler/CInit.CPP.Z,16"$
|
||||
$LK,"ICZero",A="FL:::/Compiler/BackLib.CPP.Z,385",BI=210$
|
||||
$LK,"CmpCtrlDel",A="FL:::/Compiler/Lex.CPP.Z,58",BI=211$
|
||||
@@ -292,7 +292,7 @@ $LK,"PrsVarInit2",A="FL:::/Compiler/PrsVar.CPP.Z,123",BI=229$
|
||||
$LK,"PrsPop",A="FL:::/Compiler/PrsLib.CPP.Z,6",BI=230$
|
||||
$LK,"asm_seg_prefixes",A="FL:::/Compiler/Asm.CPP.Z,393"$
|
||||
$LK,"ICMinMax",A="FL:::/Compiler/BackC.CPP.Z,415",BI=231$
|
||||
$LK,"CmpLoadDefines",A="FL:::/Compiler/CInit.CPP.Z,205",BI=232$
|
||||
$LK,"CmpLoadDefines",A="FL:::/Compiler/CInit.CPP.Z,204",BI=232$
|
||||
$LK,"PrsIf",A="FL:::/Compiler/PrsStmt.CPP.Z,459",BI=233$
|
||||
$LK,"ICBuiltInFloatConst",A="FL:::/Compiler/BackLib.CPP.Z,404",BI=234$
|
||||
$LK,"ICFUnaryMinus",A="FL:::/Compiler/BackFA.CPP.Z,194",BI=235$
|
||||
@@ -338,109 +338,104 @@ $LK,"PrsDotDotDot",A="FL:::/Compiler/PrsVar.CPP.Z,381",BI=264$
|
||||
$LK,"ICMulEqu",A="FL:::/Compiler/BackA.CPP.Z,322",BI=265$
|
||||
$LK,"AsmPrsInsFlags",A="FL:::/Compiler/AsmInit.CPP.Z,1",BI=266$
|
||||
$LK,"PrsNoWarn",A="FL:::/Compiler/PrsStmt.CPP.Z,791",BI=267$
|
||||
| ||||