TempleOSCDV4.12.ISO
This commit is contained in:
1 parent
93ca216483
commit
b84bbff6db
376 files changed
+18296
-18738
No files matched your search
Binary file not shown.
+49
-49
@@ -65,28 +65,28 @@ public Bool Copy(U8 *src_files_find_mask,U8 *dst_files_find_mask=".")
|
||||
//it will be stored uncompressed.
|
||||
Bool res=TRUE;
|
||||
CDirContext *dirc;
|
||||
CDirEntry *tempde,*tempde1;
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
U8 *st;
|
||||
if (!(tempde1=FilesFind(src_files_find_mask,FUF_CLUSTER_ORDER)))
|
||||
if (!(tmpde1=FilesFind(src_files_find_mask,FUF_CLUSTER_ORDER)))
|
||||
return FALSE;
|
||||
if (IsDir(dst_files_find_mask)) {
|
||||
if (dirc=DirContextNew(dst_files_find_mask,TRUE)) {
|
||||
tempde=tempde1;
|
||||
while (tempde) {
|
||||
if (!(tempde->attr & RS_ATTR_DIR)) {
|
||||
st=FileNameAbs(tempde->name);
|
||||
if (!CopySingle(tempde->full_name,st))
|
||||
tmpde=tmpde1;
|
||||
while (tmpde) {
|
||||
if (!(tmpde->attr & RS_ATTR_DIR)) {
|
||||
st=FileNameAbs(tmpde->name);
|
||||
if (!CopySingle(tmpde->full_name,st))
|
||||
res=FALSE;
|
||||
Free(st);
|
||||
}
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
DirContextDel(dirc);
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
DirTreeDel(tmpde1);
|
||||
return res;
|
||||
} else {
|
||||
DirTreeDel(tempde1);
|
||||
DirTreeDel(tmpde1);
|
||||
return CopySingle(src_files_find_mask,dst_files_find_mask);
|
||||
}
|
||||
}
|
||||
@@ -100,22 +100,22 @@ public Bool Move(U8 *f1,U8 *f2)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
I64 CopyTree2(CDirEntry *tempde,I64 src_dir_len,I64 dst_dir_len,U8 *dst_dir)
|
||||
I64 CopyTree2(CDirEntry *tmpde,I64 src_dir_len,I64 dst_dir_len,U8 *dst_dir)
|
||||
{
|
||||
U8 *st;
|
||||
I64 res=1;
|
||||
while (tempde) {
|
||||
st=MAlloc(StrLen(tempde->full_name)+dst_dir_len+2);
|
||||
while (tmpde) {
|
||||
st=MAlloc(StrLen(tmpde->full_name)+dst_dir_len+2);
|
||||
MemCpy(st,dst_dir,dst_dir_len);
|
||||
StrCpy(st+dst_dir_len,tempde->full_name+src_dir_len);
|
||||
if (tempde->attr & RS_ATTR_DIR) {
|
||||
MkDir(st,LinkedLstCnt(tempde->sub));
|
||||
res+=CopyTree2(tempde->sub,src_dir_len,dst_dir_len,dst_dir);
|
||||
StrCpy(st+dst_dir_len,tmpde->full_name+src_dir_len);
|
||||
if (tmpde->attr & RS_ATTR_DIR) {
|
||||
MkDir(st,LinkedLstCnt(tmpde->sub));
|
||||
res+=CopyTree2(tmpde->sub,src_dir_len,dst_dir_len,dst_dir);
|
||||
} else
|
||||
if (CopySingle(tempde->full_name,st))
|
||||
if (CopySingle(tmpde->full_name,st))
|
||||
res++;
|
||||
Free(st);
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -124,7 +124,7 @@ public I64 CopyTree(U8 *src_files_find_mask,U8 *dst_files_find_mask,
|
||||
{//Copy directory tree.
|
||||
//Returns the count of copied files (not dirs).
|
||||
CDirContext *dirc;
|
||||
CDirEntry *tempde=NULL;
|
||||
CDirEntry *tmpde=NULL;
|
||||
I64 res=0,i1,i2;
|
||||
U8 *st1,*st2;
|
||||
|
||||
@@ -139,7 +139,7 @@ public I64 CopyTree(U8 *src_files_find_mask,U8 *dst_files_find_mask,
|
||||
Free(st1);
|
||||
Free(st2);
|
||||
if (dirc=DirContextNew(src_files_find_mask,TRUE,,no_mask)) {
|
||||
tempde=FilesFind(dirc->mask,FUF_RECURSE);
|
||||
tmpde=FilesFind(dirc->mask,FUF_RECURSE);
|
||||
st1=CurDir;
|
||||
DirContextDel(dirc);
|
||||
i1=StrLen(st1);
|
||||
@@ -148,45 +148,45 @@ public I64 CopyTree(U8 *src_files_find_mask,U8 *dst_files_find_mask,
|
||||
st2=CurDir;
|
||||
i2=StrLen(st2);
|
||||
if (i2==3) i2--;
|
||||
res=CopyTree2(tempde,i1,i2,st2);
|
||||
res=CopyTree2(tmpde,i1,i2,st2);
|
||||
DirContextDel(dirc);
|
||||
Free(st2);
|
||||
}
|
||||
DirTreeDel(tempde);
|
||||
DirTreeDel(tmpde);
|
||||
Free(st1);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
I64 DelTreeDirs(CDirEntry *tempde1)
|
||||
I64 DelTreeDirs(CDirEntry *tmpde1)
|
||||
{
|
||||
I64 res=0;
|
||||
CDirEntry *tempde2;
|
||||
while (tempde1) {
|
||||
tempde2=tempde1->next;
|
||||
if (tempde1->attr & RS_ATTR_DIR) {
|
||||
if (tempde1->sub)
|
||||
res+=DelTreeDirs(tempde1->sub);
|
||||
res+=Del(tempde1->full_name,TRUE,TRUE);
|
||||
CDirEntry *tmpde2;
|
||||
while (tmpde1) {
|
||||
tmpde2=tmpde1->next;
|
||||
if (tmpde1->attr & RS_ATTR_DIR) {
|
||||
if (tmpde1->sub)
|
||||
res+=DelTreeDirs(tmpde1->sub);
|
||||
res+=Del(tmpde1->full_name,TRUE,TRUE);
|
||||
}
|
||||
DirEntryDel(tempde1);
|
||||
tempde1=tempde2;
|
||||
DirEntryDel(tmpde1);
|
||||
tmpde1=tmpde2;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
I64 DelTreeFiles(CDirEntry *tempde1)
|
||||
I64 DelTreeFiles(CDirEntry *tmpde1)
|
||||
{
|
||||
I64 res=0;
|
||||
CDirEntry *tempde2;
|
||||
while (tempde1) {
|
||||
tempde2=tempde1->next;
|
||||
if (tempde1->attr & RS_ATTR_DIR) {
|
||||
if (tempde1->sub)
|
||||
res+=DelTreeFiles(tempde1->sub);
|
||||
CDirEntry *tmpde2;
|
||||
while (tmpde1) {
|
||||
tmpde2=tmpde1->next;
|
||||
if (tmpde1->attr & RS_ATTR_DIR) {
|
||||
if (tmpde1->sub)
|
||||
res+=DelTreeFiles(tmpde1->sub);
|
||||
} else
|
||||
res+=Del(tempde1->full_name,FALSE,TRUE);
|
||||
DirEntryDel(tempde1);
|
||||
tempde1=tempde2;
|
||||
res+=Del(tmpde1->full_name,FALSE,TRUE);
|
||||
DirEntryDel(tmpde1);
|
||||
tmpde1=tmpde2;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -240,13 +240,13 @@ To Set DateL:
|
||||
Touch(filename,"",,datetime);
|
||||
*/
|
||||
I64 fuf_flags=0;
|
||||
CDirEntry *tempde,*tempde1;
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+f+F");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
||||
while (tempde) {
|
||||
TouchFile(tempde->full_name,attr,cdt);
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||
while (tmpde) {
|
||||
TouchFile(tmpde->full_name,attr,cdt);
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
DirTreeDel(tmpde1);
|
||||
}
|
||||
+78
-78
@@ -1,102 +1,102 @@
|
||||
#help_index "File/Internal"
|
||||
I64 DirTreeSerializeSize(CDirEntry *tempde)
|
||||
I64 DirTreeSerializeSize(CDirEntry *tmpde)
|
||||
{
|
||||
I64 res=0;
|
||||
while (tempde) {
|
||||
while (tmpde) {
|
||||
res+=CDIR_SIZE+1;
|
||||
if (tempde->attr & RS_ATTR_DIR)
|
||||
res+=DirTreeSerializeSize(tempde->sub);
|
||||
tempde=tempde->next;
|
||||
if (tmpde->attr & RS_ATTR_DIR)
|
||||
res+=DirTreeSerializeSize(tmpde->sub);
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
return res+1;
|
||||
}
|
||||
I64 DirTreeSerializeFill(CDirEntry *tempde,U8 *dst)
|
||||
I64 DirTreeSerializeFill(CDirEntry *tmpde,U8 *dst)
|
||||
{
|
||||
I64 res=0,i;
|
||||
while (tempde) {
|
||||
while (tmpde) {
|
||||
*dst++=1;
|
||||
res++;
|
||||
MemCpy(dst,&tempde->start,CDIR_SIZE);
|
||||
MemCpy(dst,&tmpde->start,CDIR_SIZE);
|
||||
dst+=CDIR_SIZE;
|
||||
res+=CDIR_SIZE;
|
||||
if (tempde->attr & RS_ATTR_DIR) {
|
||||
i=DirTreeSerializeFill(tempde->sub,dst);
|
||||
if (tmpde->attr & RS_ATTR_DIR) {
|
||||
i=DirTreeSerializeFill(tmpde->sub,dst);
|
||||
dst+=i;
|
||||
res+=i;
|
||||
}
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
*dst=0;
|
||||
return res+1;
|
||||
}
|
||||
public U8 *DirTreeSerialize(CDirEntry *tempde,I64 *_size=NULL)
|
||||
public U8 *DirTreeSerialize(CDirEntry *tmpde,I64 *_size=NULL)
|
||||
{//Serialize tree returned from $LK,"FilesFind",A="MN:FilesFind"$() into a one contiguous U8 array.
|
||||
I64 size=DirTreeSerializeSize(tempde);
|
||||
I64 size=DirTreeSerializeSize(tmpde);
|
||||
U8 *buf=MAlloc(size);
|
||||
DirTreeSerializeFill(tempde,buf);
|
||||
DirTreeSerializeFill(tmpde,buf);
|
||||
if (_size) *_size=size;
|
||||
return buf;
|
||||
}
|
||||
|
||||
U8 *DirTreeUnserialize2(U8 *src,CDirEntry **tempde)
|
||||
U8 *DirTreeUnserialize2(U8 *src,CDirEntry **tmpde)
|
||||
{
|
||||
CDirEntry *tempde1;
|
||||
CDirEntry *tmpde1;
|
||||
if (*src++) {
|
||||
tempde1=CAlloc(sizeof(CDirEntry));
|
||||
*tempde=tempde1;
|
||||
MemCpy(&tempde1->start,src,CDIR_SIZE);
|
||||
tmpde1=CAlloc(sizeof(CDirEntry));
|
||||
*tmpde=tmpde1;
|
||||
MemCpy(&tmpde1->start,src,CDIR_SIZE);
|
||||
src+=CDIR_SIZE;
|
||||
if (tempde1->attr & RS_ATTR_DIR)
|
||||
src=DirTreeUnserialize2(src,&tempde1->sub);
|
||||
src=DirTreeUnserialize2(src,&tempde1->next);
|
||||
if (tmpde1->attr & RS_ATTR_DIR)
|
||||
src=DirTreeUnserialize2(src,&tmpde1->sub);
|
||||
src=DirTreeUnserialize2(src,&tmpde1->next);
|
||||
} else
|
||||
*tempde=NULL;
|
||||
*tmpde=NULL;
|
||||
return src;
|
||||
}
|
||||
public CDirEntry *DirTreeUnserialize(U8 *src)
|
||||
{//Unserialize tree to make it like a tree returned from $LK,"FilesFind",A="MN:FilesFind"$().
|
||||
CDirEntry *tempde=NULL;
|
||||
DirTreeUnserialize2(src,&tempde);
|
||||
return tempde;
|
||||
CDirEntry *tmpde=NULL;
|
||||
DirTreeUnserialize2(src,&tmpde);
|
||||
return tmpde;
|
||||
}
|
||||
|
||||
#help_index "File/Program Routines"
|
||||
U0 FOFlatten(CDirEntry *tempde,CDirEntry **a,I64 *i)
|
||||
U0 FOFlatten(CDirEntry *tmpde,CDirEntry **a,I64 *i)
|
||||
{
|
||||
CDirEntry *tempde1;
|
||||
while (tempde) {
|
||||
tempde1=tempde->next;
|
||||
if (tempde->attr&RS_ATTR_DIR) {
|
||||
FOFlatten(tempde->sub,a,i);
|
||||
DirEntryDel(tempde);
|
||||
CDirEntry *tmpde1;
|
||||
while (tmpde) {
|
||||
tmpde1=tmpde->next;
|
||||
if (tmpde->attr&RS_ATTR_DIR) {
|
||||
FOFlatten(tmpde->sub,a,i);
|
||||
DirEntryDel(tmpde);
|
||||
} else {
|
||||
a[*i]=tempde;
|
||||
a[*i]=tmpde;
|
||||
*i=*i+1;
|
||||
}
|
||||
tempde=tempde1;
|
||||
tmpde=tmpde1;
|
||||
}
|
||||
}
|
||||
|
||||
I64 Size1(CDirEntry *tempde,I64 *_fuf_flags,I64 round_to)
|
||||
I64 Size1(CDirEntry *tmpde,I64 *_fuf_flags,I64 round_to)
|
||||
{
|
||||
U8 buf[BLK_SIZE];
|
||||
I64 res=0,i;
|
||||
CDrv *dv;
|
||||
while (tempde) {
|
||||
if ((i=tempde->size) && Bt(_fuf_flags,FUf_EXPAND) &&
|
||||
!(tempde->attr&RS_ATTR_DIR) &&
|
||||
FileAttr(tempde->name)&RS_ATTR_COMPRESSED) {
|
||||
dv=Let2Drv(*tempde->full_name);
|
||||
RBlks(dv,buf,Cluster2Blk(dv,tempde->cluster),1);
|
||||
while (tmpde) {
|
||||
if ((i=tmpde->size) && Bt(_fuf_flags,FUf_EXPAND) &&
|
||||
!(tmpde->attr&RS_ATTR_DIR) &&
|
||||
FileAttr(tmpde->name)&RS_ATTR_COMPRESSED) {
|
||||
dv=Let2Drv(*tmpde->full_name);
|
||||
RBlks(dv,buf,Cluster2Blk(dv,tmpde->cluster),1);
|
||||
i=(&buf)(CArcCompress *)->expanded_size;
|
||||
}
|
||||
if (round_to)
|
||||
i=CeilU64(tempde->size,round_to);
|
||||
if (tempde->attr&RS_ATTR_DIR)
|
||||
i+=Size1(tempde->sub,_fuf_flags,round_to);
|
||||
tempde->user_data=i;
|
||||
i=CeilU64(tmpde->size,round_to);
|
||||
if (tmpde->attr&RS_ATTR_DIR)
|
||||
i+=Size1(tmpde->sub,_fuf_flags,round_to);
|
||||
tmpde->user_data=i;
|
||||
res+=i;
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -105,26 +105,26 @@ public I64 Size(U8 *files_find_mask="/*",U8 *fu_flags=NULL,I64 round_to=0)
|
||||
//Does not include directory size of base directory, but
|
||||
//does include size of sub directories.
|
||||
I64 fuf_flags=0,res=0;
|
||||
CDirEntry *tempde1=NULL;
|
||||
CDirEntry *tmpde1=NULL;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
if (tempde1=FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND)) {
|
||||
if (tmpde1=FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND)) {
|
||||
fuf_flags&=FUF_EXPAND;
|
||||
res=Size1(tempde1,&fuf_flags,round_to);
|
||||
DirTreeDel(tempde1);
|
||||
res=Size1(tmpde1,&fuf_flags,round_to);
|
||||
DirTreeDel(tmpde1);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public I64 FileCnt(CDirEntry *tempde)
|
||||
public I64 FileCnt(CDirEntry *tmpde)
|
||||
{//Cnt of files in $LK,"CDirEntry",A="MN:CDirEntry"$ tree.
|
||||
I64 cnt=0;
|
||||
while (tempde) {
|
||||
if (tempde->attr&RS_ATTR_DIR)
|
||||
cnt+=FileCnt(tempde->sub);
|
||||
while (tmpde) {
|
||||
if (tmpde->attr&RS_ATTR_DIR)
|
||||
cnt+=FileCnt(tmpde->sub);
|
||||
else
|
||||
cnt++;
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
return cnt;
|
||||
}
|
||||
@@ -133,37 +133,37 @@ public I64 FileCnt(CDirEntry *tempde)
|
||||
public I64 FF(U8 *files_find_mask,U8 *fu_flags=NULL)
|
||||
{//Files find. List files matching mask.
|
||||
I64 cnt=0,fuf_flags=0;
|
||||
CDirEntry *tempde,*tempde1;
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
||||
while (tempde) {
|
||||
PutFileLink(tempde->full_name);
|
||||
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||
while (tmpde) {
|
||||
PutFileLink(tmpde->full_name);
|
||||
'\n';
|
||||
cnt++;
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
DirTreeDel(tmpde1);
|
||||
return cnt;
|
||||
}
|
||||
|
||||
public I64 Zip(U8 *files_find_mask="*",U8 *fu_flags=NULL)
|
||||
{//Compress files by moving to .Z filename.
|
||||
U8 *st;
|
||||
CDirEntry *tempde,*tempde1;
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
I64 res=0,fuf_flags=0;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+O");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
||||
while (tempde) {
|
||||
if (!IsDotZ(tempde->full_name)) {
|
||||
st=MStrPrint("%s.Z",tempde->full_name);
|
||||
res+=Move(tempde->full_name,st);
|
||||
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||
while (tmpde) {
|
||||
if (!IsDotZ(tmpde->full_name)) {
|
||||
st=MStrPrint("%s.Z",tmpde->full_name);
|
||||
res+=Move(tmpde->full_name,st);
|
||||
Free(st);
|
||||
}
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
DirTreeDel(tmpde1);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -172,20 +172,20 @@ public I64 Unzip(U8 *files_find_mask="*.Z",U8 *fu_flags=NULL)
|
||||
//You don't have to do this for normal operation.
|
||||
//It automatically unzips ".Z" files.
|
||||
U8 *st;
|
||||
CDirEntry *tempde,*tempde1;
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
I64 res=0,fuf_flags=0;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+O");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
||||
while (tempde) {
|
||||
if (IsDotZ(tempde->full_name)) {
|
||||
st=StrNew(tempde->full_name);
|
||||
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||
while (tmpde) {
|
||||
if (IsDotZ(tmpde->full_name)) {
|
||||
st=StrNew(tmpde->full_name);
|
||||
StrLastRem(st,".");
|
||||
res+=Move(tempde->full_name,st);
|
||||
res+=Move(tmpde->full_name,st);
|
||||
Free(st);
|
||||
}
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
DirTreeDel(tmpde1);
|
||||
return res;
|
||||
}
|
||||
+35
-35
@@ -10,36 +10,36 @@ Bool ChkDskConfirm(Bool *_fix,Bool *_confirm)
|
||||
return *_fix;
|
||||
}
|
||||
|
||||
I64 RedSeaChkDskLst(CDrv *dv,CDirEntry *tempde1,
|
||||
I64 RedSeaChkDskLst(CDrv *dv,CDirEntry *tmpde1,
|
||||
U8 *bits,U8 *bits2,I64 size,I64 bpc)
|
||||
{
|
||||
CDirEntry *tempde2;
|
||||
CDirEntry *tmpde2;
|
||||
I64 i,j,errs=0;
|
||||
while (tempde1) {
|
||||
tempde2=tempde1->next;
|
||||
if (tempde1->attr & RS_ATTR_DIR && tempde1->sub)
|
||||
errs+=RedSeaChkDskLst(dv,tempde1->sub,bits,bits2,size,bpc);
|
||||
j=(tempde1->size+bpc-1)/bpc;
|
||||
while (tmpde1) {
|
||||
tmpde2=tmpde1->next;
|
||||
if (tmpde1->attr & RS_ATTR_DIR && tmpde1->sub)
|
||||
errs+=RedSeaChkDskLst(dv,tmpde1->sub,bits,bits2,size,bpc);
|
||||
j=(tmpde1->size+bpc-1)/bpc;
|
||||
for (i=0;i<j;i++) {
|
||||
if (i+tempde1->cluster-dv->data_area>size) {
|
||||
PrintErr("Invalid Cluster:%s Cluster:%X\n",tempde1->full_name,
|
||||
i+tempde1->cluster);
|
||||
if (i+tmpde1->cluster-dv->data_area>size) {
|
||||
PrintErr("Invalid Cluster:%s Cluster:%X\n",tmpde1->full_name,
|
||||
i+tmpde1->cluster);
|
||||
errs++;
|
||||
break;
|
||||
}
|
||||
if (LBts(bits,i+tempde1->cluster-dv->data_area)) {
|
||||
PrintErr("Dbl Alloc:%s Cluster:%X\n",tempde1->full_name,
|
||||
i+tempde1->cluster);
|
||||
if (LBts(bits,i+tmpde1->cluster-dv->data_area)) {
|
||||
PrintErr("Dbl Alloc:%s Cluster:%X\n",tmpde1->full_name,
|
||||
i+tmpde1->cluster);
|
||||
errs++;
|
||||
}
|
||||
if (!LBtr(bits2,i+tempde1->cluster-dv->data_area)) {
|
||||
PrintErr("UnAlloc:%s Cluster:%X\n",tempde1->full_name,
|
||||
i+tempde1->cluster);
|
||||
if (!LBtr(bits2,i+tmpde1->cluster-dv->data_area)) {
|
||||
PrintErr("UnAlloc:%s Cluster:%X\n",tmpde1->full_name,
|
||||
i+tmpde1->cluster);
|
||||
errs++;
|
||||
}
|
||||
}
|
||||
DirEntryDel(tempde1);
|
||||
tempde1=tempde2;
|
||||
DirEntryDel(tmpde1);
|
||||
tmpde1=tmpde2;
|
||||
}
|
||||
return errs;
|
||||
}
|
||||
@@ -103,48 +103,48 @@ I64 RedSeaChkDsk(U8 drv_let,Bool *_fix,Bool *_confirm)
|
||||
return errs;
|
||||
}
|
||||
|
||||
I64 FAT32ChkDskLst(CDrv *dv,CDirEntry *tempde1,
|
||||
I64 FAT32ChkDskLst(CDrv *dv,CDirEntry *tmpde1,
|
||||
U8 *bits,U32 *bits2,I64 size,I64 bpc)
|
||||
{
|
||||
CDirEntry *tempde2;
|
||||
CDirEntry *tmpde2;
|
||||
I64 i,c,errs=0;
|
||||
while (tempde1) {
|
||||
tempde2=tempde1->next;
|
||||
if (tempde1->attr & RS_ATTR_DIR && tempde1->sub)
|
||||
errs+=FAT32ChkDskLst(dv,tempde1->sub,bits,bits2,size,bpc);
|
||||
while (tmpde1) {
|
||||
tmpde2=tmpde1->next;
|
||||
if (tmpde1->attr & RS_ATTR_DIR && tmpde1->sub)
|
||||
errs+=FAT32ChkDskLst(dv,tmpde1->sub,bits,bits2,size,bpc);
|
||||
i=0;
|
||||
c=tempde1->cluster;
|
||||
c=tmpde1->cluster;
|
||||
while (0<c<0x0FFFFFF8) {
|
||||
if (c>size) {
|
||||
PrintErr("Invalid Cluster:%s Cluster:%X\n",tempde1->full_name,c);
|
||||
PrintErr("Invalid Cluster:%s Cluster:%X\n",tmpde1->full_name,c);
|
||||
errs++;
|
||||
break;
|
||||
}
|
||||
if (LBts(bits,c)) {
|
||||
PrintErr("Dbl Alloc:%s Cluster:%X\n",tempde1->full_name,c);
|
||||
PrintErr("Dbl Alloc:%s Cluster:%X\n",tmpde1->full_name,c);
|
||||
errs++;
|
||||
}
|
||||
if (!bits2[c]) {
|
||||
PrintErr("UnAlloc:%s Cluster:%X\n",tempde1->full_name,c);
|
||||
PrintErr("UnAlloc:%s Cluster:%X\n",tmpde1->full_name,c);
|
||||
errs++;
|
||||
} else
|
||||
bits2[c]=0;
|
||||
c=ClusterNumNext(dv,c);
|
||||
i++;
|
||||
}
|
||||
if (!(tempde1->attr & RS_ATTR_DIR)) {
|
||||
if (!(tmpde1->attr & RS_ATTR_DIR)) {
|
||||
i*=bpc;
|
||||
if (tempde1->size>i) {
|
||||
PrintErr("Alloced File Too Short:%s\n",tempde1->full_name);
|
||||
if (tmpde1->size>i) {
|
||||
PrintErr("Alloced File Too Short:%s\n",tmpde1->full_name);
|
||||
errs++;
|
||||
}
|
||||
if (i>tempde1->size+bpc-1) {
|
||||
PrintWarn("Alloced File Too Long:%s\n",tempde1->full_name);
|
||||
if (i>tmpde1->size+bpc-1) {
|
||||
PrintWarn("Alloced File Too Long:%s\n",tmpde1->full_name);
|
||||
errs++;
|
||||
}
|
||||
}
|
||||
DirEntryDel(tempde1);
|
||||
tempde1=tempde2;
|
||||
DirEntryDel(tmpde1);
|
||||
tmpde1=tmpde2;
|
||||
}
|
||||
return errs;
|
||||
}
|
||||
|
||||
+196
-196
@@ -1,18 +1,18 @@
|
||||
#help_index "DolDoc/Output;StdOut/DolDoc"
|
||||
U0 DirFileDoc(CDoc *doc,CDirEntry *tempde)
|
||||
U0 DirFileDoc(CDoc *doc,CDirEntry *tmpde)
|
||||
{
|
||||
while (tempde) {
|
||||
if (tempde->attr & RS_ATTR_DIR) {
|
||||
tempde->user_data=DocPrint(doc,"$$TR,\"%s\",U=0x%X$$",tempde->name,tempde);
|
||||
while (tmpde) {
|
||||
if (tmpde->attr & RS_ATTR_DIR) {
|
||||
tmpde->user_data=DocPrint(doc,"$$TR,\"%s\",U=0x%X$$",tmpde->name,tmpde);
|
||||
DocPrint(doc,"\n$$ID,+2$$");
|
||||
if (tempde->sub)
|
||||
DirFileDoc(doc,tempde->sub);
|
||||
if (tmpde->sub)
|
||||
DirFileDoc(doc,tmpde->sub);
|
||||
DocPrint(doc,"$$ID,-2$$");
|
||||
} else {
|
||||
tempde->user_data=DocPrint(doc,"$$MU,\"%s\",U=0x%X$$",tempde->name,tempde);
|
||||
tmpde->user_data=DocPrint(doc,"$$MU,\"%s\",U=0x%X$$",tmpde->name,tmpde);
|
||||
DocPrint(doc,"\n");
|
||||
}
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,16 +31,16 @@ class CFMUncollapsedLst
|
||||
CFMUncollapsedLst *FMCollectUncollapsedLst(CDoc *doc)
|
||||
{
|
||||
CDocEntry *doc_e=doc->head.next;
|
||||
CFMUncollapsedLst *res=NULL,*tempc;
|
||||
CDirEntry *tempde;
|
||||
CFMUncollapsedLst *res=NULL,*tmpc;
|
||||
CDirEntry *tmpde;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_TREE) {
|
||||
if (!(doc_e->de_flags&DOCEF_CHECKED_COLLAPSED)) {
|
||||
if (tempde=doc_e->user_data) {
|
||||
tempc=MAlloc(sizeof(CFMUncollapsedLst));
|
||||
tempc->next=res;
|
||||
res=tempc;
|
||||
tempc->name=StrNew(tempde->full_name);
|
||||
if (tmpde=doc_e->user_data) {
|
||||
tmpc=MAlloc(sizeof(CFMUncollapsedLst));
|
||||
tmpc->next=res;
|
||||
res=tmpc;
|
||||
tmpc->name=StrNew(tmpde->full_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -49,49 +49,49 @@ CFMUncollapsedLst *FMCollectUncollapsedLst(CDoc *doc)
|
||||
return res;
|
||||
}
|
||||
|
||||
U0 FMMarkUncollapsed(CDoc *doc,CFMUncollapsedLst *tempc,
|
||||
U0 FMMarkUncollapsed(CDoc *doc,CFMUncollapsedLst *tmpc,
|
||||
U8 *cur_entry,U8 *next_entry)
|
||||
{
|
||||
CDocEntry *doc_e=doc->head.next;
|
||||
CFMUncollapsedLst *tempc1;
|
||||
CDirEntry *tempde;
|
||||
CFMUncollapsedLst *tmpc1;
|
||||
CDirEntry *tmpde;
|
||||
while (doc_e!=doc) {
|
||||
if (doc_e->type_u8==DOCT_TREE) {
|
||||
tempde=doc_e->user_data;
|
||||
tempc1=tempc;
|
||||
while (tempc1) {
|
||||
if (!StrCmp(tempc1->name,tempde->full_name)) {
|
||||
tmpde=doc_e->user_data;
|
||||
tmpc1=tmpc;
|
||||
while (tmpc1) {
|
||||
if (!StrCmp(tmpc1->name,tmpde->full_name)) {
|
||||
doc_e->de_flags&=~DOCEF_CHECKED_COLLAPSED;
|
||||
break;
|
||||
}
|
||||
tempc1=tempc1->next;
|
||||
tmpc1=tmpc1->next;
|
||||
}
|
||||
if (cur_entry) {
|
||||
if (!StrNCmp(cur_entry,tempde->full_name,StrLen(tempde->full_name))) {
|
||||
if (!StrNCmp(cur_entry,tmpde->full_name,StrLen(tmpde->full_name))) {
|
||||
doc->cur_entry=doc_e;
|
||||
if (StrLen(tempde->full_name)==StrLen(cur_entry))
|
||||
if (StrLen(tmpde->full_name)==StrLen(cur_entry))
|
||||
cur_entry=NULL;
|
||||
} else if (next_entry) {
|
||||
if (!StrNCmp(next_entry,
|
||||
tempde->full_name,StrLen(tempde->full_name))) {
|
||||
tmpde->full_name,StrLen(tmpde->full_name))) {
|
||||
doc->cur_entry=doc_e;
|
||||
if (StrLen(tempde->full_name)==StrLen(next_entry))
|
||||
if (StrLen(tmpde->full_name)==StrLen(next_entry))
|
||||
cur_entry=NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (doc_e->type_u8==DOCT_MENU_VAL) {
|
||||
tempde=doc_e->user_data;
|
||||
tmpde=doc_e->user_data;
|
||||
if (cur_entry) {
|
||||
if (!StrNCmp(cur_entry,tempde->full_name,StrLen(tempde->full_name))) {
|
||||
if (!StrNCmp(cur_entry,tmpde->full_name,StrLen(tmpde->full_name))) {
|
||||
doc->cur_entry=doc_e;
|
||||
if (StrLen(tempde->full_name)==StrLen(cur_entry))
|
||||
if (StrLen(tmpde->full_name)==StrLen(cur_entry))
|
||||
cur_entry=NULL;
|
||||
} else if (next_entry) {
|
||||
if (!StrNCmp(next_entry,
|
||||
tempde->full_name,StrLen(tempde->full_name))) {
|
||||
tmpde->full_name,StrLen(tmpde->full_name))) {
|
||||
doc->cur_entry=doc_e;
|
||||
if (StrLen(tempde->full_name)==StrLen(next_entry))
|
||||
if (StrLen(tmpde->full_name)==StrLen(next_entry))
|
||||
cur_entry=NULL;
|
||||
}
|
||||
}
|
||||
@@ -101,44 +101,44 @@ U0 FMMarkUncollapsed(CDoc *doc,CFMUncollapsedLst *tempc,
|
||||
}
|
||||
}
|
||||
|
||||
U0 FMDelUncollapsedLst(CFMUncollapsedLst *tempc)
|
||||
U0 FMDelUncollapsedLst(CFMUncollapsedLst *tmpc)
|
||||
{
|
||||
CFMUncollapsedLst *tempc1;
|
||||
while (tempc) {
|
||||
tempc1=tempc->next;
|
||||
Free(tempc->name);
|
||||
Free(tempc);
|
||||
tempc=tempc1;
|
||||
CFMUncollapsedLst *tmpc1;
|
||||
while (tmpc) {
|
||||
tmpc1=tmpc->next;
|
||||
Free(tmpc->name);
|
||||
Free(tmpc);
|
||||
tmpc=tmpc1;
|
||||
}
|
||||
}
|
||||
|
||||
CDirEntry *FMRebuildDocDrv(U8 drv_let,CDoc *doc,CDirEntry **_head,Bool init)
|
||||
{
|
||||
CDirEntry *tempde,*tempde1;
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
U8 *st;
|
||||
tempde=CAlloc(sizeof(CDirEntry));
|
||||
tempde->full_name=MStrPrint("%C:/",drv_let);
|
||||
tempde->attr=RS_ATTR_DIR;
|
||||
tmpde=CAlloc(sizeof(CDirEntry));
|
||||
tmpde->full_name=MStrPrint("%C:/",drv_let);
|
||||
tmpde->attr=RS_ATTR_DIR;
|
||||
st=MStrPrint("%c:/*",drv_let);
|
||||
if (init)
|
||||
tempde->sub=tempde1=FilesFind(st,FUF_RECURSE);
|
||||
tmpde->sub=tmpde1=FilesFind(st,FUF_RECURSE);
|
||||
else
|
||||
tempde1=NULL;
|
||||
tmpde1=NULL;
|
||||
Free(st);
|
||||
tempde->user_data=DocPrint(doc,"$$TR,\"%s\",U=0x%X$$",tempde->full_name,tempde);
|
||||
tempde->next=*_head;
|
||||
*_head=tempde;
|
||||
tmpde->user_data=DocPrint(doc,"$$TR,\"%s\",U=0x%X$$",tmpde->full_name,tmpde);
|
||||
tmpde->next=*_head;
|
||||
*_head=tmpde;
|
||||
DocPrint(doc,"\n$$ID,+2$$");
|
||||
DocBottom(doc);
|
||||
if (init) {
|
||||
DirFileDoc(doc,tempde1);
|
||||
while (tempde1) {
|
||||
tempde1->parent=tempde;
|
||||
tempde1=tempde1->next;
|
||||
DirFileDoc(doc,tmpde1);
|
||||
while (tmpde1) {
|
||||
tmpde1->parent=tmpde;
|
||||
tmpde1=tmpde1->next;
|
||||
}
|
||||
}
|
||||
DocPrint(doc,"$$ID,-2$$");
|
||||
return tempde;
|
||||
return tmpde;
|
||||
}
|
||||
|
||||
U0 FMRebuildDoc(CDoc **_doc,CDirEntry **_head,I64 mode)
|
||||
@@ -146,17 +146,17 @@ U0 FMRebuildDoc(CDoc **_doc,CDirEntry **_head,I64 mode)
|
||||
CDrv *dv;
|
||||
I64 i;
|
||||
CDoc *doc=*_doc,*doc2=sys_clipboard_doc,*parent_doc;
|
||||
CFMUncollapsedLst *tempc=NULL;
|
||||
CFMUncollapsedLst *tmpc=NULL;
|
||||
U8 *cur_entry=NULL,*next_entry=NULL;
|
||||
CDocEntry *doc_ce;
|
||||
CDirEntry *tempde,*tempde1,*cur_tree_entry;
|
||||
CDirEntry *tmpde,*tmpde1,*cur_tree_entry;
|
||||
if (!doc)
|
||||
parent_doc=DocPut;
|
||||
else {
|
||||
parent_doc=doc->parent_doc;
|
||||
Fs->put_doc=Fs->display_doc=NULL;
|
||||
DocUnlock(doc);
|
||||
WinMgrSync;
|
||||
Refresh;
|
||||
DocLock(doc);
|
||||
cur_tree_entry=NULL;
|
||||
doc_ce=doc->cur_entry;
|
||||
@@ -164,32 +164,32 @@ U0 FMRebuildDoc(CDoc **_doc,CDirEntry **_head,I64 mode)
|
||||
cur_tree_entry=doc_ce->user_data;
|
||||
if (cur_tree_entry)
|
||||
cur_entry=StrNew(cur_tree_entry->full_name);
|
||||
tempde=NULL;
|
||||
tmpde=NULL;
|
||||
if (doc_ce!=doc)
|
||||
doc_ce=doc_ce->next;
|
||||
while (doc_ce!=doc) {
|
||||
if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL)
|
||||
tempde=doc_ce->user_data;
|
||||
tmpde=doc_ce->user_data;
|
||||
else
|
||||
tempde=NULL;
|
||||
if (tempde) {
|
||||
tempde1=tempde->parent;
|
||||
while (tempde1) {
|
||||
if (tempde1==cur_tree_entry) {
|
||||
tempde=NULL;
|
||||
tmpde=NULL;
|
||||
if (tmpde) {
|
||||
tmpde1=tmpde->parent;
|
||||
while (tmpde1) {
|
||||
if (tmpde1==cur_tree_entry) {
|
||||
tmpde=NULL;
|
||||
break;
|
||||
} else
|
||||
tempde1=tempde1->parent;
|
||||
tmpde1=tmpde1->parent;
|
||||
}
|
||||
if (tempde)
|
||||
if (tmpde)
|
||||
break;
|
||||
}
|
||||
doc_ce=doc_ce->next;
|
||||
}
|
||||
if (tempde)
|
||||
next_entry=StrNew(tempde->full_name);
|
||||
if (tmpde)
|
||||
next_entry=StrNew(tmpde->full_name);
|
||||
|
||||
tempc=FMCollectUncollapsedLst(doc);
|
||||
tmpc=FMCollectUncollapsedLst(doc);
|
||||
DocDel(doc);
|
||||
}
|
||||
if (*_head) {
|
||||
@@ -219,19 +219,19 @@ U0 FMRebuildDoc(CDoc **_doc,CDirEntry **_head,I64 mode)
|
||||
dv=&blkdev.drvs[i];
|
||||
if (dv->bd->type==BDT_ATAPI) {
|
||||
if (dv->bd->flags&BDF_INITIALIZED)
|
||||
tempde=FMRebuildDocDrv(Drv2Let(dv),doc,_head,TRUE);
|
||||
tmpde=FMRebuildDocDrv(Drv2Let(dv),doc,_head,TRUE);
|
||||
else {
|
||||
tempde=FMRebuildDocDrv(Drv2Let(dv),doc,_head,FALSE);
|
||||
tempde->flags|=DEF_NOT_INITIALIZED;
|
||||
tmpde=FMRebuildDocDrv(Drv2Let(dv),doc,_head,FALSE);
|
||||
tmpde->flags|=DEF_NOT_INITIALIZED;
|
||||
}
|
||||
} else if (dv->fs_type==FSt_REDSEA || dv->fs_type==FSt_FAT32)
|
||||
FMRebuildDocDrv(Drv2Let(dv),doc,_head,TRUE);
|
||||
}
|
||||
DocTop(doc);
|
||||
FMMarkUncollapsed(doc,tempc,cur_entry,next_entry);
|
||||
FMMarkUncollapsed(doc,tmpc,cur_entry,next_entry);
|
||||
DocCenter(doc);
|
||||
DocRst(doc2,TRUE);
|
||||
FMDelUncollapsedLst(tempc);
|
||||
FMDelUncollapsedLst(tmpc);
|
||||
Free(cur_entry);
|
||||
Free(next_entry);
|
||||
*_doc=doc;
|
||||
@@ -243,28 +243,28 @@ U0 FMRename(CDoc *doc)
|
||||
{
|
||||
CEdFileName fn;
|
||||
CDocEntry *doc_e=doc->cur_entry;
|
||||
CDirEntry *tempde=NULL,*parent;
|
||||
CDirEntry *tmpde=NULL,*parent;
|
||||
if (doc_e->type_u8==DOCT_MENU_VAL) {
|
||||
tempde=doc_e->user_data;
|
||||
if (parent=tempde->parent) {
|
||||
tmpde=doc_e->user_data;
|
||||
if (parent=tmpde->parent) {
|
||||
Cd(parent->full_name);
|
||||
StrCpy(fn.name,tempde->name);
|
||||
StrCpy(fn.name,tmpde->name);
|
||||
if (DocForm(&fn)) {
|
||||
Silent;
|
||||
Move(tempde->name,fn.name);
|
||||
Move(tmpde->name,fn.name);
|
||||
Silent(OFF);
|
||||
}
|
||||
}
|
||||
} else if (doc_e->type_u8==DOCT_TREE) {
|
||||
tempde=doc_e->user_data;
|
||||
if (parent=tempde->parent) {
|
||||
tmpde=doc_e->user_data;
|
||||
if (parent=tmpde->parent) {
|
||||
Cd(parent->full_name);
|
||||
StrCpy(fn.name,tempde->name);
|
||||
StrCpy(fn.name,tmpde->name);
|
||||
if (DocForm(&fn)) {
|
||||
if (StrCmp(tempde->name,fn.name)) {
|
||||
if (StrCmp(tmpde->name,fn.name)) {
|
||||
Silent;
|
||||
if (CopyTree(tempde->name,fn.name))
|
||||
DelTree(tempde->name);
|
||||
if (CopyTree(tmpde->name,fn.name))
|
||||
DelTree(tmpde->name);
|
||||
Silent(OFF);
|
||||
}
|
||||
}
|
||||
@@ -276,11 +276,11 @@ U0 FMMkDir(CDoc *doc)
|
||||
{
|
||||
CEdFileName fn;
|
||||
CDocEntry *doc_e=doc->cur_entry;
|
||||
CDirEntry *tempde=NULL,*parent;
|
||||
CDirEntry *tmpde=NULL,*parent;
|
||||
*fn.name=0;
|
||||
if (doc_e->type_u8==DOCT_MENU_VAL) {
|
||||
tempde=doc_e->user_data;
|
||||
if (parent=tempde->parent) {
|
||||
tmpde=doc_e->user_data;
|
||||
if (parent=tmpde->parent) {
|
||||
Cd(parent->full_name);
|
||||
if (DocForm(&fn)) {
|
||||
Silent;
|
||||
@@ -289,8 +289,8 @@ U0 FMMkDir(CDoc *doc)
|
||||
}
|
||||
}
|
||||
} else if (doc_e->type_u8==DOCT_TREE) {
|
||||
tempde=doc_e->user_data;
|
||||
Cd(tempde->full_name);
|
||||
tmpde=doc_e->user_data;
|
||||
Cd(tmpde->full_name);
|
||||
if (DocForm(&fn)) {
|
||||
Silent;
|
||||
MkDir(fn.name);
|
||||
@@ -303,21 +303,21 @@ U0 FMDelete(CDoc *doc)
|
||||
{
|
||||
U8 *st;
|
||||
CDocEntry *doc_ce=doc->cur_entry;
|
||||
CDirEntry *tempde;
|
||||
CDirEntry *tmpde;
|
||||
if (doc_ce->type_u8==DOCT_MENU_VAL) {
|
||||
tempde=doc_ce->user_data;
|
||||
tmpde=doc_ce->user_data;
|
||||
Silent;
|
||||
st=MStrPrint("Delete: %s",tempde->full_name);
|
||||
st=MStrPrint("Delete: %s",tmpde->full_name);
|
||||
if (PopUpCancelOk(st))
|
||||
Del(tempde->full_name);
|
||||
Del(tmpde->full_name);
|
||||
Free(st);
|
||||
Silent(OFF);
|
||||
} else if (doc_ce->type_u8==DOCT_TREE) {
|
||||
tempde=doc_ce->user_data;
|
||||
tmpde=doc_ce->user_data;
|
||||
Silent;
|
||||
st=MStrPrint("Delete: %s",tempde->full_name);
|
||||
st=MStrPrint("Delete: %s",tmpde->full_name);
|
||||
if (PopUpCancelOk(st))
|
||||
DelTree(tempde->full_name);
|
||||
DelTree(tmpde->full_name);
|
||||
Free(st);
|
||||
Silent(OFF);
|
||||
}
|
||||
@@ -326,16 +326,16 @@ U0 FMDelete(CDoc *doc)
|
||||
U0 FMChgDsk(CDoc *doc)
|
||||
{
|
||||
CDocEntry *doc_ce=doc->cur_entry;
|
||||
CDirEntry *tempde;
|
||||
CDirEntry *tmpde;
|
||||
if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL)
|
||||
tempde=doc_ce->user_data;
|
||||
tmpde=doc_ce->user_data;
|
||||
else
|
||||
tempde=NULL;
|
||||
if (tempde) {
|
||||
while (tempde->parent)
|
||||
tempde=tempde->parent;
|
||||
tmpde=NULL;
|
||||
if (tmpde) {
|
||||
while (tmpde->parent)
|
||||
tmpde=tmpde->parent;
|
||||
Silent;
|
||||
ChgDsk(*tempde->full_name);
|
||||
ChgDsk(*tmpde->full_name);
|
||||
Silent(OFF);
|
||||
}
|
||||
}
|
||||
@@ -343,24 +343,24 @@ U0 FMChgDsk(CDoc *doc)
|
||||
U0 FMMountISO(CDoc *doc)
|
||||
{
|
||||
CDocEntry *doc_ce=doc->cur_entry;
|
||||
CDirEntry *tempde;
|
||||
if (doc_ce->type_u8==DOCT_MENU_VAL && (tempde=doc_ce->user_data))
|
||||
MountFile(tempde->full_name);
|
||||
CDirEntry *tmpde;
|
||||
if (doc_ce->type_u8==DOCT_MENU_VAL && (tmpde=doc_ce->user_data))
|
||||
MountFile(tmpde->full_name);
|
||||
}
|
||||
|
||||
U0 FMUnmount(CDoc *doc)
|
||||
{
|
||||
CDocEntry *doc_ce=doc->cur_entry;
|
||||
CDirEntry *tempde;
|
||||
CDirEntry *tmpde;
|
||||
I64 drv_let;
|
||||
if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL)
|
||||
tempde=doc_ce->user_data;
|
||||
tmpde=doc_ce->user_data;
|
||||
else
|
||||
tempde=NULL;
|
||||
if (tempde) {
|
||||
while (tempde->parent)
|
||||
tempde=tempde->parent;
|
||||
drv_let=*tempde->full_name;
|
||||
tmpde=NULL;
|
||||
if (tmpde) {
|
||||
while (tmpde->parent)
|
||||
tmpde=tmpde->parent;
|
||||
drv_let=*tmpde->full_name;
|
||||
if (Let2BlkDev(drv_let)!=Let2BlkDev(':'))
|
||||
Unmount(drv_let);
|
||||
}
|
||||
@@ -369,19 +369,19 @@ U0 FMUnmount(CDoc *doc)
|
||||
U0 FMFmtDrv(CDoc *doc)
|
||||
{
|
||||
CDocEntry *doc_ce=doc->cur_entry;
|
||||
CDirEntry *tempde;
|
||||
CDirEntry *tmpde;
|
||||
U8 *st=NULL;
|
||||
if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL)
|
||||
tempde=doc_ce->user_data;
|
||||
tmpde=doc_ce->user_data;
|
||||
else
|
||||
tempde=NULL;
|
||||
if (tempde) {
|
||||
while (tempde->parent)
|
||||
tempde=tempde->parent;
|
||||
st=MStrPrint("Format Drive '%c'?\nAre You Sure?\n",*tempde->full_name);
|
||||
tmpde=NULL;
|
||||
if (tmpde) {
|
||||
while (tmpde->parent)
|
||||
tmpde=tmpde->parent;
|
||||
st=MStrPrint("Format Drive '%c'?\nAre You Sure?\n",*tmpde->full_name);
|
||||
if (PopUpCancelOk(st)) {
|
||||
Silent;
|
||||
Fmt(*tempde->full_name,,FALSE);
|
||||
Fmt(*tmpde->full_name,,FALSE);
|
||||
Silent(OFF);
|
||||
}
|
||||
}
|
||||
@@ -391,21 +391,21 @@ U0 FMFmtDrv(CDoc *doc)
|
||||
U0 FMMakeISO(CDoc *doc)
|
||||
{
|
||||
CDocEntry *doc_ce=doc->cur_entry;
|
||||
CDirEntry *tempde;
|
||||
CDirEntry *tmpde;
|
||||
U8 *st;
|
||||
if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL)
|
||||
tempde=doc_ce->user_data;
|
||||
tmpde=doc_ce->user_data;
|
||||
else
|
||||
tempde=NULL;
|
||||
if (tempde) {
|
||||
tmpde=NULL;
|
||||
if (tmpde) {
|
||||
if (doc_ce->type_u8==DOCT_MENU_VAL)
|
||||
tempde=tempde->parent;
|
||||
if (tempde && *tempde->full_name) {
|
||||
tmpde=tmpde->parent;
|
||||
if (tmpde && *tmpde->full_name) {
|
||||
Silent;
|
||||
if (tempde->full_name[StrLen(tempde->full_name)-1]=='/')
|
||||
st=MStrPrint("%s*",tempde->full_name);
|
||||
if (tmpde->full_name[StrLen(tmpde->full_name)-1]=='/')
|
||||
st=MStrPrint("%s*",tmpde->full_name);
|
||||
else
|
||||
st=MStrPrint("%s/*",tempde->full_name);
|
||||
st=MStrPrint("%s/*",tmpde->full_name);
|
||||
ISO9660ISO(,st);
|
||||
Free(st);
|
||||
Silent(OFF);
|
||||
@@ -416,16 +416,16 @@ U0 FMMakeISO(CDoc *doc)
|
||||
U0 FMBurnISO(CDoc *doc)
|
||||
{
|
||||
CDocEntry *doc_ce=doc->cur_entry;
|
||||
CDirEntry *tempde;
|
||||
CDirEntry *tmpde;
|
||||
if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL)
|
||||
tempde=doc_ce->user_data;
|
||||
tmpde=doc_ce->user_data;
|
||||
else
|
||||
tempde=NULL;
|
||||
if (tempde) {
|
||||
while (tempde->parent)
|
||||
tempde=tempde->parent;
|
||||
tmpde=NULL;
|
||||
if (tmpde) {
|
||||
while (tmpde->parent)
|
||||
tmpde=tmpde->parent;
|
||||
Silent;
|
||||
DVDImageWrite(*tempde->full_name);
|
||||
DVDImageWrite(*tmpde->full_name);
|
||||
Silent(OFF);
|
||||
}
|
||||
}
|
||||
@@ -435,37 +435,37 @@ U0 FMCopy(CDoc *doc)
|
||||
CDoc *doc2=sys_clipboard_doc;
|
||||
U8 *st;
|
||||
CDocEntry *doc_ce=doc->cur_entry,*doc_e;
|
||||
CDirEntry *tempde,*tempde1=NULL,*tempde2;
|
||||
CDirEntry *tmpde,*tmpde1=NULL,*tmpde2;
|
||||
Bool unlock_doc2=DocLock(doc2);
|
||||
doc_e=doc2->head.next;
|
||||
|
||||
tempde1=doc_ce->user_data;
|
||||
tmpde1=doc_ce->user_data;
|
||||
if (doc_ce->type_u8==DOCT_MENU_VAL)
|
||||
tempde1=tempde1->parent;
|
||||
tmpde1=tmpde1->parent;
|
||||
else if (doc_ce->type_u8!=DOCT_TREE)
|
||||
tempde1=NULL;
|
||||
if (tempde1) {
|
||||
tmpde1=NULL;
|
||||
if (tmpde1) {
|
||||
while (doc_e!=doc2) {
|
||||
if (doc_e->type_u8==DOCT_MENU_VAL) {
|
||||
tempde=doc_e->user_data;
|
||||
tempde->flags|=DEF_PROCESSED;
|
||||
tempde2=tempde->parent;
|
||||
if (!tempde2 || !(tempde2->flags&DEF_PROCESSED)) {
|
||||
tmpde=doc_e->user_data;
|
||||
tmpde->flags|=DEF_PROCESSED;
|
||||
tmpde2=tmpde->parent;
|
||||
if (!tmpde2 || !(tmpde2->flags&DEF_PROCESSED)) {
|
||||
Silent;
|
||||
Copy(tempde->full_name,tempde1->full_name);
|
||||
Copy(tmpde->full_name,tmpde1->full_name);
|
||||
Silent(OFF);
|
||||
}
|
||||
} else if (doc_e->type_u8==DOCT_TREE) {
|
||||
tempde=doc_e->user_data;
|
||||
tempde->flags|=DEF_PROCESSED;
|
||||
tempde2=tempde->parent;
|
||||
if (!tempde2 || !(tempde2->flags&DEF_PROCESSED)) {
|
||||
tmpde=doc_e->user_data;
|
||||
tmpde->flags|=DEF_PROCESSED;
|
||||
tmpde2=tmpde->parent;
|
||||
if (!tmpde2 || !(tmpde2->flags&DEF_PROCESSED)) {
|
||||
Silent;
|
||||
if (*tempde1->name)
|
||||
st=MStrPrint("%s/%s",tempde1->full_name,tempde->name);
|
||||
if (*tmpde1->name)
|
||||
st=MStrPrint("%s/%s",tmpde1->full_name,tmpde->name);
|
||||
else
|
||||
st=MStrPrint("%s%s",tempde1->full_name,tempde->name);
|
||||
CopyTree(tempde->full_name,st);
|
||||
st=MStrPrint("%s%s",tmpde1->full_name,tmpde->name);
|
||||
CopyTree(tmpde->full_name,st);
|
||||
Free(st);
|
||||
Silent(OFF);
|
||||
}
|
||||
@@ -567,20 +567,20 @@ U0 FMRightClick()
|
||||
}
|
||||
|
||||
U8 *fm_ip_str=NULL;
|
||||
U0 (*fp_old_final_screen_update)(CDC *dc);
|
||||
U0 (*fp_old_final_scrn_update)(CDC *dc);
|
||||
|
||||
U0 FMFinalScreenUpdate(CDC *dc)
|
||||
U0 FMFinalScrnUpdate(CDC *dc)
|
||||
{
|
||||
if (fm_ip_str) {
|
||||
dc->color=LTRED;
|
||||
GrPrint(dc,ip.pos.x,ip.pos.y,"%s",fm_ip_str);
|
||||
}
|
||||
(*fp_old_final_screen_update)(dc);
|
||||
(*fp_old_final_scrn_update)(dc);
|
||||
}
|
||||
|
||||
public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
|
||||
{//File manager. Also, used to choose files and dirs.
|
||||
CDirEntry *head=NULL,*tempde,*tempde1,*tempde2;
|
||||
CDirEntry *head=NULL,*tmpde,*tmpde1,*tmpde2;
|
||||
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;
|
||||
@@ -588,15 +588,15 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
|
||||
Bool okay;
|
||||
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
fp_old_final_screen_update=gr.fp_final_screen_update;
|
||||
fp_old_final_scrn_update=gr.fp_final_scrn_update;
|
||||
MenuFilePush("::/Doc/FileMgrPullDown.DD");
|
||||
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)
|
||||
tempde1->user_data(CDocEntry *)->de_flags&=~DOCEF_CHECKED_COLLAPSED;
|
||||
tempde1=tempde1->parent;
|
||||
if (tmpde1=Cd2DirEntry(head,old_cur_dir))
|
||||
doc->cur_entry=tmpde1->user_data;
|
||||
while (tmpde1) {
|
||||
if (tmpde1->attr&RS_ATTR_DIR)
|
||||
tmpde1->user_data(CDocEntry *)->de_flags&=~DOCEF_CHECKED_COLLAPSED;
|
||||
tmpde1=tmpde1->parent;
|
||||
}
|
||||
do {
|
||||
DocUnlock(doc);
|
||||
@@ -613,51 +613,51 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
|
||||
case MSG_IP_L_DOWN:
|
||||
doc_ce=doc->cur_entry;
|
||||
fm_ip_str=doc_ce->tag;
|
||||
gr.fp_final_screen_update=&FMFinalScreenUpdate;
|
||||
gr.fp_final_scrn_update=&FMFinalScrnUpdate;
|
||||
break;
|
||||
case MSG_IP_L_UP:
|
||||
if (doc_ce) {
|
||||
gr.fp_final_screen_update=fp_old_final_screen_update;
|
||||
gr.fp_final_scrn_update=fp_old_final_scrn_update;
|
||||
if (WinCursorPosSet(Fs,a1+Fs->pix_left+Fs->scroll_x,
|
||||
a2+Fs->pix_top+Fs->scroll_y,TRUE)) {
|
||||
doc_e=doc->cur_entry;
|
||||
if (doc_e!=doc_ce) {
|
||||
st2=NULL;
|
||||
if (doc_e->type_u8==DOCT_MENU_VAL) {
|
||||
tempde1=doc_e->user_data;
|
||||
if (tempde1=tempde1->parent)
|
||||
st2=StrNew(tempde1->full_name);
|
||||
tmpde1=doc_e->user_data;
|
||||
if (tmpde1=tmpde1->parent)
|
||||
st2=StrNew(tmpde1->full_name);
|
||||
} else if (doc_e->type_u8==DOCT_TREE) {
|
||||
tempde1=doc_e->user_data;
|
||||
st2=StrNew(tempde1->full_name);
|
||||
tmpde1=doc_e->user_data;
|
||||
st2=StrNew(tmpde1->full_name);
|
||||
}
|
||||
if (st2 && doc_ce->type_u8==DOCT_MENU_VAL) {
|
||||
tempde=doc_ce->user_data;
|
||||
tmpde=doc_ce->user_data;
|
||||
Silent;
|
||||
Move(tempde->full_name,st2);
|
||||
Move(tmpde->full_name,st2);
|
||||
Silent(OFF);
|
||||
FMRebuildDoc(&doc,&head,mode);
|
||||
} else if (st2 && doc_ce->type_u8==DOCT_TREE) {
|
||||
tempde=doc_ce->user_data;
|
||||
tmpde=doc_ce->user_data;
|
||||
okay=TRUE;
|
||||
tempde2=tempde1;
|
||||
while (tempde2) {
|
||||
if (tempde2!=tempde)
|
||||
tempde2=tempde2->parent;
|
||||
tmpde2=tmpde1;
|
||||
while (tmpde2) {
|
||||
if (tmpde2!=tmpde)
|
||||
tmpde2=tmpde2->parent;
|
||||
else {
|
||||
okay=FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (okay) {
|
||||
if (*tempde1->name)
|
||||
st=MStrPrint("%s/%s",tempde1->full_name,tempde->name);
|
||||
if (*tmpde1->name)
|
||||
st=MStrPrint("%s/%s",tmpde1->full_name,tmpde->name);
|
||||
else
|
||||
st=MStrPrint("%s%s",tempde1->full_name,tempde->name);
|
||||
if (StrCmp(tempde->full_name,st)) {
|
||||
st=MStrPrint("%s%s",tmpde1->full_name,tmpde->name);
|
||||
if (StrCmp(tmpde->full_name,st)) {
|
||||
Silent;
|
||||
CopyTree(tempde->full_name,st);
|
||||
DelTree(tempde->full_name);
|
||||
CopyTree(tmpde->full_name,st);
|
||||
DelTree(tmpde->full_name);
|
||||
Silent(OFF);
|
||||
FMRebuildDoc(&doc,&head,mode);
|
||||
}
|
||||
@@ -743,15 +743,15 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
|
||||
break;
|
||||
case CH_ESC:
|
||||
doc_ce=doc->cur_entry;
|
||||
tempde=doc_ce->user_data;
|
||||
tmpde=doc_ce->user_data;
|
||||
if (mode==FM_PICK_FILE && doc_ce->type_u8==DOCT_MENU_VAL)
|
||||
res=StrNew(tempde->full_name,mem_task);
|
||||
res=StrNew(tmpde->full_name,mem_task);
|
||||
else if (mode==FM_PICK_DIR) {
|
||||
if (doc_ce->type_u8==DOCT_TREE)
|
||||
res=StrNew(tempde->full_name,mem_task);
|
||||
res=StrNew(tmpde->full_name,mem_task);
|
||||
else if (doc_ce->type_u8==DOCT_MENU_VAL &&
|
||||
(tempde=tempde->parent))
|
||||
res=StrNew(tempde->full_name,mem_task);
|
||||
(tmpde=tmpde->parent))
|
||||
res=StrNew(tmpde->full_name,mem_task);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -760,12 +760,12 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
|
||||
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;
|
||||
tmpde=doc->cur_entry->user_data;
|
||||
DocUnlock(doc);
|
||||
if (sc&SCF_SHIFT)
|
||||
AdamFile(tempde->full_name);
|
||||
AdamFile(tmpde->full_name);
|
||||
else
|
||||
PopUpFile(tempde->full_name);
|
||||
PopUpFile(tmpde->full_name);
|
||||
DocLock(doc);
|
||||
}
|
||||
} else {
|
||||
@@ -778,7 +778,7 @@ fm_regular_key:
|
||||
break;
|
||||
}
|
||||
} while (ch!=CH_ESC && ch!=CH_SHIFT_ESC);
|
||||
gr.fp_final_screen_update=fp_old_final_screen_update;
|
||||
gr.fp_final_scrn_update=fp_old_final_scrn_update;
|
||||
Fs->put_doc =old_put_doc;
|
||||
Fs->display_doc=old_display_doc;
|
||||
SettingsPop;
|
||||
|
||||
@@ -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 *head=NULL,*tempha;
|
||||
CATARep *head=NULL,*tmpha;
|
||||
Bool one_drv,make_free;
|
||||
CDoc *doc;
|
||||
boot_drv_let=ToUpper(boot_drv_let);
|
||||
@@ -57,10 +57,10 @@ 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(head,Str2I64(base0_buf));
|
||||
StrPrint(base0_buf,"0x%X",tempha->base0);
|
||||
StrPrint(base1_buf,"0x%X",tempha->base1);
|
||||
unit=tempha->unit;
|
||||
tmpha=ATARepFind(head,Str2I64(base0_buf));
|
||||
StrPrint(base0_buf,"0x%X",tmpha->base0);
|
||||
StrPrint(base1_buf,"0x%X",tmpha->base1);
|
||||
unit=tmpha->unit;
|
||||
} else if (type!=BDT_ATAPI || *base0_buf) {
|
||||
if (type==BDT_ATAPI)
|
||||
StrCpy(base1_buf,"0");
|
||||
|
||||
+28
-28
@@ -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 head,*temppp;
|
||||
CPlannedDrv head,*tmppp;
|
||||
CMasterBoot mbr;
|
||||
Bool pri=TRUE;
|
||||
I64 ext_base,drv_let2,pri_cnt=0,
|
||||
@@ -49,15 +49,15 @@ public I64 PrtDsk(U8 drv_let=0)
|
||||
drv_let2=bd->first_drv_let;
|
||||
remaining=FloorU64(bd->max_blk+1,ROUND_DRV_TO);
|
||||
while (FloorU64(remaining,ROUND_DRV_TO)>=ROUND_DRV_TO) {
|
||||
temppp=MAlloc(sizeof(CPlannedDrv));
|
||||
tmppp=MAlloc(sizeof(CPlannedDrv));
|
||||
do {
|
||||
"$$RED$$Partition %C$$FG$$\n",drv_let2;
|
||||
temppp->pri=FALSE;
|
||||
tmppp->pri=FALSE;
|
||||
if (pri) {
|
||||
"Primary Partition";
|
||||
if (YorN) {
|
||||
pri_cnt++;
|
||||
temppp->pri=TRUE;
|
||||
tmppp->pri=TRUE;
|
||||
if (pri_cnt==3)
|
||||
pri=FALSE;
|
||||
} else
|
||||
@@ -65,31 +65,31 @@ public I64 PrtDsk(U8 drv_let=0)
|
||||
}
|
||||
"Blocks Remaining:%d (0x%X)\n",
|
||||
remaining-DRV_HEADER,remaining-DRV_HEADER;
|
||||
temppp->size=CeilU64(GetI64("Size in Blocks :",
|
||||
tmppp->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,head.last);
|
||||
remaining-=temppp->size;
|
||||
} while (!(ROUND_DRV_TO<=tmppp->size<=FloorU64(remaining,ROUND_DRV_TO)));
|
||||
QueIns(tmppp,head.last);
|
||||
remaining-=tmppp->size;
|
||||
drv_let2++;
|
||||
}
|
||||
|
||||
"\n\n!!! Repartition Drive !!!\n\n";
|
||||
temppp=head.next;
|
||||
tmppp=head.next;
|
||||
drv_let2=bd->first_drv_let;
|
||||
while (temppp!=&head) {
|
||||
"Drive %C:%08X ",drv_let2,temppp->size;
|
||||
if (temppp->pri)
|
||||
while (tmppp!=&head) {
|
||||
"Drive %C:%08X ",drv_let2,tmppp->size;
|
||||
if (tmppp->pri)
|
||||
"Primary\n";
|
||||
else
|
||||
"Logical\n";
|
||||
temppp=temppp->next;
|
||||
tmppp=tmppp->next;
|
||||
drv_let2++;
|
||||
}
|
||||
if (!AreYouSure)
|
||||
goto pd_done;
|
||||
|
||||
remaining=FloorU64(bd->max_blk+1,ROUND_DRV_TO)-ROUND_DRV_TO;
|
||||
temppp=head.next;
|
||||
tmppp=head.next;
|
||||
MemSet(&mbr,0,BLK_SIZE);
|
||||
mbr.signature=0xAA55;
|
||||
offset=0;
|
||||
@@ -101,13 +101,13 @@ public I64 PrtDsk(U8 drv_let=0)
|
||||
mbr.p[i].end_head=0xFE;
|
||||
mbr.p[i].end_cyl=0xFFFF;
|
||||
mbr.p[i].offset=DRV_HEADER+offset;
|
||||
mbr.p[i].size=temppp->size-DRV_HEADER;
|
||||
offset+=temppp->size;
|
||||
remaining-=temppp->size;
|
||||
temppp=temppp->next;
|
||||
mbr.p[i].size=tmppp->size-DRV_HEADER;
|
||||
offset+=tmppp->size;
|
||||
remaining-=tmppp->size;
|
||||
tmppp=tmppp->next;
|
||||
}
|
||||
if (!i) i++;
|
||||
if (temppp!=&head) {
|
||||
if (tmppp!=&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!=&head) {
|
||||
while (tmppp!=&head) {
|
||||
start_offset=offset;
|
||||
MemSet(&mbr,0,BLK_SIZE);
|
||||
mbr.signature=0xAA55;
|
||||
@@ -132,10 +132,10 @@ public I64 PrtDsk(U8 drv_let=0)
|
||||
mbr.p[0].end_head=0xFE;
|
||||
mbr.p[0].end_cyl=0xFFFF;
|
||||
mbr.p[0].offset=DRV_HEADER;
|
||||
mbr.p[0].size=temppp->size-DRV_HEADER;
|
||||
offset+=temppp->size;
|
||||
temppp=temppp->next;
|
||||
if (temppp!=&head) {
|
||||
mbr.p[0].size=tmppp->size-DRV_HEADER;
|
||||
offset+=tmppp->size;
|
||||
tmppp=tmppp->next;
|
||||
if (tmppp!=&head) {
|
||||
mbr.p[1].active=0x80;
|
||||
mbr.p[1].start_head=0;
|
||||
mbr.p[1].start_cyl=0x101;
|
||||
@@ -143,7 +143,7 @@ public I64 PrtDsk(U8 drv_let=0)
|
||||
mbr.p[1].end_head=0xFE;
|
||||
mbr.p[1].end_cyl=0xFFFF;
|
||||
mbr.p[1].offset=offset-ext_base;
|
||||
mbr.p[1].size=temppp->size;
|
||||
mbr.p[1].size=tmppp->size;
|
||||
}
|
||||
ATAWriteBlks(bd,&mbr,start_offset,1);
|
||||
}
|
||||
@@ -155,9 +155,9 @@ public I64 PrtDsk(U8 drv_let=0)
|
||||
|
||||
pd_done:
|
||||
while (head.next!=&head) {
|
||||
temppp=head.next;
|
||||
QueRem(temppp);
|
||||
Free(temppp);
|
||||
tmppp=head.next;
|
||||
QueRem(tmppp);
|
||||
Free(tmppp);
|
||||
}
|
||||
return drv_dsk_dsk_size;
|
||||
}
|
||||
+40
-40
@@ -6,32 +6,32 @@ Bool ClassRep2(CDoc *doc,U8 *_d,U8 *class_name=lastclass,
|
||||
CMemberLst *ml;
|
||||
CDocEntry *doc_e;
|
||||
Bool unlock;
|
||||
CHashClass *tempc,*tempc2;
|
||||
CHashClass *tmpc,*tmpc2;
|
||||
if (depth>=max_depth) return TRUE;
|
||||
if (!(tempc=HashFind(class_name,Fs->hash_table,types))) {
|
||||
if (!(tmpc=HashFind(class_name,Fs->hash_table,types))) {
|
||||
DocPrint(doc,"Class Not Found.\n");
|
||||
return FALSE;
|
||||
}
|
||||
if (!ChkPtr(_d) || !ChkPtr(_d(U8 *)+tempc->size)) {
|
||||
if (!ChkPtr(_d) || !ChkPtr(_d(U8 *)+tmpc->size)) {
|
||||
DocPrint(doc,"Bad Ptr:%016X\n",_d);
|
||||
return FALSE;
|
||||
}
|
||||
if (tempc->base_class && !ClassRep2(doc,_d,tempc->base_class->str,
|
||||
if (tmpc->base_class && !ClassRep2(doc,_d,tmpc->base_class->str,
|
||||
depth,max_depth,dynamic,types,offset))
|
||||
return FALSE;
|
||||
unlock=DocLock(doc);
|
||||
DocPrint(doc,"Class:\"%s\"\n",class_name);
|
||||
ml=tempc->member_lst_and_root;
|
||||
ml=tmpc->member_lst_and_root;
|
||||
while (ml) {
|
||||
tempc2=ml->member_class;
|
||||
tmpc2=ml->member_class;
|
||||
ptr=_d(U8 *)+ml->offset;
|
||||
DocPrint(doc,"%08X ",ptr(U8 *)+offset);
|
||||
stars=tempc2->ptr_stars_cnt;
|
||||
tempc2=OptClassFwd(tempc2);
|
||||
tempc2-=tempc2->ptr_stars_cnt;
|
||||
if (tempc2->type & HTT_INTERNAL_TYPE) {
|
||||
stars=tmpc2->ptr_stars_cnt;
|
||||
tmpc2=OptClassFwd(tmpc2);
|
||||
tmpc2-=tmpc2->ptr_stars_cnt;
|
||||
if (tmpc2->type & HTT_INTERNAL_TYPE) {
|
||||
DocPrint(doc,"$$GREEN$$%-20ts:$$FG$$",ml->str);
|
||||
if (stars==1 && (tempc2->raw_type==RT_I8 || tempc2->raw_type==RT_U8)) {
|
||||
if (stars==1 && (tmpc2->raw_type==RT_I8 || tmpc2->raw_type==RT_U8)) {
|
||||
ptr=*ptr;
|
||||
if (ChkPtr(ptr)) {
|
||||
if (dynamic) {
|
||||
@@ -43,7 +43,7 @@ Bool ClassRep2(CDoc *doc,U8 *_d,U8 *class_name=lastclass,
|
||||
}
|
||||
} else if (!stars) {
|
||||
j=MinI64(ml->dim.total_cnt,32);
|
||||
if (tempc2->raw_type==RT_I8 || tempc2->raw_type==RT_U8) {
|
||||
if (tmpc2->raw_type==RT_I8 || tmpc2->raw_type==RT_U8) {
|
||||
if (j==1) {
|
||||
if (dynamic) {
|
||||
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=U8,A=\"%%c\"$$\n");
|
||||
@@ -60,7 +60,7 @@ Bool ClassRep2(CDoc *doc,U8 *_d,U8 *class_name=lastclass,
|
||||
}
|
||||
}
|
||||
for (i=0;i<j;i++) {
|
||||
switch (tempc2->raw_type) {
|
||||
switch (tmpc2->raw_type) {
|
||||
case RT_I0:
|
||||
case RT_U0:
|
||||
break;
|
||||
@@ -143,9 +143,9 @@ Bool ClassRep2(CDoc *doc,U8 *_d,U8 *class_name=lastclass,
|
||||
DocPrint(doc,"$$TR,\"%s\"$$\n",ml->str);
|
||||
DocPrint(doc,"$$ID,2$$");
|
||||
if (!stars)
|
||||
ClassRep2(doc,ptr,tempc2->str,depth+1,max_depth,dynamic);
|
||||
ClassRep2(doc,ptr,tmpc2->str,depth+1,max_depth,dynamic);
|
||||
else if (stars==1)
|
||||
ClassRep2(doc,*ptr,tempc2->str,depth+1,max_depth,dynamic);
|
||||
ClassRep2(doc,*ptr,tmpc2->str,depth+1,max_depth,dynamic);
|
||||
DocPrint(doc,"$$ID,-2$$");
|
||||
}
|
||||
} else
|
||||
@@ -202,15 +202,15 @@ public U0 ClassRepD(U8 *_d,U8 *class_name=lastclass,
|
||||
}
|
||||
}
|
||||
|
||||
U0 UpdateRegVarImg(CHashFun *tempf,U8 *_b,CTask *task)
|
||||
U0 UpdateRegVarImg(CHashFun *tmpf,U8 *_b,CTask *task)
|
||||
{
|
||||
CMemberLst *ml;
|
||||
CHashClass *tempc;
|
||||
ml=tempf->member_lst_and_root;
|
||||
CHashClass *tmpc;
|
||||
ml=tmpf->member_lst_and_root;
|
||||
while (ml) {
|
||||
if (ml->reg!=REG_NONE) {
|
||||
tempc=OptClassFwd(ml->member_class);
|
||||
MemCpy(_b+ml->offset,TaskRegAddr(task,ml->reg),tempc->size);
|
||||
tmpc=OptClassFwd(ml->member_class);
|
||||
MemCpy(_b+ml->offset,TaskRegAddr(task,ml->reg),tmpc->size);
|
||||
}
|
||||
ml=ml->next;
|
||||
}
|
||||
@@ -220,32 +220,32 @@ public U0 FunRep(U8 *st,U8 *rbp=NULL,I64 max_depth=2,CTask *task=NULL)
|
||||
{//Shows names and vals of a fun's local vars using compiler's info.
|
||||
I64 size;
|
||||
U8 *img;
|
||||
CHashFun *tempf=HashFind(st,Fs->hash_table,HTT_FUN);
|
||||
CMemberLst *tempm;
|
||||
if (tempf) {
|
||||
CHashFun *tmpf=HashFind(st,Fs->hash_table,HTT_FUN);
|
||||
CMemberLst *tmpm;
|
||||
if (tmpf) {
|
||||
if (rbp) {
|
||||
if (task) {
|
||||
//tempf->size is negative. It's the bottom
|
||||
//tmpf->size is negative. It's the bottom
|
||||
//of the fun local var space relative to RBP .
|
||||
size=tempf->arg_cnt*8-tempf->size+16;
|
||||
size=tmpf->arg_cnt*8-tmpf->size+16;
|
||||
|
||||
img=MAlloc(size);
|
||||
MemCpy(img,rbp+tempf->size,size);
|
||||
UpdateRegVarImg(tempf,img-tempf->size,task);
|
||||
ClassRep(img-tempf->size,st,max_depth,TRUE,rbp-img+tempf->size);
|
||||
MemCpy(img,rbp+tmpf->size,size);
|
||||
UpdateRegVarImg(tmpf,img-tmpf->size,task);
|
||||
ClassRep(img-tmpf->size,st,max_depth,TRUE,rbp-img+tmpf->size);
|
||||
Free(img);
|
||||
} else
|
||||
ClassRep(rbp,st,max_depth,TRUE);
|
||||
} else {
|
||||
tempm=tempf->member_lst_and_root;
|
||||
while (tempm) {
|
||||
if (0<=tempm->reg<NUM_REGS)
|
||||
"%08Z %s\n",tempm->reg,"ST_U64_REGS",tempm->str;
|
||||
tmpm=tmpf->member_lst_and_root;
|
||||
while (tmpm) {
|
||||
if (0<=tmpm->reg<NUM_REGS)
|
||||
"%08Z %s\n",tmpm->reg,"ST_U64_REGS",tmpm->str;
|
||||
else
|
||||
"%08tX %s\n",tempm->offset,tempm->str;
|
||||
tempm=tempm->next;
|
||||
"%08tX %s\n",tmpm->offset,tmpm->str;
|
||||
tmpm=tmpm->next;
|
||||
}
|
||||
"%08tX Stk Size\n",tempf->size;
|
||||
"%08tX Stk Size\n",tmpf->size;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -254,17 +254,17 @@ public U0 FunRep(U8 *st,U8 *rbp=NULL,I64 max_depth=2,CTask *task=NULL)
|
||||
public U0 Uf(U8 *st)
|
||||
{//Unassembles a named fun
|
||||
I64 i;
|
||||
CHashSrcSym *tempf;
|
||||
CHashSrcSym *tmpf;
|
||||
CDbgInfo *dbg_info;
|
||||
if (tempf=HashFind(st,Fs->hash_table,HTT_FUN|HTT_EXPORT_SYS_SYM)) {
|
||||
if (tempf->type&HTT_FUN)
|
||||
if (tmpf=HashFind(st,Fs->hash_table,HTT_FUN|HTT_EXPORT_SYS_SYM)) {
|
||||
if (tmpf->type&HTT_FUN)
|
||||
FunRep(st);
|
||||
if (dbg_info=tempf->dbg_info) {
|
||||
if (dbg_info=tmpf->dbg_info) {
|
||||
i=dbg_info->body[dbg_info->max_line+1-dbg_info->min_line]
|
||||
-dbg_info->body[0];
|
||||
Un(dbg_info->body[0],i);
|
||||
"Code Size:%04X\n",i;
|
||||
} else
|
||||
U(HashVal(tempf));
|
||||
U(HashVal(tmpf));
|
||||
}
|
||||
}
|
||||
+2
-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.HC,DD_TEMPLEOS_LOC"$.
|
||||
$TR-C,"LineRep"$
|
||||
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","120,264");
|
||||
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","81,209");
|
||||
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","119,939");
|
||||
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","81,264");
|
||||
$ID,-4$
|
||||
DefinePrint("DD_KERNEL","%08X",bfh);
|
||||
bfh(I64)+=bfh->file_size-1;
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ extern I64 BMPWrite(U8 *filename,CDC *dc,I64 bits=4);
|
||||
extern U0 ClipboardDel();
|
||||
extern CCtrl *CtrlFindUnique(CTask *haystack_task,I64 needle_type);
|
||||
extern Bool CtrlInside(CCtrl *c,I64 x,I64 y);
|
||||
extern U8 *DC2Sprite(CDC *tempb);
|
||||
extern U8 *DC2Sprite(CDC *tmpb);
|
||||
extern U0 DocBMP(CDoc *doc=NULL,U8 *filename,
|
||||
Bool dither_probability=FALSE,Bool use_ms_paint_palette=FALSE);
|
||||
extern U0 DocBinDel(CDoc *doc,CDocBin *b);
|
||||
@@ -78,6 +78,7 @@ extern Bool PopUpOk(U8 *header=NULL,U8 *footer=NULL);
|
||||
extern I64 PopUpRangeI64(
|
||||
I64 lo,I64 hi,I64 step=1,U8 *header=NULL,U8 *footer=NULL);
|
||||
extern Bool PopUpTransform(I64 *r);
|
||||
extern U0 Refresh(I64 cnt=1,Bool force=FALSE);
|
||||
extern U0 RegOneTimePopUp(I64 flag_num,U8 *msg);
|
||||
extern U0 SettingsPop(CTask *task=NULL,I64 flags=0);
|
||||
extern CTaskSettings *SettingsPush(CTask *task=NULL,I64 flags=0);
|
||||
@@ -89,7 +90,6 @@ extern Bool WinBorder(Bool val=OFF,CTask *task=NULL);
|
||||
extern CDoc *WinCursorPosSet(CTask *task,I64 ipx,I64 ipy,Bool set_cursor=TRUE);
|
||||
extern Bool WinHorz(I64 left,I64 right,CTask *task=NULL);
|
||||
extern U0 WinMax(CTask *task=NULL);
|
||||
extern U0 WinMgrSync(I64 cnt=1,Bool force=FALSE);
|
||||
extern U0 WinScrollNull(CTask *task,CD3I64 *s);
|
||||
extern U0 WinScrollRestore(CTask *task,CD3I64 *s);
|
||||
extern U0 WinScrollsInit(CTask *task);
|
||||
|
||||
+38
-38
@@ -17,13 +17,13 @@ I64 HashEntriesCompare(CWho *h1,CWho *h2)
|
||||
|
||||
I64 HashEntriesCompare2(CWho *h1,CWho *h2)
|
||||
{
|
||||
CHashFun *tempf1=h1->h,*tempf2=h2->h;
|
||||
I64 i1=HashVal(tempf1),i2=HashVal(tempf2);
|
||||
CHashFun *tmpf1=h1->h,*tmpf2=h2->h;
|
||||
I64 i1=HashVal(tmpf1),i2=HashVal(tmpf2);
|
||||
if (i1==i2) {
|
||||
i1=HashTypeNum(tempf1);
|
||||
i2=HashTypeNum(tempf2);
|
||||
i1=HashTypeNum(tmpf1);
|
||||
i2=HashTypeNum(tmpf2);
|
||||
if (i1==i2)
|
||||
return StrCmp(tempf1->str,tempf2->str);
|
||||
return StrCmp(tmpf1->str,tmpf2->str);
|
||||
}
|
||||
return i1-i2;
|
||||
}
|
||||
@@ -67,7 +67,7 @@ U8 *HelpIndexStr(U8 **_ptr,U8 *idx)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
U8 *HelpComment(CTask *task,CHash *temph,U8 *_src_link)
|
||||
U8 *HelpComment(CTask *task,CHash *tmph,U8 *_src_link)
|
||||
{
|
||||
CDoc *doc;
|
||||
CDocEntry *doc_e;
|
||||
@@ -80,9 +80,9 @@ U8 *HelpComment(CTask *task,CHash *temph,U8 *_src_link)
|
||||
|
||||
doc=DocPut(task);
|
||||
doc_e=doc->cur_entry;
|
||||
if (temph->type&HTT_FUN) {
|
||||
if (Bt(&temph(CHashFun *)->flags,Ff__EXTERN) ||
|
||||
Bt(&temph(CHashFun *)->flags,Ff_INTERNAL))
|
||||
if (tmph->type&HTT_FUN) {
|
||||
if (Bt(&tmph(CHashFun *)->flags,Ff__EXTERN) ||
|
||||
Bt(&tmph(CHashFun *)->flags,Ff_INTERNAL))
|
||||
while (doc_e!=doc &&
|
||||
(!(doc_e->de_flags&DOCEF_TAG)||!StrOcc(doc_e->tag,';')))
|
||||
doc_e=doc_e->next;
|
||||
@@ -153,7 +153,7 @@ U8 *idx=NULL,CDoc *doc=NULL)
|
||||
// "+m" to order by number (normally alphabetical)
|
||||
// "-r" just local hash table
|
||||
CHashTable *table;
|
||||
CHashSrcSym *temph;
|
||||
CHashSrcSym *tmph;
|
||||
CHashGeneric *ptr;
|
||||
CWho *lst;
|
||||
I64 cnt,i,j,k,f=0;
|
||||
@@ -182,16 +182,16 @@ U8 *idx=NULL,CDoc *doc=NULL)
|
||||
table=h;
|
||||
while (table) {
|
||||
for (i=0;i<=table->mask;i++) {
|
||||
temph=table->body[i];
|
||||
while (temph) {
|
||||
if (!(temph->type & (HTF_IMPORT | HTF_PRIVATE)) &&
|
||||
(temph->type & HTF_PUBLIC || !publics)) {
|
||||
tmph=table->body[i];
|
||||
while (tmph) {
|
||||
if (!(tmph->type & (HTF_IMPORT | HTF_PRIVATE)) &&
|
||||
(tmph->type & HTF_PUBLIC || !publics)) {
|
||||
if (!idx)
|
||||
cnt++;
|
||||
else if (temph->type&HTG_SRC_SYM && (cur_idx=temph->idx))
|
||||
else if (tmph->type&HTG_SRC_SYM && (cur_idx=tmph->idx))
|
||||
cnt+=HelpIndexCnt(cur_idx,idx);
|
||||
}
|
||||
temph=temph->next;
|
||||
tmph=tmph->next;
|
||||
}
|
||||
}
|
||||
if (recurse)
|
||||
@@ -206,19 +206,19 @@ U8 *idx=NULL,CDoc *doc=NULL)
|
||||
table=h;
|
||||
while (table) {
|
||||
for (i=0;i<=table->mask;i++) {
|
||||
temph=table->body[i];
|
||||
while (temph) {
|
||||
if (!(temph->type & (HTF_IMPORT | HTF_PRIVATE)) &&
|
||||
(temph->type & HTF_PUBLIC || !publics))
|
||||
tmph=table->body[i];
|
||||
while (tmph) {
|
||||
if (!(tmph->type & (HTF_IMPORT | HTF_PRIVATE)) &&
|
||||
(tmph->type & HTF_PUBLIC || !publics))
|
||||
if (!idx)
|
||||
lst[j++].h=temph;
|
||||
else if (temph->type&HTG_SRC_SYM && (cur_idx=temph->idx) &&
|
||||
lst[j++].h=tmph;
|
||||
else if (tmph->type&HTG_SRC_SYM && (cur_idx=tmph->idx) &&
|
||||
(k=HelpIndexCnt(cur_idx,idx)))
|
||||
while (k--) {
|
||||
lst[j].idx=HelpIndexStr(&cur_idx,idx);
|
||||
lst[j++].h=temph;
|
||||
lst[j++].h=tmph;
|
||||
}
|
||||
temph=temph->next;
|
||||
tmph=tmph->next;
|
||||
}
|
||||
}
|
||||
if (recurse)
|
||||
@@ -331,13 +331,13 @@ public I64 HashDepthRep(CHashTable *table=NULL)
|
||||
{//Hash table linked-list chain depth report.
|
||||
//Histogram of collision count.
|
||||
I64 i,j,longest=0,cnt=0,a[HDR_MAX];
|
||||
CHash *temph;
|
||||
CHash *tmph;
|
||||
if (!table) table=Fs->hash_table;
|
||||
MemSet(a,0,sizeof(a));
|
||||
for (i=0;i<=table->mask;i++) {
|
||||
temph=table->body[i];
|
||||
if (temph) {
|
||||
j=LinkedLstCnt(temph);
|
||||
tmph=table->body[i];
|
||||
if (tmph) {
|
||||
j=LinkedLstCnt(tmph);
|
||||
if (j<HDR_MAX)
|
||||
a[j]++;
|
||||
cnt+=j;
|
||||
@@ -377,14 +377,14 @@ public U0 MapFileLoad(U8 *filename)
|
||||
*absname=FileNameAbs(name);
|
||||
CDoc *doc=DocRead(name);
|
||||
CDocEntry *doc_e;
|
||||
CHashSrcSym *temph;
|
||||
CHashSrcSym *tmph;
|
||||
I64 i,j,base=0;
|
||||
CDbgInfo *dbg_info;
|
||||
|
||||
FileExtRem(absname);
|
||||
if (absname[1]==':' && StrLen(absname)>2 &&
|
||||
(temph=HashSingleTableFind(absname+2,Fs->hash_table,HTT_MODULE)))
|
||||
base=temph(CHashGeneric *)->user_data0+sizeof(CBinFile);
|
||||
(tmph=HashSingleTableFind(absname+2,Fs->hash_table,HTT_MODULE)))
|
||||
base=tmph(CHashGeneric *)->user_data0+sizeof(CBinFile);
|
||||
|
||||
if (!doc) return;
|
||||
doc_e=doc->head.next;
|
||||
@@ -394,11 +394,11 @@ public U0 MapFileLoad(U8 *filename)
|
||||
st=MStrUtil(doc_e->tag,SUF_REM_TRAILING);
|
||||
else
|
||||
st=MStrUtil(doc_e->aux_str,SUF_REM_TRAILING);
|
||||
if (temph=HashSingleTableFind(st,Fs->hash_table,HTG_SRC_SYM)) {
|
||||
if (tmph=HashSingleTableFind(st,Fs->hash_table,HTG_SRC_SYM)) {
|
||||
if (*doc_e->tag) {
|
||||
Free(temph->src_link);
|
||||
temph->src_link=doc_e->aux_str;
|
||||
ptr=temph->src_link;
|
||||
Free(tmph->src_link);
|
||||
tmph->src_link=doc_e->aux_str;
|
||||
ptr=tmph->src_link;
|
||||
if (ptr[0] && ptr[1] && ptr[2]==':') {
|
||||
if (ptr[3]==':')
|
||||
ptr[3]=blkdev.boot_drv_let;
|
||||
@@ -407,14 +407,14 @@ public U0 MapFileLoad(U8 *filename)
|
||||
}
|
||||
doc_e->aux_str=NULL;
|
||||
}
|
||||
if (temph->type&(HTT_FUN|HTT_EXPORT_SYS_SYM) &&
|
||||
!(dbg_info=temph->dbg_info) && doc_e->bin_data &&
|
||||
if (tmph->type&(HTT_FUN|HTT_EXPORT_SYS_SYM) &&
|
||||
!(dbg_info=tmph->dbg_info) && doc_e->bin_data &&
|
||||
(dbg_info=doc_e->bin_data->data)) {
|
||||
if (doc_e->bin_data->size>MSize(dbg_info))
|
||||
"Corrupt Map Entry\n";
|
||||
else {
|
||||
doc_e->bin_data->data=NULL;
|
||||
temph->dbg_info=dbg_info;
|
||||
tmph->dbg_info=dbg_info;
|
||||
for (i=dbg_info->min_line;i<=dbg_info->max_line+1;i++) {
|
||||
j=i-dbg_info->min_line;
|
||||
if (dbg_info->body[j])
|
||||
|
||||
+160
-160
@@ -17,14 +17,14 @@ U0 ODERstPtrs(CMathODE *ode)
|
||||
ode->state_scale=ptr; ptr(I64)+=s;
|
||||
ode->DstateDt=ptr; ptr(I64)+=s;
|
||||
ode->initial_state=ptr; ptr(I64)+=s;
|
||||
ode->temp0=ptr; ptr(I64)+=s;
|
||||
ode->temp1=ptr; ptr(I64)+=s;
|
||||
ode->temp2=ptr; ptr(I64)+=s;
|
||||
ode->temp3=ptr; ptr(I64)+=s;
|
||||
ode->temp4=ptr; ptr(I64)+=s;
|
||||
ode->temp5=ptr; ptr(I64)+=s;
|
||||
ode->temp6=ptr; ptr(I64)+=s;
|
||||
ode->temp7=ptr;
|
||||
ode->tmp0=ptr; ptr(I64)+=s;
|
||||
ode->tmp1=ptr; ptr(I64)+=s;
|
||||
ode->tmp2=ptr; ptr(I64)+=s;
|
||||
ode->tmp3=ptr; ptr(I64)+=s;
|
||||
ode->tmp4=ptr; ptr(I64)+=s;
|
||||
ode->tmp5=ptr; ptr(I64)+=s;
|
||||
ode->tmp6=ptr; ptr(I64)+=s;
|
||||
ode->tmp7=ptr;
|
||||
}
|
||||
|
||||
public CMathODE *ODENew(I64 n,F64 max_tolerance=1e-6,I64 flags=0)
|
||||
@@ -79,26 +79,26 @@ U0 ODESetMassesPtrs(CMathODE *ode,F64 *state,F64 *DstateDt)
|
||||
{
|
||||
COrder2D3 *ptr1=state(F64 *)+ode->n,
|
||||
*ptr2=DstateDt(F64 *)+ode->n;
|
||||
CMass *tempm=ode->next_mass;
|
||||
while (tempm!=&ode->next_mass) {
|
||||
tempm->state=ptr1++;
|
||||
tempm->DstateDt=ptr2++;
|
||||
tempm=tempm->next;
|
||||
CMass *tmpm=ode->next_mass;
|
||||
while (tmpm!=&ode->next_mass) {
|
||||
tmpm->state=ptr1++;
|
||||
tmpm->DstateDt=ptr2++;
|
||||
tmpm=tmpm->next;
|
||||
}
|
||||
}
|
||||
|
||||
U0 ODEState2Internal(CMathODE *ode)
|
||||
{
|
||||
CMass *tempm;
|
||||
CMass *tmpm;
|
||||
F64 *old_array_base;
|
||||
I64 mass_cnt;
|
||||
|
||||
if (ode->flags&ODEF_HAS_MASSES) {
|
||||
mass_cnt=0;
|
||||
tempm=ode->next_mass;
|
||||
while (tempm!=&ode->next_mass) {
|
||||
tmpm=ode->next_mass;
|
||||
while (tmpm!=&ode->next_mass) {
|
||||
mass_cnt++;
|
||||
tempm=tempm->next;
|
||||
tmpm=tmpm->next;
|
||||
}
|
||||
old_array_base=ode->array_base;
|
||||
ode->n_internal=ode->n+6*mass_cnt;
|
||||
@@ -107,10 +107,10 @@ U0 ODEState2Internal(CMathODE *ode)
|
||||
ODERstPtrs(ode);
|
||||
|
||||
ODESetMassesPtrs(ode,ode->state_internal,ode->state_internal);
|
||||
tempm=ode->next_mass;
|
||||
while (tempm!=&ode->next_mass) {
|
||||
MemCpy(tempm->state,&tempm->saved_state,sizeof(COrder2D3));
|
||||
tempm=tempm->next;
|
||||
tmpm=ode->next_mass;
|
||||
while (tmpm!=&ode->next_mass) {
|
||||
MemCpy(tmpm->state,&tmpm->saved_state,sizeof(COrder2D3));
|
||||
tmpm=tmpm->next;
|
||||
}
|
||||
}
|
||||
MemCpy(ode->state_internal,ode->state,ode->n*sizeof(F64));
|
||||
@@ -118,14 +118,14 @@ U0 ODEState2Internal(CMathODE *ode)
|
||||
|
||||
U0 ODEInternal2State(CMathODE *ode)
|
||||
{
|
||||
CMass *tempm;
|
||||
CMass *tmpm;
|
||||
MemCpy(ode->state,ode->state_internal,ode->n*sizeof(F64));
|
||||
if (ode->flags&ODEF_HAS_MASSES) {
|
||||
ODESetMassesPtrs(ode,ode->state_internal,ode->state_internal);
|
||||
tempm=ode->next_mass;
|
||||
while (tempm!=&ode->next_mass) {
|
||||
MemCpy(&tempm->saved_state,tempm->state,sizeof(COrder2D3));
|
||||
tempm=tempm->next;
|
||||
tmpm=ode->next_mass;
|
||||
while (tmpm!=&ode->next_mass) {
|
||||
MemCpy(&tmpm->saved_state,tmpm->state,sizeof(COrder2D3));
|
||||
tmpm=tmpm->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -133,58 +133,58 @@ U0 ODEInternal2State(CMathODE *ode)
|
||||
public U0 ODERenum(CMathODE *ode)
|
||||
{//Renumber masses and springs.
|
||||
I64 i;
|
||||
CSpring *temps;
|
||||
CMass *tempm;
|
||||
CSpring *tmps;
|
||||
CMass *tmpm;
|
||||
|
||||
i=0;
|
||||
tempm=ode->next_mass;
|
||||
while (tempm!=&ode->next_mass) {
|
||||
tempm->num=i++;
|
||||
tempm=tempm->next;
|
||||
tmpm=ode->next_mass;
|
||||
while (tmpm!=&ode->next_mass) {
|
||||
tmpm->num=i++;
|
||||
tmpm=tmpm->next;
|
||||
}
|
||||
|
||||
i=0;
|
||||
temps=ode->next_spring;
|
||||
while (temps!=&ode->next_spring) {
|
||||
temps->num=i++;
|
||||
temps->end1_num=temps->end1->num;
|
||||
temps->end2_num=temps->end2->num;
|
||||
temps=temps->next;
|
||||
tmps=ode->next_spring;
|
||||
while (tmps!=&ode->next_spring) {
|
||||
tmps->num=i++;
|
||||
tmps->end1_num=tmps->end1->num;
|
||||
tmps->end2_num=tmps->end2->num;
|
||||
tmps=tmps->next;
|
||||
}
|
||||
}
|
||||
|
||||
public CMass *MassFind(CMathODE *ode,F64 x,F64 y,F64 z=0)
|
||||
{//Search for mass nearest to x,y,z.
|
||||
CMass *tempm,*best_mass=NULL;
|
||||
CMass *tmpm,*best_mass=NULL;
|
||||
F64 dd,best_dd=MAX_F64;
|
||||
|
||||
tempm=ode->next_mass;
|
||||
while (tempm!=&ode->next_mass) {
|
||||
dd=Sqr(tempm->x-x)+Sqr(tempm->y-y)+Sqr(tempm->z-z);
|
||||
tmpm=ode->next_mass;
|
||||
while (tmpm!=&ode->next_mass) {
|
||||
dd=Sqr(tmpm->x-x)+Sqr(tmpm->y-y)+Sqr(tmpm->z-z);
|
||||
if (dd<best_dd) {
|
||||
best_dd=dd;
|
||||
best_mass=tempm;
|
||||
best_mass=tmpm;
|
||||
}
|
||||
tempm=tempm->next;
|
||||
tmpm=tmpm->next;
|
||||
}
|
||||
return best_mass;
|
||||
}
|
||||
|
||||
public CSpring *SpringFind(CMathODE *ode,F64 x,F64 y,F64 z=0)
|
||||
{//Find spring midpoint nearest x,y,z.
|
||||
CSpring *temps,*best_spring=NULL;
|
||||
CSpring *tmps,*best_spring=NULL;
|
||||
F64 dd,best_dd=MAX_F64;
|
||||
|
||||
temps=ode->next_spring;
|
||||
while (temps!=&ode->next_spring) {
|
||||
dd=Sqr((temps->end1->x+temps->end2->x)/2-x)+
|
||||
Sqr((temps->end1->y+temps->end2->y)/2-y)+
|
||||
Sqr((temps->end1->z+temps->end2->z)/2-z);
|
||||
tmps=ode->next_spring;
|
||||
while (tmps!=&ode->next_spring) {
|
||||
dd=Sqr((tmps->end1->x+tmps->end2->x)/2-x)+
|
||||
Sqr((tmps->end1->y+tmps->end2->y)/2-y)+
|
||||
Sqr((tmps->end1->z+tmps->end2->z)/2-z);
|
||||
if (dd<best_dd) {
|
||||
best_dd=dd;
|
||||
best_spring=temps;
|
||||
best_spring=tmps;
|
||||
}
|
||||
temps=temps->next;
|
||||
tmps=tmps->next;
|
||||
}
|
||||
return best_spring;
|
||||
}
|
||||
@@ -193,31 +193,31 @@ public U0 MassOrSpringFind(
|
||||
CMathODE *ode,CMass **res_mass,CSpring **res_spring,
|
||||
F64 x,F64 y,F64 z=0)
|
||||
{//Find spring or mass nearest x,y,z.
|
||||
CMass *tempm,*best_mass=NULL;
|
||||
CSpring *temps,*best_spring=NULL;
|
||||
CMass *tmpm,*best_mass=NULL;
|
||||
CSpring *tmps,*best_spring=NULL;
|
||||
F64 dd,best_dd=MAX_F64;
|
||||
|
||||
tempm=ode->next_mass;
|
||||
while (tempm!=&ode->next_mass) {
|
||||
dd=Sqr(tempm->x-x)+Sqr(tempm->y-y)+Sqr(tempm->z-z);
|
||||
tmpm=ode->next_mass;
|
||||
while (tmpm!=&ode->next_mass) {
|
||||
dd=Sqr(tmpm->x-x)+Sqr(tmpm->y-y)+Sqr(tmpm->z-z);
|
||||
if (dd<best_dd) {
|
||||
best_dd=dd;
|
||||
best_mass=tempm;
|
||||
best_mass=tmpm;
|
||||
}
|
||||
tempm=tempm->next;
|
||||
tmpm=tmpm->next;
|
||||
}
|
||||
|
||||
temps=ode->next_spring;
|
||||
while (temps!=&ode->next_spring) {
|
||||
dd=Sqr((temps->end1->x+temps->end2->x)/2-x)+
|
||||
Sqr((temps->end1->y+temps->end2->y)/2-y)+
|
||||
Sqr((temps->end1->z+temps->end2->z)/2-z);
|
||||
tmps=ode->next_spring;
|
||||
while (tmps!=&ode->next_spring) {
|
||||
dd=Sqr((tmps->end1->x+tmps->end2->x)/2-x)+
|
||||
Sqr((tmps->end1->y+tmps->end2->y)/2-y)+
|
||||
Sqr((tmps->end1->z+tmps->end2->z)/2-z);
|
||||
if (dd<best_dd) {
|
||||
best_dd=dd;
|
||||
best_spring=temps;
|
||||
best_spring=tmps;
|
||||
best_mass=NULL;
|
||||
}
|
||||
temps=temps->next;
|
||||
tmps=tmps->next;
|
||||
}
|
||||
if (res_mass) *res_mass =best_mass;
|
||||
if (res_spring) *res_spring=best_spring;
|
||||
@@ -225,126 +225,126 @@ public U0 MassOrSpringFind(
|
||||
|
||||
public CMass *MassFindNum(CMathODE *ode,I64 num)
|
||||
{//Return mass number N.
|
||||
CMass *tempm=ode->next_mass;
|
||||
while (tempm!=&ode->next_mass) {
|
||||
if (tempm->num==num)
|
||||
return tempm;
|
||||
tempm=tempm->next;
|
||||
CMass *tmpm=ode->next_mass;
|
||||
while (tmpm!=&ode->next_mass) {
|
||||
if (tmpm->num==num)
|
||||
return tmpm;
|
||||
tmpm=tmpm->next;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
public U0 ODERstInactive(CMathODE *ode)
|
||||
{//Set all masses and springs to ACTIVE for new trial.
|
||||
CMass *tempm;
|
||||
CSpring *temps;
|
||||
tempm=ode->next_mass;
|
||||
while (tempm!=&ode->next_mass) {
|
||||
tempm->flags&=~MSF_INACTIVE;
|
||||
tempm=tempm->next;
|
||||
CMass *tmpm;
|
||||
CSpring *tmps;
|
||||
tmpm=ode->next_mass;
|
||||
while (tmpm!=&ode->next_mass) {
|
||||
tmpm->flags&=~MSF_INACTIVE;
|
||||
tmpm=tmpm->next;
|
||||
}
|
||||
temps=ode->next_spring;
|
||||
while (temps!=&ode->next_spring) {
|
||||
temps->flags&=~SSF_INACTIVE;
|
||||
temps=temps->next;
|
||||
tmps=ode->next_spring;
|
||||
while (tmps!=&ode->next_spring) {
|
||||
tmps->flags&=~SSF_INACTIVE;
|
||||
tmps=tmps->next;
|
||||
}
|
||||
}
|
||||
|
||||
U0 ODECalcSprings(CMathODE *ode)
|
||||
{
|
||||
CSpring *temps=ode->next_spring;
|
||||
CSpring *tmps=ode->next_spring;
|
||||
CMass *e1,*e2;
|
||||
F64 d;
|
||||
CD3 p;
|
||||
while (temps!=&ode->next_spring) {
|
||||
if (temps->flags&SSF_INACTIVE) {
|
||||
temps->displacement=0;
|
||||
temps->f=0;
|
||||
while (tmps!=&ode->next_spring) {
|
||||
if (tmps->flags&SSF_INACTIVE) {
|
||||
tmps->displacement=0;
|
||||
tmps->f=0;
|
||||
} else {
|
||||
e1=temps->end1;
|
||||
e2=temps->end2;
|
||||
e1=tmps->end1;
|
||||
e2=tmps->end2;
|
||||
d=D3Norm(D3Sub(&p,&e2->state->x,&e1->state->x));
|
||||
temps->displacement=d-temps->rest_len;
|
||||
temps->f=temps->displacement*temps->const;
|
||||
if (temps->f>0 && temps->flags&SSF_NO_TENSION)
|
||||
temps->f=0;
|
||||
else if (temps->f<0 && temps->flags&SSF_NO_COMPRESSION)
|
||||
temps->f=0;
|
||||
tmps->displacement=d-tmps->rest_len;
|
||||
tmps->f=tmps->displacement*tmps->const;
|
||||
if (tmps->f>0 && tmps->flags&SSF_NO_TENSION)
|
||||
tmps->f=0;
|
||||
else if (tmps->f<0 && tmps->flags&SSF_NO_COMPRESSION)
|
||||
tmps->f=0;
|
||||
if (d>0) {
|
||||
D3MulEqu(&p,temps->f/d);
|
||||
D3MulEqu(&p,tmps->f/d);
|
||||
D3AddEqu(&e1->DstateDt->DxDt,&p);
|
||||
D3SubEqu(&e2->DstateDt->DxDt,&p);
|
||||
}
|
||||
}
|
||||
temps=temps->next;
|
||||
tmps=tmps->next;
|
||||
}
|
||||
}
|
||||
|
||||
U0 ODECalcDrag(CMathODE *ode)
|
||||
{
|
||||
CMass *tempm;
|
||||
CMass *tmpm;
|
||||
F64 d,dd;
|
||||
CD3 p;
|
||||
if (ode->drag_v || ode->drag_v2 || ode->drag_v3) {
|
||||
tempm=ode->next_mass;
|
||||
while (tempm!=&ode->next_mass) {
|
||||
if (!(tempm->flags & MSF_INACTIVE) &&
|
||||
tempm->drag_profile_factor &&
|
||||
(dd=D3NormSqr(&tempm->state->DxDt))) {
|
||||
tmpm=ode->next_mass;
|
||||
while (tmpm!=&ode->next_mass) {
|
||||
if (!(tmpm->flags & MSF_INACTIVE) &&
|
||||
tmpm->drag_profile_factor &&
|
||||
(dd=D3NormSqr(&tmpm->state->DxDt))) {
|
||||
d=ode->drag_v;
|
||||
if (ode->drag_v2)
|
||||
d+=ode->drag_v2*Sqrt(dd);
|
||||
if (ode->drag_v3)
|
||||
d+=dd*ode->drag_v3;
|
||||
D3SubEqu(&tempm->DstateDt->DxDt,
|
||||
D3Mul(&p,d*tempm->drag_profile_factor,&tempm->state->DxDt));
|
||||
D3SubEqu(&tmpm->DstateDt->DxDt,
|
||||
D3Mul(&p,d*tmpm->drag_profile_factor,&tmpm->state->DxDt));
|
||||
}
|
||||
tempm=tempm->next;
|
||||
tmpm=tmpm->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
U0 ODEApplyAccelerationLimit(CMathODE *ode)
|
||||
{
|
||||
CMass *tempm;
|
||||
CMass *tmpm;
|
||||
F64 d;
|
||||
if (ode->acceleration_limit) {
|
||||
tempm=ode->next_mass;
|
||||
while (tempm!=&ode->next_mass) {
|
||||
if (!(tempm->flags & MSF_INACTIVE) &&
|
||||
(d=D3Norm(&tempm->DstateDt->DxDt))>ode->acceleration_limit)
|
||||
D3MulEqu(&tempm->DstateDt->DxDt,ode->acceleration_limit/d);
|
||||
tempm=tempm->next;
|
||||
tmpm=ode->next_mass;
|
||||
while (tmpm!=&ode->next_mass) {
|
||||
if (!(tmpm->flags & MSF_INACTIVE) &&
|
||||
(d=D3Norm(&tmpm->DstateDt->DxDt))>ode->acceleration_limit)
|
||||
D3MulEqu(&tmpm->DstateDt->DxDt,ode->acceleration_limit/d);
|
||||
tmpm=tmpm->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
U0 ODECallDerivative(CMathODE *ode,F64 t,F64 *state,F64 *DstateDt)
|
||||
{
|
||||
CMass *tempm;
|
||||
CMass *tmpm;
|
||||
if (ode->flags&ODEF_HAS_MASSES) {
|
||||
ODESetMassesPtrs(ode,state,DstateDt);
|
||||
tempm=ode->next_mass;
|
||||
while (tempm!=&ode->next_mass) {
|
||||
if (!(tempm->flags&MSF_INACTIVE)) {
|
||||
D3Zero(&tempm->DstateDt->DxDt);
|
||||
D3Copy(&tempm->DstateDt->x,&tempm->state->DxDt);
|
||||
tmpm=ode->next_mass;
|
||||
while (tmpm!=&ode->next_mass) {
|
||||
if (!(tmpm->flags&MSF_INACTIVE)) {
|
||||
D3Zero(&tmpm->DstateDt->DxDt);
|
||||
D3Copy(&tmpm->DstateDt->x,&tmpm->state->DxDt);
|
||||
}
|
||||
tempm=tempm->next;
|
||||
tmpm=tmpm->next;
|
||||
}
|
||||
ODECalcSprings(ode);
|
||||
ODECalcDrag(ode);
|
||||
(*ode->derivative)(ode,t,state,DstateDt);
|
||||
tempm=ode->next_mass;
|
||||
while (tempm!=&ode->next_mass) {
|
||||
if (!(tempm->flags&MSF_INACTIVE)) {
|
||||
if (tempm->flags&MSF_FIXED) {
|
||||
D3Zero(&tempm->DstateDt->DxDt);
|
||||
D3Zero(&tempm->DstateDt->x);
|
||||
} else if (tempm->mass)
|
||||
D3DivEqu(&tempm->DstateDt->DxDt,tempm->mass);
|
||||
tmpm=ode->next_mass;
|
||||
while (tmpm!=&ode->next_mass) {
|
||||
if (!(tmpm->flags&MSF_INACTIVE)) {
|
||||
if (tmpm->flags&MSF_FIXED) {
|
||||
D3Zero(&tmpm->DstateDt->DxDt);
|
||||
D3Zero(&tmpm->DstateDt->x);
|
||||
} else if (tmpm->mass)
|
||||
D3DivEqu(&tmpm->DstateDt->DxDt,tmpm->mass);
|
||||
}
|
||||
tempm=tempm->next;
|
||||
tmpm=tmpm->next;
|
||||
}
|
||||
ODEApplyAccelerationLimit(ode);
|
||||
} else
|
||||
@@ -365,10 +365,10 @@ U0 ODERK4OneStep(CMathODE *ode)
|
||||
I64 i,n=ode->n_internal;
|
||||
F64 xh,hh,h6,*dym,*dyt,*yt,*DstateDt;
|
||||
|
||||
dym =ode->temp0;
|
||||
dyt =ode->temp1;
|
||||
yt =ode->temp2;
|
||||
DstateDt=ode->temp3;
|
||||
dym =ode->tmp0;
|
||||
dyt =ode->tmp1;
|
||||
yt =ode->tmp2;
|
||||
DstateDt=ode->tmp3;
|
||||
hh =0.5*ode->h;
|
||||
h6 =ode->h / 6.0;
|
||||
xh =ode->t + hh;
|
||||
@@ -425,34 +425,34 @@ U0 ODECashKarp(CMathODE *ode)
|
||||
I64 i,n=ode->n_internal;
|
||||
F64 h=ode->h,*state=ode->state_internal,
|
||||
*DstateDt=ode->DstateDt,*ak2,*ak3,*ak4,*ak5,*ak6,
|
||||
*tempstate,*stateerr,*outstate;
|
||||
*tmpstate,*stateerr,*outstate;
|
||||
|
||||
ak2=ode->temp0;
|
||||
ak3=ode->temp1;
|
||||
ak4=ode->temp2;
|
||||
ak5=ode->temp3;
|
||||
ak6=ode->temp4;
|
||||
tempstate=ode->temp5;
|
||||
outstate=ode->temp6;
|
||||
stateerr=ode->temp7;
|
||||
ak2=ode->tmp0;
|
||||
ak3=ode->tmp1;
|
||||
ak4=ode->tmp2;
|
||||
ak5=ode->tmp3;
|
||||
ak6=ode->tmp4;
|
||||
tmpstate=ode->tmp5;
|
||||
outstate=ode->tmp6;
|
||||
stateerr=ode->tmp7;
|
||||
|
||||
for (i=0;i<n;i++)
|
||||
tempstate[i]=state[i]+ODEb21*h*DstateDt[i];
|
||||
ODECallDerivative(ode,ode->t+ODEa2*h,tempstate,ak2);
|
||||
tmpstate[i]=state[i]+ODEb21*h*DstateDt[i];
|
||||
ODECallDerivative(ode,ode->t+ODEa2*h,tmpstate,ak2);
|
||||
for (i=0;i<n;i++)
|
||||
tempstate[i]=state[i]+h*(ODEb31*DstateDt[i]+ODEb32*ak2[i]);
|
||||
ODECallDerivative(ode,ode->t+ODEa3*h,tempstate,ak3);
|
||||
tmpstate[i]=state[i]+h*(ODEb31*DstateDt[i]+ODEb32*ak2[i]);
|
||||
ODECallDerivative(ode,ode->t+ODEa3*h,tmpstate,ak3);
|
||||
for (i=0;i<n;i++)
|
||||
tempstate[i]=state[i]+h*(ODEb41*DstateDt[i]+ODEb42*ak2[i]+ODEb43*ak3[i]);
|
||||
ODECallDerivative(ode,ode->t+ODEa4*h,tempstate,ak4);
|
||||
tmpstate[i]=state[i]+h*(ODEb41*DstateDt[i]+ODEb42*ak2[i]+ODEb43*ak3[i]);
|
||||
ODECallDerivative(ode,ode->t+ODEa4*h,tmpstate,ak4);
|
||||
for (i=0;i<n;i++)
|
||||
tempstate[i]=state[i]+h*(ODEb51*DstateDt[i]+
|
||||
tmpstate[i]=state[i]+h*(ODEb51*DstateDt[i]+
|
||||
ODEb52*ak2[i]+ODEb53*ak3[i]+ODEb54*ak4[i]);
|
||||
ODECallDerivative(ode,ode->t+ODEa5*h,tempstate,ak5);
|
||||
ODECallDerivative(ode,ode->t+ODEa5*h,tmpstate,ak5);
|
||||
for (i=0;i<n;i++)
|
||||
tempstate[i]=state[i]+h*(ODEb61*DstateDt[i]+
|
||||
tmpstate[i]=state[i]+h*(ODEb61*DstateDt[i]+
|
||||
ODEb62*ak2[i]+ODEb63*ak3[i]+ODEb64*ak4[i]+ODEb65*ak5[i]);
|
||||
ODECallDerivative(ode,ode->t+ODEa6*h,tempstate,ak6);
|
||||
ODECallDerivative(ode,ode->t+ODEa6*h,tmpstate,ak6);
|
||||
for (i=0;i<n;i++)
|
||||
outstate[i]=state[i]+h*(ODEc1*DstateDt[i]+
|
||||
ODEc3*ak3[i]+ODEc4*ak4[i]+ODEc6*ak6[i]);
|
||||
@@ -469,23 +469,23 @@ U0 ODECashKarp(CMathODE *ode)
|
||||
U0 ODERK5OneStep(CMathODE *ode)
|
||||
{
|
||||
I64 i;
|
||||
F64 errmax,temp,*tempstate=ode->temp6,*stateerr=ode->temp7;
|
||||
F64 errmax,tmp,*tmpstate=ode->tmp6,*stateerr=ode->tmp7;
|
||||
while (TRUE) {
|
||||
ode->h=Clamp(ode->h,ode->h_min,ode->h_max);
|
||||
ODECashKarp(ode);
|
||||
errmax=0.0;
|
||||
for (i=0;i<ode->n_internal;i++) {
|
||||
temp=Abs(stateerr[i]/ode->state_scale[i]);
|
||||
if (temp>errmax)
|
||||
errmax=temp;
|
||||
tmp=Abs(stateerr[i]/ode->state_scale[i]);
|
||||
if (tmp>errmax)
|
||||
errmax=tmp;
|
||||
}
|
||||
errmax/=ode->tolerance_internal;
|
||||
if (errmax<=1.0 || ode->h==ode->h_min) break;
|
||||
temp=ode->h*SAFETY*errmax`PSHRNK;
|
||||
if (temp<0.1*ode->h)
|
||||
tmp=ode->h*SAFETY*errmax`PSHRNK;
|
||||
if (tmp<0.1*ode->h)
|
||||
ode->h*=0.1;
|
||||
else
|
||||
ode->h=temp;
|
||||
ode->h=tmp;
|
||||
}
|
||||
ode->t+=ode->h;
|
||||
if (errmax>ERRCON)
|
||||
@@ -493,13 +493,13 @@ U0 ODERK5OneStep(CMathODE *ode)
|
||||
else
|
||||
ode->h*=5.0;
|
||||
ode->h=Clamp(ode->h,ode->h_min,ode->h_max);
|
||||
MemCpy(ode->state_internal,tempstate,sizeof(F64)*ode->n_internal);
|
||||
MemCpy(ode->state_internal,tmpstate,sizeof(F64)*ode->n_internal);
|
||||
}
|
||||
|
||||
F64 ode_alloced_factor=0.75;
|
||||
|
||||
U0 ODEsUpdate(CTask *task)
|
||||
{/* This routine is called by the $LK,"window mgr",A="FF:::/Adam/Gr/GrScreen.HC,ODEsUpdate"$ on a continuous
|
||||
{/* This routine is called by the $LK,"window mgr",A="FF:::/Adam/Gr/GrScrn.HC,ODEsUpdate"$ on a continuous
|
||||
basis to allow real-time simulation. It is intended
|
||||
to provide ress good enough for games. It uses a runge-kutta
|
||||
integrator which is a better algorithm than doing it with Euler.
|
||||
|
||||
File renamed without changes.
+16
-16
@@ -2,16 +2,16 @@
|
||||
public U8 *ACDDefGet(U8 *st,I64 def_num=1)
|
||||
{//MAlloc str holding single dict definition of word.
|
||||
CFile *f;
|
||||
CHashGeneric *temph;
|
||||
CHashGeneric *tmph;
|
||||
U8 *res=NULL,*buf,*in_ptr,
|
||||
*st2=MStrUtil(st,SUF_TO_UPPER);
|
||||
temph=HashFind(st2,ac.hash_table,HTT_DICT_WORD);
|
||||
tmph=HashFind(st2,ac.hash_table,HTT_DICT_WORD);
|
||||
Free(st2);
|
||||
if (temph) {
|
||||
if (tmph) {
|
||||
if (f=FOpen(ACD_DEF_FILENAME,"r")) {
|
||||
buf=MAlloc(ACD_BLK_SIZE*2+1);
|
||||
buf[ACD_BLK_SIZE*2]=0; //terminate
|
||||
FRBlks(f,buf,temph->user_data0*ACD_BLK_SIZE/BLK_SIZE,
|
||||
FRBlks(f,buf,tmph->user_data0*ACD_BLK_SIZE/BLK_SIZE,
|
||||
ACD_BLK_SIZE*2/BLK_SIZE);
|
||||
FClose(f);
|
||||
in_ptr=buf;
|
||||
@@ -46,16 +46,16 @@ public U8 *ACDDefGet(U8 *st,I64 def_num=1)
|
||||
public U8 *ACDDefsGet(U8 *st)
|
||||
{//MAlloc str with all dict definitions of word.
|
||||
CFile *f;
|
||||
CHashGeneric *temph;
|
||||
CHashGeneric *tmph;
|
||||
U8 *res=NULL,*buf,*in_ptr,*in_ptr2,
|
||||
*st2=MStrUtil(st,SUF_TO_UPPER);
|
||||
temph=HashFind(st2,ac.hash_table,HTT_DICT_WORD);
|
||||
tmph=HashFind(st2,ac.hash_table,HTT_DICT_WORD);
|
||||
Free(st2);
|
||||
if (temph) {
|
||||
if (tmph) {
|
||||
if (f=FOpen(ACD_DEF_FILENAME,"r")) {
|
||||
buf=MAlloc(ACD_BLK_SIZE*2+1);
|
||||
buf[ACD_BLK_SIZE*2]=0; //terminate
|
||||
FRBlks(f,buf,temph->user_data0*ACD_BLK_SIZE/BLK_SIZE,
|
||||
FRBlks(f,buf,tmph->user_data0*ACD_BLK_SIZE/BLK_SIZE,
|
||||
ACD_BLK_SIZE*2/BLK_SIZE);
|
||||
FClose(f);
|
||||
in_ptr=buf;
|
||||
@@ -143,7 +143,7 @@ U0 ACDFillin(I64 n)
|
||||
s=acd.fillins[n]+1;
|
||||
len=StrLen(s);
|
||||
if (len>ac.partial_len)
|
||||
Auto(s+ac.partial_len);
|
||||
In(s+ac.partial_len);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,16 +246,16 @@ U0 ACFillIn(I64 n)
|
||||
if (0<=--n<ac.num_fillins) {
|
||||
s=ac.fillin_matches[n]->str;
|
||||
if (StrLen(s)>ac.partial_len)
|
||||
Auto(s+ac.partial_len);
|
||||
In(s+ac.partial_len);
|
||||
}
|
||||
}
|
||||
|
||||
U0 ACMan(I64 n,CTask *parent_task=NULL)
|
||||
{
|
||||
CHashAC *tempw;
|
||||
CHashSrcSym *temph;
|
||||
if (0<=--n<ac.num_fillins && (tempw=ac.fillin_matches[n]) &&
|
||||
(temph=HashFind(tempw->str,Fs->hash_table,HTG_SRC_SYM)) &&
|
||||
temph->src_link)
|
||||
PopUpEd(temph->src_link,parent_task);
|
||||
CHashAC *tmpw;
|
||||
CHashSrcSym *tmph;
|
||||
if (0<=--n<ac.num_fillins && (tmpw=ac.fillin_matches[n]) &&
|
||||
(tmph=HashFind(tmpw->str,Fs->hash_table,HTG_SRC_SYM)) &&
|
||||
tmph->src_link)
|
||||
PopUpEd(tmph->src_link,parent_task);
|
||||
}
|
||||
+26
-26
@@ -5,7 +5,7 @@ acd.has_defs =FileFind(ACD_DEF_FILENAME)||FileFind(ACD_DEF_FILENAME_Z);
|
||||
public U0 ACDWordsLoad()
|
||||
{//Put words from word list into hash table.
|
||||
I64 size;
|
||||
CHashGeneric *temph;
|
||||
CHashGeneric *tmph;
|
||||
U8 *in_ptr,*in_start,*st2;
|
||||
U16 *d;
|
||||
acd.num_words=0;
|
||||
@@ -21,17 +21,17 @@ public U0 ACDWordsLoad()
|
||||
in_ptr++;
|
||||
if (*in_ptr) {
|
||||
st2=MStrUtil(in_ptr,SUF_TO_UPPER);
|
||||
temph=ACAlloc(sizeof(CHashGeneric)+StrLen(st2)+1);
|
||||
StrCpy(temph+1,st2);
|
||||
tmph=ACAlloc(sizeof(CHashGeneric)+StrLen(st2)+1);
|
||||
StrCpy(tmph+1,st2);
|
||||
Free(st2);
|
||||
in_ptr+=StrLen(in_ptr)+1;
|
||||
temph->str=temph+1;
|
||||
temph->use_cnt=1;
|
||||
temph->type=HTT_DICT_WORD;
|
||||
tmph->str=tmph+1;
|
||||
tmph->use_cnt=1;
|
||||
tmph->type=HTT_DICT_WORD;
|
||||
d=in_ptr;
|
||||
temph->user_data0=*d;
|
||||
tmph->user_data0=*d;
|
||||
in_ptr+=2;
|
||||
HashAdd(temph,ac.hash_table);
|
||||
HashAdd(tmph,ac.hash_table);
|
||||
acd.num_words++;
|
||||
} else
|
||||
in_ptr+=3;
|
||||
@@ -43,19 +43,19 @@ public U0 ACDWordsLoad()
|
||||
#help_index "AutoComplete"
|
||||
CHashAC *ACHashAdd(U8 *w)
|
||||
{
|
||||
CHashAC *tempw=HashFind(w,ac.hash_table,HTT_WORD);
|
||||
if (tempw) {
|
||||
tempw->hits++;
|
||||
return tempw;
|
||||
CHashAC *tmpw=HashFind(w,ac.hash_table,HTT_WORD);
|
||||
if (tmpw) {
|
||||
tmpw->hits++;
|
||||
return tmpw;
|
||||
}
|
||||
tempw=ACAlloc(sizeof(CHashAC));
|
||||
tempw->str=AStrNew(w);
|
||||
tempw->type=HTT_WORD;
|
||||
tempw->use_cnt=1;
|
||||
tempw->hits=1;
|
||||
HashAdd(tempw,ac.hash_table);
|
||||
tmpw=ACAlloc(sizeof(CHashAC));
|
||||
tmpw->str=AStrNew(w);
|
||||
tmpw->type=HTT_WORD;
|
||||
tmpw->use_cnt=1;
|
||||
tmpw->hits=1;
|
||||
HashAdd(tmpw,ac.hash_table);
|
||||
ac.num_words++;
|
||||
return tempw;
|
||||
return tmpw;
|
||||
}
|
||||
|
||||
U0 ACSingleFileAdd(U8 *buf)
|
||||
@@ -93,20 +93,20 @@ U0 ACSingleFileAdd(U8 *buf)
|
||||
U0 ACMainFileLstTraverse(U8 *files_find_mask)
|
||||
{
|
||||
U8 *buf;
|
||||
CDirEntry *tempde,*tempde1;
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
try {
|
||||
tempde=tempde1=FilesFind(files_find_mask,
|
||||
tmpde=tmpde1=FilesFind(files_find_mask,
|
||||
FUF_RECURSE|FUF_JUST_TXT|FUF_JUST_FILES|FUF_CLUSTER_ORDER);
|
||||
while (tempde) {
|
||||
"%s\n",tempde->full_name;
|
||||
buf=FileRead(tempde->full_name);
|
||||
while (tmpde) {
|
||||
"%s\n",tmpde->full_name;
|
||||
buf=FileRead(tmpde->full_name);
|
||||
ACSingleFileAdd(buf);
|
||||
Free(buf);
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
} catch
|
||||
Fs->catch_except=TRUE;
|
||||
DirTreeDel(tempde1);
|
||||
DirTreeDel(tmpde1);
|
||||
}
|
||||
|
||||
U0 ACProgressTask(Bool *_start_flag)
|
||||
|
||||
+16
-16
@@ -60,21 +60,21 @@ I64 ACPriorWordInStr(U8 *src,U8 *dst,I64 len,I64 buf_size)
|
||||
return i+1;
|
||||
}
|
||||
|
||||
U0 ACFillInAdd(CHashAC *tempw)
|
||||
U0 ACFillInAdd(CHashAC *tmpw)
|
||||
{
|
||||
I64 k;
|
||||
if (ac.num_fillins<AC_MAX_FILLINS ||
|
||||
tempw->hits>ac.fillin_hits[ac.num_fillins-1]) {
|
||||
tmpw->hits>ac.fillin_hits[ac.num_fillins-1]) {
|
||||
for (k=ac.num_fillins-1;k>=0;k--) {
|
||||
if (tempw->hits<=ac.fillin_hits[k])
|
||||
if (tmpw->hits<=ac.fillin_hits[k])
|
||||
break;
|
||||
else {
|
||||
ac.fillin_matches[k+1]=ac.fillin_matches[k];
|
||||
ac.fillin_hits[k+1] =ac.fillin_hits[k];
|
||||
}
|
||||
}
|
||||
ac.fillin_matches[k+1]=tempw;
|
||||
ac.fillin_hits[k+1] =tempw->hits;
|
||||
ac.fillin_matches[k+1]=tmpw;
|
||||
ac.fillin_hits[k+1] =tmpw->hits;
|
||||
if (ac.num_fillins<AC_MAX_FILLINS)
|
||||
ac.num_fillins++;
|
||||
}
|
||||
@@ -85,9 +85,9 @@ U0 ACPutChoices(CDoc *focus_l,CDocEntry *doc_e,CTask *focus_task,
|
||||
{
|
||||
I64 i,data_col;
|
||||
U8 *buf,*buf1,*src=NULL,*st;
|
||||
CHashAC *tempw;
|
||||
CHashAC *tmpw;
|
||||
F64 timeout_time=tS+0.5;
|
||||
CHashSrcSym *temph;
|
||||
CHashSrcSym *tmph;
|
||||
|
||||
src=DocScanLine(focus_l,doc_e,&data_col);
|
||||
DocUnlock(focus_l);
|
||||
@@ -108,11 +108,11 @@ U0 ACPutChoices(CDoc *focus_l,CDocEntry *doc_e,CTask *focus_task,
|
||||
ac.num_fillins=0;
|
||||
if (*ac.cur_word)
|
||||
for (i=0;i<=ac.hash_table->mask && tS<timeout_time;i++) {
|
||||
tempw=ac.hash_table->body[i];
|
||||
while (tempw) {
|
||||
if (!MemCmp(ac.cur_word,tempw->str,StrLen(ac.cur_word)))
|
||||
ACFillInAdd(tempw);
|
||||
tempw=tempw->next;
|
||||
tmpw=ac.hash_table->body[i];
|
||||
while (tmpw) {
|
||||
if (!MemCmp(ac.cur_word,tmpw->str,StrLen(ac.cur_word)))
|
||||
ACFillInAdd(tmpw);
|
||||
tmpw=tmpw->next;
|
||||
}
|
||||
}
|
||||
ACDocRst(51,13);
|
||||
@@ -122,11 +122,11 @@ U0 ACPutChoices(CDoc *focus_l,CDocEntry *doc_e,CTask *focus_task,
|
||||
st=ac.fillin_matches[i]->str;
|
||||
"$$GREEN$$F%02d$$FG$$ ",i+1;
|
||||
if (TaskValidate(focus_task) &&
|
||||
(temph=HashFind(st,focus_task->hash_table,HTG_SRC_SYM)) &&
|
||||
temph->src_link) {
|
||||
if (temph->type&HTF_PUBLIC)
|
||||
(tmph=HashFind(st,focus_task->hash_table,HTG_SRC_SYM)) &&
|
||||
tmph->src_link) {
|
||||
if (tmph->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,tmph->src_link;
|
||||
} else
|
||||
"%s\n",st;
|
||||
}
|
||||
|
||||
File renamed without changes.
+11
-11
@@ -18,15 +18,15 @@ U0 CtrlsUpdate(CTask *task)
|
||||
if (c->update_derived_vals)
|
||||
(*c->update_derived_vals)(c);
|
||||
if (c->flags&CTRLF_BORDER) {
|
||||
c->screen_left =gr.pan_text_x+task->pix_left+c->left-FONT_WIDTH;
|
||||
c->screen_right =gr.pan_text_x+task->pix_left+c->right-FONT_WIDTH;
|
||||
c->screen_top =gr.pan_text_y+task->pix_top+c->top-FONT_HEIGHT;
|
||||
c->screen_bottom=gr.pan_text_y+task->pix_top+c->bottom-FONT_HEIGHT;
|
||||
c->scrn_left =gr.pan_text_x+task->pix_left+c->left-FONT_WIDTH;
|
||||
c->scrn_right =gr.pan_text_x+task->pix_left+c->right-FONT_WIDTH;
|
||||
c->scrn_top =gr.pan_text_y+task->pix_top+c->top-FONT_HEIGHT;
|
||||
c->scrn_bottom=gr.pan_text_y+task->pix_top+c->bottom-FONT_HEIGHT;
|
||||
} else {
|
||||
c->screen_left =gr.pan_text_x+task->pix_left+c->left;
|
||||
c->screen_right =gr.pan_text_x+task->pix_left+c->right;
|
||||
c->screen_top =gr.pan_text_y+task->pix_top+c->top;
|
||||
c->screen_bottom=gr.pan_text_y+task->pix_top+c->bottom;
|
||||
c->scrn_left =gr.pan_text_x+task->pix_left+c->left;
|
||||
c->scrn_right =gr.pan_text_x+task->pix_left+c->right;
|
||||
c->scrn_top =gr.pan_text_y+task->pix_top+c->top;
|
||||
c->scrn_bottom=gr.pan_text_y+task->pix_top+c->bottom;
|
||||
}
|
||||
c=c->next;
|
||||
}
|
||||
@@ -35,9 +35,9 @@ U0 CtrlsUpdate(CTask *task)
|
||||
fp_update_ctrls=&CtrlsUpdate;
|
||||
|
||||
Bool CtrlInsideRect(CCtrl *c,I64 x,I64 y)
|
||||
{//screen coordinates
|
||||
if (c->screen_left<=x<=c->screen_right &&
|
||||
c->screen_top<=y<=c->screen_bottom)
|
||||
{//scrn coordinates
|
||||
if (c->scrn_left<=x<=c->scrn_right &&
|
||||
c->scrn_top<=y<=c->scrn_bottom)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
+33
-33
@@ -14,7 +14,7 @@ class CTemplateCS
|
||||
|
||||
CTemplateCS *CtrlSliderGet()
|
||||
{
|
||||
CTemplateCSSlider *temps;
|
||||
CTemplateCSSlider *tmps;
|
||||
U8 *st,pmt[STR_LEN];
|
||||
CTemplateCS *res=CAlloc(sizeof(CTemplateCS));
|
||||
|
||||
@@ -33,10 +33,10 @@ CTemplateCS *CtrlSliderGet()
|
||||
Free(st);
|
||||
break;
|
||||
}
|
||||
temps=CAlloc(sizeof(CTemplateCSSlider));
|
||||
temps->name=st;
|
||||
QueIns(temps,res->last_slider);
|
||||
temps->num=res->num_sliders++;
|
||||
tmps=CAlloc(sizeof(CTemplateCSSlider));
|
||||
tmps->name=st;
|
||||
QueIns(tmps,res->last_slider);
|
||||
tmps->num=res->num_sliders++;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -45,7 +45,7 @@ U0 TemplateCtrlSlider(CDoc *doc)
|
||||
{
|
||||
CTask *task;
|
||||
CTemplateCS *m=NULL;
|
||||
CTemplateCSSlider *temps;
|
||||
CTemplateCSSlider *tmps;
|
||||
I64 i;
|
||||
|
||||
DocUnlock(doc);
|
||||
@@ -65,10 +65,10 @@ class CSliderState
|
||||
{
|
||||
",m->range,m->spacing,m->border);
|
||||
|
||||
temps=m->next_slider;
|
||||
while (temps!=&m->next_slider) {
|
||||
DocPrint(doc," I64 %s;\n",temps->name);
|
||||
temps=temps->next;
|
||||
tmps=m->next_slider;
|
||||
while (tmps!=&m->next_slider) {
|
||||
DocPrint(doc," I64 %s;\n",tmps->name);
|
||||
tmps=tmps->next;
|
||||
}
|
||||
if (*m->glbl_name)
|
||||
DocPrint(doc,"} %s;\n",m->glbl_name);
|
||||
@@ -98,32 +98,32 @@ U0 DrawCtrlSlider(CDC *dc,CCtrl *c)
|
||||
|
||||
DocPrint(doc," dc->color=LTRED;\n");
|
||||
|
||||
temps=m->next_slider;
|
||||
while (temps!=&m->next_slider) {
|
||||
tmps=m->next_slider;
|
||||
while (tmps!=&m->next_slider) {
|
||||
DocPrint(doc,
|
||||
" GrPrint(dc,c->left+%d*SLIDER_SPACING+%d-FONT_WIDTH/2,
|
||||
c->top+SLIDER_SPACING+SLIDER_RANGE+3,
|
||||
\"%%d\",s->%s*10/SLIDER_RANGE);\n",
|
||||
temps->num+1,temps->num,temps->name);
|
||||
temps=temps->next;
|
||||
tmps->num+1,tmps->num,tmps->name);
|
||||
tmps=tmps->next;
|
||||
}
|
||||
|
||||
temps=m->next_slider;
|
||||
while (temps!=&m->next_slider) {
|
||||
tmps=m->next_slider;
|
||||
while (tmps!=&m->next_slider) {
|
||||
DocPrint(doc,
|
||||
" GrRect(dc,c->left+%d*SLIDER_SPACING+%d-3,"
|
||||
"c->top+SLIDER_SPACING+SLIDER_RANGE-1-s->%s-2,7,5);\n",
|
||||
temps->num+1,temps->num,temps->name);
|
||||
temps=temps->next;
|
||||
tmps->num+1,tmps->num,tmps->name);
|
||||
tmps=tmps->next;
|
||||
}
|
||||
DocPrint(doc," dc->color=YELLOW;\n");
|
||||
|
||||
temps=m->next_slider;
|
||||
while (temps!=&m->next_slider) {
|
||||
tmps=m->next_slider;
|
||||
while (tmps!=&m->next_slider) {
|
||||
DocPrint(doc," GrRect(dc,c->left+%d*SLIDER_SPACING+%d-2,"
|
||||
"c->top+SLIDER_SPACING+SLIDER_RANGE-1-s->%s-1,5,3);\n",
|
||||
temps->num+1,temps->num,temps->name);
|
||||
temps=temps->next;
|
||||
tmps->num+1,tmps->num,tmps->name);
|
||||
tmps=tmps->next;
|
||||
}
|
||||
DocPrint(doc,
|
||||
"}
|
||||
@@ -137,11 +137,11 @@ U0 UpdateDerivedCtrlSlider(CCtrl *c)
|
||||
c->bottom=c->top+SLIDER_SPACING*2+SLIDER_RANGE;
|
||||
",m->num_sliders+1,m->num_sliders);
|
||||
|
||||
temps=m->next_slider;
|
||||
while (temps!=&m->next_slider) {
|
||||
tmps=m->next_slider;
|
||||
while (tmps!=&m->next_slider) {
|
||||
DocPrint(doc," s->%s=ClampI64(s->%s,0,SLIDER_RANGE-1);\n",
|
||||
temps->name,temps->name);
|
||||
temps=temps->next;
|
||||
tmps->name,tmps->name);
|
||||
tmps=tmps->next;
|
||||
}
|
||||
DocPrint(doc,
|
||||
"}
|
||||
@@ -152,19 +152,19 @@ U0 LeftClickSlider(CCtrl *c,I64 x,I64 y,Bool down)
|
||||
CSliderState *s=c->state;
|
||||
");
|
||||
|
||||
temps=m->next_slider;
|
||||
while (temps!=&m->next_slider) {
|
||||
tmps=m->next_slider;
|
||||
while (tmps!=&m->next_slider) {
|
||||
DocPrint(doc," ");
|
||||
if (temps!=m->next_slider)
|
||||
if (tmps!=m->next_slider)
|
||||
DocPrint(doc,"else ");
|
||||
if (temps->next==&m->next_slider)
|
||||
if (tmps->next==&m->next_slider)
|
||||
DocPrint(doc,"\n");
|
||||
else
|
||||
DocPrint(doc,"if (x<c->left+%d*SLIDER_SPACING+%d+SLIDER_SPACING/2)\n",
|
||||
temps->num+1,temps->num);
|
||||
tmps->num+1,tmps->num);
|
||||
DocPrint(doc," s->%s=SLIDER_RANGE-1-(y-(c->top+SLIDER_SPACING));\n",
|
||||
temps->name);
|
||||
temps=temps->next;
|
||||
tmps->name);
|
||||
tmps=tmps->next;
|
||||
}
|
||||
|
||||
DocPrint(doc,
|
||||
|
||||
+23
-23
@@ -117,7 +117,7 @@ U0 PCILookUpSingle(CDoc *doc,I64 m,I64 d,U8 **_vendor,U8 **_dev)
|
||||
|
||||
U0 PCILookUpDevs()
|
||||
{
|
||||
CPCIDev *temppci;
|
||||
CPCIDev *tmppci;
|
||||
I64 w1,w2,b,d,f,timeout=32*8*2;
|
||||
CDoc *doc;
|
||||
if (dev.pci_head.next!=&dev.pci_head)
|
||||
@@ -128,16 +128,16 @@ U0 PCILookUpDevs()
|
||||
for (f=0;f<8;f++) {
|
||||
w1=PCIReadU16(b,d,f,0);
|
||||
if (w1!=0xFFFF) {
|
||||
temppci=ACAlloc(sizeof(CPCIDev));
|
||||
temppci->bus=b;
|
||||
temppci->dev=d;
|
||||
temppci->fun=f;
|
||||
temppci->vendor=w1;
|
||||
temppci->dev_id=w2=PCIReadU16(b,d,f,2);
|
||||
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_head.last);
|
||||
tmppci=ACAlloc(sizeof(CPCIDev));
|
||||
tmppci->bus=b;
|
||||
tmppci->dev=d;
|
||||
tmppci->fun=f;
|
||||
tmppci->vendor=w1;
|
||||
tmppci->dev_id=w2=PCIReadU16(b,d,f,2);
|
||||
tmppci->sub_code=PCIReadU8(b,d,f,0xA);
|
||||
tmppci->base_code=PCIReadU8(b,d,f,0xB);
|
||||
PCILookUpSingle(doc,w1,w2,&tmppci->vendor_str,&tmppci->dev_id_str);
|
||||
QueIns(tmppci,dev.pci_head.last);
|
||||
timeout=32*8*2;
|
||||
} else if (sys_pci_busses==256 && --timeout<=0)
|
||||
goto lud_done;
|
||||
@@ -148,20 +148,20 @@ lud_done:
|
||||
|
||||
public U0 PCIRep()
|
||||
{//Report description of PCI devices.
|
||||
CPCIDev *temppci;
|
||||
CPCIDev *tmppci;
|
||||
"PCI Busses:%d\n",sys_pci_busses;
|
||||
if (!FileFind(PCI_DEV_FILE)) {
|
||||
"You don't have the PCI device file.\n";
|
||||
return;
|
||||
}
|
||||
PCILookUpDevs;
|
||||
temppci=dev.pci_head.next;
|
||||
while (temppci!=&dev.pci_head) {
|
||||
tmppci=dev.pci_head.next;
|
||||
while (tmppci!=&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,
|
||||
temppci->vendor_str,temppci->dev_id_str;
|
||||
temppci=temppci->next;
|
||||
tmppci->bus,tmppci->dev,tmppci->fun,
|
||||
tmppci->base_code,tmppci->sub_code,
|
||||
tmppci->vendor_str,tmppci->dev_id_str;
|
||||
tmppci=tmppci->next;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,18 +243,18 @@ public U0 MemBIOSRep()
|
||||
{//Report the memory ranges reported by the BIOS at boot.
|
||||
U16 *m01=SYS_MEM_E801;
|
||||
CMemE820 *m20=SYS_MEM_E820;
|
||||
CMemRange *tempmr;
|
||||
CMemRange *tmpmr;
|
||||
"Standard Addresses\n"
|
||||
"0x000A0000-0x000BFFFF VGA\n"
|
||||
"0xFEE00000-0xFEE00FFF See $$LK,\"APIC\",A=\"MN:LAPIC_BASE\"$$\n\n"
|
||||
"32 Bit Device Mem\n";
|
||||
while (LBts(&sys_semas[SYS_SEMA_DEV_MEM],0))
|
||||
Yield;
|
||||
tempmr=dev.mem32_head.next;
|
||||
while (tempmr!=&dev.mem32_head) {
|
||||
tmpmr=dev.mem32_head.next;
|
||||
while (tmpmr!=&dev.mem32_head) {
|
||||
"%02X:0x%016X-0x%016X\n",
|
||||
tempmr->type,tempmr->base,tempmr->base+tempmr->size-1;
|
||||
tempmr=tempmr->next;
|
||||
tmpmr->type,tmpmr->base,tmpmr->base+tmpmr->size-1;
|
||||
tmpmr=tmpmr->next;
|
||||
}
|
||||
LBtr(&sys_semas[SYS_SEMA_DEV_MEM],0);
|
||||
|
||||
|
||||
+16
-16
@@ -34,7 +34,7 @@ U0 DocBinsValidate(CDoc *doc)
|
||||
b=doc->bin_head.next;
|
||||
while (b!=&doc->bin_head) {
|
||||
b->use_cnt=0;
|
||||
b->temp_use_cnt=0;
|
||||
b->tmp_use_cnt=0;
|
||||
b->renum_num=-1;
|
||||
Free(b->tag);
|
||||
b->tag=NULL;
|
||||
@@ -46,7 +46,7 @@ U0 DocBinsValidate(CDoc *doc)
|
||||
if (doc_e->de_flags & DOCEF_HAS_BIN) {
|
||||
if (b=doc_e->bin_data=DocBinFindNum(doc,doc_e->bin_num)) {
|
||||
if (doc_e->de_flags & DOCEF_BIN_PTR_LINK)
|
||||
b->temp_use_cnt=MAX_I32;
|
||||
b->tmp_use_cnt=MAX_I32;
|
||||
if (!b->use_cnt++)
|
||||
b->renum_num=++renum_num;
|
||||
doc_e->bin_num=b->renum_num;
|
||||
@@ -98,7 +98,7 @@ I64 DocBinPtrRst(CDoc *doc,CDocEntry *doc_e)
|
||||
{
|
||||
U8 *st,*st2;
|
||||
CDoc *doc2;
|
||||
CDocBin *tempb,*tempb2;
|
||||
CDocBin *tmpb,*tmpb2;
|
||||
I64 i,bin_num=0;
|
||||
if (doc_e->de_flags&DOCEF_HAS_BIN &&
|
||||
doc_e->bin_ptr_link && StrLen(doc_e->bin_ptr_link)) {
|
||||
@@ -109,26 +109,26 @@ I64 DocBinPtrRst(CDoc *doc,CDocEntry *doc_e)
|
||||
i=Str2I64(st2);
|
||||
if (i>0||*st2) {
|
||||
doc2=DocRead(st);
|
||||
if (i>0 && (tempb2=DocBinFindNum(doc2,i)) ||
|
||||
i==0 && (tempb2=DocBinFindTag(doc2,st2))) {
|
||||
if (i>0 && (tmpb2=DocBinFindNum(doc2,i)) ||
|
||||
i==0 && (tmpb2=DocBinFindTag(doc2,st2))) {
|
||||
i=1;
|
||||
if (bin_num>0) {
|
||||
if (tempb=DocBinFindNum(doc,bin_num)) {
|
||||
i=tempb->use_cnt;
|
||||
DocBinDel(doc,tempb);
|
||||
if (tmpb=DocBinFindNum(doc,bin_num)) {
|
||||
i=tmpb->use_cnt;
|
||||
DocBinDel(doc,tmpb);
|
||||
}
|
||||
} else
|
||||
bin_num=doc->cur_bin_num++;
|
||||
tempb=MAllocIdent(tempb2,doc->mem_task);
|
||||
tempb->use_cnt=i;
|
||||
tempb->data=MAllocIdent(tempb2->data,doc->mem_task);
|
||||
tempb->num=bin_num;
|
||||
doc_e->bin_data=tempb;
|
||||
tmpb=MAllocIdent(tmpb2,doc->mem_task);
|
||||
tmpb->use_cnt=i;
|
||||
tmpb->data=MAllocIdent(tmpb2->data,doc->mem_task);
|
||||
tmpb->num=bin_num;
|
||||
doc_e->bin_data=tmpb;
|
||||
if (doc_e->de_flags&DOCEF_TAG && doc_e->tag && *doc_e->tag)
|
||||
tempb->tag=StrNew(doc_e->tag,doc->mem_task);
|
||||
tmpb->tag=StrNew(doc_e->tag,doc->mem_task);
|
||||
else
|
||||
tempb->tag=NULL;
|
||||
QueIns(tempb,doc->bin_head.last);
|
||||
tmpb->tag=NULL;
|
||||
QueIns(tmpb,doc->bin_head.last);
|
||||
} else
|
||||
bin_num=0;
|
||||
DocDel(doc2);
|
||||
|
||||
@@ -344,7 +344,7 @@ public U0 EdLineDown(CDoc *doc,I64 sc=MIN_I64)
|
||||
if ((doc_ce2->y<y || doc_ce2->x<x ||
|
||||
doc_ce2->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP) ||
|
||||
doc_ce2->x==x && !doc_ce2->max_col &&
|
||||
Bt(doldoc.type_flags_nontag_invisible,doc_ce2->type_u8)) && sc>=0)
|
||||
Bt(doldoc.type_flags_nontag_invis,doc_ce2->type_u8)) && sc>=0)
|
||||
BEqu(&doc_ce2->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||
if (doc_ce2==doc_ce) break;
|
||||
doc_ce2=doc_ce2->next;
|
||||
@@ -455,7 +455,7 @@ U0 EdCharIns(I64 ch,I64 sc,CDoc *doc)
|
||||
} else {
|
||||
doc->dollar_buf[doc->dollar_buf_ptr]=0;
|
||||
doc->flags&=~DOCF_IN_DOLLAR;
|
||||
DocPrint(doc,doc->dollar_buf);
|
||||
DocPrint(doc,"%s",doc->dollar_buf);
|
||||
doc->dollar_buf_ptr=0;
|
||||
goto ic_done;
|
||||
}
|
||||
@@ -475,8 +475,8 @@ U0 EdCharIns(I64 ch,I64 sc,CDoc *doc)
|
||||
!(sc & (SCF_CTRL|SCF_SHIFT)) &&
|
||||
doc_ce->de_flags &
|
||||
(DOCEF_LINK|DOCEF_TREE|DOCEF_LST|DOCEF_CHECK_COLLAPSABLE|
|
||||
DOCEF_LEFT_MACRO|DOCEF_LEFT_EXP|DOCEF_LEFT_CB|DOCEF_LEFT_AUTO |
|
||||
DOCEF_RIGHT_MACRO|DOCEF_RIGHT_EXP|DOCEF_RIGHT_CB|DOCEF_RIGHT_AUTO)) {
|
||||
DOCEF_LEFT_MACRO|DOCEF_LEFT_EXP|DOCEF_LEFT_CB|DOCEF_LEFT_IN_STR |
|
||||
DOCEF_RIGHT_MACRO|DOCEF_RIGHT_EXP|DOCEF_RIGHT_CB|DOCEF_RIGHT_IN_STR)) {
|
||||
doc->cmd_U8=ch;
|
||||
DocEntryRun(doc,doc_ce,FALSE);
|
||||
DocLock(doc);
|
||||
|
||||
+30
-30
@@ -66,7 +66,7 @@ I64 EdRILex(CRILex *rx)
|
||||
{
|
||||
rx->is_not_cont=FALSE;
|
||||
I64 i;
|
||||
CLexFile *tempf;
|
||||
CLexFile *tmpf;
|
||||
do {
|
||||
Lex(rx->cc1);
|
||||
Lex(rx->cc2);
|
||||
@@ -77,10 +77,10 @@ I64 EdRILex(CRILex *rx)
|
||||
rx->is_not_cont=TRUE;
|
||||
if (rx->was_new_line && (rx->cc1->token!=':' || i==KW_CASE ||
|
||||
i==KW_DFT || i==KW_START || i==KW_END)) {
|
||||
tempf=rx->cc2->lex_include_stk;
|
||||
while (tempf->next)
|
||||
tempf=tempf->next;
|
||||
QueVectU8Put(rx->indent,tempf->cur_entry->y,rx->depth+rx->one_shot);
|
||||
tmpf=rx->cc2->lex_include_stk;
|
||||
while (tmpf->next)
|
||||
tmpf=tmpf->next;
|
||||
QueVectU8Put(rx->indent,tmpf->cur_entry->y,rx->depth+rx->one_shot);
|
||||
rx->one_shot=0;
|
||||
}
|
||||
if (rx->cc2->token=='\n')
|
||||
@@ -346,7 +346,7 @@ I64 EdRAGetU8(CDoc *doc)
|
||||
U0 EdRACollect(CDoc *doc,CRenum *head)
|
||||
{
|
||||
I64 ch,i;
|
||||
CRenum *tempr;
|
||||
CRenum *tmpr;
|
||||
U8 buf[sizeof(CEdFindText.find_text)];
|
||||
ch=EdRAGetU8(doc);
|
||||
while (ch>=0) {
|
||||
@@ -371,9 +371,9 @@ U0 EdRACollect(CDoc *doc,CRenum *head)
|
||||
ch=EdRAGetU8(doc);
|
||||
if (ch==':') {
|
||||
ch=EdRAGetU8(doc);
|
||||
tempr=MAlloc(sizeof(CRenum));
|
||||
StrCpy(tempr->label,buf);
|
||||
QueIns(tempr,head->last);
|
||||
tmpr=MAlloc(sizeof(CRenum));
|
||||
StrCpy(tmpr->label,buf);
|
||||
QueIns(tmpr,head->last);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -388,7 +388,7 @@ U0 EdRenumAsm(CDoc *doc)
|
||||
{
|
||||
Bool unlock=DocLock(doc);
|
||||
I64 num=0;
|
||||
CRenum head,*tempr,*tempr1;
|
||||
CRenum head,*tmpr,*tmpr1;
|
||||
U8 buf[sizeof(CEdFindText.find_text)],
|
||||
buf2[sizeof(CEdFindText.find_text)];
|
||||
|
||||
@@ -396,14 +396,14 @@ U0 EdRenumAsm(CDoc *doc)
|
||||
EdSelFun(doc,TRUE);
|
||||
EdRACollect(doc,&head);
|
||||
|
||||
tempr=head.next;
|
||||
while (tempr!=&head) {
|
||||
tempr1=tempr->next;
|
||||
tmpr=head.next;
|
||||
while (tmpr!=&head) {
|
||||
tmpr1=tmpr->next;
|
||||
num+=ASM_RENUM_SPACING;
|
||||
StrPrint(buf,"@#%02d",num);
|
||||
EdReplace(doc,tempr->label,buf,TRUE,TRUE,TRUE);
|
||||
Free(tempr);
|
||||
tempr=tempr1;
|
||||
EdReplace(doc,tmpr->label,buf,TRUE,TRUE,TRUE);
|
||||
Free(tmpr);
|
||||
tmpr=tmpr1;
|
||||
}
|
||||
|
||||
while (num) {
|
||||
@@ -426,7 +426,7 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
I64 i,start_y,end_y,x,r,goto_line_num;
|
||||
U8 *b,*st,*st2,*prj_file;
|
||||
CTask *task=NULL;
|
||||
CSrvCmd *tempc;
|
||||
CSrvCmd *tmpc;
|
||||
CQueVectU8 *indent;
|
||||
|
||||
DocRecalc(doc);
|
||||
@@ -442,12 +442,12 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
task=Spawn(&SrvCmdLine,NULL,"Srv",,Fs);
|
||||
st2=CurDir;
|
||||
st=MStrPrint("Cd(\"%s\");",st2);
|
||||
tempc=TaskExe(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
tmpc=TaskExe(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
Free(st2);
|
||||
Free(st);
|
||||
WinHorz(Fs->win_left,Fs->win_right, task);
|
||||
WinVert(Fs->win_top, Fs->win_bottom,task);
|
||||
if (JobResScan(tempc,&r)) {
|
||||
if (JobResScan(tmpc,&r)) {
|
||||
st=DirFile(doc->filename.name,,"PRJ.Z");
|
||||
prj_file=FileNameAbs(st,FUF_Z_OR_NOT_Z);
|
||||
Free(st);
|
||||
@@ -455,24 +455,24 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
st2=DirFile(prj_file),
|
||||
st=MStrPrint("Cd(\"%s\");",st2);
|
||||
Free(st2);
|
||||
tempc=TaskExe(task,Fs,st,1<<SVCf_WAKE_MASTER|
|
||||
tmpc=TaskExe(task,Fs,st,1<<SVCf_WAKE_MASTER|
|
||||
1<<SVCf_FOCUS_MASTER|1<<SVCf_FREE_ON_COMPLETE);
|
||||
Free(st);
|
||||
st=MStrPrint("\"$$WW,1$$\";Cmp(\"%s\",\"SysTemp\",\"SysTemp\");",
|
||||
st=MStrPrint("\"$$WW,1$$\";Cmp(\"%s\",\"SysTmp\",\"SysTmp\");",
|
||||
prj_file);
|
||||
tempc=TaskExe(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
tmpc=TaskExe(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
Free(st);
|
||||
if (JobResScan(tempc,&r))
|
||||
if (JobResScan(tmpc,&r))
|
||||
if (!r) {
|
||||
tempc=TaskExe(task,Fs,
|
||||
"Load(\"SysTemp\",LDF_JUST_LOAD);",
|
||||
tmpc=TaskExe(task,Fs,
|
||||
"Load(\"SysTmp\",LDF_JUST_LOAD);",
|
||||
1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
if (JobResScan(tempc,&r))
|
||||
if (JobResScan(tmpc,&r))
|
||||
okay=TRUE;
|
||||
}
|
||||
tempc=TaskExe(task,Fs,"Del(\"SysTemp.*\");",
|
||||
tmpc=TaskExe(task,Fs,"Del(\"SysTmp.*\");",
|
||||
1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
JobResScan(tempc,&r);
|
||||
JobResScan(tmpc,&r);
|
||||
} else {
|
||||
Free(prj_file);
|
||||
st=DirFile(doc->filename.name,"Load","HC.Z");
|
||||
@@ -483,9 +483,9 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
||||
else
|
||||
st=MStrPrint("\"$$WW,1$$\";ExeFile(\"%s\",CCF_JUST_LOAD);",
|
||||
doc->filename.name);
|
||||
tempc=TaskExe(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
tmpc=TaskExe(task,Fs,st,1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
Free(st);
|
||||
if (JobResScan(tempc,&r) && r)
|
||||
if (JobResScan(tmpc,&r) && r)
|
||||
okay=TRUE;
|
||||
}
|
||||
Free(prj_file);
|
||||
|
||||
@@ -151,9 +151,9 @@ public Bool DocEd(CDoc *doc,I64 dof_flags=0)
|
||||
|
||||
DocUnlock(doc);
|
||||
if (!(dof_flags&DOF_DONT_WINMGR_SYNC)) {
|
||||
WinMgrSync(2,TRUE);
|
||||
Refresh(2,TRUE);
|
||||
if (doc->flags&DOCF_MIN_SIZE)
|
||||
WinMgrSync(2,TRUE);
|
||||
Refresh(2,TRUE);
|
||||
}
|
||||
res=View;
|
||||
|
||||
|
||||
+17
-17
@@ -5,24 +5,24 @@ public U0 DocLoad(CDoc *doc,U8 *src2,I64 size)
|
||||
I64 i;
|
||||
U8 *src;
|
||||
Bool unlock=DocLock(doc);
|
||||
CDocBin *tempb;
|
||||
CDocBin *tmpb;
|
||||
doc->find_replace->filter_lines=0;
|
||||
if (src2) {
|
||||
DocPutS(doc,src2); //Too big $LK,"DocPrint",A="MN:DocPrint"$() is wasteful.
|
||||
src=src2+StrLen(src2)+1;
|
||||
i=size-(offset(CDocBin.end)-offset(CDocBin.start));
|
||||
while (src<=src2+i) {
|
||||
tempb=CAlloc(sizeof(CDocBin),doc->mem_task);
|
||||
MemCpy(&tempb->start,src,offset(CDocBin.end)-offset(CDocBin.start));
|
||||
tmpb=CAlloc(sizeof(CDocBin),doc->mem_task);
|
||||
MemCpy(&tmpb->start,src,offset(CDocBin.end)-offset(CDocBin.start));
|
||||
src+=offset(CDocBin.end)-offset(CDocBin.start);
|
||||
tempb->data=MAlloc(tempb->size,doc->mem_task);
|
||||
if (tempb->size) {
|
||||
MemCpy(tempb->data,src,tempb->size);
|
||||
src+=tempb->size;
|
||||
tmpb->data=MAlloc(tmpb->size,doc->mem_task);
|
||||
if (tmpb->size) {
|
||||
MemCpy(tmpb->data,src,tmpb->size);
|
||||
src+=tmpb->size;
|
||||
}
|
||||
QueIns(tempb,doc->bin_head.last);
|
||||
if (tempb->num>=doc->cur_bin_num)
|
||||
doc->cur_bin_num=tempb->num+1;
|
||||
QueIns(tmpb,doc->bin_head.last);
|
||||
if (tmpb->num>=doc->cur_bin_num)
|
||||
doc->cur_bin_num=tmpb->num+1;
|
||||
}
|
||||
}
|
||||
if (!(doc->flags & (DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS)))
|
||||
@@ -38,7 +38,7 @@ public CDoc *DocRead(U8 *name=NULL,I64 flags=0)
|
||||
U8 *src,*name2;
|
||||
I64 size=0;
|
||||
CDirContext *dirc;
|
||||
if (!name) name=blkdev.temp_filename;
|
||||
if (!name) name=blkdev.tmp_filename;
|
||||
doc->flags|=flags;
|
||||
name2=FileNameAbs(name);
|
||||
StrCpy(doc->filename.name,name2);
|
||||
@@ -104,7 +104,7 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
|
||||
}
|
||||
}
|
||||
for (b=doc->bin_head.next;b!=&doc->bin_head;b=b->next)
|
||||
if (b->use_cnt>b->temp_use_cnt)
|
||||
if (b->use_cnt>b->tmp_use_cnt)
|
||||
cnt+=offset(CDocBin.end)-offset(CDocBin.start)+b->size;
|
||||
res=MAlloc(cnt);
|
||||
dst=res;
|
||||
@@ -157,7 +157,7 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
|
||||
b=doc->bin_head.next;
|
||||
if (b!=&doc->bin_head) {
|
||||
do {
|
||||
if (b->use_cnt>b->temp_use_cnt) {
|
||||
if (b->use_cnt>b->tmp_use_cnt) {
|
||||
MemCpy(dst,&b->start,offset(CDocBin.end)-offset(CDocBin.start));
|
||||
dst+=offset(CDocBin.end)-offset(CDocBin.start);
|
||||
MemCpy(dst,b->data,b->size);
|
||||
@@ -297,7 +297,7 @@ U0 DocUndoRestore(CDoc *doc)
|
||||
DocUnlock(doc);
|
||||
}
|
||||
|
||||
#help_index "Graphics/Windows BMP Files;Graphics/GRA Files;"\
|
||||
#help_index "Graphics/Windows BMP Files;Graphics/GR Files;"\
|
||||
"DolDoc/Output;StdOut/DolDoc"
|
||||
public Bool DocType(CDoc *doc=NULL,U8 *filename,I64 trailing_new_lines=1)
|
||||
{//Output txt or graphic file to document.
|
||||
@@ -318,8 +318,8 @@ public Bool DocType(CDoc *doc=NULL,U8 *filename,I64 trailing_new_lines=1)
|
||||
} else if (FilesFindMatch(filename,"*.BMP;*.bmp")) {
|
||||
DocBMP(doc,filename,,TRUE);
|
||||
res=TRUE;
|
||||
} else if (FilesFindMatch(filename,"*.GRA*")) {
|
||||
DocGRA(doc,filename);
|
||||
} else if (FilesFindMatch(filename,"*.GR*")) {
|
||||
DocGR(doc,filename);
|
||||
res=TRUE;
|
||||
}
|
||||
if (res)
|
||||
@@ -327,7 +327,7 @@ public Bool DocType(CDoc *doc=NULL,U8 *filename,I64 trailing_new_lines=1)
|
||||
return res;
|
||||
}
|
||||
|
||||
#help_index "Graphics/Windows BMP Files;Graphics/GRA Files;"\
|
||||
#help_index "Graphics/Windows BMP Files;Graphics/GR Files;"\
|
||||
"File/Cmd Line (Typically);DolDoc/Cmd Line (Typically);"\
|
||||
"StdOut;Cmd Line (Typically)"
|
||||
public Bool Type(U8 *filename,I64 trailing_new_lines=1)
|
||||
|
||||
+17
-17
@@ -60,7 +60,7 @@ U0 DocDataFmt(CDoc *doc,CDocEntry *doc_e,I64 d=DOCM_CANCEL)
|
||||
{
|
||||
I64 i;
|
||||
U8 *ptr,*ptr2;
|
||||
CHashDefineStr *temph;
|
||||
CHashDefineStr *tmph;
|
||||
if (doc_e->type_u8==DOCT_DATA && doc_e->de_flags&DOCEF_AUX_STR ||
|
||||
doc_e->type_u8==DOCT_CHECK_BOX || doc_e->de_flags & DOCEF_LST) {
|
||||
if (d==DOCM_CANCEL) {
|
||||
@@ -109,9 +109,9 @@ U0 DocDataFmt(CDoc *doc,CDocEntry *doc_e,I64 d=DOCM_CANCEL)
|
||||
}
|
||||
doc_e->max_col=i;
|
||||
} else if (doc_e->de_flags & DOCEF_LST) {
|
||||
if (doc_e->de_flags & DOCEF_DEFINE && (temph=HashFind(doc_e->define_str,
|
||||
doc->win_task->hash_table,HTT_DEFINE_STR)) && 0<=d<temph->cnt) {
|
||||
ptr=MStrPrint("[%s]",temph->sub_idx[d]);
|
||||
if (doc_e->de_flags & DOCEF_DEFINE && (tmph=HashFind(doc_e->define_str,
|
||||
doc->win_task->hash_table,HTT_DEFINE_STR)) && 0<=d<tmph->cnt) {
|
||||
ptr=MStrPrint("[%s]",tmph->sub_idx[d]);
|
||||
Free(doc_e->tag);
|
||||
doc_e->tag=StrNew(ptr,doc->mem_task);
|
||||
Free(ptr);
|
||||
@@ -132,7 +132,7 @@ U0 DocDataScan(CDoc *doc,CDocEntry *doc_e)
|
||||
{
|
||||
I64 i,d;
|
||||
U8 *ptr,*ptr1,*ptr2;
|
||||
CHashDefineStr *temph;
|
||||
CHashDefineStr *tmph;
|
||||
if (doc_e->type_u8==DOCT_DATA && doc_e->de_flags&DOCEF_AUX_STR ||
|
||||
doc_e->type_u8==DOCT_CHECK_BOX || doc_e->de_flags & DOCEF_LST) {
|
||||
if (doc_e->de_flags&DOCEF_DEREF_DATA &&
|
||||
@@ -166,7 +166,7 @@ U0 DocDataScan(CDoc *doc,CDocEntry *doc_e)
|
||||
} else if (doc_e->de_flags & DOCEF_LST) {
|
||||
d=0;
|
||||
if (doc_e->tag && doc_e->de_flags & DOCEF_DEFINE &&
|
||||
(temph=HashFind(doc_e->define_str,
|
||||
(tmph=HashFind(doc_e->define_str,
|
||||
doc->win_task->hash_table,HTT_DEFINE_STR))) {
|
||||
ptr1=ptr2=StrNew(doc_e->tag);
|
||||
if (*ptr2=='[') {
|
||||
@@ -175,7 +175,7 @@ U0 DocDataScan(CDoc *doc,CDocEntry *doc_e)
|
||||
if (ptr2[i-1]==']')
|
||||
ptr2[i-1]=0;
|
||||
}
|
||||
d=LstMatch(ptr2,temph->data);
|
||||
d=LstMatch(ptr2,tmph->data);
|
||||
Free(ptr1);
|
||||
}
|
||||
} else {
|
||||
@@ -213,11 +213,11 @@ public Bool DocForm(U8 *_d,U8 *class_name=lastclass,
|
||||
CMemberLst *ml;
|
||||
CDocEntry *doc_e;
|
||||
U8 *fmtstr;
|
||||
CHashClass *tempc,*tempc2;
|
||||
CHashClass *tmpc,*tmpc2;
|
||||
CDoc *doc;
|
||||
Bool res=FALSE;
|
||||
I64 old_border_src=Fs->border_src,has_action;
|
||||
if (!(tempc=HashFind(class_name,Fs->hash_table,HTT_CLASS)))
|
||||
if (!(tmpc=HashFind(class_name,Fs->hash_table,HTT_CLASS)))
|
||||
return FALSE;
|
||||
doc=DocNew;
|
||||
doc->desc='Form';
|
||||
@@ -225,18 +225,18 @@ public Bool DocForm(U8 *_d,U8 *class_name=lastclass,
|
||||
doc->flags|=DOCF_OVERSTRIKE|DOCF_FORM;
|
||||
if (dof_flags&DOF_MIN_SIZE)
|
||||
doc->flags|=DOCF_MIN_SIZE;
|
||||
ml=tempc->member_lst_and_root;
|
||||
ml=tmpc->member_lst_and_root;
|
||||
while (ml) {
|
||||
if ((fmtstr=MemberMetaData("fmtstr",ml)) &&
|
||||
(doc_e=DocPrint(doc,"%s",fmtstr))) {
|
||||
tempc2=ml->member_class;
|
||||
tmpc2=ml->member_class;
|
||||
if ((doc_e->type_u8==DOCT_DATA || doc_e->type_u8==DOCT_LST ||
|
||||
doc_e->type_u8==DOCT_CHECK_BOX) && !tempc2->ptr_stars_cnt) {
|
||||
tempc2=OptClassFwd(tempc2);
|
||||
tempc2-=tempc2->ptr_stars_cnt;
|
||||
if (tempc2->type & HTT_INTERNAL_TYPE) {
|
||||
doc_e->type_u8==DOCT_CHECK_BOX) && !tmpc2->ptr_stars_cnt) {
|
||||
tmpc2=OptClassFwd(tmpc2);
|
||||
tmpc2-=tmpc2->ptr_stars_cnt;
|
||||
if (tmpc2->type & HTT_INTERNAL_TYPE) {
|
||||
if (ml->dim.next) { //Array
|
||||
if (tempc2->raw_type==RT_U8 &&
|
||||
if (tmpc2->raw_type==RT_U8 &&
|
||||
LBtr(&doc_e->de_flags,&DOCEf_DFT_LEN)) {
|
||||
doc_e->len=ml->dim.total_cnt;
|
||||
if (doc_e->de_flags&DOCEF_HAS_TERMINATOR)
|
||||
@@ -246,7 +246,7 @@ public Bool DocForm(U8 *_d,U8 *class_name=lastclass,
|
||||
doc->mem_task); //+2 because "_\0"
|
||||
}
|
||||
} else if (LBtr(&doc_e->de_flags,DOCEf_DFT_RAW_TYPE))
|
||||
doc_e->raw_type=tempc2->raw_type;
|
||||
doc_e->raw_type=tmpc2->raw_type;
|
||||
}
|
||||
}
|
||||
if (doc_e->de_flags&DOCEF_REMALLOC_DATA) {
|
||||
|
||||
+33
-33
@@ -1,33 +1,33 @@
|
||||
#help_index "DolDoc/Misc"
|
||||
|
||||
U32 *DocHighlight(CDocEntry *doc_e,U8 *src,I64 len,I64 _temp_u32_attr)
|
||||
U32 *DocHighlight(CDocEntry *doc_e,U8 *src,I64 len,I64 _tmp_u32_attr)
|
||||
{//Be aware of $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.HC"$.
|
||||
U32 *res=MAlloc((len+1)*sizeof(U32)),*dst=res;
|
||||
U8 *ptr;
|
||||
CDocSettings *s=&doc_e->settings;
|
||||
I64 ch,ch1,last_ch,temp_u32_attr,mask_temp_u32_attr=_temp_u32_attr&0xFFFFF000,
|
||||
I64 ch,ch1,last_ch,tmp_u32_attr,mask_tmp_u32_attr=_tmp_u32_attr&0xFFFFF000,
|
||||
comment_depth,brace_depth=s->brace_depth,paren_depth=s->paren_depth;
|
||||
CHash *temph;
|
||||
CHash *tmph;
|
||||
switch [s->state] {
|
||||
case DOCSS_NORMAL:
|
||||
hl_normal:
|
||||
while (len) {
|
||||
while (len && !Bt(chars_bmp_alpha_numeric,*src)) {
|
||||
temp_u32_attr=_temp_u32_attr;
|
||||
tmp_u32_attr=_tmp_u32_attr;
|
||||
ch1=*src++;
|
||||
switch (ch1) {
|
||||
case '/':
|
||||
if (len>=2) {
|
||||
if (*src=='/') {
|
||||
temp_u32_attr=DOC_COLOR_COMMENT<<8|mask_temp_u32_attr;
|
||||
*dst++=ch1+temp_u32_attr;
|
||||
*dst++=*src++ +temp_u32_attr;
|
||||
tmp_u32_attr=DOC_COLOR_COMMENT<<8|mask_tmp_u32_attr;
|
||||
*dst++=ch1+tmp_u32_attr;
|
||||
*dst++=*src++ +tmp_u32_attr;
|
||||
len-=2;
|
||||
goto hl_cpp_comment;
|
||||
} else if (*src=='*') {
|
||||
temp_u32_attr=DOC_COLOR_COMMENT<<8|mask_temp_u32_attr;
|
||||
*dst++=ch1+temp_u32_attr;
|
||||
*dst++=*src++ +temp_u32_attr;
|
||||
tmp_u32_attr=DOC_COLOR_COMMENT<<8|mask_tmp_u32_attr;
|
||||
*dst++=ch1+tmp_u32_attr;
|
||||
*dst++=*src++ +tmp_u32_attr;
|
||||
len-=2;
|
||||
comment_depth=1;
|
||||
goto hl_comment;
|
||||
@@ -35,33 +35,33 @@ hl_normal:
|
||||
}
|
||||
break;
|
||||
case '\'':
|
||||
temp_u32_attr=DOC_COLOR_QUOTE<<8|mask_temp_u32_attr;
|
||||
*dst++=ch1+temp_u32_attr;
|
||||
tmp_u32_attr=DOC_COLOR_QUOTE<<8|mask_tmp_u32_attr;
|
||||
*dst++=ch1+tmp_u32_attr;
|
||||
len--;
|
||||
goto hl_single_quote;
|
||||
case '\"':
|
||||
temp_u32_attr=DOC_COLOR_QUOTE<<8|mask_temp_u32_attr;
|
||||
*dst++=ch1+temp_u32_attr;
|
||||
tmp_u32_attr=DOC_COLOR_QUOTE<<8|mask_tmp_u32_attr;
|
||||
*dst++=ch1+tmp_u32_attr;
|
||||
len--;
|
||||
goto hl_dbl_quote;
|
||||
case '(':
|
||||
if (paren_depth++&1)
|
||||
temp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_temp_u32_attr;
|
||||
tmp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_tmp_u32_attr;
|
||||
break;
|
||||
case ')':
|
||||
if (--paren_depth&1)
|
||||
temp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_temp_u32_attr;
|
||||
tmp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_tmp_u32_attr;
|
||||
break;
|
||||
case '{':
|
||||
if (brace_depth++&1)
|
||||
temp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_temp_u32_attr;
|
||||
tmp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_tmp_u32_attr;
|
||||
break;
|
||||
case '}':
|
||||
if (--brace_depth&1)
|
||||
temp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_temp_u32_attr;
|
||||
tmp_u32_attr=DOC_COLOR_ALT_TEXT<<8|mask_tmp_u32_attr;
|
||||
break;
|
||||
}
|
||||
*dst++=ch1+temp_u32_attr;
|
||||
*dst++=ch1+tmp_u32_attr;
|
||||
if (!--len) goto hl_normal_done;
|
||||
}
|
||||
ptr=src;
|
||||
@@ -71,16 +71,16 @@ hl_normal:
|
||||
}
|
||||
ch=*src;
|
||||
*src=0;
|
||||
if (temph=HashFind(ptr,cmp.asm_hash,
|
||||
if (tmph=HashFind(ptr,cmp.asm_hash,
|
||||
HTT_KEYWORD|HTT_ASM_KEYWORD|HTT_OPCODE|HTT_REG)) {
|
||||
if (temph->type&(HTT_KEYWORD|HTT_ASM_KEYWORD|HTT_OPCODE))
|
||||
temp_u32_attr=DOC_COLOR_KEYWORD<<8|mask_temp_u32_attr;
|
||||
if (tmph->type&(HTT_KEYWORD|HTT_ASM_KEYWORD|HTT_OPCODE))
|
||||
tmp_u32_attr=DOC_COLOR_KEYWORD<<8|mask_tmp_u32_attr;
|
||||
else
|
||||
temp_u32_attr=DOC_COLOR_KEYWORD2<<8|mask_temp_u32_attr;
|
||||
tmp_u32_attr=DOC_COLOR_KEYWORD2<<8|mask_tmp_u32_attr;
|
||||
} else
|
||||
temp_u32_attr=_temp_u32_attr;
|
||||
tmp_u32_attr=_tmp_u32_attr;
|
||||
while (ch1=*ptr++)
|
||||
*dst++=ch1+temp_u32_attr;
|
||||
*dst++=ch1+tmp_u32_attr;
|
||||
*src=ch;
|
||||
}
|
||||
hl_normal_done:
|
||||
@@ -88,12 +88,12 @@ hl_normal_done:
|
||||
s->comment_depth=0;
|
||||
break;
|
||||
case DOCSS_SINGLE_QUOTE:
|
||||
temp_u32_attr=DOC_COLOR_QUOTE<<8|mask_temp_u32_attr;
|
||||
tmp_u32_attr=DOC_COLOR_QUOTE<<8|mask_tmp_u32_attr;
|
||||
hl_single_quote:
|
||||
last_ch=0;
|
||||
while (len--) {
|
||||
ch1=*src++;
|
||||
*dst++=ch1+temp_u32_attr;
|
||||
*dst++=ch1+tmp_u32_attr;
|
||||
if (last_ch!='\\' && ch1=='\'')
|
||||
goto hl_normal;
|
||||
if (last_ch=='\\' && ch1=='\\')
|
||||
@@ -105,12 +105,12 @@ hl_single_quote:
|
||||
s->comment_depth=0;
|
||||
break;
|
||||
case DOCSS_DBL_QUOTE:
|
||||
temp_u32_attr=DOC_COLOR_QUOTE<<8|mask_temp_u32_attr;
|
||||
tmp_u32_attr=DOC_COLOR_QUOTE<<8|mask_tmp_u32_attr;
|
||||
hl_dbl_quote:
|
||||
last_ch=0;
|
||||
while (len--) {
|
||||
ch1=*src++;
|
||||
*dst++=ch1+temp_u32_attr;
|
||||
*dst++=ch1+tmp_u32_attr;
|
||||
if (last_ch!='\\' && ch1=='\"')
|
||||
goto hl_normal;
|
||||
if (last_ch=='\\' && ch1=='\\')
|
||||
@@ -122,13 +122,13 @@ hl_dbl_quote:
|
||||
s->comment_depth=0;
|
||||
break;
|
||||
case DOCSS_COMMENT:
|
||||
temp_u32_attr=DOC_COLOR_COMMENT<<8|mask_temp_u32_attr;
|
||||
tmp_u32_attr=DOC_COLOR_COMMENT<<8|mask_tmp_u32_attr;
|
||||
comment_depth=s->comment_depth;
|
||||
hl_comment:
|
||||
last_ch=0;
|
||||
while (len--) {
|
||||
ch1=*src++;
|
||||
*dst++=ch1+temp_u32_attr;
|
||||
*dst++=ch1+tmp_u32_attr;
|
||||
if (last_ch=='*' && ch1=='/') {
|
||||
if (!--comment_depth)
|
||||
goto hl_normal;
|
||||
@@ -140,10 +140,10 @@ hl_comment:
|
||||
s->comment_depth=comment_depth;
|
||||
break;
|
||||
case DOCSS_CPP_Z_COMMENT:
|
||||
temp_u32_attr=DOC_COLOR_COMMENT<<8|mask_temp_u32_attr;
|
||||
tmp_u32_attr=DOC_COLOR_COMMENT<<8|mask_tmp_u32_attr;
|
||||
hl_cpp_comment:
|
||||
while (len--)
|
||||
*dst++=*src++ +temp_u32_attr;
|
||||
*dst++=*src++ +tmp_u32_attr;
|
||||
s->state=DOCSS_CPP_Z_COMMENT;
|
||||
s->comment_depth=0;
|
||||
break;
|
||||
|
||||
@@ -4,7 +4,7 @@ U0 DocInit()
|
||||
{//$LK-UL,"CMD Defines",A="MN:DOCT_TEXT"$
|
||||
CCmpCtrl *cc;
|
||||
I64 i;
|
||||
CHashGeneric *temph;
|
||||
CHashGeneric *tmph;
|
||||
|
||||
DefineLstLoad("ST_DOC_CMDS",
|
||||
"TX\0CR\0SR\0TB\0PB\0CU\0MK\0PT\0CL\0PL\0LM\0RM\0HD\0FO\0ID\0FG\0"
|
||||
@@ -12,7 +12,7 @@ U0 DocInit()
|
||||
"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"
|
||||
"LC\0LIS\0RC\0RIS\0LX\0CX\0RX\0TY\0CY\0BY\0"
|
||||
"HL\0WW\0BK\0IV\0SEL\0UL\0"
|
||||
"TC\0PRY\0MRX\0WR\0L\0X\0Q\0FST\0B\0S\0BD\0C\0CA\0RD\0UD\0P\0M\0"
|
||||
"TRM\0Z\0H\0TR\0LS\0SK\0PU\0SIF\0FS\0NC\0DD\0DL\0DRT\0");
|
||||
@@ -32,8 +32,8 @@ U0 DocInit()
|
||||
cc->htc.hash_table_lst=NULL;
|
||||
Lex(cc);
|
||||
while (cc->token==TK_IDENT) {
|
||||
if (temph=HashFind(cc->cur_str,doldoc.hash,DHT_DOC_CMD)) {
|
||||
i=temph->user_data0;
|
||||
if (tmph=HashFind(cc->cur_str,doldoc.hash,DHT_DOC_CMD)) {
|
||||
i=tmph->user_data0;
|
||||
Lex(cc);
|
||||
PrsDocFlags(cc,&doldoc.dft_de_flags[i],&doldoc.dft_type_flags[i]);
|
||||
}
|
||||
@@ -51,7 +51,7 @@ U0 DocInit()
|
||||
Bts(doldoc.type_flags_form,i);
|
||||
|
||||
//Don't forget $LK,"cmp_type_flags_src_code",A="MN:cmp_type_flags_src_code"$.
|
||||
doldoc.type_flags_nontag_invisible[0]=
|
||||
doldoc.type_flags_nontag_invis[0]=
|
||||
1<<DOCT_PMT|
|
||||
1<<DOCT_PAGE_LEN|
|
||||
1<<DOCT_LEFT_MARGIN|
|
||||
|
||||
+19
-11
@@ -95,11 +95,9 @@ Bool DocFileEd(I64 _type,U8 *filename,
|
||||
doc=Str2I64(filename);//See $LK,"SpriteEdText",A="MN:SpriteEdText"$()
|
||||
res=TRUE;
|
||||
} else {
|
||||
|
||||
st1=StrNew(filename);
|
||||
st2=StrNew(filename);
|
||||
StrLastRem(st1,"/",st2); //st2 is name without dir
|
||||
|
||||
if (!FileNameChk(st2))
|
||||
doc=NULL;
|
||||
else {
|
||||
@@ -107,8 +105,7 @@ Bool DocFileEd(I64 _type,U8 *filename,
|
||||
if (Bt(&edf_dof_flags,EDf_BAIL)) //if bail, scan parents
|
||||
res=FileFind(filename,,
|
||||
FUF_JUST_FILES|FUF_Z_OR_NOT_Z|FUF_SCAN_PARENTS);
|
||||
else if (!(res=FileFind(filename,,
|
||||
FUF_JUST_FILES)))
|
||||
else if (!(res=FileFind(filename,,FUF_JUST_FILES)))
|
||||
other_found=FileFind(filename,,
|
||||
FUF_JUST_FILES|FUF_Z_OR_NOT_Z|FUF_SCAN_PARENTS);
|
||||
doc=DocRead(filename,flags);
|
||||
@@ -116,7 +113,6 @@ Bool DocFileEd(I64 _type,U8 *filename,
|
||||
Silent(old_silent);
|
||||
Fs->border_src=BDS_ED_FILENAME_DRV;
|
||||
}
|
||||
|
||||
Free(st1);
|
||||
Free(st2);
|
||||
}
|
||||
@@ -149,7 +145,12 @@ Bool DocFileEd(I64 _type,U8 *filename,
|
||||
|
||||
if (edf_dof_flags&EDF_WAS_WRITE)
|
||||
res=FALSE;
|
||||
if (!(edf_dof_flags&EDF_BAIL) && DocEd(doc,edf_dof_flags|DOF_DONT_HOME)) {
|
||||
if (!(edf_dof_flags&EDF_BAIL)) {
|
||||
if (*doc->filename.name)
|
||||
doc->filename.dirc=DirContextNew(doc->filename.name);
|
||||
else
|
||||
doc->filename.dirc=NULL;
|
||||
if (DocEd(doc,edf_dof_flags|DOF_DONT_HOME)) {
|
||||
DocLock(doc);
|
||||
doc_e=doc->cur_entry;
|
||||
if (doc_e!=doc)
|
||||
@@ -161,6 +162,8 @@ Bool DocFileEd(I64 _type,U8 *filename,
|
||||
res=TRUE;
|
||||
}
|
||||
}
|
||||
DirContextDel(doc->filename.dirc);
|
||||
}
|
||||
if (!(LK_DOC<=_type<=LK_DOC_LINE))
|
||||
DocDel(doc);
|
||||
}
|
||||
@@ -179,11 +182,11 @@ public I64 EdLinkCvt(U8 *link_st,U8 **_filename=NULL,U8 **_needle_str=NULL,
|
||||
{//$LK,"Editor Link",A="MN:LK_FILE"$--> filename, needle_str and line number.
|
||||
U8 *st,*ptr,*src,*filename=NULL,*needle_str=NULL,*filename2;
|
||||
I64 res,i,num=1;
|
||||
CHashSrcSym *temph;
|
||||
CHashSrcSym *tmph;
|
||||
if (!link_st||!*link_st) {
|
||||
if (edf_dof_flags&EDF_BAIL)
|
||||
return -1;
|
||||
link_st=blkdev.temp_filename;
|
||||
link_st=blkdev.tmp_filename;
|
||||
}
|
||||
st=StrNew(link_st);
|
||||
res=LK_FILE;
|
||||
@@ -192,8 +195,8 @@ public I64 EdLinkCvt(U8 *link_st,U8 **_filename=NULL,U8 **_needle_str=NULL,
|
||||
filename2=st+3;
|
||||
switch (res=DefineMatch(st,"ST_LINK_TYPES",LMF_IGNORE_CASE)) {
|
||||
case LK_MAN_PAGE:
|
||||
if (temph=HashFind(filename2,Fs->hash_table,HTG_SRC_SYM))
|
||||
res=EdLinkCvt(temph->src_link,&filename,
|
||||
if (tmph=HashFind(filename2,Fs->hash_table,HTG_SRC_SYM))
|
||||
res=EdLinkCvt(tmph->src_link,&filename,
|
||||
&needle_str,&num,edf_dof_flags);
|
||||
else
|
||||
res=-1;
|
||||
@@ -292,11 +295,15 @@ lc_done:
|
||||
return res;
|
||||
}
|
||||
|
||||
public Bool DocLinkChk(U8 *link_st)
|
||||
public Bool DocLinkChk(CDoc *doc,U8 *link_st)
|
||||
{//Check for bad $LK,"Editor Link",A="MN:LK_FILE"$.
|
||||
U8 *filename,*st;
|
||||
Bool res=FALSE;
|
||||
CDirContext *dirc;
|
||||
if (link_st) {
|
||||
st=FileNameAbs(doc->filename.name);
|
||||
dirc=DirContextNew(st);
|
||||
Free(st);
|
||||
switch (EdLinkCvt(link_st,&filename)) {
|
||||
case -1:
|
||||
break;
|
||||
@@ -320,6 +327,7 @@ public Bool DocLinkChk(U8 *link_st)
|
||||
res=TRUE;
|
||||
}
|
||||
Free(filename);
|
||||
DirContextDel(dirc);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
+51
-51
@@ -7,18 +7,18 @@ I64 sys_macro_repeat_n=1;
|
||||
|
||||
U0 SysMacroStripKey(CSrvCmd *macro_head,I64 a1,I64 a2)
|
||||
{
|
||||
CSrvCmd *tempc,*tempc1;
|
||||
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 ||
|
||||
tempc->msg_code==MSG_KEY_DOWN_UP) &&
|
||||
a1 && tempc->aux1==a1 || !a1 && tempc->aux2==a2) {
|
||||
QueRem(tempc);
|
||||
SrvCmdDel(tempc);
|
||||
CSrvCmd *tmpc,*tmpc1;
|
||||
tmpc=macro_head->next;
|
||||
while (tmpc!=macro_head) {
|
||||
tmpc1=tmpc->next;
|
||||
if (tmpc->cmd_code==SVCT_MSG &&
|
||||
(tmpc->msg_code==MSG_KEY_DOWN || tmpc->msg_code==MSG_KEY_UP ||
|
||||
tmpc->msg_code==MSG_KEY_DOWN_UP) &&
|
||||
a1 && tmpc->aux1==a1 || !a1 && tmpc->aux2==a2) {
|
||||
QueRem(tmpc);
|
||||
SrvCmdDel(tmpc);
|
||||
}
|
||||
tempc=tempc1;
|
||||
tmpc=tmpc1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,77 +26,77 @@ U0 SysMacroStripKey(CSrvCmd *macro_head,I64 a1,I64 a2)
|
||||
#define MT_MSG 1
|
||||
#define MT_CHAR 2
|
||||
|
||||
class CMacroTemp
|
||||
class CMacroTmp
|
||||
{
|
||||
CMacroTemp *next,*last;
|
||||
CMacroTmp *next,*last;
|
||||
I64 type;
|
||||
U8 buf[STR_LEN];
|
||||
};
|
||||
|
||||
CMacroTemp *Cmd2MT(CSrvCmd *tempc)
|
||||
CMacroTmp *Cmd2MT(CSrvCmd *tmpc)
|
||||
{
|
||||
U8 buf[8];
|
||||
CMacroTemp *tempmt=CAlloc(sizeof(CMacroTemp));
|
||||
if (Bt(chars_bmp_macro,tempc->aux1) && tempc->msg_code==MSG_KEY_DOWN) {
|
||||
tempmt->type=MT_CHAR;
|
||||
buf[0]=tempc->aux1;
|
||||
CMacroTmp *tmpmt=CAlloc(sizeof(CMacroTmp));
|
||||
if (Bt(chars_bmp_macro,tmpc->aux1) && tmpc->msg_code==MSG_KEY_DOWN) {
|
||||
tmpmt->type=MT_CHAR;
|
||||
buf[0]=tmpc->aux1;
|
||||
buf[1]=0;
|
||||
StrPrint(tempmt->buf,"%Q",buf);
|
||||
StrPrint(tmpmt->buf,"%Q",buf);
|
||||
} else {
|
||||
tempmt->type=MT_MSG;
|
||||
StrPrint(tempmt->buf,"Msg(0x%X,0x%X,0x%X);",
|
||||
tempc->msg_code,tempc->aux1,tempc->aux2);
|
||||
tmpmt->type=MT_MSG;
|
||||
StrPrint(tmpmt->buf,"Msg(0x%X,0x%X,0x%X);",
|
||||
tmpc->msg_code,tmpc->aux1,tmpc->aux2);
|
||||
}
|
||||
return tempmt;
|
||||
return tmpmt;
|
||||
}
|
||||
|
||||
U8 *SysMacro2Str(CSrvCmd *macro_head)
|
||||
{
|
||||
CSrvCmd *tempc;
|
||||
CSrvCmd *tmpc;
|
||||
I64 cnt=1; //terminating zero
|
||||
U8 *ptr,*m;
|
||||
CMacroTemp *tempmt,*tempmt1,head;
|
||||
CMacroTmp *tmpmt,*tmpmt1,head;
|
||||
LBtr(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
|
||||
|
||||
QueInit(&head);
|
||||
head.type=MT_NULL;
|
||||
tempc=macro_head->next;
|
||||
while (tempc!=macro_head) {
|
||||
tempmt=Cmd2MT(tempc);
|
||||
QueIns(tempmt,head.last);
|
||||
cnt+=StrLen(tempmt->buf);
|
||||
if (tempmt->type==MT_CHAR) {
|
||||
if (tempmt->last->type!=MT_CHAR)
|
||||
tmpc=macro_head->next;
|
||||
while (tmpc!=macro_head) {
|
||||
tmpmt=Cmd2MT(tmpc);
|
||||
QueIns(tmpmt,head.last);
|
||||
cnt+=StrLen(tmpmt->buf);
|
||||
if (tmpmt->type==MT_CHAR) {
|
||||
if (tmpmt->last->type!=MT_CHAR)
|
||||
cnt+=StrLen("\"");
|
||||
if (tempmt->next->type!=MT_CHAR)
|
||||
if (tmpmt->next->type!=MT_CHAR)
|
||||
cnt+=StrLen("\";");
|
||||
}
|
||||
tempc=tempc->next;
|
||||
tmpc=tmpc->next;
|
||||
}
|
||||
|
||||
m=MAlloc(cnt);
|
||||
ptr=m;
|
||||
|
||||
tempmt=head.next;
|
||||
while (tempmt!=&head) {
|
||||
tempmt1=tempmt->next;
|
||||
if (tempmt->type==MT_MSG) {
|
||||
StrCpy(ptr, tempmt->buf);
|
||||
ptr+=StrLen(tempmt->buf);
|
||||
tmpmt=head.next;
|
||||
while (tmpmt!=&head) {
|
||||
tmpmt1=tmpmt->next;
|
||||
if (tmpmt->type==MT_MSG) {
|
||||
StrCpy(ptr, tmpmt->buf);
|
||||
ptr+=StrLen(tmpmt->buf);
|
||||
} else {
|
||||
if (tempmt->last->type!=MT_CHAR) {
|
||||
if (tmpmt->last->type!=MT_CHAR) {
|
||||
StrCpy(ptr, "\"");
|
||||
ptr+=StrLen("\"");
|
||||
}
|
||||
StrCpy(ptr,tempmt->buf);
|
||||
ptr+=StrLen(tempmt->buf);
|
||||
if (tempmt->next->type!=MT_CHAR) {
|
||||
StrCpy(ptr,tmpmt->buf);
|
||||
ptr+=StrLen(tmpmt->buf);
|
||||
if (tmpmt->next->type!=MT_CHAR) {
|
||||
StrCpy(ptr, "\";");
|
||||
ptr+=StrLen("\";");
|
||||
}
|
||||
}
|
||||
Free(tempmt);
|
||||
tempmt=tempmt1;
|
||||
Free(tmpmt);
|
||||
tmpmt=tmpmt1;
|
||||
}
|
||||
*ptr=0;
|
||||
return m;
|
||||
@@ -111,7 +111,7 @@ U0 PlaySysMacro(I64 n=1)
|
||||
m=SysMacro2Str(&sys_macro_head);
|
||||
while (n-- && TaskValidate(task)) {
|
||||
if (task==Fs)
|
||||
AutoStr("%s",m);
|
||||
InStr("%s",m);
|
||||
else
|
||||
XTalkStrWait(task,"%s",m);
|
||||
}
|
||||
@@ -123,7 +123,7 @@ U0 EdInsCapturedMacro()
|
||||
{
|
||||
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+LIS,T=\"%s\",LM=\"%$$Q\"$$",
|
||||
captured_macro_name,st);
|
||||
Free(st);
|
||||
}
|
||||
@@ -139,7 +139,7 @@ I64 PopUpMacroMenu()
|
||||
{
|
||||
I64 res=0;
|
||||
U8 buf[STR_LEN];
|
||||
CSrvCmd *tempc;
|
||||
CSrvCmd *tmpc;
|
||||
CDoc *doc=DocNew;
|
||||
CDocEntry *doc_e=DocPrint(doc,"$$DA-P,LEN=STR_LEN-1,A=\"Name:%%s\"$$");
|
||||
doc_e->data=captured_macro_name;
|
||||
@@ -162,9 +162,9 @@ I64 PopUpMacroMenu()
|
||||
sys_macro_task=Spawn(&SrvCmdLine,NULL,"Macro Popup",,Fs);
|
||||
Fs->popup_task=sys_macro_task;
|
||||
LBts(&sys_macro_task->display_flags,DISPLAYf_WIN_ON_TOP);
|
||||
tempc=TaskExe(sys_macro_task,Fs,buf,
|
||||
tmpc=TaskExe(sys_macro_task,Fs,buf,
|
||||
1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||
JobResScan(tempc,&res);
|
||||
JobResScan(tmpc,&res);
|
||||
Fs->popup_task=NULL;
|
||||
Kill(sys_macro_task);
|
||||
sys_macro_task=NULL;
|
||||
|
||||
@@ -136,7 +136,7 @@ U0 DocUndoCntSet(CDoc *doc)
|
||||
public CDocEntry *DocEntryCopy(CDoc *doc,CDocEntry *doc_e)
|
||||
{//Make copy of entry and all parts of entry.
|
||||
CDocEntry *doc_ne;
|
||||
CDocBin *tempb;
|
||||
CDocBin *tmpb;
|
||||
CTask *task=doc->mem_task;
|
||||
doc_ne=MAllocIdent(doc_e,task);
|
||||
doc_ne->next=doc_ne;
|
||||
@@ -156,16 +156,16 @@ public CDocEntry *DocEntryCopy(CDoc *doc,CDocEntry *doc_e)
|
||||
if (doc_e->de_flags & DOCEF_BIN_PTR_LINK)
|
||||
doc_ne->bin_ptr_link=MAllocIdent(doc_e->bin_ptr_link,task);
|
||||
if (doc_e->de_flags & DOCEF_HAS_BIN) {
|
||||
tempb=MAllocIdent(doc_e->bin_data,task);
|
||||
tempb->data=MAllocIdent(doc_e->bin_data->data,task);
|
||||
tmpb=MAllocIdent(doc_e->bin_data,task);
|
||||
tmpb->data=MAllocIdent(doc_e->bin_data->data,task);
|
||||
doc_ne->bin_num=doc->cur_bin_num;
|
||||
tempb->num=doc->cur_bin_num++;
|
||||
doc_ne->bin_data=tempb;
|
||||
tmpb->num=doc->cur_bin_num++;
|
||||
doc_ne->bin_data=tmpb;
|
||||
if (doc_e->de_flags&DOCEF_TAG && doc_e->tag && *doc_e->tag)
|
||||
tempb->tag=StrNew(doc_e->tag,task);
|
||||
tmpb->tag=StrNew(doc_e->tag,task);
|
||||
else
|
||||
tempb->tag=NULL;
|
||||
QueIns(tempb,doc->bin_head.last);
|
||||
tmpb->tag=NULL;
|
||||
QueIns(tmpb,doc->bin_head.last);
|
||||
}
|
||||
if (doc_e->de_flags & DOCEF_REMALLOC_DATA)
|
||||
doc_ne->data=MAllocIdent(doc_e->data,task);
|
||||
@@ -368,7 +368,7 @@ public CDoc *DocNew(U8 *filename=NULL,CTask *task=NULL)
|
||||
if (filename)
|
||||
StrCpy(doc->filename.name,filename);
|
||||
else
|
||||
StrCpy(doc->filename.name,blkdev.temp_filename);
|
||||
StrCpy(doc->filename.name,blkdev.tmp_filename);
|
||||
doc->find_replace=CAlloc(sizeof(CEdFindText),task);
|
||||
doc->find_replace->scan_fwd=TRUE;
|
||||
doc->find_replace->match_case=TRUE;
|
||||
|
||||
+12
-12
@@ -88,21 +88,21 @@ I64 DocOptFile(U8 *filename,I64 fuf_flags)
|
||||
DocDel(doc);
|
||||
return res;
|
||||
}
|
||||
I64 DocOptLst(CDirEntry *tempde,I64 fuf_flags)
|
||||
I64 DocOptLst(CDirEntry *tmpde,I64 fuf_flags)
|
||||
{
|
||||
I64 res=0;
|
||||
CDirEntry *tempde1;
|
||||
while (tempde) {
|
||||
tempde1=tempde->next;
|
||||
if (tempde->attr & RS_ATTR_DIR) {
|
||||
if (tempde->sub) {
|
||||
"Scanning Directory: %s\n",tempde->full_name;
|
||||
res+=DocOptLst(tempde->sub,fuf_flags);
|
||||
CDirEntry *tmpde1;
|
||||
while (tmpde) {
|
||||
tmpde1=tmpde->next;
|
||||
if (tmpde->attr & RS_ATTR_DIR) {
|
||||
if (tmpde->sub) {
|
||||
"Scanning Directory: %s\n",tmpde->full_name;
|
||||
res+=DocOptLst(tmpde->sub,fuf_flags);
|
||||
}
|
||||
} else
|
||||
res+=DocOptFile(tempde->full_name,fuf_flags);
|
||||
DirEntryDel(tempde);
|
||||
tempde=tempde1;
|
||||
res+=DocOptFile(tmpde->full_name,fuf_flags);
|
||||
DirEntryDel(tmpde);
|
||||
tmpde=tmpde1;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -110,7 +110,7 @@ public I64 DocOpt(U8 *files_find_mask="*",U8 *fu_flags=NULL)
|
||||
{//Optimize $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ Files, eliminating aux_str's and .Z's.
|
||||
//+R flag for aggressively risky.
|
||||
I64 fuf_flags=0;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+T");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+$$");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
return DocOptLst(FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND),
|
||||
fuf_flags&~FUG_FILES_FIND);
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
I64 PrsDocFlagSingle(CCmpCtrl *cc,I64 *_de_flags,U32 *_type,Bool turn_on)
|
||||
{
|
||||
I64 res=-1;
|
||||
CHashGeneric *temph;
|
||||
CHashGeneric *tmph;
|
||||
if (cc->token==TK_IDENT &&
|
||||
(temph=HashFind(cc->cur_str,doldoc.hash,DHT_DOC_FLAG))) {
|
||||
res=temph->user_data0;
|
||||
(tmph=HashFind(cc->cur_str,doldoc.hash,DHT_DOC_FLAG))) {
|
||||
res=tmph->user_data0;
|
||||
if (res<64) {
|
||||
BEqu(_de_flags,res,turn_on);
|
||||
switch (res) {
|
||||
@@ -219,18 +219,18 @@ CDocEntry *PrsDollarCmd(CDoc *doc,U8 *st)
|
||||
I64 i,j,de_flags,processed_flags,attr=DOC_DFT;
|
||||
U8 *ptr,*st2;
|
||||
CDocEntry *doc_e=NULL;
|
||||
CHashGeneric *temph;
|
||||
CHashGeneric *tmph;
|
||||
CCmpCtrl *cc=CmpCtrlNew(st,CCF_DONT_FREE_BUF);
|
||||
CHashTable *old_hash_table_lst=cc->htc.hash_table_lst;
|
||||
try {
|
||||
cc->htc.hash_table_lst=NULL;
|
||||
if (Lex(cc)==TK_IDENT) {
|
||||
if (temph=HashFind(cc->cur_str,doldoc.hash,DHT_DOC_CMD|DHT_COLOR)) {
|
||||
if (temph->type&DHT_DOC_CMD)
|
||||
i=temph->user_data0;
|
||||
if (tmph=HashFind(cc->cur_str,doldoc.hash,DHT_DOC_CMD|DHT_COLOR)) {
|
||||
if (tmph->type&DHT_DOC_CMD)
|
||||
i=tmph->user_data0;
|
||||
else {//DHT_COLOR
|
||||
i=DOCT_FOREGROUND;
|
||||
attr=temph->user_data0;
|
||||
attr=tmph->user_data0;
|
||||
}
|
||||
} else
|
||||
goto pd_err;
|
||||
|
||||
@@ -296,7 +296,7 @@ public I64 PopUpFile(U8 *filename,Bool warn_ext=TRUE,
|
||||
okay=FALSE;
|
||||
if (okay) {
|
||||
st=MStrPrint(
|
||||
"\"$$$$WW+H,1$$$$\";Auto(\"ExeFile2(\\\"%s\\\",CCF_CMD_LINE);\\n\");"
|
||||
"\"$$$$WW+H,1$$$$\";In(\"ExeFile2(\\\"%s\\\",CCF_CMD_LINE);\\n\");"
|
||||
"UserTaskCont;",
|
||||
name2);
|
||||
res=PopUp(st,parent,_pu_task);
|
||||
|
||||
@@ -364,8 +364,11 @@ public U0 DocPutKey(CDoc *doc,I64 ch=0,I64 sc=0)
|
||||
if (!(sc&SCF_SHIFT)) {
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Edit/Save As");
|
||||
else
|
||||
DocWrite(doc,TRUE);
|
||||
else if (DocWrite(doc,TRUE)&&(st=FileNameAbs(doc->filename.name))) {
|
||||
DirContextDel(doc->filename.dirc);
|
||||
doc->filename.dirc=DirContextNew(st);
|
||||
Free(st);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CH_CTRLB:
|
||||
|
||||
+72
-72
@@ -201,67 +201,67 @@ CDocEntry *DocWordWrapAdd(CDoc *doc,CDocEntry *doc_e,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
I64 DocTempAttr(CDoc *doc,CDocEntry *doc_e,I64 cur_u8_attr)
|
||||
I64 DocTmpAttr(CDoc *doc,CDocEntry *doc_e,I64 cur_u8_attr)
|
||||
{
|
||||
I64 temp_u32_attr;
|
||||
I64 tmp_u32_attr;
|
||||
doc_e->de_flags=doc->flags& (DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT) |
|
||||
doc_e->de_flags&~(DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT);
|
||||
temp_u32_attr=(cur_u8_attr&0xF0)<<8|
|
||||
tmp_u32_attr=(cur_u8_attr&0xF0)<<8|
|
||||
doc->flags&DOCG_BL_IV_UL|(doc_e->settings.shifted_x&0x1F)<<16|
|
||||
(doc_e->settings.shifted_y&0x1F)<<21;
|
||||
if (doc_e->de_flags & DOCEF_HAS_BIN && *doc_e->tag=='<')
|
||||
temp_u32_attr.u8[1]|=DOC_COLOR_BIN;
|
||||
tmp_u32_attr.u8[1]|=DOC_COLOR_BIN;
|
||||
else
|
||||
switch (doc_e->type_u8) {
|
||||
case DOCT_SPRITE:
|
||||
if (doc_e->de_flags & DOCEF_LEFT_EXP)
|
||||
temp_u32_attr.u8[1]|=cur_u8_attr&15;
|
||||
tmp_u32_attr.u8[1]|=cur_u8_attr&15;
|
||||
else if (doc_e->de_flags & DOCEF_LINK)
|
||||
temp_u32_attr.u8[1]|=DOC_COLOR_LINK;
|
||||
tmp_u32_attr.u8[1]|=DOC_COLOR_LINK;
|
||||
else if (doc_e->de_flags & DOCEF_LEFT_MACRO)
|
||||
temp_u32_attr.u8[1]|=DOC_COLOR_MACRO;
|
||||
tmp_u32_attr.u8[1]|=DOC_COLOR_MACRO;
|
||||
else if (doc_e->de_flags & (DOCEF_TREE|DOCEF_LST))
|
||||
temp_u32_attr.u8[1]|=DOC_COLOR_TREE;
|
||||
tmp_u32_attr.u8[1]|=DOC_COLOR_TREE;
|
||||
else
|
||||
temp_u32_attr.u8[1]|=DOC_COLOR_BIN;
|
||||
tmp_u32_attr.u8[1]|=DOC_COLOR_BIN;
|
||||
break;
|
||||
case DOCT_HTML_CODE:
|
||||
temp_u32_attr.u8[1]|=DOC_COLOR_BIN;
|
||||
tmp_u32_attr.u8[1]|=DOC_COLOR_BIN;
|
||||
break;
|
||||
case DOCT_LINK:
|
||||
temp_u32_attr.u8[1]|=DOC_COLOR_LINK;
|
||||
tmp_u32_attr.u8[1]|=DOC_COLOR_LINK;
|
||||
break;
|
||||
case DOCT_MACRO:
|
||||
temp_u32_attr.u8[1]|=DOC_COLOR_MACRO;
|
||||
tmp_u32_attr.u8[1]|=DOC_COLOR_MACRO;
|
||||
break;
|
||||
case DOCT_ANCHOR:
|
||||
temp_u32_attr.u8[1]|=DOC_COLOR_ANCHOR;
|
||||
tmp_u32_attr.u8[1]|=DOC_COLOR_ANCHOR;
|
||||
break;
|
||||
case DOCT_TREE:
|
||||
case DOCT_LST:
|
||||
temp_u32_attr.u8[1]|=DOC_COLOR_TREE;
|
||||
tmp_u32_attr.u8[1]|=DOC_COLOR_TREE;
|
||||
break;
|
||||
default:
|
||||
temp_u32_attr.u8[1]|=cur_u8_attr&15;
|
||||
tmp_u32_attr.u8[1]|=cur_u8_attr&15;
|
||||
}
|
||||
doc_e->type.u8[1]=temp_u32_attr.u8[1];
|
||||
temp_u32_attr|=doc_e->type&0xFFFF0000;
|
||||
doc_e->type.u8[1]=tmp_u32_attr.u8[1];
|
||||
tmp_u32_attr|=doc_e->type&0xFFFF0000;
|
||||
if (doc_e==doc->cur_entry && !(doc->flags&DOCF_DONT_HIGHLIGHT_CURSOR) &&
|
||||
doc_e->type_u8!=DOCT_TEXT)
|
||||
temp_u32_attr^=0xFF00;
|
||||
doc_e->settings.final_u32_attr=temp_u32_attr;
|
||||
return temp_u32_attr;
|
||||
tmp_u32_attr^=0xFF00;
|
||||
doc_e->settings.final_u32_attr=tmp_u32_attr;
|
||||
return tmp_u32_attr;
|
||||
}
|
||||
|
||||
public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
{//Recalc and fmt. Also used by WinMgr to draw on screen.
|
||||
{//Recalc and fmt. Also used by WinMgr to draw on scrn.
|
||||
I64 i,ii,j,k,x,x0,y,y0,D,d2,col,col2,best_col=0,best_d=MAX_I64,xx,yy,zz,
|
||||
num_entries=0,i_jif,cur_u8_attr,temp_u32_attr,
|
||||
num_entries=0,i_jif,cur_u8_attr,tmp_u32_attr,
|
||||
cursor_y=MIN_I64,left_margin,right_margin,y_plot_top,y_plot_bottom,
|
||||
top,left,bottom,right,width,height,scroll_x,scroll_y,pix_top,pix_left;
|
||||
CDocEntry reg *doc_e,reg *doc_e2,*best_doc_e,*next_clear_found=NULL,
|
||||
*added_cursor=NULL;
|
||||
CDocBin *tempb;
|
||||
CDocBin *tmpb;
|
||||
CDocSettings *s;
|
||||
Bool del_doc_e,skipped_update,tree_collapsed,same_win,more=FALSE,
|
||||
find_cursor=FALSE,blink_flag,full_refresh=TRUE,unlock,clear_holds;
|
||||
@@ -272,12 +272,12 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
I32 *depth_buf=NULL;
|
||||
F64 cur_time=tS;
|
||||
CWinScroll *vss,*hss;
|
||||
CHashDefineStr *temph;
|
||||
CHashDefineStr *tmph;
|
||||
|
||||
if (!doc || doc->doc_signature!=DOC_SIGNATURE_VAL) return FALSE;
|
||||
|
||||
//WinMgr updates all wins $TX,"30",D="WINMGR_FPS"$, 33.33333mS
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && doc->owning_task!=Fs) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN && doc->owning_task!=Fs) {
|
||||
i_jif=cnts.jiffies+JIFFY_FREQ/250; //4 ms
|
||||
while (Bt(&doc->locked_flags,DOClf_LOCKED)) {
|
||||
if (cnts.jiffies>=i_jif)
|
||||
@@ -302,7 +302,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
if (win_task)
|
||||
dc=DCAlias(gr.dc2,win_task); //Necessary for sprites
|
||||
break;
|
||||
case RECALCt_TO_SCREEN:
|
||||
case RECALCt_TO_SCRN:
|
||||
if (doc->updates_cnt++%(ToI64(winmgr.fps/10)+1) &&
|
||||
!Bt(&doc->flags,DOCf_DO_FULL_REFRESH) &&
|
||||
!(doc->flags&DOCF_BWD_MOVEMENT))
|
||||
@@ -352,7 +352,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
doc->top_line_num=0;
|
||||
doc->line_start_col=0;
|
||||
recalc_flags&=~RECALCF_HAS_CURSOR;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN)
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN)
|
||||
doc->settings_head.cur_text_attr=
|
||||
doc->settings_head.dft_text_attr=win_task->border_attr;
|
||||
} else {
|
||||
@@ -373,7 +373,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
find_cursor=TRUE;
|
||||
}
|
||||
}
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN)
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN)
|
||||
doc->settings_head.cur_text_attr=
|
||||
doc->settings_head.dft_text_attr=win_task->text_attr;
|
||||
}
|
||||
@@ -385,7 +385,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
right ==doc->old_win_right &&
|
||||
doc->cur_entry==doc->old_cur_entry &&
|
||||
doc->cur_col==doc->old_cur_col;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN) {
|
||||
y_plot_top=y0-scroll_y/FONT_HEIGHT;
|
||||
y_plot_bottom=y0+height-1-scroll_y/FONT_HEIGHT;
|
||||
if (!(doc->flags&DOCF_BORDER_DOC) &&
|
||||
@@ -406,7 +406,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
cur_u8_attr=s->cur_text_attr;
|
||||
if (doc_e==doc->head.next) {
|
||||
doc->flags&=~DOCF_BWD_MOVEMENT;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN && full_refresh)
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN && full_refresh)
|
||||
doc->flags&=~DOCF_HAS_SONG;
|
||||
} else
|
||||
doc->flags=doc_e->de_flags& DOCEF_HIGHLIGHT |
|
||||
@@ -443,9 +443,9 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
else
|
||||
doc_e->tag=StrNew("",mem_task);
|
||||
} else {
|
||||
if (temph=HashFind(doc_e->define_str,
|
||||
if (tmph=HashFind(doc_e->define_str,
|
||||
win_task->hash_table,HTT_DEFINE_STR))
|
||||
doc_e->tag=StrNew(temph->data,mem_task);
|
||||
doc_e->tag=StrNew(tmph->data,mem_task);
|
||||
else
|
||||
doc_e->tag=CAlloc(1,mem_task);
|
||||
}
|
||||
@@ -483,7 +483,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
}
|
||||
col2=0;
|
||||
|
||||
temp_u32_attr=DocTempAttr(doc,doc_e,cur_u8_attr);
|
||||
tmp_u32_attr=DocTmpAttr(doc,doc_e,cur_u8_attr);
|
||||
if (doc_e==doc->cur_entry) {
|
||||
cursor_y=doc_e->y;
|
||||
if (recalc_flags&RECALCF_ADD_CURSOR && !added_cursor) {
|
||||
@@ -547,20 +547,20 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
j=StrLen(doc_e->tag);
|
||||
if (j && doc_e->scroll_len) {
|
||||
i_jif=ToI64(cur_time*FONT_WIDTH*DOC_SCROLL_SPEED)%(j*FONT_WIDTH);
|
||||
temp_u32_attr=temp_u32_attr & 0xFFE0FF00|
|
||||
tmp_u32_attr=tmp_u32_attr & 0xFFE0FF00|
|
||||
(FONT_WIDTH-1-i_jif&(FONT_WIDTH-1))<<16;
|
||||
#assert FONT_WIDTH==8
|
||||
i_jif>>=3;
|
||||
for (k=0;k<doc_e->scroll_len;k++) {
|
||||
ch=ptr[(i_jif+k)%j];
|
||||
if (!Bt(chars_bmp_displayable,ch)) ch='.';
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER))
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,temp_u32_attr+ch);
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,tmp_u32_attr+ch);
|
||||
else
|
||||
TextChar(win_task,FALSE,x-x0,y-y0,temp_u32_attr+ch);
|
||||
TextChar(win_task,FALSE,x-x0,y-y0,tmp_u32_attr+ch);
|
||||
}
|
||||
x++;
|
||||
}
|
||||
@@ -574,9 +574,9 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) {
|
||||
while (ch=*ptr++) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW))
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,temp_u32_attr+ch);
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,tmp_u32_attr+ch);
|
||||
else
|
||||
if (find_cursor) {
|
||||
d2=DocCharDist(doc,x,y);
|
||||
@@ -590,10 +590,10 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
}
|
||||
} else {
|
||||
if (doc_e->type_u8==DOCT_TEXT && doc_e->de_flags&DOCEF_HIGHLIGHT)
|
||||
hl=DocHighlight(doc_e,ptr,k,temp_u32_attr);
|
||||
hl=DocHighlight(doc_e,ptr,k,tmp_u32_attr);
|
||||
else
|
||||
hl=NULL;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||
//Technically we should do this for scrolling_x, too.
|
||||
if (y>y_plot_bottom)
|
||||
@@ -602,7 +602,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
if (hl)
|
||||
TextLenAttrStr(win_task,x-x0,y-y0,k,hl);
|
||||
else
|
||||
TextLenStr(win_task,x-x0,y-y0,k,temp_u32_attr,ptr);
|
||||
TextLenStr(win_task,x-x0,y-y0,k,tmp_u32_attr,ptr);
|
||||
}
|
||||
col2+=k;
|
||||
x+=k;
|
||||
@@ -647,13 +647,13 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
StrPrint(buf,"%08tX ",bptr);
|
||||
ptr=buf;
|
||||
while (ch=*ptr++) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER))
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,temp_u32_attr+ch);
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,tmp_u32_attr+ch);
|
||||
else
|
||||
TextChar(win_task,FALSE,x-x0,y-y0,temp_u32_attr+ch);
|
||||
TextChar(win_task,FALSE,x-x0,y-y0,tmp_u32_attr+ch);
|
||||
}
|
||||
if (find_cursor) {
|
||||
d2=DocCharDist(doc,x,y);
|
||||
@@ -669,13 +669,13 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
StrPrint(buf,"%02tX",*bptr++);
|
||||
ptr=buf;
|
||||
while (ch=*ptr++) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER))
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,temp_u32_attr+ch);
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,tmp_u32_attr+ch);
|
||||
else
|
||||
TextChar(win_task,FALSE,x-x0,y-y0,temp_u32_attr+ch);
|
||||
TextChar(win_task,FALSE,x-x0,y-y0,tmp_u32_attr+ch);
|
||||
}
|
||||
if (find_cursor) {
|
||||
d2=DocCharDist(doc,x,y);
|
||||
@@ -694,13 +694,13 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
for (j=0;j<k;j++) {
|
||||
ch=*bptr++;
|
||||
if (!Bt(chars_bmp_displayable,ch)) ch='.';
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER))
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,temp_u32_attr+ch);
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,tmp_u32_attr+ch);
|
||||
else
|
||||
TextChar(win_task,FALSE,x-x0,y-y0,temp_u32_attr+ch);
|
||||
TextChar(win_task,FALSE,x-x0,y-y0,tmp_u32_attr+ch);
|
||||
}
|
||||
if (find_cursor) {
|
||||
d2=DocCharDist(doc,x,y);
|
||||
@@ -718,7 +718,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
||||
break;
|
||||
case DOCT_NEW_LINE:
|
||||
case DOCT_SOFT_NEW_LINE:
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)&&
|
||||
y_plot_top<=y<=y_plot_bottom)
|
||||
TextLenAttr(win_task,x-x0,y-y0,width-(x-x0),cur_u8_attr<<8);
|
||||
@@ -779,9 +779,9 @@ rc_adjust_xy:
|
||||
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 &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW))
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,temp_u32_attr+CH_SPACE);
|
||||
TextChar(win_task,TRUE,x-x0,y-y0,tmp_u32_attr+CH_SPACE);
|
||||
if (find_cursor) {
|
||||
d2=DocCharDist(doc,x,y);
|
||||
if (d2<D)
|
||||
@@ -791,10 +791,10 @@ rc_adjust_xy:
|
||||
}
|
||||
} else {
|
||||
k-=x;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
!(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," ");
|
||||
TextLenStr(win_task,x-x0,y-y0,k,tmp_u32_attr," ");
|
||||
x+=k;
|
||||
} else {
|
||||
if (find_cursor) {
|
||||
@@ -956,16 +956,16 @@ 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);
|
||||
if ((tempb=doc_e->bin_data) &&
|
||||
!tempb->tag && doc_e->tag && *doc_e->tag)
|
||||
tempb->tag=StrNew(doc_e->tag,mem_task);
|
||||
if (tempb && dc) {
|
||||
if ((tmpb=doc_e->bin_data) &&
|
||||
!tmpb->tag && doc_e->tag && *doc_e->tag)
|
||||
tmpb->tag=StrNew(doc_e->tag,mem_task);
|
||||
if (tmpb && dc) {
|
||||
DCRst(dc);
|
||||
dc->flags&=~(DCF_DONT_DRAW|DCF_LOCATE_NEAREST);
|
||||
if (recalc_flags&RECALCG_MASK!=RECALCt_TO_SCREEN ||
|
||||
if (recalc_flags&RECALCG_MASK!=RECALCt_TO_SCRN ||
|
||||
doc_e->de_flags&DOCEF_DONT_DRAW)
|
||||
dc->flags|=DCF_DONT_DRAW;
|
||||
bptr=tempb->data;
|
||||
bptr=tmpb->data;
|
||||
ii=SpriteTypeMask(bptr);
|
||||
if (ii&1<<SPT_NUM_TYPES) {
|
||||
bptr=gr.empty_sprite;
|
||||
@@ -974,19 +974,19 @@ rc_adjust_xy:
|
||||
if (ii&(1<<SPT_FLOOD_FILL|1<<SPT_FLOOD_FILL_NOT))
|
||||
i=cur_u8_attr>>4 &0xF ^ win_task->text_attr>>4 & 0xF;
|
||||
else {
|
||||
i=temp_u32_attr>>12&0xF ^ win_task->text_attr>>4 & 0xF;
|
||||
if (temp_u32_attr & DOCET_SEL)
|
||||
i=tmp_u32_attr>>12&0xF ^ win_task->text_attr>>4 & 0xF;
|
||||
if (tmp_u32_attr & DOCET_SEL)
|
||||
i^=0xF;
|
||||
if (temp_u32_attr & DOCET_INVERT)
|
||||
if (tmp_u32_attr & DOCET_INVERT)
|
||||
i^=0xF;
|
||||
if (blink_flag &&
|
||||
(doc_e==doc->cur_entry || temp_u32_attr&DOCET_BLINK))
|
||||
(doc_e==doc->cur_entry || tmp_u32_attr&DOCET_BLINK))
|
||||
i^=0xF;
|
||||
}
|
||||
dc->color=i;
|
||||
if (find_cursor)
|
||||
dc->flags|=DCF_LOCATE_NEAREST;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
doc->cur_sprite==bptr) {
|
||||
dc->flags|=DCF_LOCATE_NEAREST;
|
||||
dc->cur_x=ip.pos.x;
|
||||
@@ -1024,7 +1024,7 @@ rc_adjust_xy:
|
||||
}
|
||||
Sprite3(dc,xx,yy,zz,bptr);
|
||||
dc->depth_buf=NULL;
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
doc->cur_sprite==bptr)
|
||||
doc->nearest_sprite_elem_num=dc->nearest_sprite_elem_num;
|
||||
dc->flags&=~(DCF_LOCATE_NEAREST|DCF_DONT_DRAW|DCF_TRANSFORMATION);
|
||||
@@ -1036,7 +1036,7 @@ rc_adjust_xy:
|
||||
break;
|
||||
case DOCT_SONG:
|
||||
if (sys_focus_task==win_task &&
|
||||
recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||
if (doc_e->aux_str &&
|
||||
(!music.cur_song || StrCmp(music.cur_song,doc_e->aux_str))) {
|
||||
@@ -1059,7 +1059,7 @@ rc_adjust_xy:
|
||||
|
||||
if (doc_e->de_flags & DOCEF_HAS_BORDER)
|
||||
TextBorder(win_task,doc_e->x-x0,x-x0-1,doc_e->y-y0,y-y0,
|
||||
temp_u32_attr.u8[1],ToBool(doc_e->de_flags & DOCEF_SOLID_BORDER));
|
||||
tmp_u32_attr.u8[1],ToBool(doc_e->de_flags & DOCEF_SOLID_BORDER));
|
||||
if (full_refresh) {
|
||||
switch (doc_e->type_u8) {
|
||||
case DOCT_CHECK_BOX:
|
||||
@@ -1245,7 +1245,7 @@ rc_skip:
|
||||
doc->col=doc->x+1;
|
||||
|
||||
if (recalc_flags&RECALCF_HAS_CURSOR) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN) {
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN) {
|
||||
x=0;
|
||||
y=0;
|
||||
} else {
|
||||
@@ -1273,7 +1273,7 @@ rc_skip:
|
||||
doc->line_start_col=doc->x+x;
|
||||
}
|
||||
}
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN &&
|
||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN &&
|
||||
recalc_flags&RECALCF_HAS_CURSOR) {
|
||||
x=doc->x-doc->line_start_col+left +scroll_x/FONT_WIDTH;
|
||||
y=doc->y-doc->top_line_num+top+scroll_y/FONT_HEIGHT;
|
||||
|
||||
+10
-10
@@ -45,18 +45,18 @@ U0 DocBorderLstDraw(CDoc *doc)
|
||||
CTask *win_task=doc->win_task;
|
||||
I64 i,y=-1,attr=win_task->border_attr<<8;
|
||||
U64 ch;
|
||||
CDoc *templ=doc;
|
||||
CDoc *tmpl=doc;
|
||||
CD3I64 saved_scroll;
|
||||
while (templ && templ->doc_signature==DOC_SIGNATURE_VAL) {
|
||||
y+=(Bsr(templ->desc)+7)>>3+1; //StrLen+1
|
||||
templ=templ->parent_doc;
|
||||
while (tmpl && tmpl->doc_signature==DOC_SIGNATURE_VAL) {
|
||||
y+=(Bsr(tmpl->desc)+7)>>3+1; //StrLen+1
|
||||
tmpl=tmpl->parent_doc;
|
||||
}
|
||||
templ=doc;
|
||||
tmpl=doc;
|
||||
if (y>win_task->win_height)
|
||||
y=win_task->win_height;
|
||||
WinScrollNull(win_task,&saved_scroll);
|
||||
while (templ && templ->doc_signature==DOC_SIGNATURE_VAL) {
|
||||
ch=templ->desc;
|
||||
while (tmpl && tmpl->doc_signature==DOC_SIGNATURE_VAL) {
|
||||
ch=tmpl->desc;
|
||||
i=(Bsr(ch)+7)>>3; //StrLen
|
||||
ch=EndianI64(ch<<((8-i)<<3));
|
||||
attr=win_task->border_attr<<8;
|
||||
@@ -65,7 +65,7 @@ U0 DocBorderLstDraw(CDoc *doc)
|
||||
ch>>=8;
|
||||
}
|
||||
y--;
|
||||
templ=templ->parent_doc;
|
||||
tmpl=tmpl->parent_doc;
|
||||
}
|
||||
WinScrollRestore(win_task,&saved_scroll);
|
||||
}
|
||||
@@ -203,11 +203,11 @@ U0 DocUpdateTaskDocs(CTask *task)
|
||||
task->border_attr=DrvTextAttrGet(*doc->filename.name);
|
||||
if (task->title_src==TTS_ED_FILENAME)
|
||||
MemCpy(task->task_title,doc->filename.name,STR_LEN-1);
|
||||
DocRecalc(doc,RECALCt_TO_SCREEN|RECALCF_HAS_CURSOR);
|
||||
DocRecalc(doc,RECALCt_TO_SCRN|RECALCF_HAS_CURSOR);
|
||||
}
|
||||
if ((doc=DocBorder(task)) && !(doc->flags&DOCF_DONT_SHOW)) {
|
||||
WinScrollNull(task,&saved_scroll);
|
||||
DocRecalc(doc,RECALCt_TO_SCREEN);
|
||||
DocRecalc(doc,RECALCt_TO_SCRN);
|
||||
WinScrollRestore(task,&saved_scroll);
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ public I64 DocEntryRun(CDoc *doc,CDocEntry *doc_e,
|
||||
//Sometimes returns locked, sometimes unlocked
|
||||
U8 ch=doc->cmd_U8,*st;
|
||||
I64 res=DOCM_CANCEL,has_action=FALSE;
|
||||
CHashDefineStr *temph;
|
||||
CHashDefineStr *tmph;
|
||||
DocLock(doc);
|
||||
if (!exited) {
|
||||
if (doc_e->de_flags & DOCEF_ESC) {
|
||||
@@ -46,18 +46,18 @@ public I64 DocEntryRun(CDoc *doc,CDocEntry *doc_e,
|
||||
PopUp(st,Fs);
|
||||
Free(st);
|
||||
} else {
|
||||
if (doc_e->de_flags & DOCEF_LEFT_AUTO)
|
||||
AutoStr("%s",doc_e->left_macro);
|
||||
if (doc_e->de_flags & DOCEF_LEFT_IN_STR)
|
||||
InStr("%s",doc_e->left_macro);
|
||||
else
|
||||
Auto("%s",doc_e->left_macro);
|
||||
In("%s",doc_e->left_macro);
|
||||
}
|
||||
has_action=TRUE;
|
||||
}
|
||||
if (!exited && doc_e->de_flags & DOCEF_LST &&
|
||||
doc_e->de_flags & DOCEF_DEFINE &&
|
||||
(temph=HashFind(doc_e->define_str,
|
||||
(tmph=HashFind(doc_e->define_str,
|
||||
doc->win_task->hash_table,HTT_DEFINE_STR)) &&
|
||||
(res=PopUpPickLst(temph->data))!=DOCM_CANCEL) {
|
||||
(res=PopUpPickLst(tmph->data))!=DOCM_CANCEL) {
|
||||
DocDataFmt(doc,doc_e,res);
|
||||
DocDataScan(doc,doc_e);
|
||||
has_action=TRUE;
|
||||
@@ -85,10 +85,10 @@ public I64 DocEntryRun(CDoc *doc,CDocEntry *doc_e,
|
||||
PopUp(st,Fs);
|
||||
Free(st);
|
||||
} else {
|
||||
if (doc_e->de_flags & DOCEF_RIGHT_AUTO)
|
||||
AutoStr("%s",doc_e->right_macro);
|
||||
if (doc_e->de_flags & DOCEF_RIGHT_IN_STR)
|
||||
InStr("%s",doc_e->right_macro);
|
||||
else
|
||||
Auto("%s",doc_e->right_macro);
|
||||
In("%s",doc_e->right_macro);
|
||||
}
|
||||
has_action=TRUE;
|
||||
}
|
||||
|
||||
+22
-16
@@ -61,7 +61,7 @@ public U0 DocTermNew()
|
||||
#define RIGHT_ED 6
|
||||
#define RIGHT_MOUNT 7
|
||||
#define RIGHT_PLAIN 8
|
||||
#define RIGHT_AUTOFILE 9
|
||||
#define RIGHT_INFILE 9
|
||||
|
||||
I64 PopUpTermRight(U8 *header)
|
||||
{
|
||||
@@ -69,19 +69,19 @@ I64 PopUpTermRight(U8 *header)
|
||||
CDoc *doc=DocNew;
|
||||
if (header) DocPrint(doc,"%s",header);
|
||||
DocPrint(doc,"\n\n"
|
||||
"TXT=%s\nJIT=%s\nGRA=%s"
|
||||
"TXT=%s\nDD =%s\nJIT=%s\nGR =%s"
|
||||
"$$CM+LX,1,3 $$$$BT,\"INCLUDE JIT\",LE=RIGHT_INCLUDE$$"
|
||||
"$$CM+LX,26,0$$$$BT,\"ADAM_INCLUDE JIT\",LE=RIGHT_AINCLUDE$$"
|
||||
"$$CM+LX,25,0$$$$BT,\"ADAM_INCLUDE JIT\",LE=RIGHT_AINCLUDE$$"
|
||||
"$$CM+LX,1,3 $$$$BT,\"COPY \",LE=RIGHT_COPY$$"
|
||||
"$$CM+LX,26,0$$$$BT,\"MOVE OR RENAME \",LE=RIGHT_MOVE$$"
|
||||
"$$CM+LX,25,0$$$$BT,\"MOVE OR RENAME \",LE=RIGHT_MOVE$$"
|
||||
"$$CM+LX,1,3 $$$$BT,\"DELETE \",LE=RIGHT_DELETE$$"
|
||||
"$$CM+LX,26,0$$$$BT,\"TYPE TXT;GRA\",LE=RIGHT_TYPE$$"
|
||||
"$$CM+LX,1,3 $$$$BT,\"ED TXT\",LE=RIGHT_ED$$"
|
||||
"$$CM+LX,26,0$$$$BT,\"MOUNT ISO.C\",LE=RIGHT_MOUNT$$"
|
||||
"$$CM+LX,1,3 $$$$BT,\"PLAIN ED TXT\",LE=RIGHT_PLAIN$$"
|
||||
"$$CM+LX,26,0$$$$BT,\"AUTOFILE AUT\",LE=RIGHT_AUTOFILE$$\n"
|
||||
"$$CM+LX,1,3 $$$$BT,\"CANCEL \",LE=DOCM_CANCEL$$",
|
||||
FILEMASK_TXT,FILEMASK_JIT,FILEMASK_GRA);
|
||||
"$$CM+LX,25,0$$$$BT,\"TYPE TXT;GR\",LE=RIGHT_TYPE$$"
|
||||
"$$CM+LX,1,3 $$$$BT,\"DOLDOC EDIT DD\",LE=RIGHT_ED$$"
|
||||
"$$CM+LX,25,0$$$$BT,\"MOUNT ISO.C\",LE=RIGHT_MOUNT$$"
|
||||
"$$CM+LX,1,3 $$$$BT,\"PLAIN TEXT EDIT TXT\",LE=RIGHT_PLAIN$$"
|
||||
"$$CM+LX,25,0$$$$BT,\"INFILE IN\",LE=RIGHT_INFILE$$"
|
||||
"$$CM+LX,1,3 $$$$BT,\"CANCEL \",LE=DOCM_CANCEL$$\n",
|
||||
FILEMASK_TXT,FILEMASK_DD,FILEMASK_JIT,FILEMASK_GR);
|
||||
i=PopUpMenu(doc);
|
||||
DocDel(doc);
|
||||
return i;
|
||||
@@ -159,6 +159,12 @@ I64 TermRightClickLink(CDoc *doc,CDocEntry *doc_e)
|
||||
res=Type(st);
|
||||
break;
|
||||
case RIGHT_ED:
|
||||
if (FileExtDot(st) && !FilesFindMatch(st,FILEMASK_DD)) {
|
||||
if (!PopUpCancelOk(ST_WARN_ST "Not DolDoc File\n\n")) {
|
||||
send_new_line=TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
"Ed(\"%s\");\n$$PT$$$$FG$$$$BG$$",st;
|
||||
res=Ed(st);
|
||||
break;
|
||||
@@ -178,16 +184,16 @@ I64 TermRightClickLink(CDoc *doc,CDocEntry *doc_e)
|
||||
"Plain(\"%s\");\n$$PT$$$$FG$$$$BG$$",st;
|
||||
res=Plain(st);
|
||||
break;
|
||||
case RIGHT_AUTOFILE:
|
||||
if (FileExtDot(st) && !FilesFindMatch(st,"*.AUT*")) {
|
||||
if (!PopUpCancelOk(ST_WARN_ST "Not .AUT File\n\n")) {
|
||||
case RIGHT_INFILE:
|
||||
if (FileExtDot(st) && !FilesFindMatch(st,"*.IN*")) {
|
||||
if (!PopUpCancelOk(ST_WARN_ST "Not .IN File\n\n")) {
|
||||
send_new_line=TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
"AutoFile(\"%s\");\n$$PT$$$$FG$$$$BG$$",st;
|
||||
"InFile(\"%s\");\n$$PT$$$$FG$$$$BG$$",st;
|
||||
WinZBufUpdate;
|
||||
AutoFile(st);
|
||||
InFile(st);
|
||||
res=TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -597,7 +597,7 @@ class CEdMacroMenu
|
||||
left_macro[512] fmtstr "$$DA-P,A=\"Left Click Macro :%s\"$$\n",
|
||||
left_exp[512] fmtstr "$$DA-P,A=\"Left Click Expression :%s\"$$\n";
|
||||
Bool popup fmtstr "$$CB,\"PopUp\"$$\n",
|
||||
left_is_auto fmtstr "$$CB,\"Left is AutoStr\"$$\n",
|
||||
left_is_in_str fmtstr "$$CB,\"Left is InStr\"$$\n",
|
||||
left_x fmtstr "$$CB,\"Left X \"$$\n",
|
||||
center_x fmtstr "$$CB,\"Center X \"$$\n",
|
||||
right_x fmtstr "$$CB,\"Right X \"$$\n",
|
||||
@@ -628,7 +628,7 @@ U0 EdInsMacroMenu(Bool is_macro)
|
||||
if (e->invert) CatPrint(buf,"+IV");
|
||||
if (!e->underline) CatPrint(buf,"-UL");
|
||||
if (!e->escape) CatPrint(buf,"-X");
|
||||
if (e->left_is_auto) CatPrint(buf,"+LA");
|
||||
if (e->left_is_in_str) CatPrint(buf,"+LIS");
|
||||
if (*e->tag || is_macro) {
|
||||
if (is_macro) {
|
||||
if (*e->tag) {
|
||||
@@ -671,7 +671,7 @@ class CEdButton
|
||||
margin_rel fmtstr "$$CB,\"Margin Rel X\"$$\n",
|
||||
escape fmtstr "$$CB,\"Escape\"$$\n";
|
||||
U8 left_macro[512] fmtstr "$$DA-P,A=\"Left Click Macro:%s\"$$\n";
|
||||
Bool left_is_auto fmtstr "$$CB,\"Left is AutoStr\"$$\n";
|
||||
Bool left_is_in_str fmtstr "$$CB,\"Left is InStr\"$$\n";
|
||||
U8 left_exp[512] fmtstr "$$DA-P,A=\"Left Click Expression:%s\"$$\n";
|
||||
Bool quote fmtstr "$$CB,\"Quote\"$$\n";
|
||||
};
|
||||
@@ -689,7 +689,7 @@ U0 EdInsButton()
|
||||
if (e->right_x ) CatPrint(buf,"+RX");
|
||||
if (e->margin_rel) CatPrint(buf,"+MRX");
|
||||
if (!e->escape) CatPrint(buf,"-X");
|
||||
if (e->left_is_auto) CatPrint(buf,"+LA");
|
||||
if (e->left_is_in_str) CatPrint(buf,"+LIS");
|
||||
if (*e->tag) {
|
||||
if (e->quote) {
|
||||
st=MStrPrint("%q",e->tag);
|
||||
@@ -1079,7 +1079,7 @@ class CEdMacroSprite
|
||||
exp[512] fmtstr "$$DA-P,A=\"Macro :%s\"$$\n";
|
||||
Bool escape fmtstr "$$CB,\"Escape\"$$\n",
|
||||
popup fmtstr "$$CB,\"PopUp\"$$\n",
|
||||
is_auto fmtstr "$$CB,\"AutoStr\"$$\n";
|
||||
is_in_str fmtstr "$$CB,\"InStr\"$$\n";
|
||||
};
|
||||
|
||||
class CEdMenuSprite
|
||||
@@ -1088,7 +1088,7 @@ class CEdMenuSprite
|
||||
exp[512] fmtstr "$$DA-P,A=\"Expression :%s\"$$\n";
|
||||
Bool escape fmtstr "$$CB,\"Escape\"$$\n",
|
||||
popup,
|
||||
is_auto;
|
||||
is_in_str;
|
||||
};
|
||||
|
||||
U8 *EdSpriteLink(Bool *_pop_up,U8 **_html_link)
|
||||
@@ -1119,7 +1119,7 @@ U8 *EdSprite(I64 bin_num)
|
||||
e->escape=TRUE;
|
||||
if (DocForm(e,,,,ctrl_L_footer)) {
|
||||
CatPrint(buf,"+UL");
|
||||
if (e->is_auto) CatPrint(buf,"+LA");
|
||||
if (e->is_in_str) CatPrint(buf,"+LIS");
|
||||
if (e->popup) CatPrint(buf,"+PU");
|
||||
if (e->escape) CatPrint(buf,"+X");
|
||||
st=MStrPrint("%q",e->exp);
|
||||
|
||||
@@ -5,10 +5,10 @@ Cd(__DIR__);;
|
||||
|
||||
/*
|
||||
TempleOS DolDoc's can have "cursor movement" cmds which can move the cursor up
|
||||
the screen and layer on existing text. It can also have callback funs which
|
||||
the scrn and layer on existing text. It can also have callback funs which
|
||||
supply live, changing text. For these reasons, you can't assume you know
|
||||
where the visible portion of the document is and must process much
|
||||
of the document each time it is placed on the screen, becoming CPU
|
||||
where the vis portion of the document is and must process much
|
||||
of the document each time it is placed on the scrn, becoming CPU
|
||||
intensive on big documents.
|
||||
See $LK,"::/Doc/DolDocOverview.DD"$
|
||||
*/
|
||||
@@ -22,7 +22,7 @@ public class CDolDocGlbls
|
||||
{
|
||||
CHashTable *hash;
|
||||
I64 dft_de_flags [DOCT_NUM_TYPES],
|
||||
type_flags_nontag_invisible [(DOCT_NUM_TYPES+63)/64],
|
||||
type_flags_nontag_invis [(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],
|
||||
|
||||
+146
-146
@@ -1,4 +1,4 @@
|
||||
$PURPLE$$TX+CX,"The Purpose of Life"$$FG$
|
||||
$FG,5$$TX+CX,"The Purpose of Life"$$FG$
|
||||
|
||||
$WW,1$The Catholic purpose of life is to know God, love God and obey God.$FG$ Pope Francis said it was "to serve the other." I am High Priest of God's official temple and I say the purpose of life is to do continual offerings to God like Cain and Abel and enjoy God's response. Francis has a charity; I have a church. Jesus said loving God was more important than loving neighbor. $LK,"Matthew,22:35-40",A="BF:Matthew,22:35-40"$ And, He did not say with half your brain behind your back.
|
||||
|
||||
@@ -12,7 +12,7 @@ Do a text search for "new song" in the Bible. It's mentioned nine times. When
|
||||
|
||||
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."
|
||||
|
||||
The technique I use to consult the Holy Spirit is reading a microsecond-range stop-watch each button press for random numbers. Then, I pick words or passages. You can use the $MA-X+PU,"AfterEgypt",HTML="http://www.youtube.com/watch?v=P0MsDl39UL0",LM="#include \"::/Apps/AfterEgypt/Run\""$ in God's official temple, $RED$$TX,"TempleOS",HTML="http://www.templeos.org"$$FG$.
|
||||
The technique I use to consult the Holy Spirit is reading a microsecond-range stop-watch each button press for random numbers. Then, I pick words or passages. You can use the $MA-X+PU,"AfterEgypt",HTML="http://www.youtube.com/watch?v=P0MsDl39UL0",LM="#include \"::/Apps/AfterEgypt/Run\""$ in God's official temple, $FG,4$$TX,"TempleOS",HTML="http://www.templeos.org"$$FG$.
|
||||
|
||||
Since seeking the word of the Holy Spirit, I have come to know God much better than I've heard others explain. For example, God said to me in an oracle that war was, "servicemen competing." That sounds more like the immutable God of our planet than what you hear from most religious people. God is not Venus (god of love) and not Mars (god of war), He's our dearly beloved God of Earth. If Mammon is a false god of money, Mars or Venus might be useful words to describe other false gods. I figure the greatest challenge for the Creator is boredom, ours and His. What would teen-age male video games be like if war had never happened? Christ said live by the sword, die by the sword, which is loving neighbor as self. $LK,"Matthew,26:52",A="BF:Matthew,26:52"$
|
||||
|
||||
@@ -52,167 +52,167 @@ ________________________________________________________________________________
|
||||
QUESTION | GOD'S ANSWER
|
||||
________________________________|_______________________________________________
|
||||
|
||||
War? $RED$"Servicemen competing"$FG$
|
||||
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? $RED$Are you calling me lazy?$FG$
|
||||
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.)
|
||||
|
||||
On using Markov chains? $RED$"No weights"$FG$
|
||||
On doing offerings? $RED$"Honest measures"(You get out what you put in.)
|
||||
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"$.
|
||||
"Barter"(God also called offerings bartering.)$FG$
|
||||
The holocaust? $RED$Wanted to "compact" the Jews.$FG$
|
||||
Arab/Jews? $RED$"Oil funny hopefully"$FG$
|
||||
Peace? $RED$One Palestinian can ruin it.$FG$
|
||||
Best religion? $RED$One with most new vistas of understanding in$FG$
|
||||
$RED$a lifetime -- one you can level-up the most in.$FG$
|
||||
Chavez blaming the US. $RED$"Japan industrious"$FG$
|
||||
On racism? $RED$"Sports"$FG$
|
||||
On socialism? $RED$"pardon_the_French, never_happy, never_enough"$FG$
|
||||
$RED$"Gall aspect anti-Christ"$FG$
|
||||
On overpopulation $RED$"Okay church what_now whats_the_plan"$FG$
|
||||
Favorite thing on TV? $RED$"Soap_operas"$FG$
|
||||
Favorite movie? $RED$$TX,"Three Kings",HTML="http://www.youtube.com/watch?v=8NOAd2mldQ8"$. Also Highlander$FG$
|
||||
Favorite song? $RED$$TX,"Morning has Broken",HTML="http://www.youtube.com/watch?v=kKoRp05L95c"$
|
||||
The holocaust? $FG,4$Wanted to "compact" the Jews.$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$
|
||||
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$
|
||||
$FG,4$"Gall aspect anti-Christ"$FG$
|
||||
On overpopulation $FG,4$"Okay church what_now whats_the_plan"$FG$
|
||||
Favorite thing on TV? $FG,4$"Soap_operas"$FG$
|
||||
Favorite movie? $FG,4$$TX,"Three Kings",HTML="http://www.youtube.com/watch?v=8NOAd2mldQ8"$. Also Highlander$FG$
|
||||
Favorite song? $FG,4$$TX,"Morning has Broken",HTML="http://www.youtube.com/watch?v=kKoRp05L95c"$
|
||||
God said the first bird croaked, not sung.$FG$
|
||||
Favorite comic strip? $RED$$TX,"Prince Valiant",HTML="http://en.wikipedia.org/wiki/Prince_Valiant"$$FG$
|
||||
Shakespeare? $RED$had a "vile heart"$FG$
|
||||
Likes $RED$Beverly Hillbillies (Oil is a gift from God)$FG$
|
||||
$RED$God likes being hero. Don't be proud of heart$FG$
|
||||
$RED$and not accept a gift from God!$FG$
|
||||
Likes $RED$Gomer Pyle$FG$
|
||||
Favorite saint? $RED$"ho_ho_ho"$FG$
|
||||
Favorite animal? $RED$"Elephant two"$FG$
|
||||
Favorite animal? $RED$"Bears"$FG$
|
||||
Favorite color? $RED$"Jude" (Jade Blue?)$FG$
|
||||
Favorite color? $RED$"Gold"$FG$
|
||||
Favorite color? $RED$$TX,"\"Iceberg\" blue",HTML="https://upload.wikimedia.org/wikipedia/commons/3/38/Blue_ice_in_South_Greenland_-_Visit_Greenland.jpg"$$FG$
|
||||
Money? $RED$"Enough vehemently better"$FG$
|
||||
$RED$"Pride [or] money, choose_one"$FG$
|
||||
Favorite car? $RED$Beamer$FG$
|
||||
Favorite soda? $RED$Root beer, $TX,"scotch variety",HTML="http://www.head-beer.org/modules.php?name=Brands&rbop=Brand&bid=1965"$.$FG$
|
||||
Favorite comic strip? $FG,4$$TX,"Prince Valiant",HTML="http://en.wikipedia.org/wiki/Prince_Valiant"$$FG$
|
||||
Shakespeare? $FG,4$had a "vile heart"$FG$
|
||||
Likes $FG,4$Beverly Hillbillies (Oil is a gift from God)$FG$
|
||||
$FG,4$God likes being hero. Don't be proud of heart$FG$
|
||||
$FG,4$and not accept a gift from God!$FG$
|
||||
Likes $FG,4$Gomer Pyle$FG$
|
||||
Favorite saint? $FG,4$"ho_ho_ho"$FG$
|
||||
Favorite animal? $FG,4$"Elephant two"$FG$
|
||||
Favorite animal? $FG,4$"Bears"$FG$
|
||||
Favorite color? $FG,4$"Jude" (Jade Blue?)$FG$
|
||||
Favorite color? $FG,4$"Gold"$FG$
|
||||
Favorite color? $FG,4$$TX,"\"Iceberg\" blue",HTML="https://upload.wikimedia.org/wikipedia/commons/3/38/Blue_ice_in_South_Greenland_-_Visit_Greenland.jpg"$$FG$
|
||||
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.head-beer.org/modules.php?name=Brands&rbop=Brand&bid=1965"$.$FG$
|
||||
Homosexuality? $LK,"Matthew,15:11",A="BF:Matthew,15:11"$
|
||||
Pets? $RED$"homo" Hates fact too dependent and tame.$FG$
|
||||
Sports? $RED$"homo"
|
||||
Pets? $FG,4$"homo" Hates fact too dependent and tame.$FG$
|
||||
Sports? $FG,4$"homo"
|
||||
"Tackle a horse"$FG$
|
||||
Favorite sport? $RED$Hockey$FG$
|
||||
$TX,"Wreck of the Edmund Fitzgerald",HTML="http://www.youtube.com/watch?v=9vST6hVRj2A"$ $RED$"homo"$FG$
|
||||
Smelling farts $RED$"Sodom"$FG$
|
||||
Women's dress $RED$Upper skin exposure not as bad as lower.$FG$
|
||||
Remarriage? $RED$"More babies"$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$
|
||||
Women's dress $FG,4$Upper skin exposure not as bad as lower.$FG$
|
||||
Remarriage? $FG,4$"More babies"$FG$
|
||||
Things you don't care about
|
||||
that people think you do? $RED$Solomon's 300 concubines$FG$
|
||||
Adultery? $RED$Can be good.$FG$
|
||||
Pretty ladies? $RED$$TX,"A prince is not flustered.",HTML="http://www.youtube.com/watch?v=YcqF6sC-ztY"$$FG$
|
||||
Animal sacrifices? $RED$Early Jews were "primitive".$FG$
|
||||
What do elephants think about? $RED$"Skin, hunger"$FG$
|
||||
What makes elephants happy? $RED$"Baths"$FG$
|
||||
Elephants $RED$"Mini-skirts" (Skin webbing from back leg.)$FG$
|
||||
What makes my birds happy? $RED$"Gnawing"$FG$
|
||||
What makes my birds laugh? $RED$"Bite ouch" (If I say "ouch".)$FG$
|
||||
What are my birds saying? $RED$"Chanting"$FG$
|
||||
that people think you do? $FG,4$Solomon's 300 concubines$FG$
|
||||
Adultery? $FG,4$Can be good.$FG$
|
||||
Pretty ladies? $FG,4$$TX,"A prince is not flustered.",HTML="http://www.youtube.com/watch?v=YcqF6sC-ztY"$$FG$
|
||||
Animal sacrifices? $FG,4$Early Jews were "primitive".$FG$
|
||||
What do elephants think about? $FG,4$"Skin, hunger"$FG$
|
||||
What makes elephants happy? $FG,4$"Baths"$FG$
|
||||
Elephants $FG,4$"Mini-skirts" (Skin webbing from back leg.)$FG$
|
||||
What makes my birds happy? $FG,4$"Gnawing"$FG$
|
||||
What makes my birds laugh? $FG,4$"Bite ouch" (If I say "ouch".)$FG$
|
||||
What are my birds saying? $FG,4$"Chanting"$FG$
|
||||
My birds sure preen a lot. $LK,"The creature was made subject to vanity...",A="BF:Romans,8:20"$
|
||||
What makes bears happy? $RED$"Reaping depends"$FG$
|
||||
What makes otters happy? $RED$"Eternal skies"$FG$
|
||||
What makes hippos happy? $RED$"Ascending breath"$FG$
|
||||
What makes horses happy? $RED$"[the] Call [of the] Open Range"$FG$
|
||||
What do cheetahs think about? $RED$"Seeth me?" (Can he see me?)$FG$
|
||||
Orangutan or chimp smarter? $RED$"Species exhibit similar glory"$FG$
|
||||
Endangered species? $RED$"Enough stars?"$FG$
|
||||
Everything seems bad. $RED$Plant trees.$FG$
|
||||
What's for dinner? $RED$"Whale"$FG$
|
||||
Favorite Messier Object? $RED$"$TX,"M104 Sombrero Galaxy",HTML="http://en.wikipedia.org/wiki/Messier_104"$"$FG$
|
||||
$TX,"Shepard's Prayer",HTML="http://en.wikipedia.org/wiki/Alan_Shepard"$? $RED$"I_am_not_amused economy joke"$FG$
|
||||
Favorite band? $RED$"Beatles"$FG$
|
||||
Good bands? $RED$Rush, Triumph$FG$
|
||||
$RED$Likes harmonies$FG$
|
||||
$TX,"Little Drummer Boy?",HTML="http://www.youtube.com/watch?v=S50cf3xIb50"$ $RED$Doesn't like my drumming.$FG$
|
||||
Should I listen to classical? $RED$"Poison"$FG$
|
||||
Do You like chess people? $RED$"Do not admire the proud."$FG$
|
||||
Chess? $RED$"... will winter with you."$FG$
|
||||
$RED$"Headstones"$FG$
|
||||
If You could teach one class? $RED$Health$FG$
|
||||
Favorite video game? $RED$Donkey Kong$FG$
|
||||
Favorite National Park? $RED$$TX,"Whitman Mission",HTML="http://www.nps.gov/whmi/index.htm"$$FG$
|
||||
Favorite actor? $RED$Hugh Grant$FG$
|
||||
Favorite vocalist? $RED$Mick Jagger$FG$
|
||||
Favorite guitarist? $RED$"$TX,"Simmons Destroyer",HTML="http://www.youtube.com/watch?v=nNADrrjTysk&t=3m55s"$"$FG$
|
||||
Favorite National Anthem? $RED$$TX,"Latvia's National Anthem",HTML="http://www.youtube.com/watch?v=PFx-56KkweM"$$FG$
|
||||
America the Beautiful? $RED$Hates it. Poet made self cry with own beauty.$FG$
|
||||
Model for new $TX,"Sistine Chapel",HTML="http://en.wikipedia.org/wiki/Sistine_chapel"$? $RED$Ben Franklin$FG$
|
||||
Voice if God wanted to sing? $RED$$TX,"Stabbing Westward's singer",HTML="https://www.youtube.com/watch?v=5NZsCYOM4j0"$$FG$
|
||||
Stonehenge? $RED$Landmark for boundaries.$FG$
|
||||
Easter Island? $RED$Ice, telephone pole holes.$FG$
|
||||
Dinosaurs? $RED$Brontosaurs' feet hurt when stepped.
|
||||
What makes bears happy? $FG,4$"Reaping depends"$FG$
|
||||
What makes otters happy? $FG,4$"Eternal skies"$FG$
|
||||
What makes hippos happy? $FG,4$"Ascending breath"$FG$
|
||||
What makes horses happy? $FG,4$"[the] Call [of the] Open Range"$FG$
|
||||
What do cheetahs think about? $FG,4$"Seeth me?" (Can he see me?)$FG$
|
||||
Orangutan or chimp smarter? $FG,4$"Species exhibit similar glory"$FG$
|
||||
Endangered species? $FG,4$"Enough stars?"$FG$
|
||||
Everything seems bad. $FG,4$Plant trees.$FG$
|
||||
What's for dinner? $FG,4$"Whale"$FG$
|
||||
Favorite Messier Object? $FG,4$"$TX,"M104 Sombrero Galaxy",HTML="http://en.wikipedia.org/wiki/Messier_104"$"$FG$
|
||||
$TX,"Shepard's Prayer",HTML="http://en.wikipedia.org/wiki/Alan_Shepard"$? $FG,4$"I_am_not_amused economy joke"$FG$
|
||||
Favorite band? $FG,4$"Beatles"$FG$
|
||||
Good bands? $FG,4$Rush, Triumph$FG$
|
||||
$FG,4$Likes harmonies$FG$
|
||||
$TX,"Little Drummer Boy?",HTML="http://www.youtube.com/watch?v=S50cf3xIb50"$ $FG,4$Doesn't like my drumming.$FG$
|
||||
Should I listen to classical? $FG,4$"Poison"$FG$
|
||||
Do You like chess people? $FG,4$"Do not admire the proud."$FG$
|
||||
Chess? $FG,4$"... will winter with you."$FG$
|
||||
$FG,4$"Headstones"$FG$
|
||||
If You could teach one class? $FG,4$Health$FG$
|
||||
Favorite video game? $FG,4$Donkey Kong$FG$
|
||||
Favorite National Park? $FG,4$$TX,"Whitman Mission",HTML="http://www.nps.gov/whmi/index.htm"$$FG$
|
||||
Favorite actor? $FG,4$Hugh Grant$FG$
|
||||
Favorite vocalist? $FG,4$Mick Jagger$FG$
|
||||
Favorite guitarist? $FG,4$"$TX,"Simmons Destroyer",HTML="http://www.youtube.com/watch?v=nNADrrjTysk&t=3m55s"$"$FG$
|
||||
Favorite National Anthem? $FG,4$$TX,"Latvia's National Anthem",HTML="http://www.youtube.com/watch?v=PFx-56KkweM"$$FG$
|
||||
America the Beautiful? $FG,4$Hates it. Poet made self cry with own beauty.$FG$
|
||||
Model for new $TX,"Sistine Chapel",HTML="http://en.wikipedia.org/wiki/Sistine_chapel"$? $FG,4$Ben Franklin$FG$
|
||||
Voice if God wanted to sing? $FG,4$$TX,"Stabbing Westward's singer",HTML="https://www.youtube.com/watch?v=5NZsCYOM4j0"$$FG$
|
||||
Stonehenge? $FG,4$Landmark for boundaries.$FG$
|
||||
Easter Island? $FG,4$Ice, telephone pole holes.$FG$
|
||||
Dinosaurs? $FG,4$Brontosaurs' feet hurt when stepped.
|
||||
Dinosaurs slept in water.$FG$
|
||||
Hardest part in evolution? $RED$Getting monkey mothers to hold babies nursing.$FG$
|
||||
$RED$(Smothering a problem).$FG$
|
||||
Happiest day in evolution? $RED$"Fruit"$FG$
|
||||
Significant thing in evolution? $RED$"Fish shoulders"$FG$
|
||||
Biggest thing to fly (pterodactyl)? $RED$"Couch"$FG$
|
||||
What made pterodactyls happy? $RED$"Members against organs"$FG$
|
||||
What did Neanderthals think about? $RED$"Warmth"$FG$
|
||||
What was the first thing cooked? $RED$I think He said "hair".$FG$
|
||||
What was Lucy's husband's name? $RED$"Golem"$FG$
|
||||
Was stegosuarus lame like turtles? $RED$"Not pet rocks"$FG$
|
||||
T-Rex? $RED$Lugged carcases over his shoulder.
|
||||
Hardest part in evolution? $FG,4$Getting monkey mothers to hold babies nursing.$FG$
|
||||
$FG,4$(Smothering a problem).$FG$
|
||||
Happiest day in evolution? $FG,4$"Fruit"$FG$
|
||||
Significant thing in evolution? $FG,4$"Fish shoulders"$FG$
|
||||
Biggest thing to fly (pterodactyl)? $FG,4$"Couch"$FG$
|
||||
What made pterodactyls happy? $FG,4$"Members against organs"$FG$
|
||||
What did Neanderthals think about? $FG,4$"Warmth"$FG$
|
||||
What was the first thing cooked? $FG,4$I think He said "hair".$FG$
|
||||
What was Lucy's husband's name? $FG,4$"Golem"$FG$
|
||||
Was stegosuarus lame like turtles? $FG,4$"Not pet rocks"$FG$
|
||||
T-Rex? $FG,4$Lugged carcases over his shoulder.
|
||||
Carcus lasted a month.$FG$
|
||||
What was T-Rexes sharing a carcus like? $RED$"Punch... Punch"$FG$
|
||||
Surprises in dinosaur anatomy? $RED$Supporting and securing the heart.$FG$
|
||||
How does He feel about the Avatar movie?$RED$"Sick skin"$FG$
|
||||
What do You like at zoos with kids? $RED$"Dignity" Animals worried about dignity.$FG$
|
||||
Who's better alien or preditor? $RED$"Lions"$FG$
|
||||
What from You is like a Rubik's cube? $RED$Training a horse.$FG$
|
||||
Does He like mirrored glass megachurch? $RED$"Secular glass"$FG$
|
||||
Pipe Organs $RED$Are sacred.$FG$
|
||||
You like to hangout in courts?Hospitals?$RED$"Prisons"$FG$
|
||||
Best way for Bill Gates to save lives? $RED$Earthquake prediction$FG$
|
||||
Stem cells? $RED$Lower hanging fruit exists (2007)$FG$
|
||||
Eleventh commandment? $RED$Thou shall not litter.$FG$
|
||||
Twelfth commandment? $RED$$TX,"Don't shoot unarmed men on the shitter.",HTML="http://www.youtube.com/watch?v=8wGiJcq95Ug"$
|
||||
What was T-Rexes sharing a carcus like? $FG,4$"Punch... Punch"$FG$
|
||||
Surprises in dinosaur anatomy? $FG,4$Supporting and securing the heart.$FG$
|
||||
How does He feel about the Avatar movie?$FG,4$"Sick skin"$FG$
|
||||
What do You like at zoos with kids? $FG,4$"Dignity" Animals worried about dignity.$FG$
|
||||
Who's better alien or preditor? $FG,4$"Lions"$FG$
|
||||
What from You is like a Rubik's cube? $FG,4$Training a horse.$FG$
|
||||
Does He like mirrored glass megachurch? $FG,4$"Secular glass"$FG$
|
||||
Pipe Organs $FG,4$Are sacred.$FG$
|
||||
You like to hangout in courts?Hospitals?$FG,4$"Prisons"$FG$
|
||||
Best way for Bill Gates to save lives? $FG,4$Earthquake prediction$FG$
|
||||
Stem cells? $FG,4$Lower hanging fruit exists (2007)$FG$
|
||||
Eleventh commandment? $FG,4$Thou shall not litter.$FG$
|
||||
Twelfth commandment? $FG,4$$TX,"Don't shoot unarmed men on the shitter.",HTML="http://www.youtube.com/watch?v=8wGiJcq95Ug"$
|
||||
(I asked God why pointless plagues in Exodus?
|
||||
God wanted guilt to accumulate, first.)$FG$
|
||||
Thirteenth commandment $RED$No gore unless it looks fake.$FG$
|
||||
Fourteenth commandment $RED$No pedophilia or child porn.$FG$
|
||||
Fifteenth commandment $RED$Don't eat rare meat with blood.$FG$
|
||||
Sixteenth commandment $RED$No wife beating.$FG$
|
||||
Seventeen commandment $RED$Do not swing from radio towers with one hand.$FG$
|
||||
Eighteenth commandment $RED$Do not disturb.$FG$
|
||||
Before Katrina $RED$Floods do justice. Black bead elder (tree book)$FG$
|
||||
After Katrina $RED$Suffering Simplifies Life$FG$
|
||||
What field are You most better? $RED$Economics$FG$
|
||||
Favorite toy for kids? $RED$Magnifying glass$FG$
|
||||
Asked Jesus if He liked mustard?$RED$"Bad meat happeneth"$FG$
|
||||
(Reluctantly) Faith healing? $RED$"It's complicated"$FG$
|
||||
Mars? $RED$Start planting!$FG$
|
||||
Mars rover? $RED$Should have had a microphone$FG$
|
||||
$TX,"Storm on Saturn",HTML="http://www.space.com/22646-monster-saturn-storm-water-ice.html"$ $RED$Pollen$FG$
|
||||
Space war game? $RED$Should have space weather.$FG$
|
||||
$TX,"Saturn's hexagon pole cloud?",HTML="http://en.wikipedia.org/wiki/Saturn's_hexagon"$ $RED$"Compass" (Magnetism)$FG$
|
||||
Liquid moon's odd atmosphere? $RED$"Surf"$FG$
|
||||
How many E.T. civs in Universe? $RED$20 or 80 (I forgot. I died laughing.)$FG$
|
||||
Are they peaceful? $RED$Fight them! (Also, funny.)$FG$
|
||||
Most difficult control system? $RED$$TX,"Dung beetle",HTML="http://www.youtube.com/watch?v=Q1zbgd6xpGQ"$$FG$
|
||||
How can Judge Judy improve? $RED$No hard feelings$FG$
|
||||
How can Chef Ramsay improve? $RED$Make so it doesn't seem like toil for cooks.$FG$
|
||||
How can Hawking communicate? $RED$Blow from a nostril on a candle.$FG$
|
||||
$TX,"Photons bouncing?",HTML="https://www.youtube.com/watch?v=8FC6udrMPvo"$ $RED$"Folded coffee filter"$FG$
|
||||
Wormholes? $RED$Bent wormholes have echoes.$FG$
|
||||
Thirteenth commandment $FG,4$No gore unless it looks fake.$FG$
|
||||
Fourteenth commandment $FG,4$No pedophilia or child porn.$FG$
|
||||
Fifteenth commandment $FG,4$Don't eat rare meat with blood.$FG$
|
||||
Sixteenth commandment $FG,4$No wife beating.$FG$
|
||||
Seventeen commandment $FG,4$Do not swing from radio towers with one hand.$FG$
|
||||
Eighteenth commandment $FG,4$Do not disturb.$FG$
|
||||
Before Katrina $FG,4$Floods do justice. Black bead elder (tree book)$FG$
|
||||
After Katrina $FG,4$Suffering Simplifies Life$FG$
|
||||
What field are You most better? $FG,4$Economics$FG$
|
||||
Favorite toy for kids? $FG,4$Magnifying glass$FG$
|
||||
Asked Jesus if He liked mustard?$FG,4$"Bad meat happeneth"$FG$
|
||||
(Reluctantly) Faith healing? $FG,4$"It's complicated"$FG$
|
||||
Mars? $FG,4$Start planting!$FG$
|
||||
Mars rover? $FG,4$Should have had a microphone$FG$
|
||||
$TX,"Storm on Saturn",HTML="http://www.space.com/22646-monster-saturn-storm-water-ice.html"$ $FG,4$Pollen$FG$
|
||||
Space war game? $FG,4$Should have space weather.$FG$
|
||||
$TX,"Saturn's hexagon pole cloud?",HTML="http://en.wikipedia.org/wiki/Saturn's_hexagon"$ $FG,4$"Compass" (Magnetism)$FG$
|
||||
Liquid moon's odd atmosphere? $FG,4$"Surf"$FG$
|
||||
How many E.T. civs in Universe? $FG,4$20 or 80 (I forgot. I died laughing.)$FG$
|
||||
Are they peaceful? $FG,4$Fight them! (Also, funny.)$FG$
|
||||
Most difficult control system? $FG,4$$TX,"Dung beetle",HTML="http://www.youtube.com/watch?v=Q1zbgd6xpGQ"$$FG$
|
||||
How can Judge Judy improve? $FG,4$No hard feelings$FG$
|
||||
How can Chef Ramsay improve? $FG,4$Make so it doesn't seem like toil for cooks.$FG$
|
||||
How can Hawking communicate? $FG,4$Blow from a nostril on a candle.$FG$
|
||||
$TX,"Photons bouncing?",HTML="https://www.youtube.com/watch?v=8FC6udrMPvo"$ $FG,4$"Folded coffee filter"$FG$
|
||||
Wormholes? $FG,4$Bent wormholes have echoes.$FG$
|
||||
|
||||
Operating system? $RED$Was about to make line number column in editor.
|
||||
Operating system? $FG,4$Was about to make line number column in editor.
|
||||
God nixed it. I was about to do different graphic modes when I found 800x600 missing. God said just one mode 640x480. I was about to add child windows. God said, "God is not the author of such confusion." I asked for verification of 640x480 16 color. God said it was because of the children and their offerings. I asked about sound. God said "single voice". I asked for verification of not having different drivers. God confirmed this.$FG$
|
||||
640x480 16 color? $RED$God said it was a covenant, like circumcision.
|
||||
640x480 16 color? $FG,4$God said it was a covenant, like circumcision.
|
||||
$TX,"Modern graphics hard for kids/amateurs",HTML="http://www.youtube.com/watch?v=VUxcVzpeFqc"$.$FG$
|
||||
On Unix? $RED$God said it was rich with the patina of age.$FG$
|
||||
On Alcohol? $RED$Hate inebriation$FG$
|
||||
On rare steak? $RED$Too rare is very bad. Don't eat blood!$FG$
|
||||
Just before Katrina? $RED$Floods do my justice.Black bead elder(tree book)$FG$
|
||||
After Katrina? $RED$Suffering simplifies life$FG$
|
||||
Why the Sandy Hook shooting? $RED$The pot legalization law. (Sarcastic answer?)$FG$
|
||||
Deep Water Horizon $RED$(Claimed credit.)$FG$
|
||||
Cost of God's time to me? $RED$"The complete works of Shakespeare"$FG$
|
||||
On death? $RED$"awful"$FG$
|
||||
Opening of Saving Private Ryan? $RED$"Ouch"$FG$
|
||||
On Unix? $FG,4$God said it was rich with the patina of age.$FG$
|
||||
On Alcohol? $FG,4$Hate inebriation$FG$
|
||||
On rare steak? $FG,4$Too rare is very bad. Don't eat blood!$FG$
|
||||
Just before Katrina? $FG,4$Floods do my justice.Black bead elder(tree book)$FG$
|
||||
After Katrina? $FG,4$Suffering simplifies life$FG$
|
||||
Why the Sandy Hook shooting? $FG,4$The pot legalization law. (Sarcastic answer?)$FG$
|
||||
Deep Water Horizon $FG,4$(Claimed credit.)$FG$
|
||||
Cost of God's time to me? $FG,4$"The complete works of Shakespeare"$FG$
|
||||
On death? $FG,4$"awful"$FG$
|
||||
Opening of Saving Private Ryan? $FG,4$"Ouch"$FG$
|
||||
+10
-10
@@ -77,7 +77,7 @@ public I64 GodInit(U8 *files_find_mask="/Adam/God/Vocab.DD*",U8 *fu_flags=NULL)
|
||||
{//Read God's vocab file for picking words.
|
||||
I64 i,ch,fuf_flags=0;
|
||||
U8 *buf,*ptr,*ptr2;
|
||||
CDirEntry *tempde,*tempde1;
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+T+O");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
if (fuf_flags&~FUG_FILES_FIND)
|
||||
@@ -87,10 +87,10 @@ public I64 GodInit(U8 *files_find_mask="/Adam/God/Vocab.DD*",U8 *fu_flags=NULL)
|
||||
god.word_file_mask=StrNew(files_find_mask);
|
||||
god.word_fuf_flags=fuf_flags;
|
||||
|
||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
||||
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||
i=0;
|
||||
while (tempde) {
|
||||
if (buf=ptr=FileRead(tempde->full_name)) {
|
||||
while (tmpde) {
|
||||
if (buf=ptr=FileRead(tmpde->full_name)) {
|
||||
while (*ptr) {
|
||||
while (*ptr && !Bt(chars_bmp_word,*ptr))
|
||||
ptr++;
|
||||
@@ -103,17 +103,17 @@ public I64 GodInit(U8 *files_find_mask="/Adam/God/Vocab.DD*",U8 *fu_flags=NULL)
|
||||
}
|
||||
Free(buf);
|
||||
}
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
|
||||
Free(god.words);
|
||||
god.num_words=i;
|
||||
god.words=MAlloc(i*sizeof(U8 *));
|
||||
|
||||
tempde=tempde1;
|
||||
tmpde=tmpde1;
|
||||
i=0;
|
||||
while (tempde) {
|
||||
if (buf=ptr=FileRead(tempde->full_name)) {
|
||||
while (tmpde) {
|
||||
if (buf=ptr=FileRead(tmpde->full_name)) {
|
||||
while (*ptr) {
|
||||
while (*ptr && !Bt(chars_bmp_word,*ptr))
|
||||
ptr++;
|
||||
@@ -129,9 +129,9 @@ public I64 GodInit(U8 *files_find_mask="/Adam/God/Vocab.DD*",U8 *fu_flags=NULL)
|
||||
}
|
||||
Free(buf);
|
||||
}
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
DirTreeDel(tmpde1);
|
||||
return god.num_words;
|
||||
} GodInit;
|
||||
|
||||
|
||||
+36
-36
@@ -83,7 +83,7 @@ public I64 GrBlot(CDC *dc=gr.dc,I64 x,I64 y,CDC *img)
|
||||
CColorROPU32 color,c,old_color;
|
||||
CTask *win_task;
|
||||
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
x+=win_task->scroll_x;
|
||||
y+=win_task->scroll_y;
|
||||
@@ -98,7 +98,7 @@ public I64 GrBlot(CDC *dc=gr.dc,I64 x,I64 y,CDC *img)
|
||||
h1=0;
|
||||
w2=img->width;
|
||||
h2=img->height;
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
x+=win_task->pix_left;
|
||||
y+=win_task->pix_top;
|
||||
}
|
||||
@@ -109,7 +109,7 @@ public I64 GrBlot(CDC *dc=gr.dc,I64 x,I64 y,CDC *img)
|
||||
dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num;
|
||||
}
|
||||
}
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (x+w1<0) w1=-x;
|
||||
if (x+w2>win_task->pix_right+1)
|
||||
w2=win_task->pix_right+1-x;
|
||||
@@ -165,7 +165,7 @@ public I64 GrBlot(CDC *dc=gr.dc,I64 x,I64 y,CDC *img)
|
||||
case ROPB_MONO:
|
||||
color_mask=gr.to_8_colors[color.c0.color];
|
||||
if (img->flags&DCF_NO_TRANSPARENTS) {
|
||||
if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP)
|
||||
if (!(dc->flags & DCF_SCRN_BITMAP) || dc->flags&DCF_ON_TOP)
|
||||
win_z_buf_ptr=NULL;
|
||||
else {
|
||||
win_z_num=win_task->win_z_num;
|
||||
@@ -273,7 +273,7 @@ public I64 GrBlot(CDC *dc=gr.dc,I64 x,I64 y,CDC *img)
|
||||
}
|
||||
} else {
|
||||
k=h1*img->width_internal;
|
||||
if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP) {
|
||||
if (!(dc->flags & DCF_SCRN_BITMAP) || dc->flags&DCF_ON_TOP) {
|
||||
for (j=h1;j<h2;j++) {
|
||||
for (i=w1;i<w2;i++)
|
||||
if (img->body[k+i])
|
||||
@@ -318,7 +318,7 @@ public I64 GrBlot(CDC *dc=gr.dc,I64 x,I64 y,CDC *img)
|
||||
break;
|
||||
case ROPB_EQU:
|
||||
if (img->flags&DCF_NO_TRANSPARENTS) {
|
||||
if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP)
|
||||
if (!(dc->flags & DCF_SCRN_BITMAP) || dc->flags&DCF_ON_TOP)
|
||||
win_z_buf_ptr=NULL;
|
||||
else {
|
||||
win_z_num=win_task->win_z_num;
|
||||
@@ -423,7 +423,7 @@ public I64 GrBlot(CDC *dc=gr.dc,I64 x,I64 y,CDC *img)
|
||||
} else {
|
||||
here1a:
|
||||
k=h1*img->width_internal;
|
||||
if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP) {
|
||||
if (!(dc->flags & DCF_SCRN_BITMAP) || dc->flags&DCF_ON_TOP) {
|
||||
for (j=h1;j<h2;j++) {
|
||||
for (i=w1;i<w2;i++) {
|
||||
c=img->body[k+i];
|
||||
@@ -477,7 +477,7 @@ here1a:
|
||||
break;
|
||||
case ROPB_XOR:
|
||||
if (img->flags&DCF_NO_TRANSPARENTS) {
|
||||
if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP)
|
||||
if (!(dc->flags & DCF_SCRN_BITMAP) || dc->flags&DCF_ON_TOP)
|
||||
win_z_buf_ptr=NULL;
|
||||
else {
|
||||
win_z_num=win_task->win_z_num;
|
||||
@@ -625,7 +625,7 @@ public CDC *DCExt(CDC *dc=gr.dc,I64 x1,I64 y1,I64 x2,I64 y2,
|
||||
CTask *win_task;
|
||||
if (x1>x2) SwapI64(&x1,&x2);
|
||||
if (y1>y2) SwapI64(&y1,&y2);
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
x1+=win_task->pix_left+win_task->scroll_x;
|
||||
y1+=win_task->pix_top +win_task->scroll_y;
|
||||
@@ -648,7 +648,7 @@ public I64 GrPutChar(CDC *dc=gr.dc,I64 x,I64 y,U8 ch)
|
||||
CColorROPU32 color,c;
|
||||
CTask *win_task;
|
||||
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
x+=win_task->scroll_x;
|
||||
y+=win_task->scroll_y;
|
||||
@@ -665,7 +665,7 @@ public I64 GrPutChar(CDC *dc=gr.dc,I64 x,I64 y,U8 ch)
|
||||
w2=FONT_WIDTH;
|
||||
h2=FONT_HEIGHT;
|
||||
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
x+=win_task->pix_left;
|
||||
y+=win_task->pix_top;
|
||||
}
|
||||
@@ -676,7 +676,7 @@ public I64 GrPutChar(CDC *dc=gr.dc,I64 x,I64 y,U8 ch)
|
||||
dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num;
|
||||
}
|
||||
}
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (x+w1<0) w1=-x;
|
||||
if (x+w2>win_task->pix_right+1)
|
||||
w2=win_task->pix_right+1-x;
|
||||
@@ -729,7 +729,7 @@ public I64 GrPutChar(CDC *dc=gr.dc,I64 x,I64 y,U8 ch)
|
||||
color_mask=gr.to_8_colors[color.c0.color];
|
||||
k1=x+w1;
|
||||
kk1=(h1+y)*dc->width_internal+k1;
|
||||
if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP) {
|
||||
if (!(dc->flags & DCF_SCRN_BITMAP) || dc->flags&DCF_ON_TOP) {
|
||||
if (leading_pixels) {
|
||||
dst=dc->body+kk1&~7;
|
||||
src=font_ptr;
|
||||
@@ -937,7 +937,7 @@ public I64 GrRect(CDC *dc=gr.dc,I64 x,I64 y,I64 w,I64 h)
|
||||
Bool dither,probability_dither;
|
||||
CTask *win_task;
|
||||
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
x+=win_task->scroll_x;
|
||||
y+=win_task->scroll_y;
|
||||
@@ -954,7 +954,7 @@ public I64 GrRect(CDC *dc=gr.dc,I64 x,I64 y,I64 w,I64 h)
|
||||
w2=w;
|
||||
h2=h;
|
||||
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
x+=win_task->pix_left;
|
||||
y+=win_task->pix_top;
|
||||
}
|
||||
@@ -968,7 +968,7 @@ public I64 GrRect(CDC *dc=gr.dc,I64 x,I64 y,I64 w,I64 h)
|
||||
dc->nearest_sprite_elem_num=dc->cur_sprite_elem_num;
|
||||
}
|
||||
}
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (x+w1<0) w1=-x;
|
||||
if (x+w2>win_task->pix_right+1)
|
||||
w2=win_task->pix_right+1-x;
|
||||
@@ -1028,7 +1028,7 @@ public I64 GrRect(CDC *dc=gr.dc,I64 x,I64 y,I64 w,I64 h)
|
||||
}
|
||||
res+=dc->collision_cnt;
|
||||
} else {
|
||||
if (!(dc->flags & DCF_SCREEN_BITMAP) || dc->flags&DCF_ON_TOP)
|
||||
if (!(dc->flags & DCF_SCRN_BITMAP) || dc->flags&DCF_ON_TOP)
|
||||
win_z_buf_ptr=NULL;
|
||||
else {
|
||||
win_z_num=win_task->win_z_num;
|
||||
@@ -1380,7 +1380,7 @@ I64 GrRayLenMinus(CDC *dc,I64 x,I64 y)
|
||||
Bool not_color=ToBool(dc->flags&DCF_FILL_NOT_COLOR);
|
||||
CTask *win_task;
|
||||
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
x+=win_task->scroll_x;
|
||||
y+=win_task->scroll_y;
|
||||
@@ -1389,7 +1389,7 @@ I64 GrRayLenMinus(CDC *dc,I64 x,I64 y)
|
||||
y3=y;
|
||||
if (x3<0 || y3<0)
|
||||
goto gr_done;
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
x3+=win_task->pix_left;
|
||||
y3+=win_task->pix_top;
|
||||
if (!(0<=x3<=win_task->pix_right) || !(0<=y3<=win_task->pix_bottom) ||
|
||||
@@ -1404,7 +1404,7 @@ I64 GrRayLenMinus(CDC *dc,I64 x,I64 y)
|
||||
while (TRUE) {
|
||||
x3=x;
|
||||
if (x3&(FONT_WIDTH-1)==FONT_WIDTH-1) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (x3<0) break;
|
||||
x3+=win_task->pix_left;
|
||||
if (!(0<=x3<=win_task->pix_right) || x3>=dc->width ||
|
||||
@@ -1413,7 +1413,7 @@ I64 GrRayLenMinus(CDC *dc,I64 x,I64 y)
|
||||
} else
|
||||
if (!(0<=x3<dc->width))
|
||||
break;
|
||||
} else if (dc->flags & DCF_SCREEN_BITMAP)
|
||||
} else if (dc->flags & DCF_SCRN_BITMAP)
|
||||
x3+=win_task->pix_left;
|
||||
dst=dst2+x3;
|
||||
c=*dst;
|
||||
@@ -1447,7 +1447,7 @@ I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
|
||||
I32 *db2;
|
||||
CTask *win_task;
|
||||
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
x+=win_task->scroll_x;
|
||||
y+=win_task->scroll_y;
|
||||
@@ -1458,7 +1458,7 @@ I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
|
||||
y3=y;
|
||||
if (x3<0 || y3<0)
|
||||
goto gr_done;
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
x3+=win_task->pix_left;
|
||||
y3+=win_task->pix_top;
|
||||
if (!(0<=x3<=win_task->pix_right) || !(0<=y3<=win_task->pix_bottom) ||
|
||||
@@ -1487,7 +1487,7 @@ I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
|
||||
while (TRUE) {
|
||||
x3=x;
|
||||
if (!(x3&(FONT_WIDTH-1))) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (x3<0) break;
|
||||
x3+=win_task->pix_left;
|
||||
if (!(0<=x3<=win_task->pix_right) || x3>=dc->width ||
|
||||
@@ -1497,7 +1497,7 @@ I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
|
||||
if (!(0<=x3<dc->width))
|
||||
break;
|
||||
}
|
||||
} else if (dc->flags & DCF_SCREEN_BITMAP)
|
||||
} else if (dc->flags & DCF_SCRN_BITMAP)
|
||||
x3+=win_task->pix_left;
|
||||
|
||||
dst=dst2+x3;
|
||||
@@ -1558,7 +1558,7 @@ I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
|
||||
} else
|
||||
break;
|
||||
}
|
||||
if (dc->flags & DCF_SCREEN_BITMAP)
|
||||
if (dc->flags & DCF_SCRN_BITMAP)
|
||||
*x1=x-1-win_task->scroll_x;
|
||||
else
|
||||
*x1=x-1;
|
||||
@@ -1566,7 +1566,7 @@ I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
|
||||
while (TRUE) {
|
||||
x3=x;
|
||||
if (x3&(FONT_WIDTH-1)==FONT_WIDTH-1) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
if (x3<0) break;
|
||||
x3+=win_task->pix_left;
|
||||
if (!(0<=x3<=win_task->pix_right) || x3>=dc->width ||
|
||||
@@ -1575,7 +1575,7 @@ I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
|
||||
} else
|
||||
if (!(0<=x3<dc->width))
|
||||
break;
|
||||
} else if (dc->flags & DCF_SCREEN_BITMAP)
|
||||
} else if (dc->flags & DCF_SCRN_BITMAP)
|
||||
x3+=win_task->pix_left;
|
||||
|
||||
dst=dst2+x3;
|
||||
@@ -1656,7 +1656,7 @@ public I64 GrHLine(CDC *dc=gr.dc,I64 x1,I64 x2,I64 y,I64 z1=0,I64 z2=0)
|
||||
return GrRect(dc,x1,y,x2-x1+1,1);
|
||||
}
|
||||
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
x1+=win_task->scroll_x;
|
||||
x2+=win_task->scroll_x;
|
||||
@@ -1685,7 +1685,7 @@ public I64 GrHLine(CDC *dc=gr.dc,I64 x1,I64 x2,I64 y,I64 z1=0,I64 z2=0)
|
||||
} else
|
||||
i=0;
|
||||
j=0;
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
x1+=win_task->pix_left;
|
||||
x2+=win_task->pix_left;
|
||||
if (x1>win_task->pix_right)
|
||||
@@ -1731,7 +1731,7 @@ public I64 GrHLine(CDC *dc=gr.dc,I64 x1,I64 x2,I64 y,I64 z1=0,I64 z2=0)
|
||||
if (dc->flags & DCF_DONT_DRAW)
|
||||
goto gr_done;
|
||||
|
||||
if (!(dc->flags & DCF_SCREEN_BITMAP) ||
|
||||
if (!(dc->flags & DCF_SCRN_BITMAP) ||
|
||||
win_task->next_task==sys_winmgr_task ||
|
||||
dc->flags&DCF_ON_TOP || !IsPixCovered0(win_task,x1,y))
|
||||
char_clear=TRUE;
|
||||
@@ -1799,7 +1799,7 @@ public I64 GrHLine(CDC *dc=gr.dc,I64 x1,I64 x2,I64 y,I64 z1=0,I64 z2=0)
|
||||
db++;
|
||||
z+=dz;
|
||||
if (!(x1&(FONT_WIDTH-1)) && x1<=x2) {
|
||||
if (!(dc->flags & DCF_SCREEN_BITMAP)||
|
||||
if (!(dc->flags & DCF_SCRN_BITMAP)||
|
||||
win_task->next_task==sys_winmgr_task ||
|
||||
dc->flags&DCF_ON_TOP || !IsPixCovered0(win_task,x1,y))
|
||||
char_clear=TRUE;
|
||||
@@ -1827,7 +1827,7 @@ public I64 GrVLine(CDC *dc=gr.dc,I64 x,I64 y1,I64 y2,I64 z1=0,I64 z2=0)
|
||||
return GrRect(dc,x,y1,1,y2-y1+1);
|
||||
}
|
||||
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
x +=win_task->scroll_x;
|
||||
y1+=win_task->scroll_y;
|
||||
@@ -1856,7 +1856,7 @@ public I64 GrVLine(CDC *dc=gr.dc,I64 x,I64 y1,I64 y2,I64 z1=0,I64 z2=0)
|
||||
} else
|
||||
i=0;
|
||||
j=0;
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
y1+=win_task->pix_top;
|
||||
y2+=win_task->pix_top;
|
||||
if (y1>win_task->pix_bottom)
|
||||
@@ -1902,7 +1902,7 @@ public I64 GrVLine(CDC *dc=gr.dc,I64 x,I64 y1,I64 y2,I64 z1=0,I64 z2=0)
|
||||
if (dc->flags & DCF_DONT_DRAW)
|
||||
goto gr_done;
|
||||
|
||||
if (!(dc->flags & DCF_SCREEN_BITMAP) ||
|
||||
if (!(dc->flags & DCF_SCRN_BITMAP) ||
|
||||
win_task->next_task==sys_winmgr_task ||
|
||||
dc->flags&DCF_ON_TOP || !IsPixCovered0(win_task,x,y1))
|
||||
char_clear=TRUE;
|
||||
@@ -1970,7 +1970,7 @@ public I64 GrVLine(CDC *dc=gr.dc,I64 x,I64 y1,I64 y2,I64 z1=0,I64 z2=0)
|
||||
db+=dc->width_internal;
|
||||
z+=dz;
|
||||
if (!(y1&(FONT_HEIGHT-1)) && y1<=y2) {
|
||||
if (!(dc->flags & DCF_SCREEN_BITMAP)||
|
||||
if (!(dc->flags & DCF_SCRN_BITMAP)||
|
||||
win_task->next_task==sys_winmgr_task ||
|
||||
dc->flags&DCF_ON_TOP || !IsPixCovered0(win_task,x,y1))
|
||||
char_clear=TRUE;
|
||||
|
||||
+24
-24
@@ -373,13 +373,13 @@ public CDC *DCLoad(U8 *src,I64 *_size=NULL,CTask *task=NULL)
|
||||
return res;
|
||||
}
|
||||
|
||||
#help_index "Graphics/GRA Files"
|
||||
#help_file "::/Doc/GRAFiles"
|
||||
#help_index "Graphics/Device Contexts;Graphics/GRA Files"
|
||||
public I64 GRAWrite(U8 *filename,CDC *dc,I64 dcsf_flags=DCSF_COMPRESSED)
|
||||
{//TempleOS GRA File.
|
||||
#help_index "Graphics/GR Files"
|
||||
#help_file "::/Doc/GRFiles"
|
||||
#help_index "Graphics/Device Contexts;Graphics/GR Files"
|
||||
public I64 GRWrite(U8 *filename,CDC *dc,I64 dcsf_flags=DCSF_COMPRESSED)
|
||||
{//TempleOS GR File.
|
||||
I64 size;
|
||||
U8 *st=DftExt(filename,"GRA.Z"),
|
||||
U8 *st=DftExt(filename,"GR.Z"),
|
||||
*src=DCSave(dc,&size,dcsf_flags);
|
||||
FileWrite(st,src,size);
|
||||
Free(st);
|
||||
@@ -387,10 +387,10 @@ public I64 GRAWrite(U8 *filename,CDC *dc,I64 dcsf_flags=DCSF_COMPRESSED)
|
||||
return size;
|
||||
}
|
||||
|
||||
public CDC *GRARead(U8 *filename,CTask *task=NULL)
|
||||
{//TempleOS GRA File.
|
||||
public CDC *GRRead(U8 *filename,CTask *task=NULL)
|
||||
{//TempleOS GR File.
|
||||
CDC *dc=NULL;
|
||||
U8 *st=DftExt(filename,"GRA.Z"),
|
||||
U8 *st=DftExt(filename,"GR.Z"),
|
||||
*src=FileRead(st);
|
||||
if (src)
|
||||
dc=DCLoad(src,,task);
|
||||
@@ -399,27 +399,27 @@ public CDC *GRARead(U8 *filename,CTask *task=NULL)
|
||||
return dc;
|
||||
}
|
||||
|
||||
#help_index "Graphics/Sprite;Graphics/GRA Files;DolDoc/Output;StdOut/DolDoc"
|
||||
public U0 DocGRA(CDoc *doc=NULL,U8 *filename)
|
||||
{//Put a GRA file into a document as asprite.
|
||||
CDC *dc=GRARead(filename);
|
||||
#help_index "Graphics/Sprite;Graphics/GR Files;DolDoc/Output;StdOut/DolDoc"
|
||||
public U0 DocGR(CDoc *doc=NULL,U8 *filename)
|
||||
{//Put a GR file into a document as asprite.
|
||||
CDC *dc=GRRead(filename);
|
||||
CSprite *elems=DC2Sprite(dc);
|
||||
DocSprite(doc,elems);
|
||||
Free(elems);
|
||||
DCDel(dc);
|
||||
}
|
||||
|
||||
#help_index "Graphics/Device Contexts;Graphics/Screen"
|
||||
public CDC *DCScreenCapture(Bool include_zoom=TRUE,CTask *task=NULL)
|
||||
{//Capture screen to a device context.
|
||||
#help_index "Graphics/Device Contexts;Graphics/Scrn"
|
||||
public CDC *DCScrnCapture(Bool include_zoom=TRUE,CTask *task=NULL)
|
||||
{//Capture scrn to a device context.
|
||||
CDC *dc;
|
||||
U8 *dst;
|
||||
WinMgrSync(2,TRUE);
|
||||
Refresh(2,TRUE);
|
||||
if (include_zoom)
|
||||
dc=DCCopy(gr.screen_image,task);
|
||||
dc=DCCopy(gr.scrn_image,task);
|
||||
else
|
||||
dc=DCCopy(gr.dc1,task);
|
||||
dc->flags&=~DCF_SCREEN_BITMAP;
|
||||
dc->flags&=~DCF_SCRN_BITMAP;
|
||||
dst=MAlloc(dc->width_internal*dc->height,task);
|
||||
//Pick background color that never occurs. COLOR_INVALID
|
||||
GrBitMap4ToBitMap8(dst,dc->body,
|
||||
@@ -429,12 +429,12 @@ public CDC *DCScreenCapture(Bool include_zoom=TRUE,CTask *task=NULL)
|
||||
return dc;
|
||||
}
|
||||
|
||||
#help_index "Graphics/GRA Files;Graphics/Screen"
|
||||
public I64 GRAScreenCapture(U8 *filename,Bool include_zoom=TRUE)
|
||||
{//Capture screen to a TempleOS GRA File.
|
||||
#help_index "Graphics/GR Files;Graphics/Scrn"
|
||||
public I64 GRScrnCapture(U8 *filename,Bool include_zoom=TRUE)
|
||||
{//Capture scrn to a TempleOS GR File.
|
||||
I64 size;
|
||||
CDC *dc=DCScreenCapture(include_zoom);
|
||||
size=GRAWrite(filename,dc,DCSF_COMPRESSED|DCSF_PALETTE_GET);
|
||||
CDC *dc=DCScrnCapture(include_zoom);
|
||||
size=GRWrite(filename,dc,DCSF_COMPRESSED|DCSF_PALETTE_GET);
|
||||
DCDel(dc);
|
||||
return size;
|
||||
}
|
||||
+5
-5
@@ -1,4 +1,4 @@
|
||||
#help_index "Graphics/Screen"
|
||||
#help_index "Graphics/Scrn"
|
||||
|
||||
U0 CtrlAltZ(I64 sc)
|
||||
{
|
||||
@@ -10,9 +10,9 @@ U0 CtrlAltZ(I64 sc)
|
||||
CtrlAltCBSet('Z',&CtrlAltZ,"Cmd /Zoom In",
|
||||
"Cmd /Zoom Out");
|
||||
|
||||
U0 Screen2Clipboard(I64)
|
||||
U0 Scrn2Clipboard(I64)
|
||||
{
|
||||
CDC *dc=DCScreenCapture;
|
||||
CDC *dc=DCScrnCapture;
|
||||
U8 *elems=DC2Sprite(dc);
|
||||
Bool unlock_doc=DocLock(sys_clipboard_doc);
|
||||
ClipboardDel;
|
||||
@@ -24,6 +24,6 @@ U0 Screen2Clipboard(I64)
|
||||
}
|
||||
U0 CtrlAltS(I64)
|
||||
{
|
||||
Spawn(&Screen2Clipboard);
|
||||
Spawn(&Scrn2Clipboard);
|
||||
}
|
||||
CtrlAltCBSet('S',&CtrlAltS,"Cmd /Screen Shot to Clipboard");
|
||||
CtrlAltCBSet('S',&CtrlAltS,"Cmd /Scrn Shot to Clipboard");
|
||||
+5
-5
@@ -3,7 +3,7 @@
|
||||
public class CGrGlbls
|
||||
{
|
||||
I64 *to_8_bits,*to_8_colors;
|
||||
CDC *screen_image, //Read only.
|
||||
CDC *scrn_image, //Read only.
|
||||
*dc, //Persistent
|
||||
*dc1,
|
||||
*dc2, //Updated every refresh
|
||||
@@ -19,7 +19,7 @@ public class CGrGlbls
|
||||
I64 highest_uncovered;
|
||||
U16 *vga_text_cache;
|
||||
I64 pan_text_x,pan_text_y; //[-7,7]
|
||||
U0 (*fp_final_screen_update)(CDC *dc);//Mouse cursor is handled here.
|
||||
U0 (*fp_final_scrn_update)(CDC *dc);//Mouse cursor is handled here.
|
||||
U0 (*fp_wall_paper)(CTask *task);
|
||||
U0 (*fp_draw_input_ptr)(CDC *dc,I64 x,I64 y);
|
||||
U0 (*fp_draw_grab_input_ptr)(CDC *dc,I64 x,I64 y,Bool closed);
|
||||
@@ -33,9 +33,9 @@ public class CGrGlbls
|
||||
I8 circle_lo[GR_NUM_PEN_BRUSHES][GR_NUM_PEN_BRUSHES],
|
||||
circle_hi[GR_NUM_PEN_BRUSHES][GR_NUM_PEN_BRUSHES];
|
||||
|
||||
#define GR_MAX_SCREEN_ZOOM 8
|
||||
U8 *screen_zoom_tables[GR_MAX_SCREEN_ZOOM+1];
|
||||
I64 screen_zoom,sx,sy;
|
||||
#define GR_MAX_SCRN_ZOOM 8
|
||||
U8 *scrn_zoom_tables[GR_MAX_SCRN_ZOOM+1];
|
||||
I64 scrn_zoom,sx,sy;
|
||||
|
||||
//When zoomed, this keeps the mouse centered.
|
||||
Bool continuous_scroll,
|
||||
|
||||
+11
-11
@@ -1,4 +1,4 @@
|
||||
#help_index "Graphics/Screen"
|
||||
#help_index "Graphics/Scrn"
|
||||
|
||||
U0 GrSetUpTables()
|
||||
{
|
||||
@@ -75,10 +75,10 @@ U0 GrSetUpTables()
|
||||
OutU8(VGAP_DATA,0x0F);
|
||||
//Virtual Box crashes on the following for some reason.
|
||||
// MemSet(text.vga_alias,0,GR_HEIGHT*GR_WIDTH>>3);
|
||||
MemSet(gr.screen_image->body,0,GR_WIDTH*GR_HEIGHT>>1);
|
||||
MemSet(gr.scrn_image->body,0,GR_WIDTH*GR_HEIGHT>>1);
|
||||
}
|
||||
for (i=1;i<=GR_MAX_SCREEN_ZOOM;i++) {
|
||||
dst=gr.screen_zoom_tables[i]=MAlloc(256*i);
|
||||
for (i=1;i<=GR_MAX_SCRN_ZOOM;i++) {
|
||||
dst=gr.scrn_zoom_tables[i]=MAlloc(256*i);
|
||||
for (j=0;j<256;j++) {
|
||||
m=0;
|
||||
for (k=0;k<8;k++) {
|
||||
@@ -93,7 +93,7 @@ U0 GrSetUpTables()
|
||||
}
|
||||
}
|
||||
|
||||
#help_index "Graphics/Screen;Windows"
|
||||
#help_index "Graphics/Scrn;Windows"
|
||||
|
||||
U0 WinZBufFill(CTask *task)
|
||||
{//Not public
|
||||
@@ -175,7 +175,7 @@ U0 GrInit2()
|
||||
MemSet(&gr,0,sizeof(CGrGlbls));
|
||||
gr.sprite_hash=HashTableNew(512);
|
||||
HashDefineLstAdd("ST_SPRITE_ELEM_CODES",SPHT_ELEM_CODE,gr.sprite_hash);
|
||||
gr.screen_zoom=1;
|
||||
gr.scrn_zoom=1;
|
||||
|
||||
PaletteSetStd;
|
||||
fp_set_std_palette=&PaletteSetStd;
|
||||
@@ -191,19 +191,19 @@ U0 GrInit2()
|
||||
gr.win_z_buf=MAlloc(TEXT_ROWS*TEXT_COLS*sizeof(U16));
|
||||
|
||||
gr.dc2=DCNew(GR_WIDTH,GR_HEIGHT);
|
||||
gr.dc2->flags|=DCF_SCREEN_BITMAP;
|
||||
gr.dc2->flags|=DCF_SCRN_BITMAP;
|
||||
gr.dc_cache=DCNew(GR_WIDTH,GR_HEIGHT);
|
||||
|
||||
gr.dc=DCNew(GR_WIDTH,GR_HEIGHT);
|
||||
gr.dc->flags|=DCF_SCREEN_BITMAP|DCF_ON_TOP;
|
||||
gr.dc->flags|=DCF_SCRN_BITMAP|DCF_ON_TOP;
|
||||
DCFill;
|
||||
|
||||
gr.dc1=DCNew(GR_WIDTH,GR_HEIGHT);
|
||||
gr.dc1->flags|=DCF_SCREEN_BITMAP;
|
||||
gr.dc1->flags|=DCF_SCRN_BITMAP;
|
||||
|
||||
gr.screen_image=DCNew(GR_WIDTH,GR_HEIGHT); //4-bit
|
||||
gr.scrn_image=DCNew(GR_WIDTH,GR_HEIGHT); //4-bit
|
||||
gr.zoomed_dc =DCNew(GR_WIDTH,GR_HEIGHT); //4-bit
|
||||
gr.zoomed_dc->flags|=DCF_SCREEN_BITMAP;
|
||||
gr.zoomed_dc->flags|=DCF_SCRN_BITMAP;
|
||||
}
|
||||
|
||||
GrInit2;
|
||||
+42
-42
@@ -277,8 +277,8 @@ public U0 DCReflect(CDC *dc,I64 *_x,I64 *_y,I64 *_z)
|
||||
}
|
||||
|
||||
#help_index "Graphics/Math"
|
||||
#define SCALE1 24
|
||||
#define SCALE2 8
|
||||
#define GR_SCALE1_BITS 24
|
||||
#define GR_SCALE2_BITS 8
|
||||
public Bool Circle(U8 *aux_data,I64 cx,I64 cy,I64 cz,I64 radius,
|
||||
Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z),
|
||||
I64 step=1,F64 start_radians=0,F64 len_radians=2*ã)
|
||||
@@ -288,13 +288,13 @@ public Bool Circle(U8 *aux_data,I64 cx,I64 cy,I64 cz,I64 radius,
|
||||
F64 t;
|
||||
if (radius<=0||!step) return TRUE;
|
||||
t=1.0/radius;
|
||||
c=1<<SCALE1*Cos(t);
|
||||
c=1<<GR_SCALE1_BITS*Cos(t);
|
||||
if (step<0) {
|
||||
step=-step;
|
||||
s2=1<<SCALE1*Sin(t);
|
||||
s2=1<<GR_SCALE1_BITS*Sin(t);
|
||||
s1=-s2;
|
||||
} else {
|
||||
s1=1<<SCALE1*Sin(t);
|
||||
s1=1<<GR_SCALE1_BITS*Sin(t);
|
||||
s2=-s1;
|
||||
}
|
||||
if (start_radians) {
|
||||
@@ -304,14 +304,14 @@ public Bool Circle(U8 *aux_data,I64 cx,I64 cy,I64 cz,I64 radius,
|
||||
x=radius;
|
||||
y=0;
|
||||
}
|
||||
x<<=SCALE2;
|
||||
y<<=SCALE2;
|
||||
x<<=GR_SCALE2_BITS;
|
||||
y<<=GR_SCALE2_BITS;
|
||||
for (i=0;i<=len;i+=step) {
|
||||
if (!(*fp_plot)(aux_data,cx+x>>SCALE2,cy+y>>SCALE2,cz))
|
||||
if (!(*fp_plot)(aux_data,cx+x>>GR_SCALE2_BITS,cy+y>>GR_SCALE2_BITS,cz))
|
||||
return FALSE;
|
||||
for (j=0;j<step;j++) {
|
||||
x1=(c*x+s1*y)>>SCALE1;
|
||||
y1=(s2*x+c*y)>>SCALE1;
|
||||
x1=(c*x+s1*y)>>GR_SCALE1_BITS;
|
||||
y1=(s2*x+c*y)>>GR_SCALE1_BITS;
|
||||
x=x1; y=y1;
|
||||
}
|
||||
}
|
||||
@@ -336,18 +336,18 @@ public Bool Ellipse(U8 *aux_data,I64 cx,I64 cy,I64 cz,
|
||||
len=Ceil(len_radians*y_radius);
|
||||
}
|
||||
|
||||
c=1<<SCALE1*Cos(t);
|
||||
c=1<<GR_SCALE1_BITS*Cos(t);
|
||||
if (step<0) {
|
||||
step=-step;
|
||||
s2=1<<SCALE1*Sin(t);
|
||||
s2=1<<GR_SCALE1_BITS*Sin(t);
|
||||
s1=-s2;
|
||||
} else {
|
||||
s1=1<<SCALE1*Sin(t);
|
||||
s1=1<<GR_SCALE1_BITS*Sin(t);
|
||||
s2=-s1;
|
||||
}
|
||||
|
||||
c2=1<<SCALE1*Cos(rot_angle);
|
||||
s12=1<<SCALE1*Sin(rot_angle);
|
||||
c2=1<<GR_SCALE1_BITS*Cos(rot_angle);
|
||||
s12=1<<GR_SCALE1_BITS*Sin(rot_angle);
|
||||
s22=-s12;
|
||||
|
||||
if (start_radians) {
|
||||
@@ -357,29 +357,29 @@ public Bool Ellipse(U8 *aux_data,I64 cx,I64 cy,I64 cz,
|
||||
x=x_radius;
|
||||
y=0;
|
||||
}
|
||||
x<<=SCALE2;
|
||||
y<<=SCALE2;
|
||||
x<<=GR_SCALE2_BITS;
|
||||
y<<=GR_SCALE2_BITS;
|
||||
x2=x;
|
||||
y2=y;
|
||||
|
||||
y1=y2*y_radius/x_radius;
|
||||
x=(c2*x2+s12*y1)>>SCALE1;
|
||||
y=(s22*x2+c2*y1)>>SCALE1;
|
||||
x=(c2*x2+s12*y1)>>GR_SCALE1_BITS;
|
||||
y=(s22*x2+c2*y1)>>GR_SCALE1_BITS;
|
||||
|
||||
for (i=0;i<=len;i+=step) {
|
||||
if ((x>>SCALE2!=_x || y>>SCALE2!=_y || first) &&
|
||||
!(*fp_plot)(aux_data,cx+x>>SCALE2,cy+y>>SCALE2,cz))
|
||||
if ((x>>GR_SCALE2_BITS!=_x || y>>GR_SCALE2_BITS!=_y || first) &&
|
||||
!(*fp_plot)(aux_data,cx+x>>GR_SCALE2_BITS,cy+y>>GR_SCALE2_BITS,cz))
|
||||
return FALSE;
|
||||
|
||||
_x=x>>SCALE2; _y=y>>SCALE2; first=FALSE;
|
||||
_x=x>>GR_SCALE2_BITS; _y=y>>GR_SCALE2_BITS; first=FALSE;
|
||||
for (j=0;j<step;j++) {
|
||||
x1=(c*x2+s1*y2)>>SCALE1;
|
||||
y1=(s2*x2+c*y2)>>SCALE1;
|
||||
x1=(c*x2+s1*y2)>>GR_SCALE1_BITS;
|
||||
y1=(s2*x2+c*y2)>>GR_SCALE1_BITS;
|
||||
x2=x1;
|
||||
y2=y1;
|
||||
y1=y1*y_radius/x_radius;
|
||||
x=(c2*x1+s12*y1)>>SCALE1;
|
||||
y=(s22*x1+c2*y1)>>SCALE1;
|
||||
x=(c2*x1+s12*y1)>>GR_SCALE1_BITS;
|
||||
y=(s22*x1+c2*y1)>>GR_SCALE1_BITS;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
@@ -401,13 +401,13 @@ public Bool RegPoly(U8 *aux_data,I64 cx,I64 cy,I64 cz,
|
||||
angle_step=2*ã/sides;
|
||||
n=len_radians*sides/(2*ã);
|
||||
|
||||
s1=1<<SCALE1*Sin(angle_step);
|
||||
s1=1<<GR_SCALE1_BITS*Sin(angle_step);
|
||||
s2=-s1;
|
||||
c=1<<SCALE1*Cos(angle_step);
|
||||
c=1<<GR_SCALE1_BITS*Cos(angle_step);
|
||||
|
||||
s12=1<<SCALE1*Sin(rot_angle);
|
||||
s12=1<<GR_SCALE1_BITS*Sin(rot_angle);
|
||||
s22=-s12;
|
||||
c2=1<<SCALE1*Cos(rot_angle);
|
||||
c2=1<<GR_SCALE1_BITS*Cos(rot_angle);
|
||||
|
||||
if (start_radians) {
|
||||
x=x_radius*Cos(start_radians);
|
||||
@@ -416,27 +416,27 @@ public Bool RegPoly(U8 *aux_data,I64 cx,I64 cy,I64 cz,
|
||||
x=x_radius;
|
||||
y=0;
|
||||
}
|
||||
x<<=SCALE2;
|
||||
y<<=SCALE2;
|
||||
x<<=GR_SCALE2_BITS;
|
||||
y<<=GR_SCALE2_BITS;
|
||||
x2=x;
|
||||
y2=y;
|
||||
|
||||
y1=y2*y_radius/x_radius;
|
||||
x=(c2*x2+s12*y1)>>SCALE1;
|
||||
y=(s22*x2+c2*y1)>>SCALE1;
|
||||
x=(c2*x2+s12*y1)>>GR_SCALE1_BITS;
|
||||
y=(s22*x2+c2*y1)>>GR_SCALE1_BITS;
|
||||
|
||||
xx1=cx+x>>SCALE2;
|
||||
yy1=cy+y>>SCALE2;
|
||||
xx1=cx+x>>GR_SCALE2_BITS;
|
||||
yy1=cy+y>>GR_SCALE2_BITS;
|
||||
for (i=0;i<n;i++) {
|
||||
x1=(c*x2+s1*y2)>>SCALE1;
|
||||
y1=(s2*x2+c*y2)>>SCALE1;
|
||||
x1=(c*x2+s1*y2)>>GR_SCALE1_BITS;
|
||||
y1=(s2*x2+c*y2)>>GR_SCALE1_BITS;
|
||||
x2=x1;
|
||||
y2=y1;
|
||||
y1=y1*y_radius/x_radius;
|
||||
x=(c2*x1+s12*y1)>>SCALE1;
|
||||
y=(s22*x1+c2*y1)>>SCALE1;
|
||||
xx2=cx+x>>SCALE2;
|
||||
yy2=cy+y>>SCALE2;
|
||||
x=(c2*x1+s12*y1)>>GR_SCALE1_BITS;
|
||||
y=(s22*x1+c2*y1)>>GR_SCALE1_BITS;
|
||||
xx2=cx+x>>GR_SCALE2_BITS;
|
||||
yy2=cy+y>>GR_SCALE2_BITS;
|
||||
if (!Line(aux_data,xx1,yy1,cz,xx2,yy2,cz,fp_plot,step))
|
||||
return FALSE;
|
||||
xx1=xx2; yy1=yy2;
|
||||
|
||||
+13
-13
@@ -2,13 +2,13 @@
|
||||
|
||||
public Bool GrClamp(CDC *dc=gr.dc,I64 *left,I64 *top,I64 *right,I64 *bottom,
|
||||
I64 width=0,I64 height=0)
|
||||
{//Returns screen, not window coordinates.
|
||||
{//Returns scrn, not window coordinates.
|
||||
CTask *win_task;
|
||||
*left=0;
|
||||
*top=0;
|
||||
*right=dc->width-1;
|
||||
*bottom=dc->height-1;
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
if (GR_WIDTH-1<*right)
|
||||
*right=GR_WIDTH-1;
|
||||
@@ -32,11 +32,11 @@ public Bool GrClamp(CDC *dc=gr.dc,I64 *left,I64 *top,I64 *right,I64 *bottom,
|
||||
|
||||
Bool DCClipLine(CDC *dc=gr.dc,I64 *x1,I64 *y1,I64 *x2,I64 *y2,
|
||||
I64 width=0,I64 height=0)
|
||||
{//Also converts window to screen coordinates
|
||||
{//Also converts window to scrn coordinates
|
||||
I64 left,top,right,bottom;
|
||||
CTask *win_task;
|
||||
if (GrClamp(dc,&left,&top,&right,&bottom,width,height)) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
*x1+=win_task->pix_left+win_task->scroll_x;
|
||||
*y1+=win_task->pix_top+win_task->scroll_y;
|
||||
@@ -60,7 +60,7 @@ public Bool GrPlot(CDC *dc=gr.dc,I64 x,I64 y)
|
||||
dc->color.c0.rop=ROPB_MONO;
|
||||
GrBlot(dc,x,y,dc->brush);
|
||||
dc->color=old_color;
|
||||
} else if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
} else if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
x+=win_task->pix_left+win_task->scroll_x;
|
||||
y+=win_task->pix_top+win_task->scroll_y;
|
||||
@@ -91,7 +91,7 @@ Bool GrPlot1(CDC *dc=gr.dc,I64 x,I64 y)
|
||||
else
|
||||
GrBlot(dc,x,y,dc->brush);
|
||||
dc->color=old_color;
|
||||
} else if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
} else if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
x+=win_task->pix_left+win_task->scroll_x;
|
||||
y+=win_task->pix_top+win_task->scroll_y;
|
||||
@@ -110,9 +110,9 @@ Bool GrPlot1(CDC *dc=gr.dc,I64 x,I64 y)
|
||||
|
||||
public I64 GrPeek(CDC *dc=gr.dc,I64 x,I64 y)
|
||||
{//2D. Clipping but no transformation.
|
||||
//Returns pix color or -1 if off-screen or covered.
|
||||
//Returns pix color or -1 if off-scrn or covered.
|
||||
CTask *win_task;
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
x+=win_task->pix_left+win_task->scroll_x;
|
||||
y+=win_task->pix_top+win_task->scroll_y;
|
||||
@@ -512,7 +512,7 @@ public Bool GrPlot3(CDC *dc=gr.dc,I64 x,I64 y,I64 z)
|
||||
}
|
||||
}
|
||||
if (record) {
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
x+=win_task->pix_left+win_task->scroll_x;
|
||||
y+=win_task->pix_top+win_task->scroll_y;
|
||||
@@ -550,7 +550,7 @@ gr_done:
|
||||
Bool GrLinePlot0(CDC *dc,I64 x,I64 y,I64 z)
|
||||
{//This is a callback.
|
||||
CTask *win_task=dc->win_task;
|
||||
if (!(dc->flags & DCF_SCREEN_BITMAP) ||
|
||||
if (!(dc->flags & DCF_SCRN_BITMAP) ||
|
||||
win_task->next_task==sys_winmgr_task ||
|
||||
dc->flags&DCF_ON_TOP ||
|
||||
!IsPixCovered0(win_task,x,y)) {
|
||||
@@ -1204,7 +1204,7 @@ normal_image:
|
||||
x1+=dx1; y1+=dy1; z1+=dz1;
|
||||
x+=dw;
|
||||
}
|
||||
res=1; //TODO: check off screen
|
||||
res=1; //TODO: check off scrn
|
||||
} else
|
||||
res=GrBlot(dc,x1,y1,img);
|
||||
gr_done:
|
||||
@@ -1415,7 +1415,7 @@ public I64 GrFillTri0(CDC *dc=gr.dc,CD3I32 *p1,CD3I32 *p2,CD3I32 *p4)
|
||||
|
||||
min=0;
|
||||
max=dc->height;
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
min-=win_task->scroll_y+win_task->pix_top;
|
||||
max-=win_task->scroll_y+win_task->pix_top;
|
||||
@@ -1623,7 +1623,7 @@ public I64 GrFillTri0(CDC *dc=gr.dc,CD3I32 *p1,CD3I32 *p2,CD3I32 *p4)
|
||||
|
||||
min=0;
|
||||
max=dc->width;
|
||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
||||
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||
win_task=dc->win_task;
|
||||
min-=win_task->scroll_x+win_task->pix_left;
|
||||
max-=win_task->scroll_x+win_task->pix_left;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#help_index "Graphics/Screen"
|
||||
#help_index "Graphics/Scrn"
|
||||
|
||||
U0 GrUpdateTaskODEs(CTask *task)
|
||||
{
|
||||
sys_task_being_screen_updated=task;
|
||||
sys_task_being_scrn_updated=task;
|
||||
try
|
||||
ODEsUpdate(task);
|
||||
catch {
|
||||
@@ -12,14 +12,14 @@ U0 GrUpdateTaskODEs(CTask *task)
|
||||
Sleep(3000);
|
||||
VGAFlush;
|
||||
}
|
||||
sys_task_being_screen_updated=NULL;
|
||||
sys_task_being_scrn_updated=NULL;
|
||||
}
|
||||
|
||||
U0 GrUpdateTaskWin(CTask *task)
|
||||
{ //Draw a win. Only core0 tasks have a win.
|
||||
{ //Draw a win. Only Core0 tasks have a win.
|
||||
CDC *dc;
|
||||
CD3I64 saved_scroll;
|
||||
sys_task_being_screen_updated=task;
|
||||
sys_task_being_scrn_updated=task;
|
||||
try {
|
||||
if (!Bt(&task->display_flags,DISPLAYf_NO_BORDER))
|
||||
TextBorder(Fs,task->win_left,task->win_right,task->win_top,
|
||||
@@ -52,7 +52,7 @@ U0 GrUpdateTaskWin(CTask *task)
|
||||
VGAFlush;
|
||||
}
|
||||
}
|
||||
sys_task_being_screen_updated=NULL;
|
||||
sys_task_being_scrn_updated=NULL;
|
||||
}
|
||||
|
||||
U0 GrUpdateTasks()
|
||||
@@ -64,7 +64,7 @@ U0 GrUpdateTasks()
|
||||
if (Bt(&sys_semas[SYS_SEMA_UPDATE_WIN_Z_BUF],0))
|
||||
WinZBufUpdate;
|
||||
task1=task=sys_winmgr_task;
|
||||
do { //Loop through core0 tasks.
|
||||
do { //Loop through Core0 tasks.
|
||||
if (!TaskValidate(task)) break;
|
||||
if (Bt(&task->display_flags,DISPLAYf_SHOW) &&
|
||||
Bt(gr.win_uncovered_bitmap,task->win_z_num))
|
||||
@@ -89,62 +89,62 @@ U0 GrUpdateTasks()
|
||||
winmgr.last_ode_time=winmgr.ode_time;
|
||||
ode_alloced_factor=LowPass1(0.1,ode_alloced_factor,
|
||||
Clamp(Gs->idle_factor-0.1,0.2,0.8),1/winmgr.fps);
|
||||
sys_task_being_screen_updated=NULL;
|
||||
sys_task_being_scrn_updated=NULL;
|
||||
}
|
||||
|
||||
U0 GrFixZoomScale()
|
||||
{
|
||||
gr.screen_zoom=ClampI64(gr.screen_zoom,1,GR_MAX_SCREEN_ZOOM);
|
||||
if (gr.screen_zoom==1) {
|
||||
gr.scrn_zoom=ClampI64(gr.scrn_zoom,1,GR_MAX_SCRN_ZOOM);
|
||||
if (gr.scrn_zoom==1) {
|
||||
gr.sx=0;
|
||||
gr.sy=0;
|
||||
} else {
|
||||
gr.sx=ClampI64(gr.sx,0,GR_WIDTH-GR_WIDTH/gr.screen_zoom)&~7;
|
||||
gr.sy=ClampI64(gr.sy,0,GR_HEIGHT-GR_HEIGHT/gr.screen_zoom);
|
||||
gr.sx=ClampI64(gr.sx,0,GR_WIDTH-GR_WIDTH/gr.scrn_zoom)&~7;
|
||||
gr.sy=ClampI64(gr.sy,0,GR_HEIGHT-GR_HEIGHT/gr.scrn_zoom);
|
||||
}
|
||||
}
|
||||
|
||||
public U0 GrScaleZoom(F64 scale)
|
||||
{//Multiply zoom factor larger or smaller.
|
||||
F64 s=gr.screen_zoom;
|
||||
gr.screen_zoom=gr.screen_zoom*scale;
|
||||
F64 s=gr.scrn_zoom;
|
||||
gr.scrn_zoom=gr.scrn_zoom*scale;
|
||||
GrFixZoomScale;
|
||||
s/=gr.screen_zoom;
|
||||
s/=gr.scrn_zoom;
|
||||
ip.scale.x*=s;
|
||||
ip.scale.y*=s;
|
||||
ip.scale.z*=s;
|
||||
ip.offset.x=ip.pos.x-(ip.pos.x-ip.offset.x)*s;
|
||||
ip.offset.y=ip.pos.y-(ip.pos.y-ip.offset.y)*s;
|
||||
ip.offset.z=ip.pos.z-(ip.pos.z-ip.offset.z)*s;
|
||||
gr.sx=ip.pos.x-gr.zoomed_dc->width >>1/gr.screen_zoom;
|
||||
gr.sy=ip.pos.y-gr.zoomed_dc->height>>1/gr.screen_zoom;
|
||||
gr.sx=ip.pos.x-gr.zoomed_dc->width >>1/gr.scrn_zoom;
|
||||
gr.sy=ip.pos.y-gr.zoomed_dc->height>>1/gr.scrn_zoom;
|
||||
GrFixZoomScale;
|
||||
}
|
||||
|
||||
U0 GrZoomInScreen()
|
||||
U0 GrZoomInScrn()
|
||||
{
|
||||
GrFixZoomScale;
|
||||
I64 plane,row,col,k,l,
|
||||
d2=gr.zoomed_dc->width>>3/gr.screen_zoom,
|
||||
d2=gr.zoomed_dc->width>>3/gr.scrn_zoom,
|
||||
d4=gr.zoomed_dc->width_internal>>3,
|
||||
d5=d4-d2*gr.screen_zoom,
|
||||
d3=gr.zoomed_dc->height/gr.screen_zoom,
|
||||
d5=d4-d2*gr.scrn_zoom,
|
||||
d3=gr.zoomed_dc->height/gr.scrn_zoom,
|
||||
d6=(gr.zoomed_dc->height-d3)*gr.dc1->width_internal>>3,
|
||||
d7=gr.zoomed_dc->height%gr.screen_zoom*d4;
|
||||
U8 *src,*src2,*dst,*src3,*map=gr.screen_zoom_tables[gr.screen_zoom];
|
||||
d7=gr.zoomed_dc->height%gr.scrn_zoom*d4;
|
||||
U8 *src,*src2,*dst,*src3,*map=gr.scrn_zoom_tables[gr.scrn_zoom];
|
||||
|
||||
src=gr.dc1->body+gr.sx>>3+gr.sy*gr.dc1->width_internal>>3;
|
||||
dst=gr.zoomed_dc->body;
|
||||
for (plane=1;plane<0x10;plane<<=1) {
|
||||
row=d3;
|
||||
while (row--) {
|
||||
k=gr.screen_zoom;
|
||||
k=gr.scrn_zoom;
|
||||
while (k--) {
|
||||
src2=src;
|
||||
col=d2;
|
||||
while (col--) {
|
||||
src3=&map[*src2++];
|
||||
l=gr.screen_zoom;
|
||||
l=gr.scrn_zoom;
|
||||
while (l--) {
|
||||
*dst++=*src3;
|
||||
src3+=256;
|
||||
@@ -367,13 +367,13 @@ U0 GrUpdateVGAGraphics()
|
||||
{//Update Graphic Card
|
||||
I64 row,plane,d=gr.zoomed_dc->width_internal>>6;
|
||||
U32 *src,*vga,*dst;
|
||||
if (gr.screen_zoom==1)
|
||||
if (gr.scrn_zoom==1)
|
||||
src=gr.dc1->body;
|
||||
else {
|
||||
GrZoomInScreen;
|
||||
GrZoomInScrn;
|
||||
src=gr.zoomed_dc->body;
|
||||
}
|
||||
dst=gr.screen_image->body;
|
||||
dst=gr.scrn_image->body;
|
||||
if (LBtr(&sys_semas[SYS_SEMA_FLUSH_VGA_IMAGE],0)) {
|
||||
for (plane=1;plane<0x10;plane<<=1) {
|
||||
OutU8(VGAP_IDX,VGAR_MAP_MASK);
|
||||
@@ -395,8 +395,8 @@ U0 GrUpdateVGAGraphics()
|
||||
}
|
||||
}
|
||||
|
||||
U0 GrUpdateScreen()
|
||||
{//Called by the Window Manager $LK,"HERE",A="FF:::/Adam/WinB.HC,GrUpdateScreen"$, 30 times a second.
|
||||
U0 GrUpdateScrn()
|
||||
{//Called by the Window Manager $LK,"HERE",A="FF:::/Adam/WinMgr.HC,GrUpdateScrn"$, 30 times a second.
|
||||
CDC *dc;
|
||||
if (!Bt(&sys_run_level,RLf_VGA)) //if text mode
|
||||
GrUpdateTasks;
|
||||
@@ -409,8 +409,8 @@ U0 GrUpdateScreen()
|
||||
|
||||
dc=DCAlias(gr.dc2,Fs);
|
||||
dc->flags|=DCF_ON_TOP;
|
||||
if (gr.fp_final_screen_update)
|
||||
(*gr.fp_final_screen_update)(dc);
|
||||
if (gr.fp_final_scrn_update)
|
||||
(*gr.fp_final_scrn_update)(dc);
|
||||
DCDel(dc);
|
||||
|
||||
if (!Bt(&sys_run_level,RLf_VGA)) //if text mode
|
||||
+122
-122
@@ -18,7 +18,7 @@ one of the most complicated.
|
||||
public U0 Sprite3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,
|
||||
Bool just_one_elem=FALSE)
|
||||
{//Plot a sprite into a CDC.
|
||||
CSprite *tempg=elems-offset(CSprite.start);
|
||||
CSprite *tmpg=elems-offset(CSprite.start);
|
||||
I64 i,j,k,x1,y1,z1,x2,y2,
|
||||
cur_sprite_elem_num=0,*old_r,*r2,
|
||||
old_flags=dc->flags,
|
||||
@@ -33,19 +33,19 @@ public U0 Sprite3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,
|
||||
dc->nearest_sprite_elem_num=0;
|
||||
dc->nearest_dist=MAX_I64;
|
||||
}
|
||||
while (tempg->type) {
|
||||
while (tmpg->type) {
|
||||
dc->cur_sprite_elem_num=cur_sprite_elem_num;
|
||||
switch (tempg->type) {
|
||||
switch (tmpg->type) {
|
||||
case SPT_COLOR:
|
||||
dc->color=dc->color&~(COLORROP_COLORS_MASK|ROPF_DITHER)|tempg->c.color;
|
||||
dc->color=dc->color&~(COLORROP_COLORS_MASK|ROPF_DITHER)|tmpg->c.color;
|
||||
break;
|
||||
case SPT_DITHER_COLOR:
|
||||
dc->color=dc->color&~COLORROP_COLORS_MASK|
|
||||
tempg->d.dither_color.u8[0]|
|
||||
tempg->d.dither_color.u8[1]<<COLORROP_BITS|ROPF_DITHER;
|
||||
tmpg->d.dither_color.u8[0]|
|
||||
tmpg->d.dither_color.u8[1]<<COLORROP_BITS|ROPF_DITHER;
|
||||
break;
|
||||
case SPT_WIDTH:
|
||||
dc->pen_width=tempg->w.width;
|
||||
dc->pen_width=tmpg->w.width;
|
||||
DCPenWidthScale(dc);
|
||||
break;
|
||||
case SPT_TRANSFORM_ON:
|
||||
@@ -65,94 +65,94 @@ public U0 Sprite3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,
|
||||
dc->flags&=~DCF_TRANSFORMATION;
|
||||
break;
|
||||
case SPT_PT:
|
||||
GrPlot3(dc,tempg->p.x1+x,tempg->p.y1+y,z);
|
||||
GrPlot3(dc,tmpg->p.x1+x,tmpg->p.y1+y,z);
|
||||
break;
|
||||
case SPT_TEXT:
|
||||
GrPrint3(dc,tempg->ps.x1+x,tempg->ps.y1+y,z,"%s",tempg->ps.st);
|
||||
GrPrint3(dc,tmpg->ps.x1+x,tmpg->ps.y1+y,z,"%s",tmpg->ps.st);
|
||||
break;
|
||||
case SPT_TEXT_BOX:
|
||||
GrTextBox3(dc,tempg->ps.x1+x,tempg->ps.y1+y,z,tempg->ps.st);
|
||||
GrTextBox3(dc,tmpg->ps.x1+x,tmpg->ps.y1+y,z,tmpg->ps.st);
|
||||
break;
|
||||
case SPT_TEXT_DIAMOND:
|
||||
GrTextDiamond3(dc,tempg->ps.x1+x,tempg->ps.y1+y,z,tempg->ps.st);
|
||||
GrTextDiamond3(dc,tmpg->ps.x1+x,tmpg->ps.y1+y,z,tmpg->ps.st);
|
||||
break;
|
||||
case SPT_FLOOD_FILL:
|
||||
GrFloodFill3(dc,tempg->p.x1+x,tempg->p.y1+y,z,FALSE);
|
||||
GrFloodFill3(dc,tmpg->p.x1+x,tmpg->p.y1+y,z,FALSE);
|
||||
break;
|
||||
case SPT_FLOOD_FILL_NOT:
|
||||
i=dc->color;
|
||||
dc->color=dc->color.c0;
|
||||
GrFloodFill3(dc,tempg->p.x1+x,tempg->p.y1+y,z,TRUE);
|
||||
GrFloodFill3(dc,tmpg->p.x1+x,tmpg->p.y1+y,z,TRUE);
|
||||
dc->color=i;
|
||||
break;
|
||||
case SPT_SHIFT:
|
||||
x+=tempg->p.x1;
|
||||
y+=tempg->p.y1;
|
||||
x+=tmpg->p.x1;
|
||||
y+=tmpg->p.y1;
|
||||
break;
|
||||
case SPT_LINE:
|
||||
GrLine3(dc,tempg->pp.x1+x,tempg->pp.y1+y,z,
|
||||
tempg->pp.x2+x,tempg->pp.y2+y,z);
|
||||
GrLine3(dc,tmpg->pp.x1+x,tmpg->pp.y1+y,z,
|
||||
tmpg->pp.x2+x,tmpg->pp.y2+y,z);
|
||||
break;
|
||||
case SPT_ARROW:
|
||||
GrArrow3(dc,tempg->pp.x1+x,tempg->pp.y1+y,z,
|
||||
tempg->pp.x2+x,tempg->pp.y2+y,z);
|
||||
GrArrow3(dc,tmpg->pp.x1+x,tmpg->pp.y1+y,z,
|
||||
tmpg->pp.x2+x,tmpg->pp.y2+y,z);
|
||||
break;
|
||||
case SPT_PLANAR_SYMMETRY:
|
||||
if (DCSymmetry3Set(dc,tempg->pp.x1+x,tempg->pp.y1+y,z,
|
||||
tempg->pp.x2+x,tempg->pp.y2+y,z,
|
||||
tempg->pp.x2+x,tempg->pp.y2+y,z+1))
|
||||
if (DCSymmetry3Set(dc,tmpg->pp.x1+x,tmpg->pp.y1+y,z,
|
||||
tmpg->pp.x2+x,tmpg->pp.y2+y,z,
|
||||
tmpg->pp.x2+x,tmpg->pp.y2+y,z+1))
|
||||
dc->flags|=DCF_SYMMETRY;
|
||||
else
|
||||
dc->flags&=~DCF_SYMMETRY;
|
||||
break;
|
||||
case SPT_BITMAP:
|
||||
img=CAlloc(sizeof(CDC));
|
||||
img->width=tempg->pwhu.width;
|
||||
img->width_internal=(tempg->pwhu.width+7)&~7;
|
||||
img->height=tempg->pwhu.height;
|
||||
img->body=&tempg->pwhu.u;
|
||||
img->width=tmpg->pwhu.width;
|
||||
img->width_internal=(tmpg->pwhu.width+7)&~7;
|
||||
img->height=tmpg->pwhu.height;
|
||||
img->body=&tmpg->pwhu.u;
|
||||
img->dc_signature=DCS_SIGNATURE_VAL;
|
||||
GrBlot3(dc,tempg->pwhu.x1+x,tempg->pwhu.y1+y,z,img);
|
||||
GrBlot3(dc,tmpg->pwhu.x1+x,tmpg->pwhu.y1+y,z,img);
|
||||
Free(img);
|
||||
break;
|
||||
case SPT_RECT:
|
||||
GrRect3(dc,tempg->pp.x1+x,tempg->pp.y1+y,z,
|
||||
tempg->pp.x2-tempg->pp.x1,tempg->pp.y2-tempg->pp.y1);
|
||||
GrRect3(dc,tmpg->pp.x1+x,tmpg->pp.y1+y,z,
|
||||
tmpg->pp.x2-tmpg->pp.x1,tmpg->pp.y2-tmpg->pp.y1);
|
||||
break;
|
||||
case SPT_ROTATED_RECT:
|
||||
x1=tempg->ppa.x1+x;
|
||||
y1=tempg->ppa.y1+y;
|
||||
x1=tmpg->ppa.x1+x;
|
||||
y1=tmpg->ppa.y1+y;
|
||||
z1=z;
|
||||
Mat4x4MulXYZ(dc->r,&x1,&y1,&z1);
|
||||
old_r=dc->r;
|
||||
dc->flags|=DCF_TRANSFORMATION;
|
||||
r2=Mat4x4IdentNew;
|
||||
Mat4x4RotZ(r2,-tempg->ppa.angle);
|
||||
Mat4x4RotZ(r2,-tmpg->ppa.angle);
|
||||
Mat4x4TranslationEqu(r2,x1,y1,z1);
|
||||
DCMat4x4Set(dc,Mat4x4MulMat4x4New(old_r,r2));
|
||||
GrRect3(dc,0,0,0,
|
||||
tempg->ppa.x2-tempg->ppa.x1,tempg->ppa.y2-tempg->ppa.y1);
|
||||
tmpg->ppa.x2-tmpg->ppa.x1,tmpg->ppa.y2-tmpg->ppa.y1);
|
||||
Free(dc->r);
|
||||
Free(r2);
|
||||
DCMat4x4Set(dc,old_r);
|
||||
dc->flags=dc->flags&~DCF_TRANSFORMATION|old_flags;
|
||||
break;
|
||||
case SPT_CIRCLE:
|
||||
GrCircle3(dc,tempg->pr.x1+x,tempg->pr.y1+y,z,tempg->pr.radius);
|
||||
GrCircle3(dc,tmpg->pr.x1+x,tmpg->pr.y1+y,z,tmpg->pr.radius);
|
||||
break;
|
||||
case SPT_ELLIPSE:
|
||||
GrEllipse3(dc,tempg->pwha.x1+x,tempg->pwha.y1+y,z,tempg->pwha.width,
|
||||
tempg->pwha.height,tempg->pwha.angle);
|
||||
GrEllipse3(dc,tmpg->pwha.x1+x,tmpg->pwha.y1+y,z,tmpg->pwha.width,
|
||||
tmpg->pwha.height,tmpg->pwha.angle);
|
||||
break;
|
||||
case SPT_POLYGON:
|
||||
GrRegPoly3(dc,tempg->pwhas.x1+x,tempg->pwhas.y1+y,z,tempg->pwhas.width,
|
||||
tempg->pwhas.height,tempg->pwhas.sides,tempg->pwhas.angle);
|
||||
GrRegPoly3(dc,tmpg->pwhas.x1+x,tmpg->pwhas.y1+y,z,tmpg->pwhas.width,
|
||||
tmpg->pwhas.height,tmpg->pwhas.sides,tmpg->pwhas.angle);
|
||||
break;
|
||||
case SPT_POLYLINE:
|
||||
ptr=&tempg->nu.u;
|
||||
ptr=&tmpg->nu.u;
|
||||
x1=ptr[0];
|
||||
y1=ptr[1];
|
||||
for (i=1;i<tempg->nu.num;i++) {
|
||||
for (i=1;i<tmpg->nu.num;i++) {
|
||||
x2=ptr[i<<1];
|
||||
y2=ptr[i<<1+1];
|
||||
GrLine3(dc,x1+x,y1+y,z,x2+x,y2+y,z);
|
||||
@@ -160,10 +160,10 @@ public U0 Sprite3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,
|
||||
}
|
||||
break;
|
||||
case SPT_POLYPT:
|
||||
x1=tempg->npu.x;
|
||||
y1=tempg->npu.y;
|
||||
ptr=&tempg->npu.u;
|
||||
k=tempg->npu.num*3;
|
||||
x1=tmpg->npu.x;
|
||||
y1=tmpg->npu.y;
|
||||
ptr=&tmpg->npu.u;
|
||||
k=tmpg->npu.num*3;
|
||||
GrPlot3(dc,x1+x,y1+y,z);
|
||||
for (i=0;i<k;i+=3) {
|
||||
j=BFieldExtU32(ptr,i,3);
|
||||
@@ -173,73 +173,73 @@ public U0 Sprite3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,
|
||||
}
|
||||
break;
|
||||
start:
|
||||
p2=p=MAlloc(tempg->nu.num*sizeof(CD3I32));
|
||||
MemCpy(p,&tempg->nu.u,tempg->nu.num*sizeof(CD3I32));
|
||||
for (i=0;i<tempg->nu.num;i++,p2++) {
|
||||
p2=p=MAlloc(tmpg->nu.num*sizeof(CD3I32));
|
||||
MemCpy(p,&tmpg->nu.u,tmpg->nu.num*sizeof(CD3I32));
|
||||
for (i=0;i<tmpg->nu.num;i++,p2++) {
|
||||
p2->x+=x;
|
||||
p2->y+=y;
|
||||
p2->z+=z;
|
||||
}
|
||||
case SPT_BSPLINE2:
|
||||
Gr2BSpline3(dc,p,tempg->nu.num,FALSE);
|
||||
Gr2BSpline3(dc,p,tmpg->nu.num,FALSE);
|
||||
break;
|
||||
case SPT_BSPLINE3:
|
||||
Gr3BSpline3(dc,p,tempg->nu.num,FALSE);
|
||||
Gr3BSpline3(dc,p,tmpg->nu.num,FALSE);
|
||||
break;
|
||||
case SPT_BSPLINE2_CLOSED:
|
||||
Gr2BSpline3(dc,p,tempg->nu.num,TRUE);
|
||||
Gr2BSpline3(dc,p,tmpg->nu.num,TRUE);
|
||||
break;
|
||||
case SPT_BSPLINE3_CLOSED:
|
||||
Gr3BSpline3(dc,p,tempg->nu.num,TRUE);
|
||||
Gr3BSpline3(dc,p,tmpg->nu.num,TRUE);
|
||||
break;
|
||||
end:
|
||||
Free(p);
|
||||
break;
|
||||
case SPT_MESH:
|
||||
p2=p=MAlloc(tempg->mu.vertex_cnt*sizeof(CD3I32));
|
||||
MemCpy(p,&tempg->mu.u,tempg->mu.vertex_cnt*sizeof(CD3I32));
|
||||
for (i=0;i<tempg->mu.vertex_cnt;i++,p2++) {
|
||||
p2=p=MAlloc(tmpg->mu.vertex_cnt*sizeof(CD3I32));
|
||||
MemCpy(p,&tmpg->mu.u,tmpg->mu.vertex_cnt*sizeof(CD3I32));
|
||||
for (i=0;i<tmpg->mu.vertex_cnt;i++,p2++) {
|
||||
p2->x+=x;
|
||||
p2->y+=y;
|
||||
p2->z+=z;
|
||||
}
|
||||
Gr3Mesh(dc,tempg->mu.vertex_cnt,p,tempg->mu.tri_cnt,
|
||||
(&tempg->mu.u)(U8 *)+sizeof(CD3I32)*tempg->mu.vertex_cnt);
|
||||
Gr3Mesh(dc,tmpg->mu.vertex_cnt,p,tmpg->mu.tri_cnt,
|
||||
(&tmpg->mu.u)(U8 *)+sizeof(CD3I32)*tmpg->mu.vertex_cnt);
|
||||
Free(p);
|
||||
break;
|
||||
case SPT_SHIFTABLE_MESH:
|
||||
if (dc->flags&DCF_TRANSFORMATION) {
|
||||
dc->x+=tempg->pmu.x;
|
||||
dc->y+=tempg->pmu.y;
|
||||
dc->z+=tempg->pmu.z;
|
||||
dc->x+=tmpg->pmu.x;
|
||||
dc->y+=tmpg->pmu.y;
|
||||
dc->z+=tmpg->pmu.z;
|
||||
x1=x;
|
||||
y1=y;
|
||||
z1=z;
|
||||
} else {
|
||||
x1=tempg->pmu.x+x;
|
||||
y1=tempg->pmu.y+y;
|
||||
z1=tempg->pmu.z+z;
|
||||
x1=tmpg->pmu.x+x;
|
||||
y1=tmpg->pmu.y+y;
|
||||
z1=tmpg->pmu.z+z;
|
||||
}
|
||||
p2=p=MAlloc(tempg->pmu.vertex_cnt*sizeof(CD3I32));
|
||||
MemCpy(p,&tempg->pmu.u,tempg->pmu.vertex_cnt*sizeof(CD3I32));
|
||||
for (i=0;i<tempg->pmu.vertex_cnt;i++,p2++) {
|
||||
p2=p=MAlloc(tmpg->pmu.vertex_cnt*sizeof(CD3I32));
|
||||
MemCpy(p,&tmpg->pmu.u,tmpg->pmu.vertex_cnt*sizeof(CD3I32));
|
||||
for (i=0;i<tmpg->pmu.vertex_cnt;i++,p2++) {
|
||||
p2->x+=x1;
|
||||
p2->y+=y1;
|
||||
p2->z+=z1;
|
||||
}
|
||||
Gr3Mesh(dc,tempg->pmu.vertex_cnt,p,tempg->pmu.tri_cnt,
|
||||
(&tempg->pmu.u)(U8 *)+sizeof(CD3I32)*tempg->pmu.vertex_cnt);
|
||||
Gr3Mesh(dc,tmpg->pmu.vertex_cnt,p,tmpg->pmu.tri_cnt,
|
||||
(&tmpg->pmu.u)(U8 *)+sizeof(CD3I32)*tmpg->pmu.vertex_cnt);
|
||||
Free(p);
|
||||
if (dc->flags&DCF_TRANSFORMATION) {
|
||||
dc->x-=tempg->pmu.x;
|
||||
dc->y-=tempg->pmu.y;
|
||||
dc->z-=tempg->pmu.z;
|
||||
dc->x-=tmpg->pmu.x;
|
||||
dc->y-=tmpg->pmu.y;
|
||||
dc->z-=tmpg->pmu.z;
|
||||
}
|
||||
break;
|
||||
}
|
||||
cur_sprite_elem_num++;
|
||||
if (just_one_elem) break;
|
||||
tempg(U8 *)+=SpriteElemSize(tempg);
|
||||
tmpg(U8 *)+=SpriteElemSize(tmpg);
|
||||
}
|
||||
MemCpy(&dc->sym,&old_sym,sizeof(CGrSym));
|
||||
dc->color=old_color;
|
||||
@@ -334,8 +334,8 @@ public U8 *SpriteInterpolate(F64 t,U8 *elems0,U8 *elems1)
|
||||
I32 *ptr0,*ptr1,*ptrr;
|
||||
CD3I32 *p0,*p1,*pr;
|
||||
U8 *res;
|
||||
CSprite *tempg0=elems0-offset(CSprite.start),
|
||||
*tempg1=elems1-offset(CSprite.start),*tempgr;
|
||||
CSprite *tmpg0=elems0-offset(CSprite.start),
|
||||
*tmpg1=elems1-offset(CSprite.start),*tmpgr;
|
||||
if (t<0.5) {
|
||||
i=SpriteSize(elems0),
|
||||
res=MAlloc(i);
|
||||
@@ -345,19 +345,19 @@ public U8 *SpriteInterpolate(F64 t,U8 *elems0,U8 *elems1)
|
||||
res=MAlloc(i);
|
||||
MemCpy(res,elems1,i);
|
||||
}
|
||||
tempgr=res-offset(CSprite.start);
|
||||
while (tempg0->type) {
|
||||
if (tempg0->type!=tempg1->type)
|
||||
tmpgr=res-offset(CSprite.start);
|
||||
while (tmpg0->type) {
|
||||
if (tmpg0->type!=tmpg1->type)
|
||||
throw('Graphics');
|
||||
switch (tempg0->type) {
|
||||
switch (tmpg0->type) {
|
||||
case SPT_ROTATED_RECT:
|
||||
tempgr->ppa.angle=(tempg0->ppa.angle*t0+tempg1->ppa.angle*t1)/GR_SCALE;
|
||||
tmpgr->ppa.angle=(tmpg0->ppa.angle*t0+tmpg1->ppa.angle*t1)/GR_SCALE;
|
||||
case SPT_RECT:
|
||||
case SPT_LINE:
|
||||
case SPT_ARROW:
|
||||
case SPT_PLANAR_SYMMETRY:
|
||||
tempgr->pp.x2=(tempg0->pp.x2*t0+tempg1->pp.x2*t1)>>32;
|
||||
tempgr->pp.y2=(tempg0->pp.y2*t0+tempg1->pp.y2*t1)>>32;
|
||||
tmpgr->pp.x2=(tmpg0->pp.x2*t0+tmpg1->pp.x2*t1)>>32;
|
||||
tmpgr->pp.y2=(tmpg0->pp.y2*t0+tmpg1->pp.y2*t1)>>32;
|
||||
case SPT_TEXT:
|
||||
case SPT_TEXT_BOX:
|
||||
case SPT_TEXT_DIAMOND:
|
||||
@@ -365,75 +365,75 @@ public U8 *SpriteInterpolate(F64 t,U8 *elems0,U8 *elems1)
|
||||
case SPT_FLOOD_FILL:
|
||||
case SPT_FLOOD_FILL_NOT:
|
||||
case SPT_SHIFT:
|
||||
tempgr->p.x1=(tempg0->p.x1*t0+tempg1->p.x1*t1)>>32;
|
||||
tempgr->p.y1=(tempg0->p.y1*t0+tempg1->p.y1*t1)>>32;
|
||||
tmpgr->p.x1=(tmpg0->p.x1*t0+tmpg1->p.x1*t1)>>32;
|
||||
tmpgr->p.y1=(tmpg0->p.y1*t0+tmpg1->p.y1*t1)>>32;
|
||||
break;
|
||||
case SPT_CIRCLE:
|
||||
tempgr->pr.radius=(tempg0->pr.radius*t0+tempg1->pr.radius*t1)>>32;
|
||||
tempgr->pr.x1=(tempg0->pr.x1*t0+tempg1->pr.x1*t1)>>32;
|
||||
tempgr->pr.y1=(tempg0->pr.y1*t0+tempg1->pr.y1*t1)>>32;
|
||||
tmpgr->pr.radius=(tmpg0->pr.radius*t0+tmpg1->pr.radius*t1)>>32;
|
||||
tmpgr->pr.x1=(tmpg0->pr.x1*t0+tmpg1->pr.x1*t1)>>32;
|
||||
tmpgr->pr.y1=(tmpg0->pr.y1*t0+tmpg1->pr.y1*t1)>>32;
|
||||
break;
|
||||
case SPT_ELLIPSE:
|
||||
case SPT_POLYGON:
|
||||
tempgr->pwha.x1=(tempg0->pwha.x1*t0+tempg1->pwha.x1*t1)>>32;
|
||||
tempgr->pwha.y1=(tempg0->pwha.y1*t0+tempg1->pwha.y1*t1)>>32;
|
||||
tempgr->pwha.width =(tempg0->pwha.width *t0+tempg1->pwha.width*t1)>>32;
|
||||
tempgr->pwha.height=(tempg0->pwha.height*t0+tempg1->pwha.height*t1)>>32;
|
||||
tmpgr->pwha.x1=(tmpg0->pwha.x1*t0+tmpg1->pwha.x1*t1)>>32;
|
||||
tmpgr->pwha.y1=(tmpg0->pwha.y1*t0+tmpg1->pwha.y1*t1)>>32;
|
||||
tmpgr->pwha.width =(tmpg0->pwha.width *t0+tmpg1->pwha.width*t1)>>32;
|
||||
tmpgr->pwha.height=(tmpg0->pwha.height*t0+tmpg1->pwha.height*t1)>>32;
|
||||
break;
|
||||
case SPT_BITMAP:
|
||||
tempgr->pwhu.x1=(tempg0->pwhu.x1*t0+tempg1->pwhu.x1*t1)>>32;
|
||||
tempgr->pwhu.y1=(tempg0->pwhu.y1*t0+tempg1->pwhu.y1*t1)>>32;
|
||||
tmpgr->pwhu.x1=(tmpg0->pwhu.x1*t0+tmpg1->pwhu.x1*t1)>>32;
|
||||
tmpgr->pwhu.y1=(tmpg0->pwhu.y1*t0+tmpg1->pwhu.y1*t1)>>32;
|
||||
break;
|
||||
case SPT_POLYLINE:
|
||||
ptr0=&tempg0->nu.u;
|
||||
ptr1=&tempg1->nu.u;
|
||||
ptrr=&tempgr->nu.u;
|
||||
for (i=0;i<tempg0->nu.num;i++) {
|
||||
ptr0=&tmpg0->nu.u;
|
||||
ptr1=&tmpg1->nu.u;
|
||||
ptrr=&tmpgr->nu.u;
|
||||
for (i=0;i<tmpg0->nu.num;i++) {
|
||||
ptrr[i<<1]=(ptr0[i<<1]*t0+ptr1[i<<1]*t1)>>32;
|
||||
ptrr[i<<1+1]=(ptr0[i<<1+1]*t0+ptr1[i<<1+1]*t1)>>32;
|
||||
}
|
||||
break;
|
||||
case SPT_POLYPT:
|
||||
tempgr->npu.x=(tempg0->npu.x*t0+tempg1->npu.x*t1)>>32;
|
||||
tempgr->npu.y=(tempg0->npu.y*t0+tempg1->npu.y*t1)>>32;
|
||||
tmpgr->npu.x=(tmpg0->npu.x*t0+tmpg1->npu.x*t1)>>32;
|
||||
tmpgr->npu.y=(tmpg0->npu.y*t0+tmpg1->npu.y*t1)>>32;
|
||||
break;
|
||||
case SPT_BSPLINE2:
|
||||
case SPT_BSPLINE3:
|
||||
case SPT_BSPLINE2_CLOSED:
|
||||
case SPT_BSPLINE3_CLOSED:
|
||||
p0=&tempg0->nu.u;
|
||||
p1=&tempg1->nu.u;
|
||||
pr=&tempgr->nu.u;
|
||||
for (i=0;i<tempg0->nu.num;i++) {
|
||||
p0=&tmpg0->nu.u;
|
||||
p1=&tmpg1->nu.u;
|
||||
pr=&tmpgr->nu.u;
|
||||
for (i=0;i<tmpg0->nu.num;i++) {
|
||||
pr[i].x=(p0[i].x*t0+p1[i].x*t1)>>32;
|
||||
pr[i].y=(p0[i].y*t0+p1[i].y*t1)>>32;
|
||||
pr[i].z=(p0[i].z*t0+p1[i].z*t1)>>32;
|
||||
}
|
||||
break;
|
||||
case SPT_MESH:
|
||||
p0=&tempg0->mu.u;
|
||||
p1=&tempg1->mu.u;
|
||||
pr=&tempgr->mu.u;
|
||||
for (i=0;i<tempg0->mu.vertex_cnt;i++) {
|
||||
p0=&tmpg0->mu.u;
|
||||
p1=&tmpg1->mu.u;
|
||||
pr=&tmpgr->mu.u;
|
||||
for (i=0;i<tmpg0->mu.vertex_cnt;i++) {
|
||||
pr[i].x=(p0[i].x*t0+p1[i].x*t1)>>32;
|
||||
pr[i].y=(p0[i].y*t0+p1[i].y*t1)>>32;
|
||||
pr[i].z=(p0[i].z*t0+p1[i].z*t1)>>32;
|
||||
}
|
||||
break;
|
||||
case SPT_SHIFTABLE_MESH:
|
||||
p0=&tempg0->pmu.u;
|
||||
p1=&tempg1->pmu.u;
|
||||
pr=&tempgr->pmu.u;
|
||||
for (i=0;i<tempg0->pmu.vertex_cnt;i++) {
|
||||
p0=&tmpg0->pmu.u;
|
||||
p1=&tmpg1->pmu.u;
|
||||
pr=&tmpgr->pmu.u;
|
||||
for (i=0;i<tmpg0->pmu.vertex_cnt;i++) {
|
||||
pr[i].x=(p0[i].x*t0+p1[i].x*t1)>>32;
|
||||
pr[i].y=(p0[i].y*t0+p1[i].y*t1)>>32;
|
||||
pr[i].z=(p0[i].z*t0+p1[i].z*t1)>>32;
|
||||
}
|
||||
break;
|
||||
}
|
||||
tempg0(U8 *)+=SpriteElemSize(tempg0);
|
||||
tempg1(U8 *)+=SpriteElemSize(tempg1);
|
||||
tempgr(U8 *)+=SpriteElemSize(tempgr);
|
||||
tmpg0(U8 *)+=SpriteElemSize(tmpg0);
|
||||
tmpg1(U8 *)+=SpriteElemSize(tmpg1);
|
||||
tmpgr(U8 *)+=SpriteElemSize(tmpgr);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -446,26 +446,26 @@ public CDocEntry *DocSprite(CDoc *doc=NULL,U8 *elems,U8 *fmt=NULL)
|
||||
U8 *st;
|
||||
Bool unlock;
|
||||
CDocEntry *doc_e;
|
||||
CDocBin *tempb;
|
||||
CDocBin *tmpb;
|
||||
if (!doc && !(doc=DocPut)) return NULL;
|
||||
unlock=DocLock(doc);
|
||||
size=SpriteSize(elems);
|
||||
tempb=CAlloc(sizeof(CDocBin),doc->mem_task);
|
||||
tempb->size=size;
|
||||
tempb->data=MAlloc(size,doc->mem_task);
|
||||
MemCpy(tempb->data,elems,size);
|
||||
tempb->num=doc->cur_bin_num;
|
||||
tempb->use_cnt=1;
|
||||
QueIns(tempb,doc->bin_head.last);
|
||||
tmpb=CAlloc(sizeof(CDocBin),doc->mem_task);
|
||||
tmpb->size=size;
|
||||
tmpb->data=MAlloc(size,doc->mem_task);
|
||||
MemCpy(tmpb->data,elems,size);
|
||||
tmpb->num=doc->cur_bin_num;
|
||||
tmpb->use_cnt=1;
|
||||
QueIns(tmpb,doc->bin_head.last);
|
||||
if (fmt)
|
||||
st=MStrPrint(fmt,doc->cur_bin_num++);
|
||||
else
|
||||
st=MStrPrint("$$SP,\"\",BI=%d$$",doc->cur_bin_num++);
|
||||
doc_e=DocPrint(doc,"%s",st);
|
||||
Free(st);
|
||||
doc_e->bin_data=tempb;
|
||||
doc_e->bin_data=tmpb;
|
||||
if (doc_e && doc_e->de_flags&DOCEF_TAG && doc_e->tag && *doc_e->tag)
|
||||
tempb->tag=StrNew(doc_e->tag,doc->mem_task);
|
||||
tmpb->tag=StrNew(doc_e->tag,doc->mem_task);
|
||||
if (unlock)
|
||||
DocUnlock(doc);
|
||||
return doc_e;
|
||||
|
||||
+4
-4
@@ -10,14 +10,14 @@ Cd(__DIR__);;
|
||||
#include "GrDC"
|
||||
#include "GrInitB"
|
||||
#include "GrMath"
|
||||
#include "GrScreen"
|
||||
#include "GrScrn"
|
||||
#include "GrBitMap"
|
||||
#include "GrPrimatives"
|
||||
#include "GrComposites"
|
||||
|
||||
#define GE_ABORT (-1)
|
||||
#define GE_EXIT 0
|
||||
#define GE_CONT 1
|
||||
#define SPE_ABORT (-1)
|
||||
#define SPE_EXIT 0
|
||||
#define SPE_CONT 1
|
||||
#include "SpriteNew"
|
||||
#include "GrSpritePlot"
|
||||
#include "SpriteMesh"
|
||||
|
||||
+144
-144
@@ -1,33 +1,33 @@
|
||||
#help_index "Graphics/Sprite;Sprites"
|
||||
|
||||
#define GBM_EXIT 0
|
||||
#define GBM_MAIN_MENU 1
|
||||
#define GBM_COLOR 2
|
||||
#define GBM_DITHER_COLOR 3
|
||||
#define GBM_WIDTH 4
|
||||
#define GBM_PT 5
|
||||
#define GBM_LINE 6
|
||||
#define GBM_ARROW 7
|
||||
#define GBM_RECT 8
|
||||
#define GBM_CIRCLE 9
|
||||
#define GBM_TEXT 10
|
||||
#define GBM_TEXT_BOX 11
|
||||
#define GBM_TEXT_DIAMOND 12
|
||||
#define GBM_FLOOD_FILL 13
|
||||
#define GBM_FLOOD_FILL_NOT 14
|
||||
#define GBM_POLYLINE 15
|
||||
#define GBM_POLYPT 16
|
||||
#define GBM_COPY 17
|
||||
#define GBM_DELETE 18
|
||||
#define GBM_PASTE 19
|
||||
#define GBM_PASTE_TRANSPARENT 20
|
||||
#define GBM_FIND_AND_REPLACE 21
|
||||
#define GBM_TRIM_TO_EXTENTS 22
|
||||
#define GBM_ADD_OUTLINE 23
|
||||
#define GBM_ETCH 24
|
||||
#define GBM_UNDO 25
|
||||
#define GBM_SAVE_BMP 26
|
||||
#define GBM_SAVE_GRA 27
|
||||
#define SPBM_EXIT 0
|
||||
#define SPBM_MAIN_MENU 1
|
||||
#define SPBM_COLOR 2
|
||||
#define SPBM_DITHER_COLOR 3
|
||||
#define SPBM_WIDTH 4
|
||||
#define SPBM_PT 5
|
||||
#define SPBM_LINE 6
|
||||
#define SPBM_ARROW 7
|
||||
#define SPBM_RECT 8
|
||||
#define SPBM_CIRCLE 9
|
||||
#define SPBM_TEXT 10
|
||||
#define SPBM_TEXT_BOX 11
|
||||
#define SPBM_TEXT_DIAMOND 12
|
||||
#define SPBM_FLOOD_FILL 13
|
||||
#define SPBM_FLOOD_FILL_NOT 14
|
||||
#define SPBM_POLYLINE 15
|
||||
#define SPBM_POLYPT 16
|
||||
#define SPBM_COPY 17
|
||||
#define SPBM_DELETE 18
|
||||
#define SPBM_PASTE 19
|
||||
#define SPBM_PASTE_TRANSPARENT 20
|
||||
#define SPBM_FIND_AND_REPLACE 21
|
||||
#define SPBM_TRIM_TO_EXTENTS 22
|
||||
#define SPBM_ADD_OUTLINE 23
|
||||
#define SPBM_ETCH 24
|
||||
#define SPBM_UNDO 25
|
||||
#define SPBM_SAVE_BMP 26
|
||||
#define SPBM_SAVE_GRA 27
|
||||
|
||||
U0 GrInit4()
|
||||
{
|
||||
@@ -36,7 +36,7 @@ U0 GrInit4()
|
||||
"Rect\0Circle\0Text\0Text Box\0Text Diamond\0Flood Fill\0"
|
||||
"Flood Fill Not Color\0PolyLine\0PolyPoint\0Copy\0Delete\0Paste\0"
|
||||
"Paste Transparent\0Find and Replace\0Trim to Extents\0Add Outline\0"
|
||||
"Etch\0Undo\0Save BMP\0Save GRA\0");
|
||||
"Etch\0Undo\0Save BMP\0Save GR\0");
|
||||
}
|
||||
GrInit4;
|
||||
|
||||
@@ -56,34 +56,34 @@ I64 PopUpSpriteBitMap(CColorROPU32 color,I64 width)
|
||||
}
|
||||
DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Sprite BitMap Menu\"$$\n"
|
||||
"$$LK+PU+CX,\"Click for Help\",A=\"FI:::/Doc/SpriteBitMap.DD.Z\"$$\n"
|
||||
"\n$$LTBLUE$$$$MU-UL,\"Color %s\",LE=GBM_COLOR$$\n"
|
||||
"$$MU-UL,\"Dither Color %s\",LE=GBM_DITHER_COLOR$$\n"
|
||||
"$$MU-UL,\"Width %d\",LE=GBM_WIDTH$$\n"
|
||||
"$$MU-UL,\"Find & Replace Color\",LE=GBM_FIND_AND_REPLACE$$\n"
|
||||
"$$MU-UL,\"Trim to Extents\",LE=GBM_TRIM_TO_EXTENTS$$\n"
|
||||
"$$MU-UL,\"Add Outline\",LE=GBM_ADD_OUTLINE$$\n"
|
||||
"$$MU-UL,\"Etch\",LE=GBM_ETCH$$\n"
|
||||
"\n$$MU-UL,\"Point\",LE=GBM_PT$$\n"
|
||||
"$$MU-UL,\"Line\",LE=GBM_LINE$$\n"
|
||||
"$$MU-UL,\"Arrow\",LE=GBM_ARROW$$\n"
|
||||
"$$MU-UL,\"Rect\",LE=GBM_RECT$$\n"
|
||||
"$$MU-UL,\"Circle\",LE=GBM_CIRCLE$$\n"
|
||||
"$$MU-UL,\"Text\",LE=GBM_TEXT$$\n"
|
||||
"$$MU-UL,\"Text Box\",LE=GBM_TEXT_BOX$$\n"
|
||||
"$$MU-UL,\"Text Diamond\",LE=GBM_TEXT_DIAMOND$$\n"
|
||||
"$$MU-UL,\"Flood Fill\",LE=GBM_FLOOD_FILL$$\n"
|
||||
"$$MU-UL,\"Flood Fill Not Color\",LE=GBM_FLOOD_FILL_NOT$$\n"
|
||||
"$$MU-UL,\"PolyLine\",LE=GBM_POLYLINE$$\n"
|
||||
"$$MU-UL,\"PolyPoint\",LE=GBM_POLYPT$$\n"
|
||||
"\n$$MU-UL,\"Copy to Clipboard\",LE=GBM_COPY$$\n"
|
||||
"$$MU-UL,\"Delete to Clipboard\",LE=GBM_DELETE$$\n"
|
||||
"$$MU-UL,\"Paste Clipboard\",LE=GBM_PASTE$$\n"
|
||||
"$$MU-UL,\"Paste Transparent Clipboard\",LE=GBM_PASTE_TRANSPARENT$$\n"
|
||||
"\n$$MU-UL,\"Save BMP File\",LE=GBM_SAVE_BMP$$\n"
|
||||
"$$MU-UL,\"Save GRA File\",LE=GBM_SAVE_GRA$$\n"
|
||||
"\n$$MU-UL,\"Undo\",LE=GBM_UNDO$$\n"
|
||||
"\n$$PURPLE$$$$MU-UL,\"+] Sprite Main Menu\",LE=GBM_MAIN_MENU$$$$LTBLUE$$\n"
|
||||
"$$MU-UL,\"Exit Sprite\",LE=GBM_EXIT$$\n"
|
||||
"\n$$LTBLUE$$$$MU-UL,\"Color %s\",LE=SPBM_COLOR$$\n"
|
||||
"$$MU-UL,\"Dither Color %s\",LE=SPBM_DITHER_COLOR$$\n"
|
||||
"$$MU-UL,\"Width %d\",LE=SPBM_WIDTH$$\n"
|
||||
"$$MU-UL,\"Find & Replace Color\",LE=SPBM_FIND_AND_REPLACE$$\n"
|
||||
"$$MU-UL,\"Trim to Extents\",LE=SPBM_TRIM_TO_EXTENTS$$\n"
|
||||
"$$MU-UL,\"Add Outline\",LE=SPBM_ADD_OUTLINE$$\n"
|
||||
"$$MU-UL,\"Etch\",LE=SPBM_ETCH$$\n"
|
||||
"\n$$MU-UL,\"Point\",LE=SPBM_PT$$\n"
|
||||
"$$MU-UL,\"Line\",LE=SPBM_LINE$$\n"
|
||||
"$$MU-UL,\"Arrow\",LE=SPBM_ARROW$$\n"
|
||||
"$$MU-UL,\"Rect\",LE=SPBM_RECT$$\n"
|
||||
"$$MU-UL,\"Circle\",LE=SPBM_CIRCLE$$\n"
|
||||
"$$MU-UL,\"Text\",LE=SPBM_TEXT$$\n"
|
||||
"$$MU-UL,\"Text Box\",LE=SPBM_TEXT_BOX$$\n"
|
||||
"$$MU-UL,\"Text Diamond\",LE=SPBM_TEXT_DIAMOND$$\n"
|
||||
"$$MU-UL,\"Flood Fill\",LE=SPBM_FLOOD_FILL$$\n"
|
||||
"$$MU-UL,\"Flood Fill Not Color\",LE=SPBM_FLOOD_FILL_NOT$$\n"
|
||||
"$$MU-UL,\"PolyLine\",LE=SPBM_POLYLINE$$\n"
|
||||
"$$MU-UL,\"PolyPoint\",LE=SPBM_POLYPT$$\n"
|
||||
"\n$$MU-UL,\"Copy to Clipboard\",LE=SPBM_COPY$$\n"
|
||||
"$$MU-UL,\"Delete to Clipboard\",LE=SPBM_DELETE$$\n"
|
||||
"$$MU-UL,\"Paste Clipboard\",LE=SPBM_PASTE$$\n"
|
||||
"$$MU-UL,\"Paste Transparent Clipboard\",LE=SPBM_PASTE_TRANSPARENT$$\n"
|
||||
"\n$$MU-UL,\"Save BMP File\",LE=SPBM_SAVE_BMP$$\n"
|
||||
"$$MU-UL,\"Save GR File\",LE=SPBM_SAVE_GRA$$\n"
|
||||
"\n$$MU-UL,\"Undo\",LE=SPBM_UNDO$$\n"
|
||||
"\n$$PURPLE$$$$MU-UL,\"+] Sprite Main Menu\",LE=SPBM_MAIN_MENU$$$$LTBLUE$$\n"
|
||||
"$$MU-UL,\"Exit Sprite\",LE=SPBM_EXIT$$\n"
|
||||
"$$MU-UL,\"Abort Sprite\",LE=DOCM_CANCEL$$\n"
|
||||
"\nRight-Click to get back to this menu.",st1,st2,width);
|
||||
i=PopUpMenu(doc);
|
||||
@@ -201,7 +201,7 @@ U0 GrBitMapEdEtch(CDC *img,I64 width,CColorROPU32 bkcolor)
|
||||
I64 SpriteBitMapEd(CDoc *,CDocEntry *doc_e,CDC *dc,I64 *_xx1,I64 *_yy1,
|
||||
I64 *_xx2,I64 *_yy2,CDC **_img,CColorROPU32 bkcolor)
|
||||
{
|
||||
I64 i,j,mode=GBM_LINE,color=BLACK,width=1,msg_code,a1,a2,x1,y1,x11,y11,
|
||||
I64 i,j,mode=SPBM_LINE,color=BLACK,width=1,msg_code,a1,a2,x1,y1,x11,y11,
|
||||
x22,y22,res,xx1=*_xx1,yy1=*_yy1,xx2=*_xx2,yy2=*_yy2,
|
||||
old_de_flags=doc_e->de_flags;
|
||||
Bool down=FALSE;
|
||||
@@ -228,13 +228,13 @@ I64 SpriteBitMapEd(CDoc *,CDocEntry *doc_e,CDC *dc,I64 *_xx1,I64 *_yy1,
|
||||
case MSG_KEY_DOWN:
|
||||
switch (a1) {
|
||||
case CH_SHIFT_ESC:
|
||||
res=GE_ABORT;
|
||||
res=SPE_ABORT;
|
||||
goto bm_key_up_done;
|
||||
case CH_ESC:
|
||||
res=GE_CONT;
|
||||
res=SPE_CONT;
|
||||
goto bm_key_up_done;
|
||||
case 'c': //eye-dropper
|
||||
dc2=DCScreenCapture(FALSE);
|
||||
dc2=DCScrnCapture(FALSE);
|
||||
color=GrPeek(dc2,ip.pos.x,ip.pos.y)^15;//Mouse cursor is XORed.
|
||||
DCDel(dc2);
|
||||
break;
|
||||
@@ -253,19 +253,19 @@ bm_menu:
|
||||
StrCpy(Fs->task_title,DefineSub(i,"ST_SPRITE_BITMAP_MENU"));
|
||||
switch (i) {
|
||||
case DOCM_CANCEL:
|
||||
res=GE_ABORT;
|
||||
res=SPE_ABORT;
|
||||
goto bm_done;
|
||||
case GBM_EXIT:
|
||||
res=GE_EXIT;
|
||||
case SPBM_EXIT:
|
||||
res=SPE_EXIT;
|
||||
goto bm_done;
|
||||
case GBM_MAIN_MENU:
|
||||
res=GE_CONT;
|
||||
case SPBM_MAIN_MENU:
|
||||
res=SPE_CONT;
|
||||
goto bm_done;
|
||||
case GBM_COLOR:
|
||||
case SPBM_COLOR:
|
||||
i=PopUpColor(,,FALSE);
|
||||
if (i>=0) color=i;
|
||||
goto bm_menu;
|
||||
case GBM_FIND_AND_REPLACE:
|
||||
case SPBM_FIND_AND_REPLACE:
|
||||
i=PopUpColor("Find Color\n",,FALSE);
|
||||
if (i>=0) {
|
||||
j=PopUpColor("Replace Color\n",,FALSE);
|
||||
@@ -275,43 +275,43 @@ bm_menu:
|
||||
}
|
||||
}
|
||||
goto bm_menu;
|
||||
case GBM_TRIM_TO_EXTENTS:
|
||||
case SPBM_TRIM_TO_EXTENTS:
|
||||
GrBitMapEdTrimToExtents(&img,&xx1,&yy1,&xx2,&yy2,bkcolor);
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
goto bm_menu;
|
||||
case GBM_ADD_OUTLINE:
|
||||
case SPBM_ADD_OUTLINE:
|
||||
i=PopUpRangeI64(1,16,1,"Outline Width\n");
|
||||
if (i>=0) {
|
||||
GrBitMapEdAddOutline(img,i,color,bkcolor);
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
}
|
||||
goto bm_menu;
|
||||
case GBM_ETCH:
|
||||
case SPBM_ETCH:
|
||||
i=PopUpRangeI64(1,16,1,"Etch Width\n");
|
||||
if (i>=0) {
|
||||
GrBitMapEdEtch(img,i,bkcolor);
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
}
|
||||
goto bm_menu;
|
||||
case GBM_SAVE_BMP:
|
||||
case SPBM_SAVE_BMP:
|
||||
*filename.name=0;
|
||||
if (DocForm(&filename) && *filename.name)
|
||||
BMPWrite(filename.name,img);
|
||||
goto bm_menu;
|
||||
case GBM_SAVE_GRA:
|
||||
case SPBM_SAVE_GRA:
|
||||
*filename.name=0;
|
||||
if (DocForm(&filename) && *filename.name)
|
||||
GRAWrite(filename.name,img,DCSF_COMPRESSED|DCSF_PALETTE_GET);
|
||||
GRWrite(filename.name,img,DCSF_COMPRESSED|DCSF_PALETTE_GET);
|
||||
goto bm_menu;
|
||||
case GBM_DITHER_COLOR:
|
||||
case SPBM_DITHER_COLOR:
|
||||
i=PopUpColorDither;
|
||||
if (i>=0) color=i;
|
||||
goto bm_menu;
|
||||
case GBM_WIDTH:
|
||||
case SPBM_WIDTH:
|
||||
i=PopUpRangeI64(1,16,1,"Pen Width\n");
|
||||
if (i>=0) width=i;
|
||||
goto bm_menu;
|
||||
case GBM_UNDO:
|
||||
case SPBM_UNDO:
|
||||
if (undo) {
|
||||
DCFill(img,bkcolor);
|
||||
img->color=ROP_EQU;
|
||||
@@ -320,24 +320,24 @@ bm_menu:
|
||||
undo=NULL;
|
||||
}
|
||||
goto bm_menu;
|
||||
case GBM_PT:
|
||||
case GBM_LINE:
|
||||
case GBM_ARROW:
|
||||
case GBM_RECT:
|
||||
case GBM_CIRCLE:
|
||||
case GBM_FLOOD_FILL:
|
||||
case GBM_FLOOD_FILL_NOT:
|
||||
case GBM_POLYPT:
|
||||
case GBM_POLYLINE:
|
||||
case GBM_COPY:
|
||||
case GBM_DELETE:
|
||||
case GBM_PASTE:
|
||||
case GBM_PASTE_TRANSPARENT:
|
||||
case SPBM_PT:
|
||||
case SPBM_LINE:
|
||||
case SPBM_ARROW:
|
||||
case SPBM_RECT:
|
||||
case SPBM_CIRCLE:
|
||||
case SPBM_FLOOD_FILL:
|
||||
case SPBM_FLOOD_FILL_NOT:
|
||||
case SPBM_POLYPT:
|
||||
case SPBM_POLYLINE:
|
||||
case SPBM_COPY:
|
||||
case SPBM_DELETE:
|
||||
case SPBM_PASTE:
|
||||
case SPBM_PASTE_TRANSPARENT:
|
||||
mode=i;
|
||||
break;
|
||||
case GBM_TEXT:
|
||||
case GBM_TEXT_BOX:
|
||||
case GBM_TEXT_DIAMOND:
|
||||
case SPBM_TEXT:
|
||||
case SPBM_TEXT_BOX:
|
||||
case SPBM_TEXT_DIAMOND:
|
||||
Free(st);
|
||||
st=PopUpGetStr("Enter text and press <ESC>.\n");
|
||||
if (st && *st)
|
||||
@@ -349,13 +349,13 @@ bm_menu:
|
||||
DCDel(undo);
|
||||
undo=DCExt(img,0,0,img->width-1,img->height-1);
|
||||
undo->bkcolor=bkcolor;
|
||||
WinMgrSync(2,TRUE); //Let popup close
|
||||
Refresh(2,TRUE); //Let popup close
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
down=FALSE;
|
||||
break;
|
||||
case MSG_IP_L_DOWN:
|
||||
switch (mode) {
|
||||
case GBM_PT:
|
||||
case SPBM_PT:
|
||||
img->color=color;
|
||||
img->pen_width=width;
|
||||
GrPlot3(img,a1-xx1,a2-yy1,0);
|
||||
@@ -368,31 +368,31 @@ bm_menu:
|
||||
down=TRUE;
|
||||
dc->color=color;
|
||||
dc->pen_width=width;
|
||||
case GBM_LINE:
|
||||
case SPBM_LINE:
|
||||
GrLine3(dc,x1,y1,0,a1,a2,0);
|
||||
break;
|
||||
case GBM_ARROW:
|
||||
case SPBM_ARROW:
|
||||
GrArrow3(dc,x1,y1,0,a1,a2,0);
|
||||
break;
|
||||
case GBM_RECT:
|
||||
case SPBM_RECT:
|
||||
GrRect(dc,x1,y1,1,1);
|
||||
break;
|
||||
case GBM_CIRCLE:
|
||||
case SPBM_CIRCLE:
|
||||
GrCircle3(dc,x1,y1,0,1);
|
||||
break;
|
||||
case GBM_COPY:
|
||||
case GBM_DELETE:
|
||||
case SPBM_COPY:
|
||||
case SPBM_DELETE:
|
||||
dc->color=ROPF_DITHER+WHITE<<16+BLACK;
|
||||
dc->pen_width=1;
|
||||
GrBorder(dc,x1,y1,x1,y1);
|
||||
break;
|
||||
end:
|
||||
break;
|
||||
case GBM_PASTE:
|
||||
case GBM_PASTE_TRANSPARENT:
|
||||
case SPBM_PASTE:
|
||||
case SPBM_PASTE_TRANSPARENT:
|
||||
if (clipboard) {
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
if (mode==GBM_PASTE) {
|
||||
if (mode==SPBM_PASTE) {
|
||||
clipboard->flags|=DCF_NO_TRANSPARENTS;
|
||||
GrBlot(dc,a1,a2,clipboard);
|
||||
clipboard->flags&=~DCF_NO_TRANSPARENTS;
|
||||
@@ -404,32 +404,32 @@ bm_menu:
|
||||
}
|
||||
}
|
||||
break;
|
||||
case GBM_TEXT:
|
||||
case SPBM_TEXT:
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
dc->color=color;
|
||||
GrPrint(dc,a1,a2,"%s",st);
|
||||
break;
|
||||
case GBM_TEXT_BOX:
|
||||
case SPBM_TEXT_BOX:
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
dc->color=color;
|
||||
GrTextBox3(dc,a1,a2,0,st);
|
||||
break;
|
||||
case GBM_TEXT_DIAMOND:
|
||||
case SPBM_TEXT_DIAMOND:
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
dc->color=color;
|
||||
GrTextDiamond3(dc,a1,a2,0,st);
|
||||
break;
|
||||
case GBM_FLOOD_FILL:
|
||||
case SPBM_FLOOD_FILL:
|
||||
img->color=color;
|
||||
GrFloodFill(img,a1-xx1,a2-yy1);
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
break;
|
||||
case GBM_FLOOD_FILL_NOT:
|
||||
case SPBM_FLOOD_FILL_NOT:
|
||||
img->color=color;
|
||||
GrFloodFill(img,a1-xx1,a2-yy1,TRUE);
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
break;
|
||||
case GBM_POLYLINE:
|
||||
case SPBM_POLYLINE:
|
||||
if (!down) {
|
||||
x1=a1; y1=a2;
|
||||
down=TRUE;
|
||||
@@ -438,7 +438,7 @@ bm_menu:
|
||||
GrLine3(dc,x1,y1,0,a1,a2,0);
|
||||
}
|
||||
break;
|
||||
case GBM_POLYPT:
|
||||
case SPBM_POLYPT:
|
||||
x1=a1; y1=a2;
|
||||
down=TRUE;
|
||||
img->color=color;
|
||||
@@ -450,20 +450,20 @@ bm_menu:
|
||||
break;
|
||||
case MSG_IP_MOVE:
|
||||
switch (mode) {
|
||||
case GBM_LINE:
|
||||
case GBM_ARROW:
|
||||
case GBM_POLYLINE:
|
||||
case SPBM_LINE:
|
||||
case SPBM_ARROW:
|
||||
case SPBM_POLYLINE:
|
||||
if (down) {
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
dc->color=color;
|
||||
dc->pen_width=width;
|
||||
if (mode==GBM_ARROW)
|
||||
if (mode==SPBM_ARROW)
|
||||
GrArrow3(dc,x1,y1,0,a1,a2,0);
|
||||
else
|
||||
GrLine3(dc,x1,y1,0,a1,a2,0);
|
||||
}
|
||||
break;
|
||||
case GBM_RECT:
|
||||
case SPBM_RECT:
|
||||
if (down) {
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
if (x1<a1) {
|
||||
@@ -484,8 +484,8 @@ bm_menu:
|
||||
GrRect(dc,x11,y11,x22-x11+1,y22-y11+1);
|
||||
}
|
||||
break;
|
||||
case GBM_COPY:
|
||||
case GBM_DELETE:
|
||||
case SPBM_COPY:
|
||||
case SPBM_DELETE:
|
||||
if (down) {
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
if (x1<a1) {
|
||||
@@ -507,7 +507,7 @@ bm_menu:
|
||||
GrBorder(dc,x11,y11,x22,y22);
|
||||
}
|
||||
break;
|
||||
case GBM_CIRCLE:
|
||||
case SPBM_CIRCLE:
|
||||
if (down) {
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
dc->color=color;
|
||||
@@ -515,11 +515,11 @@ bm_menu:
|
||||
GrCircle3(dc,x1,y1,0,Sqrt(SqrI64(a1-x1)+SqrI64(a2-y1)));
|
||||
}
|
||||
break;
|
||||
case GBM_PASTE:
|
||||
case GBM_PASTE_TRANSPARENT:
|
||||
case SPBM_PASTE:
|
||||
case SPBM_PASTE_TRANSPARENT:
|
||||
if (clipboard) {
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
if (mode==GBM_PASTE) {
|
||||
if (mode==SPBM_PASTE) {
|
||||
clipboard->flags|=DCF_NO_TRANSPARENTS;
|
||||
GrBlot(dc,a1,a2,clipboard);
|
||||
clipboard->flags&=~DCF_NO_TRANSPARENTS;
|
||||
@@ -531,22 +531,22 @@ bm_menu:
|
||||
}
|
||||
}
|
||||
break;
|
||||
case GBM_TEXT:
|
||||
case SPBM_TEXT:
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
dc->color=color;
|
||||
GrPrint(dc,a1,a2,"%s",st);
|
||||
break;
|
||||
case GBM_TEXT_BOX:
|
||||
case SPBM_TEXT_BOX:
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
dc->color=color;
|
||||
GrTextBox3(dc,a1,a2,0,st);
|
||||
break;
|
||||
case GBM_TEXT_DIAMOND:
|
||||
case SPBM_TEXT_DIAMOND:
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
dc->color=color;
|
||||
GrTextDiamond3(dc,a1,a2,0,st);
|
||||
break;
|
||||
case GBM_POLYPT:
|
||||
case SPBM_POLYPT:
|
||||
if (down) {
|
||||
img->color=color;
|
||||
img->pen_width=width;
|
||||
@@ -559,23 +559,23 @@ bm_menu:
|
||||
break;
|
||||
case MSG_IP_L_UP:
|
||||
switch (mode) {
|
||||
case GBM_LINE:
|
||||
case GBM_ARROW:
|
||||
case GBM_POLYPT:
|
||||
case GBM_POLYLINE:
|
||||
case SPBM_LINE:
|
||||
case SPBM_ARROW:
|
||||
case SPBM_POLYPT:
|
||||
case SPBM_POLYLINE:
|
||||
img->color=color;
|
||||
img->pen_width=width;
|
||||
if (mode==GBM_ARROW)
|
||||
if (mode==SPBM_ARROW)
|
||||
GrArrow3(img,x1-xx1,y1-yy1,0,a1-xx1,a2-yy1,0);
|
||||
else
|
||||
GrLine3(img,x1-xx1,y1-yy1,0,a1-xx1,a2-yy1,0);
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
if (mode==GBM_POLYLINE) {
|
||||
if (mode==SPBM_POLYLINE) {
|
||||
x1=a1; y1=a2;
|
||||
} else
|
||||
down=FALSE;
|
||||
break;
|
||||
case GBM_RECT:
|
||||
case SPBM_RECT:
|
||||
img->color=color;
|
||||
if (x1<a1) {
|
||||
x11=x1;
|
||||
@@ -595,8 +595,8 @@ bm_menu:
|
||||
down=FALSE;
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
break;
|
||||
case GBM_COPY:
|
||||
case GBM_DELETE:
|
||||
case SPBM_COPY:
|
||||
case SPBM_DELETE:
|
||||
if (x1<a1) {
|
||||
x11=x1;
|
||||
x22=a1;
|
||||
@@ -614,23 +614,23 @@ bm_menu:
|
||||
DCDel(clipboard);
|
||||
clipboard=DCExt(img,x11-xx1,y11-yy1,x22-xx1,y22-yy1);
|
||||
clipboard->bkcolor=bkcolor;
|
||||
if (mode==GBM_DELETE) {
|
||||
if (mode==SPBM_DELETE) {
|
||||
img->color=bkcolor;
|
||||
GrRect(img,x11-xx1,y11-yy1,x22-x11+1,y22-y11+1);
|
||||
}
|
||||
goto bm_menu;
|
||||
case GBM_CIRCLE:
|
||||
case SPBM_CIRCLE:
|
||||
img->color=color;
|
||||
img->pen_width=width;
|
||||
GrCircle3(img,x1-xx1,y1-yy1,0,Sqrt(SqrI64(a1-x1)+SqrI64(a2-y1)));
|
||||
down=FALSE;
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
break;
|
||||
case GBM_PASTE:
|
||||
case GBM_PASTE_TRANSPARENT:
|
||||
case SPBM_PASTE:
|
||||
case SPBM_PASTE_TRANSPARENT:
|
||||
if (clipboard) {
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
if (mode==GBM_PASTE) {
|
||||
if (mode==SPBM_PASTE) {
|
||||
clipboard->flags|=DCF_NO_TRANSPARENTS;
|
||||
GrBlot(img,a1-xx1,a2-yy1,clipboard);
|
||||
clipboard->flags&=~DCF_NO_TRANSPARENTS;
|
||||
@@ -643,15 +643,15 @@ bm_menu:
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
}
|
||||
break;
|
||||
case GBM_TEXT:
|
||||
case SPBM_TEXT:
|
||||
img->color=color;
|
||||
GrPrint(img,a1-xx1,a2-yy1,"%s",st);
|
||||
goto bm_menu;
|
||||
case GBM_TEXT_BOX:
|
||||
case SPBM_TEXT_BOX:
|
||||
img->color=color;
|
||||
GrTextBox3(img,a1-xx1,a2-yy1,0,st);
|
||||
goto bm_menu;
|
||||
case GBM_TEXT_DIAMOND:
|
||||
case SPBM_TEXT_DIAMOND:
|
||||
img->color=color;
|
||||
GrTextDiamond3(img,a1-xx1,a2-yy1,0,st);
|
||||
goto bm_menu;
|
||||
@@ -659,7 +659,7 @@ bm_menu:
|
||||
break;
|
||||
}
|
||||
}
|
||||
WinMgrSync;
|
||||
Refresh;
|
||||
}
|
||||
bm_key_up_done:
|
||||
GetMsg(,,1<<MSG_KEY_UP);
|
||||
|
||||
+117
-117
@@ -1,6 +1,6 @@
|
||||
#help_index "Graphics/Sprite;Sprites"
|
||||
|
||||
U0 SpriteElem2Code(CDoc *doc,CSprite *tempg)
|
||||
U0 SpriteElem2Code(CDoc *doc,CSprite *tmpg)
|
||||
{
|
||||
U8 buf1[STR_LEN],buf2[STR_LEN];
|
||||
I32 *ptr;
|
||||
@@ -8,16 +8,16 @@ U0 SpriteElem2Code(CDoc *doc,CSprite *tempg)
|
||||
CD3I32 *p;
|
||||
CMeshTri *tri;
|
||||
if (!doc) doc=DocPut;
|
||||
DocPrint(doc,"%Z",tempg->type,"ST_SPRITE_ELEM_CODES");
|
||||
switch (tempg->type) {
|
||||
DocPrint(doc,"%Z",tmpg->type,"ST_SPRITE_ELEM_CODES");
|
||||
switch (tmpg->type) {
|
||||
case SPT_COLOR:
|
||||
DocPrint(doc,"{%s}",
|
||||
Color2Str(buf1,tempg->c.color));
|
||||
Color2Str(buf1,tmpg->c.color));
|
||||
break;
|
||||
case SPT_DITHER_COLOR:
|
||||
DocPrint(doc,"{%s}",
|
||||
Color2Str(buf2,ROPF_DITHER|tempg->d.dither_color.u8[0]|
|
||||
tempg->d.dither_color.u8[1]<<COLORROP_BITS));
|
||||
Color2Str(buf2,ROPF_DITHER|tmpg->d.dither_color.u8[0]|
|
||||
tmpg->d.dither_color.u8[1]<<COLORROP_BITS));
|
||||
break;
|
||||
case SPT_TRANSFORM_ON:
|
||||
DocPrint(doc,"{ON}");
|
||||
@@ -28,54 +28,54 @@ U0 SpriteElem2Code(CDoc *doc,CSprite *tempg)
|
||||
case SPT_LINE:
|
||||
case SPT_ARROW:
|
||||
case SPT_PLANAR_SYMMETRY:
|
||||
DocPrint(doc,"{(%d,%d),(%d,%d)}",tempg->pp.x1,tempg->pp.y1,
|
||||
tempg->pp.x2,tempg->pp.y2);
|
||||
DocPrint(doc,"{(%d,%d),(%d,%d)}",tmpg->pp.x1,tmpg->pp.y1,
|
||||
tmpg->pp.x2,tmpg->pp.y2);
|
||||
break;
|
||||
case SPT_RECT:
|
||||
DocPrint(doc,"{(%d,%d):(%d,%d)}",tempg->pp.x1,tempg->pp.y1,
|
||||
tempg->pp.x2-tempg->pp.x1,tempg->pp.y2-tempg->pp.y1);
|
||||
DocPrint(doc,"{(%d,%d):(%d,%d)}",tmpg->pp.x1,tmpg->pp.y1,
|
||||
tmpg->pp.x2-tmpg->pp.x1,tmpg->pp.y2-tmpg->pp.y1);
|
||||
break;
|
||||
case SPT_ROTATED_RECT:
|
||||
DocPrint(doc,"{(%d,%d):(%d,%d),%0.4f}",tempg->ppa.x1,tempg->ppa.y1,
|
||||
tempg->ppa.x2-tempg->ppa.x1,tempg->ppa.y2-tempg->ppa.y1,
|
||||
180/ã*Wrap(tempg->ppa.angle));
|
||||
DocPrint(doc,"{(%d,%d):(%d,%d),%0.4f}",tmpg->ppa.x1,tmpg->ppa.y1,
|
||||
tmpg->ppa.x2-tmpg->ppa.x1,tmpg->ppa.y2-tmpg->ppa.y1,
|
||||
180/ã*Wrap(tmpg->ppa.angle));
|
||||
break;
|
||||
case SPT_PT:
|
||||
case SPT_FLOOD_FILL:
|
||||
case SPT_SHIFT:
|
||||
DocPrint(doc,"{(%d,%d)}",tempg->p.x1,tempg->p.y1);
|
||||
DocPrint(doc,"{(%d,%d)}",tmpg->p.x1,tmpg->p.y1);
|
||||
break;
|
||||
case SPT_FLOOD_FILL_NOT:
|
||||
DocPrint(doc,"{(%d,%d),TRUE}",tempg->p.x1,tempg->p.y1);
|
||||
DocPrint(doc,"{(%d,%d),TRUE}",tmpg->p.x1,tmpg->p.y1);
|
||||
break;
|
||||
case SPT_CIRCLE:
|
||||
DocPrint(doc,"{(%d,%d):%d}",tempg->pr.x1,tempg->pr.y1,tempg->pr.radius);
|
||||
DocPrint(doc,"{(%d,%d):%d}",tmpg->pr.x1,tmpg->pr.y1,tmpg->pr.radius);
|
||||
break;
|
||||
case SPT_WIDTH:
|
||||
DocPrint(doc,"{%d}",tempg->w.width);
|
||||
DocPrint(doc,"{%d}",tmpg->w.width);
|
||||
break;
|
||||
case SPT_ELLIPSE:
|
||||
DocPrint(doc,"{(%d,%d):(%d,%d),%0.4f}",tempg->pwha.x1,tempg->pwha.y1,
|
||||
tempg->pwha.width,tempg->pwha.height,180/ã*Wrap(tempg->pwha.angle));
|
||||
DocPrint(doc,"{(%d,%d):(%d,%d),%0.4f}",tmpg->pwha.x1,tmpg->pwha.y1,
|
||||
tmpg->pwha.width,tmpg->pwha.height,180/ã*Wrap(tmpg->pwha.angle));
|
||||
break;
|
||||
case SPT_POLYGON:
|
||||
DocPrint(doc,"{%d,(%d,%d):(%d,%d),%0.4f}",tempg->pwhas.sides,
|
||||
tempg->pwhas.x1,tempg->pwhas.y1,
|
||||
tempg->pwhas.width,tempg->pwhas.height,
|
||||
180/ã*Wrap(tempg->pwhas.angle));
|
||||
DocPrint(doc,"{%d,(%d,%d):(%d,%d),%0.4f}",tmpg->pwhas.sides,
|
||||
tmpg->pwhas.x1,tmpg->pwhas.y1,
|
||||
tmpg->pwhas.width,tmpg->pwhas.height,
|
||||
180/ã*Wrap(tmpg->pwhas.angle));
|
||||
break;
|
||||
case SPT_TEXT:
|
||||
case SPT_TEXT_BOX:
|
||||
case SPT_TEXT_DIAMOND:
|
||||
DocPrint(doc,"{(%d,%d),\"%Q\"}",tempg->ps.x1,tempg->ps.y1,tempg->ps.st);
|
||||
DocPrint(doc,"{(%d,%d),\"%Q\"}",tmpg->ps.x1,tmpg->ps.y1,tmpg->ps.st);
|
||||
break;
|
||||
case SPT_POLYLINE:
|
||||
ptr=&tempg->nu.u;
|
||||
ptr=&tmpg->nu.u;
|
||||
DocPrint(doc,"{");
|
||||
for (i=0;i<tempg->nu.num;i++,ptr+=2) {
|
||||
for (i=0;i<tmpg->nu.num;i++,ptr+=2) {
|
||||
DocPrint(doc,"(%d,%d)",ptr[0],ptr[1]);
|
||||
if (i+1<tempg->nu.num) DocPrint(doc,",");
|
||||
if (i&3==3 && i+1<tempg->nu.num)
|
||||
if (i+1<tmpg->nu.num) DocPrint(doc,",");
|
||||
if (i&3==3 && i+1<tmpg->nu.num)
|
||||
DocPrint(doc,"\n");
|
||||
}
|
||||
DocPrint(doc,"}");
|
||||
@@ -84,26 +84,26 @@ U0 SpriteElem2Code(CDoc *doc,CSprite *tempg)
|
||||
case SPT_BSPLINE3:
|
||||
case SPT_BSPLINE2_CLOSED:
|
||||
case SPT_BSPLINE3_CLOSED:
|
||||
ptr=&tempg->nu.u;
|
||||
ptr=&tmpg->nu.u;
|
||||
DocPrint(doc,"{");
|
||||
for (i=0;i<tempg->nu.num;i++,ptr+=3) {
|
||||
for (i=0;i<tmpg->nu.num;i++,ptr+=3) {
|
||||
DocPrint(doc,"(%d,%d,%d)",ptr[0],ptr[1],ptr[2]);
|
||||
if (i+1<tempg->nu.num) DocPrint(doc,",");
|
||||
if (i&3==3 && i+1<tempg->nu.num)
|
||||
if (i+1<tmpg->nu.num) DocPrint(doc,",");
|
||||
if (i&3==3 && i+1<tmpg->nu.num)
|
||||
DocPrint(doc,"\n");
|
||||
}
|
||||
if (tempg->type==SPT_BSPLINE2||tempg->type==SPT_BSPLINE3)
|
||||
if (tmpg->type==SPT_BSPLINE2||tmpg->type==SPT_BSPLINE3)
|
||||
DocPrint(doc,",FALSE}");
|
||||
else
|
||||
DocPrint(doc,",TRUE}");
|
||||
break;
|
||||
case SPT_POLYPT:
|
||||
DocPrint(doc,"{(%d,%d),",tempg->npu.x,tempg->npu.y);
|
||||
ptr=&tempg->npu.u;
|
||||
DocPrint(doc,"{(%d,%d),",tmpg->npu.x,tmpg->npu.y);
|
||||
ptr=&tmpg->npu.u;
|
||||
col=16;
|
||||
for (i=0;i<tempg->npu.num;i++) {
|
||||
for (i=0;i<tmpg->npu.num;i++) {
|
||||
DocPrint(doc,"%d",BFieldExtU32(ptr,i*3,3));
|
||||
if (++col>=64 && i+1<tempg->npu.num) {
|
||||
if (++col>=64 && i+1<tmpg->npu.num) {
|
||||
DocPrint(doc,"\n");
|
||||
col=0;
|
||||
}
|
||||
@@ -111,24 +111,24 @@ U0 SpriteElem2Code(CDoc *doc,CSprite *tempg)
|
||||
DocPrint(doc,"}");
|
||||
break;
|
||||
case SPT_BITMAP:
|
||||
DocPrint(doc,"{(%d,%d):(%d,%d),\n",tempg->pwhu.x1,tempg->pwhu.y1,
|
||||
tempg->pwhu.width,tempg->pwhu.height);
|
||||
width_internal=(tempg->pwhu.width+7)&~7;
|
||||
DocPrint(doc,"{(%d,%d):(%d,%d),\n",tmpg->pwhu.x1,tmpg->pwhu.y1,
|
||||
tmpg->pwhu.width,tmpg->pwhu.height);
|
||||
width_internal=(tmpg->pwhu.width+7)&~7;
|
||||
if (width_internal<80)
|
||||
k=width_internal;
|
||||
else
|
||||
k=64;
|
||||
ptr=&tempg->pwhu.u;
|
||||
ptr=&tmpg->pwhu.u;
|
||||
col=0;
|
||||
for (j=0;j<tempg->pwhu.height;j++)
|
||||
for (j=0;j<tmpg->pwhu.height;j++)
|
||||
for (i=0;i<width_internal;i++,ptr(U8 *)++) {
|
||||
if (i>=tempg->pwhu.width)
|
||||
if (i>=tmpg->pwhu.width)
|
||||
DocPrint(doc,"_");
|
||||
else if (*ptr(U8 *)<16)
|
||||
DocPrint(doc,"%X",*ptr(U8 *));
|
||||
else
|
||||
DocPrint(doc,"%c",CH_SHIFT_SPACE);
|
||||
if (++col>=k && (i+1<width_internal||j+1<tempg->pwhu.height)) {
|
||||
if (++col>=k && (i+1<width_internal||j+1<tmpg->pwhu.height)) {
|
||||
DocPrint(doc,"\n");
|
||||
col=0;
|
||||
}
|
||||
@@ -137,11 +137,11 @@ U0 SpriteElem2Code(CDoc *doc,CSprite *tempg)
|
||||
break;
|
||||
case SPT_MESH:
|
||||
DocPrint(doc,"{FALSE,");
|
||||
p=&tempg->mu.u;
|
||||
p=&tmpg->mu.u;
|
||||
col=0;
|
||||
for (i=0;i<tempg->mu.vertex_cnt;i++,p++) {
|
||||
for (i=0;i<tmpg->mu.vertex_cnt;i++,p++) {
|
||||
DocPrint(doc,"(%d,%d,%d)",p->x,p->y,p->z);
|
||||
if (i+1<tempg->mu.vertex_cnt) DocPrint(doc,",");
|
||||
if (i+1<tmpg->mu.vertex_cnt) DocPrint(doc,",");
|
||||
if (++col==4) {
|
||||
DocPrint(doc,"\t//%d\n",i);
|
||||
col=0;
|
||||
@@ -149,11 +149,11 @@ U0 SpriteElem2Code(CDoc *doc,CSprite *tempg)
|
||||
}
|
||||
DocPrint(doc,":");
|
||||
tri=p;
|
||||
for (i=0;i<tempg->mu.tri_cnt;i++,tri++) {
|
||||
for (i=0;i<tmpg->mu.tri_cnt;i++,tri++) {
|
||||
DocPrint(doc,"(%s,%d,%d,%d)",Color2Str(buf1,tri->color),
|
||||
tri->nums[0],tri->nums[1],tri->nums[2]);
|
||||
if (i+1<tempg->mu.tri_cnt) DocPrint(doc,",");
|
||||
if (++col>=3 && i+1<tempg->mu.tri_cnt) {
|
||||
if (i+1<tmpg->mu.tri_cnt) DocPrint(doc,",");
|
||||
if (++col>=3 && i+1<tmpg->mu.tri_cnt) {
|
||||
DocPrint(doc,"\n");
|
||||
col=0;
|
||||
}
|
||||
@@ -161,12 +161,12 @@ U0 SpriteElem2Code(CDoc *doc,CSprite *tempg)
|
||||
DocPrint(doc,"}");
|
||||
break;
|
||||
case SPT_SHIFTABLE_MESH:
|
||||
DocPrint(doc,"{TRUE,(%d,%d,%d):",tempg->pmu.x,tempg->pmu.y,tempg->pmu.z);
|
||||
p=&tempg->pmu.u;
|
||||
DocPrint(doc,"{TRUE,(%d,%d,%d):",tmpg->pmu.x,tmpg->pmu.y,tmpg->pmu.z);
|
||||
p=&tmpg->pmu.u;
|
||||
col=1;
|
||||
for (i=0;i<tempg->pmu.vertex_cnt;i++,p++) {
|
||||
for (i=0;i<tmpg->pmu.vertex_cnt;i++,p++) {
|
||||
DocPrint(doc,"(%d,%d,%d)",p->x,p->y,p->z);
|
||||
if (i+1<tempg->pmu.vertex_cnt) DocPrint(doc,",");
|
||||
if (i+1<tmpg->pmu.vertex_cnt) DocPrint(doc,",");
|
||||
if (++col==4) {
|
||||
DocPrint(doc,"\t//%d\n",i);
|
||||
col=0;
|
||||
@@ -174,11 +174,11 @@ U0 SpriteElem2Code(CDoc *doc,CSprite *tempg)
|
||||
}
|
||||
DocPrint(doc,":");
|
||||
tri=p;
|
||||
for (i=0;i<tempg->pmu.tri_cnt;i++,tri++) {
|
||||
for (i=0;i<tmpg->pmu.tri_cnt;i++,tri++) {
|
||||
DocPrint(doc,"(%s,%d,%d,%d)",Color2Str(buf1,tri->color),
|
||||
tri->nums[0],tri->nums[1],tri->nums[2]);
|
||||
if (i+1<tempg->pmu.tri_cnt) DocPrint(doc,",");
|
||||
if (++col>=3 && i+1<tempg->pmu.tri_cnt) {
|
||||
if (i+1<tmpg->pmu.tri_cnt) DocPrint(doc,",");
|
||||
if (++col>=3 && i+1<tmpg->pmu.tri_cnt) {
|
||||
DocPrint(doc,"\n");
|
||||
col=0;
|
||||
}
|
||||
@@ -191,10 +191,10 @@ U0 SpriteElem2Code(CDoc *doc,CSprite *tempg)
|
||||
|
||||
public U0 Sprite2Code(CDoc *doc=NULL,U8 *elems)
|
||||
{//Sprite to text.
|
||||
CSprite *tempg=elems-offset(CSprite.start);
|
||||
while (tempg->type) {
|
||||
SpriteElem2Code(doc,tempg);
|
||||
tempg(U8 *)+=SpriteElemSize(tempg);
|
||||
CSprite *tmpg=elems-offset(CSprite.start);
|
||||
while (tmpg->type) {
|
||||
SpriteElem2Code(doc,tmpg);
|
||||
tmpg(U8 *)+=SpriteElemSize(tmpg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,9 +204,9 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
||||
CSprite *res,g;
|
||||
CColorROPU32 color;
|
||||
U8 *st,*ptr;
|
||||
CQueD3I32 headp,*tempp,*tempa1;
|
||||
CQueMeshTri headt,*tempt,*tempt1;
|
||||
CQueVectU8 *tempv;
|
||||
CQueD3I32 headp,*tmpp,*tmpa1;
|
||||
CQueMeshTri headt,*tmpt,*tmpt1;
|
||||
CQueVectU8 *tmpv;
|
||||
MemSet(&g,0,sizeof(CSprite));
|
||||
switch (type) {
|
||||
start:
|
||||
@@ -340,9 +340,9 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
||||
g.type=SPT_POLYLINE;
|
||||
QueInit(&headp);
|
||||
while (cc->token=='(') {
|
||||
tempp=CAlloc(sizeof(CQueD3I32));
|
||||
LexD2I32(cc,&tempp->p);
|
||||
QueIns(tempp,headp.last);
|
||||
tmpp=CAlloc(sizeof(CQueD3I32));
|
||||
LexD2I32(cc,&tmpp->p);
|
||||
QueIns(tmpp,headp.last);
|
||||
g.nu.num++;
|
||||
if (cc->token==',')
|
||||
Lex(cc); //Skip ,
|
||||
@@ -353,13 +353,13 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
||||
res=MAlloc(size+g.nu.num*sizeof(CD2I32));
|
||||
MemCpy(res,&g,size);
|
||||
ptr=&res->nu.u;
|
||||
tempp=headp.next;
|
||||
while (tempp!=&headp) {
|
||||
tempa1=tempp->next;
|
||||
MemCpy(ptr,&tempp->p,sizeof(CD2I32));
|
||||
tmpp=headp.next;
|
||||
while (tmpp!=&headp) {
|
||||
tmpa1=tmpp->next;
|
||||
MemCpy(ptr,&tmpp->p,sizeof(CD2I32));
|
||||
ptr+=sizeof(CD2I32);
|
||||
Free(tempp);
|
||||
tempp=tempa1;
|
||||
Free(tmpp);
|
||||
tmpp=tmpa1;
|
||||
}
|
||||
break;
|
||||
case SPT_BSPLINE2:
|
||||
@@ -369,9 +369,9 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
||||
Lex(cc); //Skip {
|
||||
QueInit(&headp);
|
||||
while (cc->token=='(') {
|
||||
tempp=CAlloc(sizeof(CQueD3I32));
|
||||
LexD3I32(cc,&tempp->p);
|
||||
QueIns(tempp,headp.last);
|
||||
tmpp=CAlloc(sizeof(CQueD3I32));
|
||||
LexD3I32(cc,&tmpp->p);
|
||||
QueIns(tmpp,headp.last);
|
||||
g.nu.num++;
|
||||
if (cc->token==',')
|
||||
Lex(cc); //Skip ,
|
||||
@@ -393,13 +393,13 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
||||
}
|
||||
MemCpy(res,&g,size);
|
||||
ptr=&res->nu.u;
|
||||
tempp=headp.next;
|
||||
while (tempp!=&headp) {
|
||||
tempa1=tempp->next;
|
||||
MemCpy(ptr,&tempp->p,sizeof(CD3I32));
|
||||
tmpp=headp.next;
|
||||
while (tmpp!=&headp) {
|
||||
tmpa1=tmpp->next;
|
||||
MemCpy(ptr,&tmpp->p,sizeof(CD3I32));
|
||||
ptr+=sizeof(CD3I32);
|
||||
Free(tempp);
|
||||
tempp=tempa1;
|
||||
Free(tmpp);
|
||||
tmpp=tmpa1;
|
||||
}
|
||||
break;
|
||||
case SPT_POLYPT:
|
||||
@@ -407,14 +407,14 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
||||
LexD2I32(cc,&g.npu.x);
|
||||
if (cc->token!=',')
|
||||
LexExcept(cc,"Expecting ',' at ");
|
||||
tempv=QueVectU8New;
|
||||
tmpv=QueVectU8New;
|
||||
while (TRUE) {
|
||||
if (!(i=LexGetChar(cc)))
|
||||
LexExcept(cc,"Expecting '}' at ");
|
||||
if (i=='}')
|
||||
break;
|
||||
if ('0'<=i<='7')
|
||||
QueVectU8Put(tempv,g.npu.num++,i-'0');
|
||||
QueVectU8Put(tmpv,g.npu.num++,i-'0');
|
||||
}
|
||||
Bts(&cc->flags,CCf_USE_LAST_U16);
|
||||
Lex(cc); //Load '}'
|
||||
@@ -424,8 +424,8 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
||||
MemCpy(res,&g,size);
|
||||
ptr=&res->npu.u;
|
||||
for (i=0;i<g.npu.num;i++)
|
||||
BFieldOrU32(ptr,i*3,QueVectU8Get(tempv,i));
|
||||
QueVectU8Del(tempv);
|
||||
BFieldOrU32(ptr,i*3,QueVectU8Get(tmpv,i));
|
||||
QueVectU8Del(tmpv);
|
||||
break;
|
||||
case SPT_BITMAP:
|
||||
Lex(cc); //Skip {
|
||||
@@ -436,7 +436,7 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
||||
LexD2I32(cc,&g.pwhu.width);
|
||||
if (cc->token!=',')
|
||||
LexExcept(cc,"Expecting ',' at ");
|
||||
tempv=QueVectU8New;
|
||||
tmpv=QueVectU8New;
|
||||
num1=0;
|
||||
while (TRUE) {
|
||||
if (!(i=ToUpper(LexGetChar(cc))))
|
||||
@@ -444,13 +444,13 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
||||
if (i=='}')
|
||||
break;
|
||||
if ('0'<=i<='9')
|
||||
QueVectU8Put(tempv,num1++,i-'0');
|
||||
QueVectU8Put(tmpv,num1++,i-'0');
|
||||
else if ('A'<=i<='F')
|
||||
QueVectU8Put(tempv,num1++,i-'A'+10);
|
||||
QueVectU8Put(tmpv,num1++,i-'A'+10);
|
||||
else if (i==CH_SPACE||i==CH_SHIFT_SPACE)
|
||||
QueVectU8Put(tempv,num1++,TRANSPARENT);
|
||||
QueVectU8Put(tmpv,num1++,TRANSPARENT);
|
||||
else if (i=='_')
|
||||
QueVectU8Put(tempv,num1++,0);
|
||||
QueVectU8Put(tmpv,num1++,0);
|
||||
}
|
||||
Bts(&cc->flags,CCf_USE_LAST_U16);
|
||||
Lex(cc); //Load '}'
|
||||
@@ -460,8 +460,8 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
||||
MemCpy(res,&g,size);
|
||||
ptr=&res->pwhu.u;
|
||||
for (i=0;i<num1;i++)
|
||||
*ptr++=QueVectU8Get(tempv,i);
|
||||
QueVectU8Del(tempv);
|
||||
*ptr++=QueVectU8Get(tmpv,i);
|
||||
QueVectU8Del(tmpv);
|
||||
break;
|
||||
case SPT_MESH:
|
||||
case SPT_SHIFTABLE_MESH:
|
||||
@@ -484,9 +484,9 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
||||
num1=0;
|
||||
QueInit(&headp);
|
||||
while (cc->token=='(') {
|
||||
tempp=CAlloc(sizeof(CQueD3I32));
|
||||
LexD3I32(cc,&tempp->p);
|
||||
QueIns(tempp,headp.last);
|
||||
tmpp=CAlloc(sizeof(CQueD3I32));
|
||||
LexD3I32(cc,&tmpp->p);
|
||||
QueIns(tmpp,headp.last);
|
||||
num1++;
|
||||
if (cc->token==',')
|
||||
Lex(cc); //Skip ,
|
||||
@@ -497,27 +497,27 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
||||
num2=0;
|
||||
QueInit(&headt);
|
||||
while (cc->token=='(') {
|
||||
tempt=CAlloc(sizeof(CQueMeshTri));
|
||||
tmpt=CAlloc(sizeof(CQueMeshTri));
|
||||
st=LexFirstRem(cc,",");
|
||||
tempt->color=Str2ColorU32(st);
|
||||
tmpt->color=Str2ColorU32(st);
|
||||
Free(st);
|
||||
Lex(cc); //Skip color
|
||||
if (cc->token!=',')
|
||||
LexExcept(cc,"Expecting ',' at ");
|
||||
Lex(cc); //Skip ,
|
||||
tempt->nums[0]=LexExpressionI64(cc);
|
||||
tmpt->nums[0]=LexExpressionI64(cc);
|
||||
if (cc->token!=',')
|
||||
LexExcept(cc,"Expecting ',' at ");
|
||||
Lex(cc); //Skip ,
|
||||
tempt->nums[1]=LexExpressionI64(cc);
|
||||
tmpt->nums[1]=LexExpressionI64(cc);
|
||||
if (cc->token!=',')
|
||||
LexExcept(cc,"Expecting ',' at ");
|
||||
Lex(cc); //Skip ,
|
||||
tempt->nums[2]=LexExpressionI64(cc);
|
||||
tmpt->nums[2]=LexExpressionI64(cc);
|
||||
if (cc->token!=')')
|
||||
LexExcept(cc,"Expecting ')' at ");
|
||||
Lex(cc); //Skip )
|
||||
QueIns(tempt,headt.last);
|
||||
QueIns(tmpt,headt.last);
|
||||
num2++;
|
||||
if (cc->token==',')
|
||||
Lex(cc); //Skip ,
|
||||
@@ -534,21 +534,21 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
||||
res=MAlloc(size+num1*sizeof(CD3I32)+num2*sizeof(CMeshTri));
|
||||
MemCpy(res,&g,size);
|
||||
ptr=res(U8 *)+size;
|
||||
tempp=headp.next;
|
||||
while (tempp!=&headp) {
|
||||
tempa1=tempp->next;
|
||||
MemCpy(ptr,&tempp->p,sizeof(CD3I32));
|
||||
tmpp=headp.next;
|
||||
while (tmpp!=&headp) {
|
||||
tmpa1=tmpp->next;
|
||||
MemCpy(ptr,&tmpp->p,sizeof(CD3I32));
|
||||
ptr+=sizeof(CD3I32);
|
||||
Free(tempp);
|
||||
tempp=tempa1;
|
||||
Free(tmpp);
|
||||
tmpp=tmpa1;
|
||||
}
|
||||
tempt=headt.next;
|
||||
while (tempt!=&headt) {
|
||||
tempt1=tempt->next;
|
||||
MemCpy(ptr,&tempt->start,sizeof(CMeshTri));
|
||||
tmpt=headt.next;
|
||||
while (tmpt!=&headt) {
|
||||
tmpt1=tmpt->next;
|
||||
MemCpy(ptr,&tmpt->start,sizeof(CMeshTri));
|
||||
ptr+=sizeof(CMeshTri);
|
||||
Free(tempt);
|
||||
tempt=tempt1;
|
||||
Free(tmpt);
|
||||
tmpt=tmpt1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -566,7 +566,7 @@ public U8 *Code2Sprite(CDoc *doc,I64 *_size=NULL)
|
||||
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;
|
||||
CHashGeneric *tmph;
|
||||
I64 i,size=0;
|
||||
QueInit(&head);
|
||||
LexAttachDoc(cc,,doc);
|
||||
@@ -574,8 +574,8 @@ public U8 *Code2Sprite(CDoc *doc,I64 *_size=NULL)
|
||||
do {
|
||||
cc->htc.hash_table_lst=NULL;
|
||||
if (Lex(cc)==TK_IDENT && //Skip ;
|
||||
(temph=HashFind(cc->cur_str,gr.sprite_hash,SPHT_ELEM_CODE))) {
|
||||
i=temph->user_data0;
|
||||
(tmph=HashFind(cc->cur_str,gr.sprite_hash,SPHT_ELEM_CODE))) {
|
||||
i=tmph->user_data0;
|
||||
cc->htc.hash_table_lst=old_hash_table_lst;
|
||||
if (Lex(cc)=='{') //Skip ident
|
||||
QueIns(Code2SpriteElem(cc,i),head.last);
|
||||
|
||||
+406
-406
File diff suppressed because it is too large.
Load diff
+235
-235
@@ -1,8 +1,8 @@
|
||||
#help_index "Graphics/Sprite;Sprites"
|
||||
|
||||
#define SPT_MENU -2
|
||||
#define SPT_INS_SCREEN_BITMAP -3
|
||||
#define SPT_INS_TRANSPARENT_SCREEN_BITMAP -4
|
||||
#define SPT_INS_SCRN_BITMAP -3
|
||||
#define SPT_INS_TRANSPARENT_SCRN_BITMAP -4
|
||||
#define SPT_ED_MENU -5
|
||||
#define SPT_EXIT -6
|
||||
|
||||
@@ -43,9 +43,9 @@ I64 PopUpSpriteMain(CSprite **_head,I64 *_cur_elem_num,
|
||||
"$$MU-UL,\"BSpline3\",LE=SPT_BSPLINE3$$\n"
|
||||
"$$MU-UL,\"BSpline2 Closed\",LE=SPT_BSPLINE2_CLOSED$$\n"
|
||||
"$$MU-UL,\"BSpline3 Closed\",LE=SPT_BSPLINE3_CLOSED$$\n"
|
||||
"$$MU-UL,\"Insert Screen-Captured BitMap\",LE=SPT_INS_SCREEN_BITMAP$$\n"
|
||||
"$$MU-UL,\"Insert Transparent Screen-Captured BitMap\","
|
||||
"LE=SPT_INS_TRANSPARENT_SCREEN_BITMAP$$\n"
|
||||
"$$MU-UL,\"Insert Scrn-Captured BitMap\",LE=SPT_INS_SCRN_BITMAP$$\n"
|
||||
"$$MU-UL,\"Insert Transparent Scrn-Captured BitMap\","
|
||||
"LE=SPT_INS_TRANSPARENT_SCRN_BITMAP$$\n"
|
||||
"$$PURPLE$$$$MU-UL,\"+] Create or Edit 3D Mesh\",LE=SPT_MESH$$\n"
|
||||
"$$MU-UL,\"+] Create or Edit Shiftable 3D Mesh\","
|
||||
"LE=SPT_SHIFTABLE_MESH$$\n"
|
||||
@@ -101,12 +101,12 @@ Bool PopUpExtents(I64 *_x1,I64 *_x2,I64 *_y1,I64 *_y2)
|
||||
return i;
|
||||
}
|
||||
|
||||
U0 SpriteScreenInit(CDC *dc,I64,I64)
|
||||
U0 SpriteScrnInit(CDC *dc,I64,I64)
|
||||
{
|
||||
//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.HC"$.
|
||||
I64 xx,yy,old_pen_width=dc->pen_width;
|
||||
CColorROPU32 old_color=dc->color;
|
||||
WinMgrSync;
|
||||
Refresh;
|
||||
DCFill(dc);
|
||||
if (dc->flags&DCF_SYMMETRY) {
|
||||
dc->flags&=~DCF_SYMMETRY;
|
||||
@@ -136,7 +136,7 @@ CSprite *SMLine(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color)
|
||||
dc->color=color&COLORROP_NO_ROP0_MASK;
|
||||
GrLine3(dc,x1,y1,0,x2,y2,0);
|
||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
||||
SpriteScreenInit(dc,x,y);
|
||||
SpriteScrnInit(dc,x,y);
|
||||
x2=a1; y2=a2;
|
||||
} while (msg_code!=MSG_IP_L_UP);
|
||||
dc->color=color&COLORROP_NO_ROP0_MASK;
|
||||
@@ -158,7 +158,7 @@ CSprite *SMArrow(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color)
|
||||
dc->color=color&COLORROP_NO_ROP0_MASK;
|
||||
GrArrow3(dc,x1,y1,0,x2,y2,0);
|
||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
||||
SpriteScreenInit(dc,x,y);
|
||||
SpriteScrnInit(dc,x,y);
|
||||
x2=a1; y2=a2;
|
||||
} while (msg_code!=MSG_IP_L_UP);
|
||||
dc->color=color&COLORROP_NO_ROP0_MASK;
|
||||
@@ -184,7 +184,7 @@ CSprite *SMPlanarSymmetry(CDC *dc,I64 x,I64 y,I64 a1,I64 a2)
|
||||
dc->color=ROPF_DITHER+WHITE<<16+BLACK;
|
||||
GrLine3(dc,x1,y1,0,x2,y2,0);
|
||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
||||
SpriteScreenInit(dc,x,y);
|
||||
SpriteScrnInit(dc,x,y);
|
||||
x2=a1; y2=a2;
|
||||
} while (msg_code!=MSG_IP_L_UP);
|
||||
dc->flags=old_flags&DCF_SYMMETRY|dc->flags&~DCF_SYMMETRY;
|
||||
@@ -206,7 +206,7 @@ CSprite *SMRect(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color)
|
||||
dc->color=color&COLORROP_NO_ROP0_MASK;
|
||||
GrRect3(dc,xx1,yy1,0,xx2-xx1,yy2-yy1);
|
||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
||||
SpriteScreenInit(dc,x,y);
|
||||
SpriteScrnInit(dc,x,y);
|
||||
x2=a1; y2=a2;
|
||||
if (x2<x1) {
|
||||
xx1=x2; xx2=x1;
|
||||
@@ -230,7 +230,7 @@ CSprite *SMRect(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color)
|
||||
return res;
|
||||
}
|
||||
|
||||
CSprite *SMScreenBitMap(I64 eletype,CDC *dc,CDC *dc2,I64 x,I64 y,I64 a1,I64 a2,
|
||||
CSprite *SMScrnBitMap(I64 eletype,CDC *dc,CDC *dc2,I64 x,I64 y,I64 a1,I64 a2,
|
||||
CColorROPU32 bm_bkcolor)
|
||||
{
|
||||
I64 i,msg_code,x1=a1,y1=a2,x2=a1,y2=a2,xx1=a1,yy1=a2,xx2=a1,yy2=a2,old_width;
|
||||
@@ -243,7 +243,7 @@ CSprite *SMScreenBitMap(I64 eletype,CDC *dc,CDC *dc2,I64 x,I64 y,I64 a1,I64 a2,
|
||||
GrBorder(dc2,xx1+Fs->pix_left+Fs->scroll_x,yy1+Fs->pix_top+Fs->scroll_y,
|
||||
xx2+Fs->pix_left+Fs->scroll_x,yy2+Fs->pix_top+Fs->scroll_y);
|
||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
||||
SpriteScreenInit(dc,x,y);
|
||||
SpriteScrnInit(dc,x,y);
|
||||
x2=a1; y2=a2;
|
||||
if (x2<x1) {
|
||||
xx1=x2; xx2=x1;
|
||||
@@ -263,15 +263,15 @@ CSprite *SMScreenBitMap(I64 eletype,CDC *dc,CDC *dc2,I64 x,I64 y,I64 a1,I64 a2,
|
||||
res->pwhu.height=yy2-yy1;
|
||||
res->pwhu.x1=0;
|
||||
res->pwhu.y1=0;
|
||||
SpriteScreenInit(dc,x,y);
|
||||
i=gr.screen_zoom;
|
||||
SpriteScrnInit(dc,x,y);
|
||||
i=gr.scrn_zoom;
|
||||
GrScaleZoom(1.0/i);
|
||||
WinMgrSync(2,TRUE);
|
||||
Refresh(2,TRUE);
|
||||
|
||||
dc3=DCScreenCapture;
|
||||
dc3=DCScrnCapture;
|
||||
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)
|
||||
if (eletype==SPT_INS_TRANSPARENT_SCRN_BITMAP)
|
||||
DCColorChg(img,bm_bkcolor);
|
||||
GrScaleZoom(i);
|
||||
MemCpy(&res->pwhu.u,img->body,((xx2-xx1+7)&~7)*(yy2-yy1));
|
||||
@@ -291,7 +291,7 @@ CSprite *SMCircle(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color)
|
||||
dc->color=color&COLORROP_NO_ROP0_MASK;
|
||||
GrCircle3(dc,x1,y1,0,Sqrt(SqrI64(x1-x2)+SqrI64(y1-y2)));
|
||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
||||
SpriteScreenInit(dc,x,y);
|
||||
SpriteScrnInit(dc,x,y);
|
||||
x2=a1; y2=a2;
|
||||
} while (msg_code!=MSG_IP_L_UP);
|
||||
dc->color=color&COLORROP_NO_ROP0_MASK;
|
||||
@@ -313,7 +313,7 @@ CSprite *SMEllipse(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color)
|
||||
dc->color=color&COLORROP_NO_ROP0_MASK;
|
||||
GrEllipse3(dc,(x1+x2)>>1,(y1+y2)>>1,0,AbsI64(x1-x2)>>1,AbsI64(y1-y2)>>1);
|
||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
||||
SpriteScreenInit(dc,x,y);
|
||||
SpriteScrnInit(dc,x,y);
|
||||
x2=a1; y2=a2;
|
||||
} while (msg_code!=MSG_IP_L_UP);
|
||||
res=CAlloc(SpriteElemQuedBaseSize(SPT_ELLIPSE));
|
||||
@@ -335,7 +335,7 @@ CSprite *SMEllipse(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color)
|
||||
GrEllipse3(dc,res->pwha.x1+x,res->pwha.y1+y,0,
|
||||
res->pwha.width,res->pwha.height,res->pwha.angle);
|
||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
||||
SpriteScreenInit(dc,x,y);
|
||||
SpriteScrnInit(dc,x,y);
|
||||
x2=a1; y2=a2;
|
||||
} while (msg_code!=MSG_IP_L_UP);
|
||||
angle1=Arg(x2-(res->pwha.x1+x),y2-(res->pwha.y1+y));
|
||||
@@ -360,7 +360,7 @@ CSprite *SMPolygon(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,I64 sides,
|
||||
GrRegPoly3(dc,(x1+x2)>>1,(y1+y2)>>1,0,
|
||||
AbsI64(x1-x2)>>1,AbsI64(y1-y2)>>1,sides);
|
||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
||||
SpriteScreenInit(dc,x,y);
|
||||
SpriteScrnInit(dc,x,y);
|
||||
x2=a1; y2=a2;
|
||||
} while (msg_code!=MSG_IP_L_UP);
|
||||
res=CAlloc(SpriteElemQuedBaseSize(SPT_POLYGON));
|
||||
@@ -384,7 +384,7 @@ CSprite *SMPolygon(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,I64 sides,
|
||||
res->pwhas.width,res->pwhas.height,
|
||||
res->pwhas.sides,res->pwhas.angle);
|
||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
||||
SpriteScreenInit(dc,x,y);
|
||||
SpriteScrnInit(dc,x,y);
|
||||
x2=a1; y2=a2;
|
||||
} while (msg_code!=MSG_IP_L_UP);
|
||||
angle1=Arg(x2-(res->pwhas.x1+x),y2-(res->pwhas.y1+y));
|
||||
@@ -405,7 +405,7 @@ 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,head2;
|
||||
CSprite *res,*tmpg,*tmpg1,head2;
|
||||
|
||||
QueInit(&head2);
|
||||
do {
|
||||
@@ -438,22 +438,22 @@ 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=head2.next;
|
||||
tmpg1=head2.next;
|
||||
for (i=0;i<num;i++) {
|
||||
tempg=tempg1->next;
|
||||
ptr[i<<1]=tempg1->p.x1;
|
||||
ptr[i<<1+1]=tempg1->p.y1;
|
||||
Free(tempg1);
|
||||
tempg1=tempg;
|
||||
tmpg=tmpg1->next;
|
||||
ptr[i<<1]=tmpg1->p.x1;
|
||||
ptr[i<<1+1]=tmpg1->p.y1;
|
||||
Free(tmpg1);
|
||||
tmpg1=tmpg;
|
||||
}
|
||||
res->type=SPT_POLYLINE;
|
||||
res->nu.num=num;
|
||||
} else {
|
||||
tempg1=head2.next;
|
||||
tmpg1=head2.next;
|
||||
for (i=0;i<num;i++) {
|
||||
tempg=tempg1->next;
|
||||
Free(tempg1);
|
||||
tempg1=tempg;
|
||||
tmpg=tmpg1->next;
|
||||
Free(tmpg1);
|
||||
tmpg1=tmpg;
|
||||
}
|
||||
res=NULL;
|
||||
}
|
||||
@@ -465,22 +465,22 @@ 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=head2.next;
|
||||
tmpg1=head2.next;
|
||||
for (i=0;i<num;i++) {
|
||||
tempg=tempg1->next;
|
||||
p[i].x=tempg1->p.x1;
|
||||
p[i].y=tempg1->p.y1;
|
||||
Free(tempg1);
|
||||
tempg1=tempg;
|
||||
tmpg=tmpg1->next;
|
||||
p[i].x=tmpg1->p.x1;
|
||||
p[i].y=tmpg1->p.y1;
|
||||
Free(tmpg1);
|
||||
tmpg1=tmpg;
|
||||
}
|
||||
res->type=eletype;
|
||||
res->nu.num=num;
|
||||
} else {
|
||||
tempg1=head2.next;
|
||||
tmpg1=head2.next;
|
||||
for (i=0;i<num;i++) {
|
||||
tempg=tempg1->next;
|
||||
Free(tempg1);
|
||||
tempg1=tempg;
|
||||
tmpg=tmpg1->next;
|
||||
Free(tmpg1);
|
||||
tmpg1=tmpg;
|
||||
}
|
||||
res=NULL;
|
||||
}
|
||||
@@ -493,7 +493,7 @@ 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,head2;
|
||||
CSprite *res,*tmpg,*tmpg1,head2;
|
||||
|
||||
QueInit(&head2);
|
||||
x3=a1-x; y3=a2-y;
|
||||
@@ -510,7 +510,7 @@ CSprite *SMPolyPoint(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color)
|
||||
res=head2.next;
|
||||
x1=x3; y1=y3;
|
||||
while (res!=&head2) {
|
||||
tempg=res->next;
|
||||
tmpg=res->next;
|
||||
if (res->p.x1==x1 && res->p.y1==y1) {
|
||||
QueRem(res);
|
||||
Free(res);
|
||||
@@ -519,7 +519,7 @@ CSprite *SMPolyPoint(CDC *dc,I64 x,I64 y,I64 a1,I64 a2,CColorROPU32 color)
|
||||
x1=res->p.x1;
|
||||
y1=res->p.y1;
|
||||
}
|
||||
res=tempg;
|
||||
res=tmpg;
|
||||
}
|
||||
|
||||
res=CAlloc(SpriteElemQuedBaseSize(SPT_POLYPT)+(num*3+7)>>3);
|
||||
@@ -528,16 +528,16 @@ 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=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)]);
|
||||
tmpg1=head2.next;
|
||||
while (tmpg1!=&head2) {
|
||||
tmpg=tmpg1->next;
|
||||
BFieldOrU32(ptr,i,polypt_map[SignI64(tmpg1->p.x1-x1)+1+
|
||||
3*(SignI64(tmpg1->p.y1-y1)+1)]);
|
||||
i+=3;
|
||||
x1=tempg1->p.x1;y1=tempg1->p.y1;
|
||||
QueRem(tempg1);
|
||||
Free(tempg1);
|
||||
tempg1=tempg;
|
||||
x1=tmpg1->p.x1;y1=tmpg1->p.y1;
|
||||
QueRem(tmpg1);
|
||||
Free(tmpg1);
|
||||
tmpg1=tmpg;
|
||||
}
|
||||
res->type=SPT_POLYPT;
|
||||
res->npu.num=num;
|
||||
@@ -548,7 +548,7 @@ 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(,head,*_cur_elem_num);
|
||||
CSprite *tmpg,*insert_pt=SpriteSetSettings(,head,*_cur_elem_num);
|
||||
I64 msg_code,x1,y1;
|
||||
U8 *st;
|
||||
doc_ce->de_flags|=DOCEF_DONT_DRAW;
|
||||
@@ -564,15 +564,15 @@ U0 SMTextFamily(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *head,CDC *dc,
|
||||
case SPT_TEXT_DIAMOND: GrTextDiamond3(dc,x1,y1,0,st); break;
|
||||
}
|
||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
||||
SpriteScreenInit(dc,x,y);
|
||||
SpriteScrnInit(dc,x,y);
|
||||
x1=a1; y1=a2;
|
||||
} while (msg_code!=MSG_IP_L_UP);
|
||||
tempg=CAlloc(SpriteElemQuedBaseSize(eletype)+StrLen(st)+1);
|
||||
tempg->type=eletype;
|
||||
tempg->ps.x1=x1-x;
|
||||
tempg->ps.y1=y1-y;
|
||||
StrCpy(tempg->ps.st,st);
|
||||
QueIns(tempg,insert_pt->last);
|
||||
tmpg=CAlloc(SpriteElemQuedBaseSize(eletype)+StrLen(st)+1);
|
||||
tmpg->type=eletype;
|
||||
tmpg->ps.x1=x1-x;
|
||||
tmpg->ps.y1=y1-y;
|
||||
StrCpy(tmpg->ps.st,st);
|
||||
QueIns(tmpg,insert_pt->last);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
*_cur_elem_num+=1;
|
||||
}
|
||||
@@ -584,7 +584,7 @@ I64 SMBitMap(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *head,
|
||||
Bool sel,I64 xx1=0,I64 yy1=0,I64 xx2=0,I64 yy2=0,I64 *_cur_elem_num)
|
||||
{
|
||||
I64 i,msg_code,x=xx,y=yy,x1=a1,y1=a2,x2=a1,y2=a2,old_width;
|
||||
CSprite *tempg,*tempg1,*insert_pt;
|
||||
CSprite *tmpg,*tmpg1,*insert_pt;
|
||||
CDC *img;
|
||||
|
||||
insert_pt=SpriteSetSettings(,head,*_cur_elem_num,xx,yy,,,&x,&y);
|
||||
@@ -599,7 +599,7 @@ I64 SMBitMap(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *head,
|
||||
dc->color=ROPF_DITHER+WHITE<<16+BLACK;
|
||||
GrBorder(dc,xx1,yy1,xx2,yy2);
|
||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
||||
SpriteScreenInit(dc,x,y);
|
||||
SpriteScrnInit(dc,x,y);
|
||||
x2=a1; y2=a2;
|
||||
if (x2<x1) {
|
||||
xx1=x2; xx2=x1;
|
||||
@@ -616,18 +616,18 @@ I64 SMBitMap(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *head,
|
||||
}
|
||||
|
||||
xx2++; yy2++;
|
||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_BITMAP)+
|
||||
tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_BITMAP)+
|
||||
((xx2-xx1+7)&~7)*(yy2-yy1));
|
||||
tempg->type=SPT_BITMAP;
|
||||
tempg->pwhu.width=xx2-xx1;
|
||||
tempg->pwhu.height=yy2-yy1;
|
||||
tempg->pwhu.x1=xx1-x;
|
||||
tempg->pwhu.y1=yy1-y;
|
||||
img=DCNew(tempg->pwhu.width,tempg->pwhu.height,Fs);
|
||||
tmpg->type=SPT_BITMAP;
|
||||
tmpg->pwhu.width=xx2-xx1;
|
||||
tmpg->pwhu.height=yy2-yy1;
|
||||
tmpg->pwhu.x1=xx1-x;
|
||||
tmpg->pwhu.y1=yy1-y;
|
||||
img=DCNew(tmpg->pwhu.width,tmpg->pwhu.height,Fs);
|
||||
img->color=bm_bkcolor;
|
||||
GrRect(img,0,0,tempg->pwhu.width,tempg->pwhu.height);
|
||||
tempg1=insert_pt;
|
||||
if (tempg1==head || tempg1->type!=SPT_BITMAP) {
|
||||
GrRect(img,0,0,tmpg->pwhu.width,tmpg->pwhu.height);
|
||||
tmpg1=insert_pt;
|
||||
if (tmpg1==head || tmpg1->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);
|
||||
@@ -636,29 +636,29 @@ I64 SMBitMap(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *head,
|
||||
*_cur_elem_num=1;
|
||||
} else {
|
||||
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);
|
||||
Free(tempg1);
|
||||
Sprite3(img,-(xx1-x),-(yy1-y),0,&tmpg1->start,TRUE);
|
||||
insert_pt=tmpg1->next;
|
||||
QueRem(tmpg1);
|
||||
Free(tmpg1);
|
||||
}
|
||||
MemCpy(&tempg->pwhu.u,img->body,((xx2-xx1+7)&~7)*(yy2-yy1));
|
||||
MemCpy(&tmpg->pwhu.u,img->body,((xx2-xx1+7)&~7)*(yy2-yy1));
|
||||
|
||||
switch (i=SpriteBitMapEd(doc,doc_ce,dc,&xx1,&yy1,
|
||||
&xx2,&yy2,&img,bm_bkcolor)) {
|
||||
case GE_EXIT:
|
||||
case GE_CONT:
|
||||
Free(tempg);
|
||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_BITMAP)+
|
||||
case SPE_EXIT:
|
||||
case SPE_CONT:
|
||||
Free(tmpg);
|
||||
tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_BITMAP)+
|
||||
((xx2-xx1+7)&~7)*(yy2-yy1));
|
||||
tempg->type=eletype;
|
||||
tempg->pwhu.width=xx2-xx1;
|
||||
tempg->pwhu.height=yy2-yy1;
|
||||
tempg->pwhu.x1=xx1-x;
|
||||
tempg->pwhu.y1=yy1-y;
|
||||
MemCpy(&tempg->pwhu.u,img->body,((xx2-xx1+7)&~7)*(yy2-yy1));
|
||||
tmpg->type=eletype;
|
||||
tmpg->pwhu.width=xx2-xx1;
|
||||
tmpg->pwhu.height=yy2-yy1;
|
||||
tmpg->pwhu.x1=xx1-x;
|
||||
tmpg->pwhu.y1=yy1-y;
|
||||
MemCpy(&tmpg->pwhu.u,img->body,((xx2-xx1+7)&~7)*(yy2-yy1));
|
||||
break;
|
||||
}
|
||||
QueIns(tempg,insert_pt->last);
|
||||
QueIns(tmpg,insert_pt->last);
|
||||
DCDel(img);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
return i;
|
||||
@@ -666,46 +666,46 @@ I64 SMBitMap(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *head,
|
||||
|
||||
U0 SMMesh(CDoc *doc,CDocEntry *doc_ce,CSprite *head,I64 *_cur_elem_num)
|
||||
{
|
||||
CSprite *tempg,*insert_pt=SpriteSetSettings(,head,*_cur_elem_num),
|
||||
*tempg1=insert_pt;
|
||||
CSprite *tmpg,*insert_pt=SpriteSetSettings(,head,*_cur_elem_num),
|
||||
*tmpg1=insert_pt;
|
||||
CD3I32 *p;
|
||||
I64 i,size,x1,y1,z1;
|
||||
I32 *mesh,*old_mesh;
|
||||
if (tempg1!=head && tempg1->type==SPT_MESH)
|
||||
old_mesh=&tempg1->mu.vertex_cnt;
|
||||
else if (tempg1!=head && tempg1->type==SPT_SHIFTABLE_MESH) {
|
||||
x1=tempg1->pmu.x;
|
||||
y1=tempg1->pmu.y;
|
||||
z1=tempg1->pmu.z;
|
||||
p=&tempg1->pmu.u;
|
||||
for (i=0;i<tempg1->pmu.vertex_cnt;i++,p++) {
|
||||
if (tmpg1!=head && tmpg1->type==SPT_MESH)
|
||||
old_mesh=&tmpg1->mu.vertex_cnt;
|
||||
else if (tmpg1!=head && tmpg1->type==SPT_SHIFTABLE_MESH) {
|
||||
x1=tmpg1->pmu.x;
|
||||
y1=tmpg1->pmu.y;
|
||||
z1=tmpg1->pmu.z;
|
||||
p=&tmpg1->pmu.u;
|
||||
for (i=0;i<tmpg1->pmu.vertex_cnt;i++,p++) {
|
||||
p->x+=x1;
|
||||
p->y+=y1;
|
||||
p->z+=z1;
|
||||
}
|
||||
old_mesh=&tempg1->pmu.vertex_cnt;
|
||||
old_mesh=&tmpg1->pmu.vertex_cnt;
|
||||
} else
|
||||
old_mesh=NULL;
|
||||
if (mesh=SpriteMeshEd(old_mesh,&size,TRUE)) {
|
||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_MESH)-sizeof(I32)*2+size);
|
||||
tempg->type=SPT_MESH;
|
||||
MemCpy(&tempg->mu.vertex_cnt,mesh,size);
|
||||
tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_MESH)-sizeof(I32)*2+size);
|
||||
tmpg->type=SPT_MESH;
|
||||
MemCpy(&tmpg->mu.vertex_cnt,mesh,size);
|
||||
Free(mesh);
|
||||
QueIns(tempg,insert_pt->last);
|
||||
QueIns(tmpg,insert_pt->last);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
if (old_mesh) {
|
||||
insert_pt=tempg;
|
||||
QueRem(tempg1);
|
||||
Free(tempg1);
|
||||
insert_pt=tmpg;
|
||||
QueRem(tmpg1);
|
||||
Free(tmpg1);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
} else
|
||||
*_cur_elem_num+=1;
|
||||
} else if (old_mesh && tempg1->type==SPT_SHIFTABLE_MESH) {
|
||||
x1=tempg1->pmu.x;
|
||||
y1=tempg1->pmu.y;
|
||||
z1=tempg1->pmu.z;
|
||||
p=&tempg1->pmu.u;
|
||||
for (i=0;i<tempg1->pmu.vertex_cnt;i++,p++) {
|
||||
} else if (old_mesh && tmpg1->type==SPT_SHIFTABLE_MESH) {
|
||||
x1=tmpg1->pmu.x;
|
||||
y1=tmpg1->pmu.y;
|
||||
z1=tmpg1->pmu.z;
|
||||
p=&tmpg1->pmu.u;
|
||||
for (i=0;i<tmpg1->pmu.vertex_cnt;i++,p++) {
|
||||
p->x-=x1;
|
||||
p->y-=y1;
|
||||
p->z-=z1;
|
||||
@@ -716,72 +716,72 @@ U0 SMMesh(CDoc *doc,CDocEntry *doc_ce,CSprite *head,I64 *_cur_elem_num)
|
||||
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(,head,*_cur_elem_num),
|
||||
*tempg1=insert_pt;
|
||||
CSprite *tmpg,*insert_pt=SpriteSetSettings(,head,*_cur_elem_num),
|
||||
*tmpg1=insert_pt;
|
||||
CD3I32 *p;
|
||||
I64 i,size,z,x1,y1,z1;
|
||||
I32 *mesh,*old_mesh;
|
||||
if (tempg1!=head && tempg1->type==SPT_MESH) {
|
||||
if (tmpg1!=head && tmpg1->type==SPT_MESH) {
|
||||
z=0;
|
||||
x1=-(a1-x);
|
||||
y1=-(a2-y);
|
||||
z1=z;
|
||||
p=&tempg1->mu.u;
|
||||
for (i=0;i<tempg1->mu.vertex_cnt;i++,p++) {
|
||||
p=&tmpg1->mu.u;
|
||||
for (i=0;i<tmpg1->mu.vertex_cnt;i++,p++) {
|
||||
p->x+=x1;
|
||||
p->y+=y1;
|
||||
p->z+=z1;
|
||||
}
|
||||
old_mesh=&tempg1->mu.vertex_cnt;
|
||||
} 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);
|
||||
z1=tempg1->pmu.z+z;
|
||||
p=&tempg1->pmu.u;
|
||||
for (i=0;i<tempg1->pmu.vertex_cnt;i++,p++) {
|
||||
old_mesh=&tmpg1->mu.vertex_cnt;
|
||||
} else if (tmpg1!=head && tmpg1->type==SPT_SHIFTABLE_MESH) {
|
||||
z=-tmpg1->pmu.z;
|
||||
x1=tmpg1->pmu.x-(a1-x);
|
||||
y1=tmpg1->pmu.y-(a2-y);
|
||||
z1=tmpg1->pmu.z+z;
|
||||
p=&tmpg1->pmu.u;
|
||||
for (i=0;i<tmpg1->pmu.vertex_cnt;i++,p++) {
|
||||
p->x+=x1;
|
||||
p->y+=y1;
|
||||
p->z+=z1;
|
||||
}
|
||||
old_mesh=&tempg1->pmu.vertex_cnt;
|
||||
old_mesh=&tmpg1->pmu.vertex_cnt;
|
||||
} else {
|
||||
z=0;
|
||||
old_mesh=NULL;
|
||||
}
|
||||
if (mesh=SpriteMeshEd(old_mesh,&size,TRUE)) {
|
||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_SHIFTABLE_MESH)-sizeof(I32)*2+size);
|
||||
tempg->type=SPT_SHIFTABLE_MESH;
|
||||
MemCpy(&tempg->pmu.vertex_cnt,mesh,size);
|
||||
tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_SHIFTABLE_MESH)-sizeof(I32)*2+size);
|
||||
tmpg->type=SPT_SHIFTABLE_MESH;
|
||||
MemCpy(&tmpg->pmu.vertex_cnt,mesh,size);
|
||||
Free(mesh);
|
||||
tempg->pmu.x=a1-x;
|
||||
tempg->pmu.y=a2-y;
|
||||
tempg->pmu.z=-z;
|
||||
QueIns(tempg,insert_pt->last);
|
||||
tmpg->pmu.x=a1-x;
|
||||
tmpg->pmu.y=a2-y;
|
||||
tmpg->pmu.z=-z;
|
||||
QueIns(tmpg,insert_pt->last);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
if (old_mesh) {
|
||||
insert_pt=tempg;
|
||||
QueRem(tempg1);
|
||||
Free(tempg1);
|
||||
insert_pt=tmpg;
|
||||
QueRem(tmpg1);
|
||||
Free(tmpg1);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
} else
|
||||
*_cur_elem_num+=1;
|
||||
} else if (old_mesh && tempg1->type==SPT_SHIFTABLE_MESH) {
|
||||
x1=tempg1->pmu.x-(a1-x);
|
||||
y1=tempg1->pmu.y-(a2-y);
|
||||
z1=tempg1->pmu.z+z;
|
||||
p=&tempg1->pmu.u;
|
||||
for (i=0;i<tempg1->pmu.vertex_cnt;i++,p++) {
|
||||
} else if (old_mesh && tmpg1->type==SPT_SHIFTABLE_MESH) {
|
||||
x1=tmpg1->pmu.x-(a1-x);
|
||||
y1=tmpg1->pmu.y-(a2-y);
|
||||
z1=tmpg1->pmu.z+z;
|
||||
p=&tmpg1->pmu.u;
|
||||
for (i=0;i<tmpg1->pmu.vertex_cnt;i++,p++) {
|
||||
p->x-=x1;
|
||||
p->y-=y1;
|
||||
p->z-=z1;
|
||||
}
|
||||
} else if (old_mesh && tempg1->type==SPT_MESH) {
|
||||
} else if (old_mesh && tmpg1->type==SPT_MESH) {
|
||||
x1=-(a1-x);
|
||||
y1=-(a2-y);
|
||||
z1= z;
|
||||
p=&tempg1->mu.u;
|
||||
for (i=0;i<tempg1->mu.vertex_cnt;i++,p++) {
|
||||
p=&tmpg1->mu.u;
|
||||
for (i=0;i<tmpg1->mu.vertex_cnt;i++,p++) {
|
||||
p->x-=x1;
|
||||
p->y-=y1;
|
||||
p->z-=z1;
|
||||
@@ -793,11 +793,11 @@ U0 SMTaskTitleSet(I64 eletype)
|
||||
{
|
||||
Fs->title_src=TTS_CONST; //Violates TTS_LOCKED_CONST
|
||||
switch (eletype) {
|
||||
case SPT_INS_SCREEN_BITMAP:
|
||||
StrCpy(Fs->task_title,"Insert Screen BitMap");
|
||||
case SPT_INS_SCRN_BITMAP:
|
||||
StrCpy(Fs->task_title,"Insert Scrn BitMap");
|
||||
break;
|
||||
case SPT_INS_TRANSPARENT_SCREEN_BITMAP:
|
||||
StrCpy(Fs->task_title,"Insert Transparent Screen BitMap");
|
||||
case SPT_INS_TRANSPARENT_SCRN_BITMAP:
|
||||
StrCpy(Fs->task_title,"Insert Transparent Scrn BitMap");
|
||||
break;
|
||||
default:
|
||||
if (eletype>=0)
|
||||
@@ -813,13 +813,13 @@ 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 *head,*tempg,*insert_pt;
|
||||
CSprite *head,*tmpg,*insert_pt;
|
||||
CDC *dc=DCAlias(,Fs),*dc2=DCAlias(,sys_winmgr_task),*dc3;
|
||||
U8 *old_task_title=StrNew(Fs->task_title);
|
||||
|
||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||
AutoComplete;
|
||||
WinMgrSync(2,TRUE);
|
||||
Refresh(2,TRUE);
|
||||
dc2->flags|=DCF_ON_TOP;
|
||||
head=Sprite2SpriteQue(doc_ce->bin_data->data);
|
||||
cur_elem_num=QueCnt(head);
|
||||
@@ -873,10 +873,10 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
i=PopUpColor(,,FALSE);
|
||||
if (i>=0) {
|
||||
color=i;
|
||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_COLOR));
|
||||
tempg->type=SPT_COLOR;
|
||||
tempg->c.color=color;
|
||||
QueIns(tempg,insert_pt->last);
|
||||
tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_COLOR));
|
||||
tmpg->type=SPT_COLOR;
|
||||
tmpg->c.color=color;
|
||||
QueIns(tmpg,insert_pt->last);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
cur_elem_num++;
|
||||
}
|
||||
@@ -888,10 +888,10 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
i=PopUpColorDither;
|
||||
if (i>=0) {
|
||||
color=i;
|
||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_DITHER_COLOR));
|
||||
tempg->type=SPT_DITHER_COLOR;
|
||||
tempg->d.dither_color=color.c0.color|color.c1.color<<8;
|
||||
QueIns(tempg,insert_pt->last);
|
||||
tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_DITHER_COLOR));
|
||||
tmpg->type=SPT_DITHER_COLOR;
|
||||
tmpg->d.dither_color=color.c0.color|color.c1.color<<8;
|
||||
QueIns(tmpg,insert_pt->last);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
cur_elem_num++;
|
||||
}
|
||||
@@ -900,9 +900,9 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
break;
|
||||
case SPT_ED_MENU:
|
||||
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;
|
||||
case SPE_ABORT: eletype=DOCM_CANCEL; break;
|
||||
case SPE_EXIT: eletype=SPT_EXIT; break;
|
||||
case SPE_CONT: eletype=SPT_MENU; break;
|
||||
}
|
||||
break;
|
||||
case SPT_MESH:
|
||||
@@ -934,7 +934,7 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
PopUpOk("Select Origin.\n");
|
||||
doc_ce->de_flags=old_de_flags;
|
||||
break;
|
||||
case SPT_INS_SCREEN_BITMAP:
|
||||
case SPT_INS_SCRN_BITMAP:
|
||||
doc_ce->de_flags|=DOCEF_DONT_DRAW;
|
||||
PopUpOk("Drag-out a rect for the extents of the\nbitmap.\n");
|
||||
doc_ce->de_flags=old_de_flags;
|
||||
@@ -957,8 +957,8 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
xx1+=xx; yy1+=yy;
|
||||
xx2+=xx; yy2+=yy;
|
||||
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;
|
||||
FALSE,xx1,yy1,xx2,yy2,&cur_elem_num)==SPE_EXIT) {
|
||||
res=SPE_EXIT;
|
||||
goto ei_done;
|
||||
}
|
||||
eletype=SPT_MENU;
|
||||
@@ -966,7 +966,7 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
}
|
||||
doc_ce->de_flags=old_de_flags;
|
||||
break;
|
||||
case SPT_INS_TRANSPARENT_SCREEN_BITMAP:
|
||||
case SPT_INS_TRANSPARENT_SCRN_BITMAP:
|
||||
doc_ce->de_flags|=DOCEF_DONT_DRAW;
|
||||
i=PopUpColor("Color to Become Transparent\n\n",,FALSE);
|
||||
if (i<0)
|
||||
@@ -984,10 +984,10 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
i=PopUpRangeI64(1,16,1,"Pen Width\n");
|
||||
if (i>=1) {
|
||||
width=i;
|
||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_WIDTH));
|
||||
tempg->type=SPT_WIDTH;
|
||||
tempg->w.width=width;
|
||||
QueIns(tempg,insert_pt->last);
|
||||
tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_WIDTH));
|
||||
tmpg->type=SPT_WIDTH;
|
||||
tmpg->w.width=width;
|
||||
QueIns(tmpg,insert_pt->last);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
cur_elem_num++;
|
||||
}
|
||||
@@ -996,12 +996,12 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
break;
|
||||
case SPT_TRANSFORM_ON:
|
||||
case SPT_TRANSFORM_OFF:
|
||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_TRANSFORM_ON));
|
||||
tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_TRANSFORM_ON));
|
||||
if (eletype==SPT_TRANSFORM_ON)
|
||||
tempg->type=SPT_TRANSFORM_ON;
|
||||
tmpg->type=SPT_TRANSFORM_ON;
|
||||
else
|
||||
tempg->type=SPT_TRANSFORM_OFF;
|
||||
QueIns(tempg,insert_pt->last);
|
||||
tmpg->type=SPT_TRANSFORM_OFF;
|
||||
QueIns(tmpg,insert_pt->last);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
cur_elem_num++;
|
||||
eletype=SPT_MENU;
|
||||
@@ -1026,39 +1026,39 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
insert_pt=SpriteSetSettings(dc,head,cur_elem_num,xx,yy,
|
||||
&color,&width,&x,&y);
|
||||
x+=xx; y+=yy;
|
||||
SpriteScreenInit(dc,x,y);
|
||||
SpriteScrnInit(dc,x,y);
|
||||
if (eletype==SPT_EXIT) {
|
||||
res=GE_EXIT;
|
||||
res=SPE_EXIT;
|
||||
goto ei_done;
|
||||
} else if (eletype==DOCM_CANCEL) {
|
||||
res=GE_ABORT;
|
||||
res=SPE_ABORT;
|
||||
goto ei_done;
|
||||
}
|
||||
switch (GetMsg(&a1,&a2,1<<MSG_KEY_DOWN|1<<MSG_IP_R_UP|1<<MSG_IP_L_DOWN)) {
|
||||
case MSG_KEY_DOWN:
|
||||
switch (a1) {
|
||||
case CH_ESC:
|
||||
res=GE_EXIT;
|
||||
res=SPE_EXIT;
|
||||
goto ei_done;
|
||||
case CH_SHIFT_ESC:
|
||||
res=GE_ABORT;
|
||||
res=SPE_ABORT;
|
||||
goto ei_done;
|
||||
case 'c': //eye-dropper
|
||||
dc3=DCScreenCapture(FALSE);
|
||||
dc3=DCScrnCapture(FALSE);
|
||||
color=GrPeek(dc3,ip.pos.x,ip.pos.y)^15;//Mouse cursor is XORed.
|
||||
DCDel(dc3);
|
||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_COLOR));
|
||||
tempg->type=SPT_COLOR;
|
||||
tempg->c.color=color;
|
||||
QueIns(tempg,insert_pt->last);
|
||||
tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_COLOR));
|
||||
tmpg->type=SPT_COLOR;
|
||||
tmpg->c.color=color;
|
||||
QueIns(tmpg,insert_pt->last);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
cur_elem_num++;
|
||||
break;
|
||||
case 't': //Set to transparent color
|
||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_COLOR));
|
||||
tempg->type=SPT_COLOR;
|
||||
tempg->c.color=TRANSPARENT;
|
||||
QueIns(tempg,insert_pt->last);
|
||||
tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_COLOR));
|
||||
tmpg->type=SPT_COLOR;
|
||||
tmpg->c.color=TRANSPARENT;
|
||||
QueIns(tmpg,insert_pt->last);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
cur_elem_num++;
|
||||
break;
|
||||
@@ -1066,9 +1066,9 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
break;
|
||||
case MSG_IP_R_UP:
|
||||
if (eletype==SPT_PLANAR_SYMMETRY) {
|
||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_PLANAR_SYMMETRY));
|
||||
tempg->type=SPT_PLANAR_SYMMETRY;
|
||||
QueIns(tempg,insert_pt->last);
|
||||
tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_PLANAR_SYMMETRY));
|
||||
tmpg->type=SPT_PLANAR_SYMMETRY;
|
||||
QueIns(tmpg,insert_pt->last);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
cur_elem_num++;
|
||||
eletype=SPT_MENU;
|
||||
@@ -1079,62 +1079,62 @@ I64 SpriteMainEd(CDoc *doc)
|
||||
switch (eletype) {
|
||||
start:
|
||||
case SPT_LINE:
|
||||
tempg=SMLine(dc,x,y,a1,a2,color);
|
||||
tmpg=SMLine(dc,x,y,a1,a2,color);
|
||||
break;
|
||||
case SPT_ARROW:
|
||||
tempg=SMArrow(dc,x,y,a1,a2,color);
|
||||
tmpg=SMArrow(dc,x,y,a1,a2,color);
|
||||
break;
|
||||
case SPT_PLANAR_SYMMETRY:
|
||||
tempg=SMPlanarSymmetry(dc,x,y,a1,a2);
|
||||
tmpg=SMPlanarSymmetry(dc,x,y,a1,a2);
|
||||
eletype=SPT_MENU;
|
||||
break;
|
||||
case SPT_RECT:
|
||||
tempg=SMRect(dc,x,y,a1,a2,color);
|
||||
tmpg=SMRect(dc,x,y,a1,a2,color);
|
||||
break;
|
||||
case SPT_INS_SCREEN_BITMAP:
|
||||
case SPT_INS_TRANSPARENT_SCREEN_BITMAP:
|
||||
tempg=SMScreenBitMap(eletype,dc,dc2,x,y,a1,a2,bm_bkcolor);
|
||||
case SPT_INS_SCRN_BITMAP:
|
||||
case SPT_INS_TRANSPARENT_SCRN_BITMAP:
|
||||
tmpg=SMScrnBitMap(eletype,dc,dc2,x,y,a1,a2,bm_bkcolor);
|
||||
eletype=SPT_MENU;
|
||||
break;
|
||||
case SPT_CIRCLE:
|
||||
tempg=SMCircle(dc,x,y,a1,a2,color);
|
||||
tmpg=SMCircle(dc,x,y,a1,a2,color);
|
||||
break;
|
||||
case SPT_ELLIPSE:
|
||||
tempg=SMEllipse(dc,x,y,a1,a2,color);
|
||||
tmpg=SMEllipse(dc,x,y,a1,a2,color);
|
||||
break;
|
||||
case SPT_POLYGON:
|
||||
tempg=SMPolygon(dc,x,y,a1,a2,i,color);
|
||||
tmpg=SMPolygon(dc,x,y,a1,a2,i,color);
|
||||
eletype=SPT_MENU;
|
||||
break;
|
||||
case SPT_PT:
|
||||
case SPT_FLOOD_FILL:
|
||||
case SPT_FLOOD_FILL_NOT:
|
||||
tempg=CAlloc(SpriteElemQuedBaseSize(eletype));
|
||||
tempg->type=eletype;
|
||||
tempg->p.x1=a1-x;
|
||||
tempg->p.y1=a2-y;
|
||||
tmpg=CAlloc(SpriteElemQuedBaseSize(eletype));
|
||||
tmpg->type=eletype;
|
||||
tmpg->p.x1=a1-x;
|
||||
tmpg->p.y1=a2-y;
|
||||
break;
|
||||
case SPT_POLYLINE:
|
||||
case SPT_BSPLINE2:
|
||||
case SPT_BSPLINE3:
|
||||
case SPT_BSPLINE2_CLOSED:
|
||||
case SPT_BSPLINE3_CLOSED:
|
||||
tempg=SMPolyLineFamily(eletype,dc,x,y,a1,a2,color);
|
||||
tmpg=SMPolyLineFamily(eletype,dc,x,y,a1,a2,color);
|
||||
break;
|
||||
case SPT_POLYPT:
|
||||
tempg=SMPolyPoint(dc,x,y,a1,a2,color);
|
||||
tmpg=SMPolyPoint(dc,x,y,a1,a2,color);
|
||||
break;
|
||||
end:
|
||||
if (tempg) {
|
||||
QueIns(tempg,insert_pt->last);
|
||||
if (tmpg) {
|
||||
QueIns(tmpg,insert_pt->last);
|
||||
SpriteEdUpdate(doc,doc_ce,head);
|
||||
cur_elem_num++;
|
||||
}
|
||||
break;
|
||||
case SPT_BITMAP:
|
||||
if (SMBitMap(eletype,doc,doc_ce,head,dc,xx,yy,a1,a2,bm_bkcolor,
|
||||
TRUE,,,,,&cur_elem_num)==GE_EXIT) {
|
||||
res=GE_EXIT;
|
||||
TRUE,,,,,&cur_elem_num)==SPE_EXIT) {
|
||||
res=SPE_EXIT;
|
||||
goto ei_done;
|
||||
}
|
||||
doc_ce->de_flags=old_de_flags;
|
||||
@@ -1172,33 +1172,33 @@ U0 EdSpriteIns(CDoc *doc)
|
||||
Bool unlock;
|
||||
U8 *st;
|
||||
CDocEntry *doc_e;
|
||||
CDocBin *tempb;
|
||||
CDocBin *tmpb;
|
||||
if (Fs!=doc->mem_task)
|
||||
throw('Graphics');
|
||||
if (st=EdSprite(doc->cur_bin_num)) {
|
||||
unlock=DocLock(doc);
|
||||
tempb=CAlloc(sizeof(CDocBin),doc->mem_task);
|
||||
tempb->size=sprite_elem_base_sizes[SPT_END];
|
||||
tempb->data=CAlloc(tempb->size,doc->mem_task);
|
||||
tempb->num=doc->cur_bin_num++;
|
||||
tempb->use_cnt=1;
|
||||
QueIns(tempb,doc->bin_head.last);
|
||||
tmpb=CAlloc(sizeof(CDocBin),doc->mem_task);
|
||||
tmpb->size=sprite_elem_base_sizes[SPT_END];
|
||||
tmpb->data=CAlloc(tmpb->size,doc->mem_task);
|
||||
tmpb->num=doc->cur_bin_num++;
|
||||
tmpb->use_cnt=1;
|
||||
QueIns(tmpb,doc->bin_head.last);
|
||||
doc_e=DocPrint(doc,"%s",st);
|
||||
doc_e->bin_data=tempb;
|
||||
doc_e->bin_data=tmpb;
|
||||
Free(st);
|
||||
if (doc_e) {
|
||||
if (doc_e->de_flags&DOCEF_TAG && doc_e->tag && *doc_e->tag)
|
||||
tempb->tag=StrNew(doc_e->tag,doc->mem_task);
|
||||
tmpb->tag=StrNew(doc_e->tag,doc->mem_task);
|
||||
doc->cur_entry=doc_e;
|
||||
doc->cur_col=0;
|
||||
DocUnlock(doc);
|
||||
DocRecalc(doc);
|
||||
if (SpriteMainEd(doc)==GE_ABORT) {
|
||||
if (SpriteMainEd(doc)==SPE_ABORT) {
|
||||
DocLock(doc);
|
||||
DocEntryDel(doc,doc_e);
|
||||
}
|
||||
} else
|
||||
DocBinDel(doc,tempb);
|
||||
DocBinDel(doc,tmpb);
|
||||
if (unlock)
|
||||
DocUnlock(doc);
|
||||
}
|
||||
@@ -1209,21 +1209,21 @@ U0 EdSpriteIns(CDoc *doc)
|
||||
U0 EdSpriteEd(CDoc *doc)
|
||||
{
|
||||
CDocEntry *doc_ce;
|
||||
CDocBin *tempb;
|
||||
CDocBin *tmpb;
|
||||
CSprite *old_csprite;
|
||||
I64 old_size;
|
||||
Bool unlock=DocLock(doc);
|
||||
doc_ce=doc->cur_entry;
|
||||
tempb=doc_ce->bin_data;
|
||||
old_size=tempb->size;
|
||||
old_csprite=tempb->data;
|
||||
tempb->data=MAllocIdent(old_csprite,doc->mem_task);
|
||||
tmpb=doc_ce->bin_data;
|
||||
old_size=tmpb->size;
|
||||
old_csprite=tmpb->data;
|
||||
tmpb->data=MAllocIdent(old_csprite,doc->mem_task);
|
||||
DocUnlock(doc);
|
||||
if (SpriteMainEd(doc)==GE_ABORT) {
|
||||
if (SpriteMainEd(doc)==SPE_ABORT) {
|
||||
DocLock(doc);
|
||||
Free(tempb->data);
|
||||
tempb->data=old_csprite;
|
||||
tempb->size=old_size;
|
||||
Free(tmpb->data);
|
||||
tmpb->data=old_csprite;
|
||||
tmpb->size=old_size;
|
||||
} else
|
||||
Free(old_csprite);
|
||||
if (unlock)
|
||||
|
||||
+296
-296
@@ -13,7 +13,7 @@ class CMeshEdVertex
|
||||
CD3I32 p; //World coordinates of the point.
|
||||
U0 end;
|
||||
CD3I32 p0,
|
||||
pt; //Transformed coordinates. (Screen)
|
||||
pt; //Transformed coordinates. (Scrn)
|
||||
I32 num,flags;
|
||||
};
|
||||
|
||||
@@ -42,7 +42,7 @@ class CMeshFrame
|
||||
F64 view_scale;
|
||||
CDC *dc;
|
||||
I32 *depth_buf;
|
||||
I64 *w2s,*s2w; //Screen-to-world and world-to-screen transform matrices.
|
||||
I64 *w2s,*s2w; //Scrn-to-world and world-to-scrn transform matrices.
|
||||
I64 vertex_cnt,tri_cnt; //Set by MeshSize
|
||||
CMeshEdVertex vertex_head,*cur_vertex,*chain_pred;
|
||||
CMeshEdTri tri_head,*cur_tri;
|
||||
@@ -51,128 +51,128 @@ class CMeshFrame
|
||||
|
||||
CMeshEdVertex *MeshVertexNew(CMeshFrame *e,I64 x,I64 y,I64 z)
|
||||
{
|
||||
CMeshEdVertex *tempv=CAlloc(sizeof(CMeshEdVertex));
|
||||
tempv->p.x=x;
|
||||
tempv->p.y=y;
|
||||
tempv->p.z=z;
|
||||
QueIns(tempv,e->vertex_head.last);
|
||||
return tempv;
|
||||
CMeshEdVertex *tmpv=CAlloc(sizeof(CMeshEdVertex));
|
||||
tmpv->p.x=x;
|
||||
tmpv->p.y=y;
|
||||
tmpv->p.z=z;
|
||||
QueIns(tmpv,e->vertex_head.last);
|
||||
return tmpv;
|
||||
}
|
||||
|
||||
CMeshEdTri *MeshTriNew(CMeshFrame *e,CColorROPU32 color,
|
||||
CMeshEdVertex *v1,CMeshEdVertex *v2,CMeshEdVertex *v3)
|
||||
{
|
||||
static I64 cpu_num=0;
|
||||
CMeshEdTri *tempt=CAlloc(sizeof(CMeshEdTri));
|
||||
tempt->cpu_num=cpu_num++%mp_cnt;
|
||||
tempt->mt.color=color;
|
||||
tempt->t[0]=v1;
|
||||
tempt->t[1]=v2;
|
||||
tempt->t[2]=v3;
|
||||
QueIns(tempt,e->tri_head.last);
|
||||
return tempt;
|
||||
CMeshEdTri *tmpt=CAlloc(sizeof(CMeshEdTri));
|
||||
tmpt->cpu_num=cpu_num++%mp_cnt;
|
||||
tmpt->mt.color=color;
|
||||
tmpt->t[0]=v1;
|
||||
tmpt->t[1]=v2;
|
||||
tmpt->t[2]=v3;
|
||||
QueIns(tmpt,e->tri_head.last);
|
||||
return tmpt;
|
||||
}
|
||||
|
||||
CMeshEdVertex *MeshVertexFindScrPt(CMeshFrame *e,I64 x,I64 y)
|
||||
{//Screen coordinates
|
||||
CMeshEdVertex *res=NULL,*tempv=e->vertex_head.next;
|
||||
{//Scrn coordinates
|
||||
CMeshEdVertex *res=NULL,*tmpv=e->vertex_head.next;
|
||||
I64 dd,dz,best_dd=MAX_I64,best_dz=MAX_I64;
|
||||
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);
|
||||
while (tmpv!=&e->vertex_head) {
|
||||
if (!(tmpv->flags&VF_IGNORE)) {
|
||||
dd=SqrI64(x-tmpv->pt.x)+SqrI64(y-tmpv->pt.y);
|
||||
dz=AbsI64(e->ip_z-tmpv->p.z);
|
||||
if (dd<best_dd || dd==best_dd && dz<best_dz) {
|
||||
res=tempv;
|
||||
res=tmpv;
|
||||
best_dd=dd;
|
||||
best_dz=dz;
|
||||
}
|
||||
}
|
||||
tempv=tempv->next;
|
||||
tmpv=tmpv->next;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
CMeshEdVertex *MeshVertexFindNum(CMeshFrame *haystack_e,I64 needle_num)
|
||||
{
|
||||
CMeshEdVertex *tempv=haystack_e->vertex_head.next;
|
||||
while (tempv!=&haystack_e->vertex_head) {
|
||||
if (tempv->num==needle_num)
|
||||
return tempv;
|
||||
tempv=tempv->next;
|
||||
CMeshEdVertex *tmpv=haystack_e->vertex_head.next;
|
||||
while (tmpv!=&haystack_e->vertex_head) {
|
||||
if (tmpv->num==needle_num)
|
||||
return tmpv;
|
||||
tmpv=tmpv->next;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
U0 MeshTriDel(CMeshFrame *e,CMeshEdTri *tempt)
|
||||
U0 MeshTriDel(CMeshFrame *e,CMeshEdTri *tmpt)
|
||||
{
|
||||
if (tempt) {
|
||||
if (tempt==e->cur_tri)
|
||||
if (tmpt) {
|
||||
if (tmpt==e->cur_tri)
|
||||
e->cur_tri=NULL;
|
||||
QueRem(tempt);
|
||||
Free(tempt);
|
||||
QueRem(tmpt);
|
||||
Free(tmpt);
|
||||
}
|
||||
}
|
||||
|
||||
U0 MeshVertexDel(CMeshFrame *e,CMeshEdVertex *tempv)
|
||||
U0 MeshVertexDel(CMeshFrame *e,CMeshEdVertex *tmpv)
|
||||
{
|
||||
I64 i;
|
||||
CMeshEdTri *tempt,*tempt1;
|
||||
if (tempv) {
|
||||
tempt=e->tri_head.next;
|
||||
while (tempt!=&e->tri_head) {
|
||||
tempt1=tempt->next;
|
||||
CMeshEdTri *tmpt,*tmpt1;
|
||||
if (tmpv) {
|
||||
tmpt=e->tri_head.next;
|
||||
while (tmpt!=&e->tri_head) {
|
||||
tmpt1=tmpt->next;
|
||||
for (i=0;i<3;i++)
|
||||
if (tempt->t[i]==tempv)
|
||||
if (tmpt->t[i]==tmpv)
|
||||
break;
|
||||
if (i<3)
|
||||
MeshTriDel(e,tempt);
|
||||
tempt=tempt1;
|
||||
MeshTriDel(e,tmpt);
|
||||
tmpt=tmpt1;
|
||||
}
|
||||
if (tempv==e->cur_vertex)
|
||||
if (tmpv==e->cur_vertex)
|
||||
e->cur_vertex=NULL;
|
||||
if (tempv==e->chain_pred)
|
||||
if (tmpv==e->chain_pred)
|
||||
e->chain_pred=NULL;
|
||||
QueRem(tempv);
|
||||
Free(tempv);
|
||||
QueRem(tmpv);
|
||||
Free(tmpv);
|
||||
}
|
||||
}
|
||||
|
||||
U0 MeshFence(CMeshFrame *e)
|
||||
{
|
||||
CMeshEdVertex *tempv,*tempv1,*tempv_last=NULL,*tempv1_last=NULL,
|
||||
CMeshEdVertex *tmpv,*tmpv1,*tmpv_last=NULL,*tmpv1_last=NULL,
|
||||
*start=e->chain_pred->next,*end=e->vertex_head.last;
|
||||
tempv=start;
|
||||
tmpv=start;
|
||||
while (TRUE) {
|
||||
tempv1=MeshVertexNew(e,tempv->p.x,tempv->p.y,tempv->p.z+e->thickness);
|
||||
if (tempv_last) {
|
||||
MeshTriNew(e,e->cur_color,tempv_last,tempv,tempv1);
|
||||
MeshTriNew(e,e->cur_color,tempv1,tempv1_last,tempv_last);
|
||||
tmpv1=MeshVertexNew(e,tmpv->p.x,tmpv->p.y,tmpv->p.z+e->thickness);
|
||||
if (tmpv_last) {
|
||||
MeshTriNew(e,e->cur_color,tmpv_last,tmpv,tmpv1);
|
||||
MeshTriNew(e,e->cur_color,tmpv1,tmpv1_last,tmpv_last);
|
||||
}
|
||||
tempv_last=tempv;
|
||||
tempv1_last=tempv1;
|
||||
if (tempv==end)
|
||||
tmpv_last=tmpv;
|
||||
tmpv1_last=tmpv1;
|
||||
if (tmpv==end)
|
||||
break;
|
||||
tempv=tempv->next;
|
||||
tmpv=tmpv->next;
|
||||
}
|
||||
if (e->closed && tempv_last) {
|
||||
MeshTriNew(e,e->cur_color,tempv_last,start,end->next);
|
||||
MeshTriNew(e,e->cur_color,end->next,tempv1_last,tempv_last);
|
||||
if (e->closed && tmpv_last) {
|
||||
MeshTriNew(e,e->cur_color,tmpv_last,start,end->next);
|
||||
MeshTriNew(e,e->cur_color,end->next,tmpv1_last,tmpv_last);
|
||||
}
|
||||
}
|
||||
|
||||
U0 MeshPolygon(CMeshFrame *e,CMeshEdVertex *start,CMeshEdVertex *end,Bool rev)
|
||||
{
|
||||
CMeshEdVertex *tempv,*tempv1;
|
||||
CMeshEdVertex *tmpv,*tmpv1;
|
||||
if (start!=end) {
|
||||
tempv=start;
|
||||
tempv1=tempv->next;
|
||||
while (tempv1!=end) {
|
||||
tmpv=start;
|
||||
tmpv1=tmpv->next;
|
||||
while (tmpv1!=end) {
|
||||
if (rev)
|
||||
MeshTriNew(e,e->cur_color,tempv1,tempv,end);
|
||||
MeshTriNew(e,e->cur_color,tmpv1,tmpv,end);
|
||||
else
|
||||
MeshTriNew(e,e->cur_color,tempv,tempv1,end);
|
||||
tempv=tempv->next;
|
||||
tempv1=tempv1->next;
|
||||
MeshTriNew(e,e->cur_color,tmpv,tmpv1,end);
|
||||
tmpv=tmpv->next;
|
||||
tmpv1=tmpv1->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -187,58 +187,58 @@ U0 MeshPrism(CMeshFrame *e)
|
||||
|
||||
U0 MeshVertexSelAll(CMeshFrame *e,Bool val)
|
||||
{
|
||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
||||
while (tempv!=&e->vertex_head) {
|
||||
CMeshEdVertex *tmpv=e->vertex_head.next;
|
||||
while (tmpv!=&e->vertex_head) {
|
||||
if (val)
|
||||
tempv->flags|=VF_SEL;
|
||||
tmpv->flags|=VF_SEL;
|
||||
else
|
||||
tempv->flags&=~VF_SEL;
|
||||
tempv=tempv->next;
|
||||
tmpv->flags&=~VF_SEL;
|
||||
tmpv=tmpv->next;
|
||||
}
|
||||
}
|
||||
|
||||
U0 MeshTriSelAll(CMeshFrame *e,Bool val)
|
||||
{
|
||||
CMeshEdTri *tempt=e->tri_head.next;
|
||||
while (tempt!=&e->tri_head) {
|
||||
CMeshEdTri *tmpt=e->tri_head.next;
|
||||
while (tmpt!=&e->tri_head) {
|
||||
if (val)
|
||||
tempt->flags|=TF_SEL;
|
||||
tmpt->flags|=TF_SEL;
|
||||
else
|
||||
tempt->flags&=~TF_SEL;
|
||||
tempt=tempt->next;
|
||||
tmpt->flags&=~TF_SEL;
|
||||
tmpt=tmpt->next;
|
||||
}
|
||||
}
|
||||
|
||||
U0 MeshVertexIgnoreSet(CMeshFrame *e,Bool val)
|
||||
{
|
||||
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;
|
||||
tempv=tempv->next;
|
||||
CMeshEdVertex *tmpv=e->vertex_head.next;
|
||||
while (tmpv!=&e->vertex_head) {
|
||||
tmpv->flags&=~VF_IGNORE;
|
||||
if (tmpv->flags&VF_SEL && val)
|
||||
tmpv->flags|=VF_IGNORE;
|
||||
tmpv=tmpv->next;
|
||||
}
|
||||
}
|
||||
|
||||
U0 MeshP0Capture(CMeshFrame *e)
|
||||
{
|
||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
||||
while (tempv!=&e->vertex_head) {
|
||||
MemCpy(&tempv->p0,&tempv->p,sizeof(CD3I32));
|
||||
tempv=tempv->next;
|
||||
CMeshEdVertex *tmpv=e->vertex_head.next;
|
||||
while (tmpv!=&e->vertex_head) {
|
||||
MemCpy(&tmpv->p0,&tmpv->p,sizeof(CD3I32));
|
||||
tmpv=tmpv->next;
|
||||
}
|
||||
}
|
||||
|
||||
U0 MeshP0Offset(CMeshFrame *e,I64 dx,I64 dy,I64 dz)
|
||||
{
|
||||
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;
|
||||
tempv->p.z=tempv->p0.z+dz;
|
||||
CMeshEdVertex *tmpv=e->vertex_head.next;
|
||||
while (tmpv!=&e->vertex_head) {
|
||||
if (tmpv->flags&VF_SEL) {
|
||||
tmpv->p.x=tmpv->p0.x+dx;
|
||||
tmpv->p.y=tmpv->p0.y+dy;
|
||||
tmpv->p.z=tmpv->p0.z+dz;
|
||||
}
|
||||
tempv=tempv->next;
|
||||
tmpv=tmpv->next;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,69 +248,69 @@ 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_head.next;
|
||||
CMeshEdVertex *tmpv=e->vertex_head.next;
|
||||
if (x1>x2) SwapI64(&x1,&x2);
|
||||
if (y1>y2) SwapI64(&y1,&y2);
|
||||
while (tempv!=&e->vertex_head) {
|
||||
if (x1<=tempv->pt.x<=x2 &&
|
||||
y1<=tempv->pt.y<=y2) {
|
||||
while (tmpv!=&e->vertex_head) {
|
||||
if (x1<=tmpv->pt.x<=x2 &&
|
||||
y1<=tmpv->pt.y<=y2) {
|
||||
if (sel_mode==SEL_MESH_AND)
|
||||
tempv->flags&=~VF_SEL;
|
||||
tmpv->flags&=~VF_SEL;
|
||||
else
|
||||
tempv->flags|=VF_SEL;
|
||||
tmpv->flags|=VF_SEL;
|
||||
} else if (sel_mode==SEL_MESH_EQU)
|
||||
tempv->flags&=~VF_SEL;
|
||||
tempv=tempv->next;
|
||||
tmpv->flags&=~VF_SEL;
|
||||
tmpv=tmpv->next;
|
||||
}
|
||||
}
|
||||
|
||||
U0 MeshTriSelRect(CMeshFrame *e,I64 sel_mode,I64 x1,I64 x2,I64 y1,I64 y2)
|
||||
{
|
||||
CMeshEdTri *tempt=e->tri_head.next;
|
||||
CMeshEdTri *tmpt=e->tri_head.next;
|
||||
if (x1>x2) SwapI64(&x1,&x2);
|
||||
if (y1>y2) SwapI64(&y1,&y2);
|
||||
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 &&
|
||||
y1<=tempt->t[1]->pt.y<=y2 &&
|
||||
x1<=tempt->t[2]->pt.x<=x2 &&
|
||||
y1<=tempt->t[2]->pt.y<=y2) {
|
||||
while (tmpt!=&e->tri_head) {
|
||||
if (x1<=tmpt->t[0]->pt.x<=x2 &&
|
||||
y1<=tmpt->t[0]->pt.y<=y2 &&
|
||||
x1<=tmpt->t[1]->pt.x<=x2 &&
|
||||
y1<=tmpt->t[1]->pt.y<=y2 &&
|
||||
x1<=tmpt->t[2]->pt.x<=x2 &&
|
||||
y1<=tmpt->t[2]->pt.y<=y2) {
|
||||
if (sel_mode==SEL_MESH_AND)
|
||||
tempt->flags&=~TF_SEL;
|
||||
tmpt->flags&=~TF_SEL;
|
||||
else
|
||||
tempt->flags|=TF_SEL;
|
||||
tmpt->flags|=TF_SEL;
|
||||
} else {
|
||||
if (sel_mode==SEL_MESH_EQU)
|
||||
tempt->flags&=~TF_SEL;
|
||||
tmpt->flags&=~TF_SEL;
|
||||
else if (sel_mode==SEL_MESH_AND) {
|
||||
if (x1<=tempt->t[0]->pt.x<=x2 &&
|
||||
y1<=tempt->t[0]->pt.y<=y2 ||
|
||||
x1<=tempt->t[1]->pt.x<=x2 &&
|
||||
y1<=tempt->t[1]->pt.y<=y2 ||
|
||||
x1<=tempt->t[2]->pt.x<=x2 &&
|
||||
y1<=tempt->t[2]->pt.y<=y2)
|
||||
tempt->flags&=~TF_SEL;
|
||||
if (x1<=tmpt->t[0]->pt.x<=x2 &&
|
||||
y1<=tmpt->t[0]->pt.y<=y2 ||
|
||||
x1<=tmpt->t[1]->pt.x<=x2 &&
|
||||
y1<=tmpt->t[1]->pt.y<=y2 ||
|
||||
x1<=tmpt->t[2]->pt.x<=x2 &&
|
||||
y1<=tmpt->t[2]->pt.y<=y2)
|
||||
tmpt->flags&=~TF_SEL;
|
||||
}
|
||||
}
|
||||
tempt=tempt->next;
|
||||
tmpt=tmpt->next;
|
||||
}
|
||||
}
|
||||
|
||||
I64 MeshSelCnt(CMeshFrame *e)
|
||||
{
|
||||
I64 res=0;
|
||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
||||
CMeshEdTri *tempt=e->tri_head.next;
|
||||
while (tempv!=&e->vertex_head) {
|
||||
if (tempv->flags&VF_SEL)
|
||||
CMeshEdVertex *tmpv=e->vertex_head.next;
|
||||
CMeshEdTri *tmpt=e->tri_head.next;
|
||||
while (tmpv!=&e->vertex_head) {
|
||||
if (tmpv->flags&VF_SEL)
|
||||
res++;
|
||||
tempv=tempv->next;
|
||||
tmpv=tmpv->next;
|
||||
}
|
||||
while (tempt!=&e->tri_head) {
|
||||
if (tempt->flags&TF_SEL)
|
||||
while (tmpt!=&e->tri_head) {
|
||||
if (tmpt->flags&TF_SEL)
|
||||
res++;
|
||||
tempt=tempt->next;
|
||||
tmpt=tmpt->next;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -318,16 +318,16 @@ I64 MeshSelCnt(CMeshFrame *e)
|
||||
U0 MeshSwapAxes(CMeshFrame *e,I64 o1,I64 o2)
|
||||
{
|
||||
Bool unsel;
|
||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
||||
CMeshEdVertex *tmpv=e->vertex_head.next;
|
||||
if (!MeshSelCnt(e)) {
|
||||
MeshVertexSelAll(e,TRUE);
|
||||
unsel=TRUE;
|
||||
} else
|
||||
unsel=FALSE;
|
||||
while (tempv!=&e->vertex_head) {
|
||||
if (tempv->flags&VF_SEL)
|
||||
SwapU32((&tempv->p)(U8 *)+o1,(&tempv->p)(U8 *)+o2);
|
||||
tempv=tempv->next;
|
||||
while (tmpv!=&e->vertex_head) {
|
||||
if (tmpv->flags&VF_SEL)
|
||||
SwapU32((&tmpv->p)(U8 *)+o1,(&tmpv->p)(U8 *)+o2);
|
||||
tmpv=tmpv->next;
|
||||
}
|
||||
if (unsel)
|
||||
MeshVertexSelAll(e,FALSE);
|
||||
@@ -336,16 +336,16 @@ U0 MeshSwapAxes(CMeshFrame *e,I64 o1,I64 o2)
|
||||
U0 MeshInvertAxis(CMeshFrame *e,I64 o)
|
||||
{
|
||||
Bool unsel;
|
||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
||||
CMeshEdVertex *tmpv=e->vertex_head.next;
|
||||
if (!MeshSelCnt(e)) {
|
||||
MeshVertexSelAll(e,TRUE);
|
||||
unsel=TRUE;
|
||||
} else
|
||||
unsel=FALSE;
|
||||
while (tempv!=&e->vertex_head) {
|
||||
if (tempv->flags&VF_SEL)
|
||||
*((&tempv->p)(U8 *)+o)(I32 *)=-*((&tempv->p)(U8 *)+o)(I32 *);
|
||||
tempv=tempv->next;
|
||||
while (tmpv!=&e->vertex_head) {
|
||||
if (tmpv->flags&VF_SEL)
|
||||
*((&tmpv->p)(U8 *)+o)(I32 *)=-*((&tmpv->p)(U8 *)+o)(I32 *);
|
||||
tmpv=tmpv->next;
|
||||
}
|
||||
if (unsel)
|
||||
MeshVertexSelAll(e,FALSE);
|
||||
@@ -355,20 +355,20 @@ U0 MeshTransformSel(CMeshFrame *e)
|
||||
{
|
||||
Bool unsel;
|
||||
I64 r[16],x,y,z;
|
||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
||||
CMeshEdVertex *tmpv=e->vertex_head.next;
|
||||
if (PopUpTransform(r)) {
|
||||
if (!MeshSelCnt(e)) {
|
||||
MeshVertexSelAll(e,TRUE);
|
||||
unsel=TRUE;
|
||||
} else
|
||||
unsel=FALSE;
|
||||
while (tempv!=&e->vertex_head) {
|
||||
if (tempv->flags&VF_SEL) {
|
||||
x=tempv->p.x; y=tempv->p.y; z=tempv->p.z;
|
||||
while (tmpv!=&e->vertex_head) {
|
||||
if (tmpv->flags&VF_SEL) {
|
||||
x=tmpv->p.x; y=tmpv->p.y; z=tmpv->p.z;
|
||||
Mat4x4MulXYZ(r,&x,&y,&z);
|
||||
tempv->p.x=x; tempv->p.y=y; tempv->p.z=z;
|
||||
tmpv->p.x=x; tmpv->p.y=y; tmpv->p.z=z;
|
||||
}
|
||||
tempv=tempv->next;
|
||||
tmpv=tmpv->next;
|
||||
}
|
||||
if (unsel)
|
||||
MeshVertexSelAll(e,FALSE);
|
||||
@@ -378,16 +378,16 @@ U0 MeshTransformSel(CMeshFrame *e)
|
||||
U0 MeshColorTris(CMeshFrame *e)
|
||||
{
|
||||
Bool unsel;
|
||||
CMeshEdTri *tempt=e->tri_head.next;
|
||||
CMeshEdTri *tmpt=e->tri_head.next;
|
||||
if (!MeshSelCnt(e)) {
|
||||
MeshTriSelAll(e,TRUE);
|
||||
unsel=TRUE;
|
||||
} else
|
||||
unsel=FALSE;
|
||||
while (tempt!=&e->tri_head) {
|
||||
if (tempt->flags & TF_SEL)
|
||||
tempt->mt.color=e->cur_color;
|
||||
tempt=tempt->next;
|
||||
while (tmpt!=&e->tri_head) {
|
||||
if (tmpt->flags & TF_SEL)
|
||||
tmpt->mt.color=e->cur_color;
|
||||
tmpt=tmpt->next;
|
||||
}
|
||||
if (unsel)
|
||||
MeshTriSelAll(e,FALSE);
|
||||
@@ -396,16 +396,16 @@ U0 MeshColorTris(CMeshFrame *e)
|
||||
U0 MeshRevTris(CMeshFrame *e)
|
||||
{
|
||||
Bool unsel;
|
||||
CMeshEdTri *tempt=e->tri_head.next;
|
||||
CMeshEdTri *tmpt=e->tri_head.next;
|
||||
if (!MeshSelCnt(e)) {
|
||||
MeshTriSelAll(e,TRUE);
|
||||
unsel=TRUE;
|
||||
} else
|
||||
unsel=FALSE;
|
||||
while (tempt!=&e->tri_head) {
|
||||
if (tempt->flags & TF_SEL)
|
||||
SwapI64(&tempt->t[1],&tempt->t[2]);
|
||||
tempt=tempt->next;
|
||||
while (tmpt!=&e->tri_head) {
|
||||
if (tmpt->flags & TF_SEL)
|
||||
SwapI64(&tmpt->t[1],&tmpt->t[2]);
|
||||
tmpt=tmpt->next;
|
||||
}
|
||||
if (unsel)
|
||||
MeshTriSelAll(e,FALSE);
|
||||
@@ -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_head.next;
|
||||
CMeshEdTri *tmpt=e->tri_head.next;
|
||||
I64 i,*old_r=dc->r;
|
||||
|
||||
//$LK,"DCAlias",A="MN:DCAlias"$() allocs a new identity rotation matrix.
|
||||
@@ -493,21 +493,21 @@ U0 MPDrawIt(CMeshFrame *e)
|
||||
GrLine3(dc,0,0,-500,0,0,0);
|
||||
}
|
||||
|
||||
while (tempt!=&e->tri_head) {
|
||||
if (tempt->cpu_num==Gs->num) {
|
||||
if (tempt->flags & TF_SEL) {
|
||||
while (tmpt!=&e->tri_head) {
|
||||
if (tmpt->cpu_num==Gs->num) {
|
||||
if (tmpt->flags & TF_SEL) {
|
||||
if (Blink)
|
||||
dc->color=ROPF_DITHER+WHITE<<16+RED;
|
||||
else
|
||||
dc->color=ROPF_DITHER+RED<<16+WHITE;
|
||||
GrFillTri0(dc,&tempt->t[0]->pt,&tempt->t[1]->pt,&tempt->t[2]->pt);
|
||||
GrFillTri0(dc,&tmpt->t[0]->pt,&tmpt->t[1]->pt,&tmpt->t[2]->pt);
|
||||
} else {
|
||||
(*dc->lighting)(dc,&tempt->t[0]->pt,&tempt->t[1]->pt,
|
||||
&tempt->t[2]->pt,tempt->mt.color);
|
||||
GrFillTri0(dc,&tempt->t[0]->pt,&tempt->t[1]->pt,&tempt->t[2]->pt);
|
||||
(*dc->lighting)(dc,&tmpt->t[0]->pt,&tmpt->t[1]->pt,
|
||||
&tmpt->t[2]->pt,tmpt->mt.color);
|
||||
GrFillTri0(dc,&tmpt->t[0]->pt,&tmpt->t[1]->pt,&tmpt->t[2]->pt);
|
||||
}
|
||||
}
|
||||
tempt=tempt->next;
|
||||
tmpt=tmpt->next;
|
||||
}
|
||||
dc->r=old_r;
|
||||
|
||||
@@ -519,7 +519,7 @@ U0 MPDrawIt(CMeshFrame *e)
|
||||
}
|
||||
|
||||
I64 *MeshW2S(CMeshFrame *e,CTask *task)
|
||||
{//World to screen coordinate transform matrix.
|
||||
{//World to scrn coordinate transform matrix.
|
||||
CCtrl *c=CtrlFindUnique(task,CTRLT_VIEWING_ANGLES);
|
||||
CViewAngles *s=c->state;
|
||||
I64 *r=Mat4x4IdentNew(task);
|
||||
@@ -534,7 +534,7 @@ I64 *MeshW2S(CMeshFrame *e,CTask *task)
|
||||
}
|
||||
|
||||
I64 *MeshS2W(CMeshFrame *e,CTask *task)
|
||||
{//Screen to world coordinate transform matrix.
|
||||
{//Scrn to world coordinate transform matrix.
|
||||
CCtrl *c=CtrlFindUnique(task,CTRLT_VIEWING_ANGLES);
|
||||
CViewAngles *s=c->state;
|
||||
I64 *r=Mat4x4IdentNew(task);
|
||||
@@ -565,7 +565,7 @@ U0 MeshCursorW(CMeshFrame *e,CTask *task,I64 *_x,I64 *_y,I64 *_z)
|
||||
yc=ip.pos.y-task->pix_top-task->scroll_y-e->cy,zc=0,
|
||||
x=0,y=0,z=e->ip_z,
|
||||
i,x2,y2,z2;
|
||||
Mat4x4MulXYZ(e->w2s,&x,&y,&z); //screen of Z vect
|
||||
Mat4x4MulXYZ(e->w2s,&x,&y,&z); //scrn of Z vect
|
||||
|
||||
//Converges onto a solution for zc, an unknown.
|
||||
for (i=0;i<128;i++) {
|
||||
@@ -606,97 +606,97 @@ U0 MeshClipboardRst()
|
||||
|
||||
U0 MeshClipboardCopy(CMeshFrame *e)
|
||||
{
|
||||
CMeshEdVertex *tempv=e->vertex_head.next,*tempv2;
|
||||
CMeshEdTri *tempt=e->tri_head.next,*tempt2;
|
||||
CMeshEdVertex *tmpv=e->vertex_head.next,*tmpv2;
|
||||
CMeshEdTri *tmpt=e->tri_head.next,*tmpt2;
|
||||
|
||||
MeshClipboardRst;
|
||||
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_head.last);
|
||||
tempv->flags|=VF_COPIED;
|
||||
tempv->flags&=~VF_SEL;
|
||||
while (tmpv!=&e->vertex_head) {
|
||||
if (tmpv->flags&VF_SEL) {
|
||||
tmpv->copy=tmpv2=ACAlloc(sizeof(CMeshEdVertex));
|
||||
MemCpy(&tmpv2->p,&tmpv->p,sizeof(CD3I32));
|
||||
QueIns(tmpv2,sys_clipboard_vertex_head.last);
|
||||
tmpv->flags|=VF_COPIED;
|
||||
tmpv->flags&=~VF_SEL;
|
||||
} else {
|
||||
tempv->copy=NULL;
|
||||
tempv->flags&=~(VF_COPIED|VF_SEL);
|
||||
tmpv->copy=NULL;
|
||||
tmpv->flags&=~(VF_COPIED|VF_SEL);
|
||||
}
|
||||
tempv=tempv->next;
|
||||
tmpv=tmpv->next;
|
||||
}
|
||||
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));
|
||||
tempt2->t[0]=tempt->t[0]->copy;
|
||||
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_head.last);
|
||||
tempt->flags|=TF_COPIED;
|
||||
tempt->flags&=~TF_SEL;
|
||||
while (tmpt!=&e->tri_head) {
|
||||
if (tmpt->flags&TF_SEL &&
|
||||
tmpt->t[0]->copy && tmpt->t[1]->copy && tmpt->t[2]->copy) {
|
||||
tmpt2=ACAlloc(sizeof(CMeshEdTri));
|
||||
tmpt2->t[0]=tmpt->t[0]->copy;
|
||||
tmpt2->t[1]=tmpt->t[1]->copy;
|
||||
tmpt2->t[2]=tmpt->t[2]->copy;
|
||||
tmpt2->mt.color=tmpt->mt.color;
|
||||
QueIns(tmpt2,sys_clipboard_tri_head.last);
|
||||
tmpt->flags|=TF_COPIED;
|
||||
tmpt->flags&=~TF_SEL;
|
||||
} else
|
||||
tempt->flags&=~(TF_COPIED|TF_SEL);
|
||||
tempt=tempt->next;
|
||||
tmpt->flags&=~(TF_COPIED|TF_SEL);
|
||||
tmpt=tmpt->next;
|
||||
}
|
||||
}
|
||||
|
||||
U0 MeshClipboardCut(CMeshFrame *e)
|
||||
{
|
||||
CMeshEdVertex *tempv=e->vertex_head.next,*tempv1;
|
||||
CMeshEdTri *tempt=e->tri_head.next,*tempt1;
|
||||
CMeshEdVertex *tmpv=e->vertex_head.next,*tmpv1;
|
||||
CMeshEdTri *tmpt=e->tri_head.next,*tmpt1;
|
||||
MeshClipboardCopy(e);
|
||||
while (tempt!=&e->tri_head) {
|
||||
tempt1=tempt->next;
|
||||
if (tempt->flags&TF_COPIED)
|
||||
MeshTriDel(e,tempt);
|
||||
tempt=tempt1;
|
||||
while (tmpt!=&e->tri_head) {
|
||||
tmpt1=tmpt->next;
|
||||
if (tmpt->flags&TF_COPIED)
|
||||
MeshTriDel(e,tmpt);
|
||||
tmpt=tmpt1;
|
||||
}
|
||||
while (tempv!=&e->vertex_head) {
|
||||
tempv1=tempv->next;
|
||||
if (tempv->flags&VF_COPIED)
|
||||
MeshVertexDel(e,tempv);
|
||||
tempv=tempv1;
|
||||
while (tmpv!=&e->vertex_head) {
|
||||
tmpv1=tmpv->next;
|
||||
if (tmpv->flags&VF_COPIED)
|
||||
MeshVertexDel(e,tmpv);
|
||||
tmpv=tmpv1;
|
||||
}
|
||||
}
|
||||
|
||||
U0 MeshClipboardDel(CMeshFrame *e)
|
||||
{//Technically not clipboard
|
||||
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;
|
||||
CMeshEdVertex *tmpv=e->vertex_head.next,*tmpv1;
|
||||
CMeshEdTri *tmpt=e->tri_head.next,*tmpt1;
|
||||
while (tmpt!=&e->tri_head) {
|
||||
tmpt1=tmpt->next;
|
||||
if (tmpt->flags&TF_SEL)
|
||||
MeshTriDel(e,tmpt);
|
||||
tmpt=tmpt1;
|
||||
}
|
||||
while (tempv!=&e->vertex_head) {
|
||||
tempv1=tempv->next;
|
||||
if (tempv->flags&VF_SEL)
|
||||
MeshVertexDel(e,tempv);
|
||||
tempv=tempv1;
|
||||
while (tmpv!=&e->vertex_head) {
|
||||
tmpv1=tmpv->next;
|
||||
if (tmpv->flags&VF_SEL)
|
||||
MeshVertexDel(e,tmpv);
|
||||
tmpv=tmpv1;
|
||||
}
|
||||
}
|
||||
|
||||
U0 MeshClipboardPaste(CMeshFrame *e)
|
||||
{
|
||||
CMeshEdVertex *tempv2=sys_clipboard_vertex_head.next,*tempv;
|
||||
CMeshEdTri *tempt2=sys_clipboard_tri_head.next,*tempt;
|
||||
CMeshEdVertex *tmpv2=sys_clipboard_vertex_head.next,*tmpv;
|
||||
CMeshEdTri *tmpt2=sys_clipboard_tri_head.next,*tmpt;
|
||||
|
||||
MeshVertexSelAll(e,FALSE);
|
||||
MeshTriSelAll(e,FALSE);
|
||||
while (tempv2!=&sys_clipboard_vertex_head) {
|
||||
tempv2->copy=tempv=CAlloc(sizeof(CMeshEdVertex));
|
||||
MemCpy(&tempv->p,&tempv2->p,sizeof(CD3I32));
|
||||
QueIns(tempv,e->vertex_head.last);
|
||||
tempv->flags|=VF_SEL;
|
||||
tempv2=tempv2->next;
|
||||
while (tmpv2!=&sys_clipboard_vertex_head) {
|
||||
tmpv2->copy=tmpv=CAlloc(sizeof(CMeshEdVertex));
|
||||
MemCpy(&tmpv->p,&tmpv2->p,sizeof(CD3I32));
|
||||
QueIns(tmpv,e->vertex_head.last);
|
||||
tmpv->flags|=VF_SEL;
|
||||
tmpv2=tmpv2->next;
|
||||
}
|
||||
|
||||
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;
|
||||
tempt2=tempt2->next;
|
||||
while (tmpt2!=&sys_clipboard_tri_head) {
|
||||
tmpt=MeshTriNew(e,tmpt2->mt.color,tmpt2->t[0]->copy,
|
||||
tmpt2->t[1]->copy,tmpt2->t[2]->copy);
|
||||
tmpt->flags|=TF_SEL;
|
||||
tmpt2=tmpt2->next;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -708,7 +708,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
CCtrl *c=CtrlFindUnique(task,CTRLT_VIEWING_ANGLES);
|
||||
F64 d;
|
||||
I64 i,x,y,z;
|
||||
CMeshEdVertex *tempv;
|
||||
CMeshEdVertex *tmpv;
|
||||
|
||||
task->horz_scroll.min=-(MESH_WORKSPACE_SIZE-task->pix_width)/2;
|
||||
task->horz_scroll.max= (MESH_WORKSPACE_SIZE-task->pix_width)/2;
|
||||
@@ -724,7 +724,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
|
||||
dc->x=e->cx;
|
||||
dc->y=e->cy;
|
||||
//z-vals less than zero are in front of screen and not drawn.
|
||||
//z-vals less than zero are in front of scrn and not drawn.
|
||||
//we want to shift all Z-vals into a drawable range.
|
||||
//GR_Z_ALL is set to half of the Z-range which is an I32.
|
||||
dc->z=GR_Z_ALL;
|
||||
@@ -741,12 +741,12 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
|
||||
DCDepthBufAlloc(dc);
|
||||
|
||||
tempv=e->vertex_head.next;
|
||||
while (tempv!=&e->vertex_head) {
|
||||
x=tempv->p.x; y=tempv->p.y; z=tempv->p.z;
|
||||
tmpv=e->vertex_head.next;
|
||||
while (tmpv!=&e->vertex_head) {
|
||||
x=tmpv->p.x; y=tmpv->p.y; z=tmpv->p.z;
|
||||
(*dc->transform)(dc,&x,&y,&z);
|
||||
tempv->pt.x=x; tempv->pt.y=y; tempv->pt.z=z;
|
||||
tempv=tempv->next;
|
||||
tmpv->pt.x=x; tmpv->pt.y=y; tmpv->pt.z=z;
|
||||
tmpv=tmpv->next;
|
||||
}
|
||||
|
||||
e->mp_not_done_flags=1<<mp_cnt-1; //Issue jobs to all cores.
|
||||
@@ -755,9 +755,9 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
for (i=0;i<mp_cnt;i++)
|
||||
JobQue(&MPDrawIt,e,i);
|
||||
|
||||
tempv=e->vertex_head.next;
|
||||
while (tempv!=&e->vertex_head) {
|
||||
x=tempv->pt.x; y=tempv->pt.y; z=tempv->pt.z;
|
||||
tmpv=e->vertex_head.next;
|
||||
while (tmpv!=&e->vertex_head) {
|
||||
x=tmpv->pt.x; y=tmpv->pt.y; z=tmpv->pt.z;
|
||||
if (e->vertex_on) {
|
||||
if (Blink(10)) //This blinks at 10 Hz.
|
||||
dc->color=ROPF_DITHER+BLACK<<16+WHITE;
|
||||
@@ -766,7 +766,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
GrLine(dc,x-3,y-3,x+3,y+3);
|
||||
GrLine(dc,x-3,y+3,x+3,y-3);
|
||||
}
|
||||
if (tempv->flags&VF_SEL) {
|
||||
if (tmpv->flags&VF_SEL) {
|
||||
if (e->ed_mode=='t') {
|
||||
if (Blink(10)) //This blinks at 10 Hz.
|
||||
dc->color=ROPF_DITHER+e->cur_color.c0.color<<16+
|
||||
@@ -782,7 +782,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
||||
}
|
||||
GrCircle(dc,x,y,3);
|
||||
}
|
||||
tempv=tempv->next;
|
||||
tmpv=tmpv->next;
|
||||
}
|
||||
|
||||
if (CtrlInside(c,ip.presnap.x,ip.presnap.y)||winmgr.show_menu) {
|
||||
@@ -847,7 +847,7 @@ U0 MeshLoad(CMeshFrame *e,U8 *src)
|
||||
{
|
||||
I64 i,j,x,y,z;
|
||||
CColorROPU32 color;
|
||||
CMeshEdVertex *tempv,*va[3];
|
||||
CMeshEdVertex *tmpv,*va[3];
|
||||
|
||||
QueInit(&e->vertex_head);
|
||||
QueInit(&e->tri_head);
|
||||
@@ -858,8 +858,8 @@ U0 MeshLoad(CMeshFrame *e,U8 *src)
|
||||
x=*src(I32 *)++;
|
||||
y=*src(I32 *)++;
|
||||
z=*src(I32 *)++;
|
||||
tempv=MeshVertexNew(e,x,y,z);
|
||||
tempv->num=i;
|
||||
tmpv=MeshVertexNew(e,x,y,z);
|
||||
tmpv->num=i;
|
||||
}
|
||||
for (i=0;i<e->tri_cnt;i++) {
|
||||
color=*src(I32 *)++;
|
||||
@@ -872,21 +872,21 @@ U0 MeshLoad(CMeshFrame *e,U8 *src)
|
||||
I64 MeshSize(CMeshFrame *e)
|
||||
{
|
||||
I64 i;
|
||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
||||
CMeshEdTri *tempt=e->tri_head.next;
|
||||
CMeshEdVertex *tmpv=e->vertex_head.next;
|
||||
CMeshEdTri *tmpt=e->tri_head.next;
|
||||
|
||||
e->vertex_cnt=0;
|
||||
while (tempv!=&e->vertex_head) {
|
||||
tempv->num=e->vertex_cnt++;
|
||||
tempv=tempv->next;
|
||||
while (tmpv!=&e->vertex_head) {
|
||||
tmpv->num=e->vertex_cnt++;
|
||||
tmpv=tmpv->next;
|
||||
}
|
||||
|
||||
e->tri_cnt=0;
|
||||
while (tempt!=&e->tri_head) {
|
||||
while (tmpt!=&e->tri_head) {
|
||||
e->tri_cnt++;
|
||||
for (i=0;i<3;i++)
|
||||
tempt->mt.nums[i]=tempt->t[i]->num;
|
||||
tempt=tempt->next;
|
||||
tmpt->mt.nums[i]=tmpt->t[i]->num;
|
||||
tmpt=tmpt->next;
|
||||
}
|
||||
return sizeof(I32)*2+
|
||||
(offset(CMeshEdVertex.end)-offset(CMeshEdVertex.start))*e->vertex_cnt+
|
||||
@@ -897,25 +897,25 @@ I32 *MeshSave(CMeshFrame *e,I64 *_size=NULL)
|
||||
{
|
||||
I64 size=MeshSize(e);
|
||||
U8 *res=MAlloc(size),*dst=res;
|
||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
||||
CMeshEdTri *tempt=e->tri_head.next;
|
||||
CMeshEdVertex *tmpv=e->vertex_head.next;
|
||||
CMeshEdTri *tmpt=e->tri_head.next;
|
||||
|
||||
*dst(I32 *)++=e->vertex_cnt;
|
||||
*dst(I32 *)++=e->tri_cnt;
|
||||
|
||||
e->vertex_cnt=0;
|
||||
while (tempv!=&e->vertex_head) {
|
||||
MemCpy(dst,&tempv->start,offset(CMeshEdVertex.end)
|
||||
while (tmpv!=&e->vertex_head) {
|
||||
MemCpy(dst,&tmpv->start,offset(CMeshEdVertex.end)
|
||||
-offset(CMeshEdVertex.start));
|
||||
dst+=offset(CMeshEdVertex.end)-offset(CMeshEdVertex.start);
|
||||
tempv=tempv->next;
|
||||
tmpv=tmpv->next;
|
||||
}
|
||||
|
||||
e->tri_cnt=0;
|
||||
while (tempt!=&e->tri_head) {
|
||||
MemCpy(dst,&tempt->start,offset(CMeshEdTri.end)-offset(CMeshEdTri.start));
|
||||
while (tmpt!=&e->tri_head) {
|
||||
MemCpy(dst,&tmpt->start,offset(CMeshEdTri.end)-offset(CMeshEdTri.start));
|
||||
dst+=offset(CMeshEdTri.end)-offset(CMeshEdTri.start);
|
||||
tempt=tempt->next;
|
||||
tmpt=tmpt->next;
|
||||
}
|
||||
if (_size) *_size=size;
|
||||
return res;
|
||||
@@ -931,27 +931,27 @@ U0 MeshCleanUp(CMeshFrame *e)
|
||||
|
||||
U0 MeshUpdateMenu(CMeshFrame *e)
|
||||
{
|
||||
CMenuEntry *tempse;
|
||||
if (tempse=MenuEntryFind(Fs->cur_menu,"View/Grid"))
|
||||
tempse->checked=ToBool(e->grid_on);
|
||||
if (tempse=MenuEntryFind(Fs->cur_menu,"View/Vertex"))
|
||||
tempse->checked=ToBool(e->vertex_on);
|
||||
if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/PlaceVertex"))
|
||||
tempse->checked=ToBool(e->ed_mode=='v');
|
||||
if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/MoveVertex"))
|
||||
tempse->checked=ToBool(e->ed_mode=='m');
|
||||
if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/MoveVertexZ"))
|
||||
tempse->checked=ToBool(e->ed_mode=='M');
|
||||
if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/Triangle"))
|
||||
tempse->checked=ToBool(e->ed_mode=='t');
|
||||
if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/Polygon"))
|
||||
tempse->checked=ToBool(e->ed_mode=='n');
|
||||
if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/Fence"))
|
||||
tempse->checked=ToBool(e->ed_mode=='f');
|
||||
if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/Prism"))
|
||||
tempse->checked=ToBool(e->ed_mode=='p');
|
||||
if (tempse=MenuEntryFind(Fs->cur_menu,"View/FlipY"))
|
||||
tempse->checked=ToBool(e->flip_y);
|
||||
CMenuEntry *tmpse;
|
||||
if (tmpse=MenuEntryFind(Fs->cur_menu,"View/Grid"))
|
||||
tmpse->checked=ToBool(e->grid_on);
|
||||
if (tmpse=MenuEntryFind(Fs->cur_menu,"View/Vertex"))
|
||||
tmpse->checked=ToBool(e->vertex_on);
|
||||
if (tmpse=MenuEntryFind(Fs->cur_menu,"Mode/PlaceVertex"))
|
||||
tmpse->checked=ToBool(e->ed_mode=='v');
|
||||
if (tmpse=MenuEntryFind(Fs->cur_menu,"Mode/MoveVertex"))
|
||||
tmpse->checked=ToBool(e->ed_mode=='m');
|
||||
if (tmpse=MenuEntryFind(Fs->cur_menu,"Mode/MoveVertexZ"))
|
||||
tmpse->checked=ToBool(e->ed_mode=='M');
|
||||
if (tmpse=MenuEntryFind(Fs->cur_menu,"Mode/Triangle"))
|
||||
tmpse->checked=ToBool(e->ed_mode=='t');
|
||||
if (tmpse=MenuEntryFind(Fs->cur_menu,"Mode/Polygon"))
|
||||
tmpse->checked=ToBool(e->ed_mode=='n');
|
||||
if (tmpse=MenuEntryFind(Fs->cur_menu,"Mode/Fence"))
|
||||
tmpse->checked=ToBool(e->ed_mode=='f');
|
||||
if (tmpse=MenuEntryFind(Fs->cur_menu,"Mode/Prism"))
|
||||
tmpse->checked=ToBool(e->ed_mode=='p');
|
||||
if (tmpse=MenuEntryFind(Fs->cur_menu,"View/FlipY"))
|
||||
tmpse->checked=ToBool(e->flip_y);
|
||||
}
|
||||
|
||||
I32 *SpriteMeshEd(I32 *head=NULL,I64 *_size=NULL,Bool flip_y=FALSE)
|
||||
@@ -973,7 +973,7 @@ $WW,0$*/
|
||||
CViewAngles *s,*old_s;
|
||||
I64 i,msg_code,sel_mode,a1,a2,make_tri_vertex_num=0,x,y,z;
|
||||
CD3I32 p0a,p0b;
|
||||
CMeshEdVertex *va[3],*tempv;
|
||||
CMeshEdVertex *va[3],*tmpv;
|
||||
Bool adjusting_z=FALSE,moving,save_and_exit;
|
||||
CMeshFrame e;
|
||||
|
||||
@@ -1060,7 +1060,7 @@ $WW,0$*/
|
||||
"$$GREEN$$'p'$$FG$$: Prism Mode\n"
|
||||
"$$GREEN$$'c'$$FG$$: Set color\n"
|
||||
"$$GREEN$$'s'$$FG$$: Set snap\n"
|
||||
"\nSee menu at top of screen for more.\n");
|
||||
"\nSee menu at top of scrn for more.\n");
|
||||
|
||||
Fs->win_inhibit=WIG_TASK_DFT|WIF_SELF_DOC-WIF_SELF_FOCUS-WIF_SELF_BORDER
|
||||
-WIF_SELF_CTRLS-WIF_FOCUS_TASK_MENU-WIF_SELF_GRAB_SCROLL;
|
||||
@@ -1267,11 +1267,11 @@ me_clipboard_cut:
|
||||
case 'j':
|
||||
if (moving)
|
||||
MeshVertexIgnoreSet(&e,TRUE);
|
||||
if (tempv=MeshVertexFindScrPt(&e,
|
||||
if (tmpv=MeshVertexFindScrPt(&e,
|
||||
ip.pos.x-Fs->pix_left-Fs->scroll_x,
|
||||
ip.pos.y-Fs->pix_top-Fs->scroll_y)) {
|
||||
Noise(25,2000,8000);
|
||||
e.ip_z=RoundI64(tempv->p.z,e.cur_snap);
|
||||
e.ip_z=RoundI64(tmpv->p.z,e.cur_snap);
|
||||
} else {
|
||||
Beep; Beep;
|
||||
e.ip_z=0;
|
||||
@@ -1324,9 +1324,9 @@ me_clipboard_cut:
|
||||
case 'm':
|
||||
if (!moving) {
|
||||
if (!MeshSelCnt(&e) &&
|
||||
(tempv=MeshVertexFindScrPt(&e,a1,a2))) {
|
||||
tempv->flags|=VF_SEL;
|
||||
e.ip_z=RoundI64(tempv->p.z,e.cur_snap);
|
||||
(tmpv=MeshVertexFindScrPt(&e,a1,a2))) {
|
||||
tmpv->flags|=VF_SEL;
|
||||
e.ip_z=RoundI64(tmpv->p.z,e.cur_snap);
|
||||
}
|
||||
if (MeshSelCnt(&e)) {
|
||||
MeshCursorW(&e,Fs,&x,&y,&z);
|
||||
@@ -1341,9 +1341,9 @@ me_clipboard_cut:
|
||||
case 'M':
|
||||
if (!adjusting_z && !moving) {
|
||||
if (!MeshSelCnt(&e) &&
|
||||
(tempv=MeshVertexFindScrPt(&e,a1,a2))) {
|
||||
tempv->flags|=VF_SEL;
|
||||
e.ip_z=RoundI64(tempv->p.z,e.cur_snap);
|
||||
(tmpv=MeshVertexFindScrPt(&e,a1,a2))) {
|
||||
tmpv->flags|=VF_SEL;
|
||||
e.ip_z=RoundI64(tmpv->p.z,e.cur_snap);
|
||||
}
|
||||
if (MeshSelCnt(&e)) {
|
||||
MeshCursorW(&e,Fs,&x,&y,&z);
|
||||
@@ -1394,16 +1394,16 @@ me_clipboard_cut:
|
||||
}
|
||||
break;
|
||||
case 't':
|
||||
if (tempv=MeshVertexFindScrPt(&e,a1,a2)) {
|
||||
if (tmpv=MeshVertexFindScrPt(&e,a1,a2)) {
|
||||
for (i=0;i<make_tri_vertex_num;i++)
|
||||
if (va[i]==tempv) {
|
||||
if (va[i]==tmpv) {
|
||||
Beep; Beep;
|
||||
break;
|
||||
}
|
||||
if (i==make_tri_vertex_num) {
|
||||
Noise(25,2000,8000);
|
||||
va[make_tri_vertex_num++]=tempv;
|
||||
tempv->flags|=VF_SEL;
|
||||
va[make_tri_vertex_num++]=tmpv;
|
||||
tmpv->flags|=VF_SEL;
|
||||
if (make_tri_vertex_num==3) {
|
||||
e.cur_tri=MeshTriNew(&e,e.cur_color,va[0],va[1],va[2]);
|
||||
for (i=0;i<make_tri_vertex_num;i++)
|
||||
|
||||
+51
-51
@@ -41,37 +41,37 @@ I64 SpriteElemQuedBaseSize(I64 type)
|
||||
return sprite_elem_base_sizes[type]+offset(CSprite.start);
|
||||
}
|
||||
|
||||
I64 SpriteElemSize(CSprite *tempg)
|
||||
I64 SpriteElemSize(CSprite *tmpg)
|
||||
{
|
||||
I64 i=sprite_elem_base_sizes[tempg->type];
|
||||
switch (tempg->type) {
|
||||
I64 i=sprite_elem_base_sizes[tmpg->type];
|
||||
switch (tmpg->type) {
|
||||
case SPT_POLYLINE:
|
||||
i+=tempg->nu.num*sizeof(CD2I32);
|
||||
i+=tmpg->nu.num*sizeof(CD2I32);
|
||||
break;
|
||||
case SPT_TEXT:
|
||||
case SPT_TEXT_BOX:
|
||||
case SPT_TEXT_DIAMOND:
|
||||
i+=StrLen(tempg->ps.st)+1;
|
||||
i+=StrLen(tmpg->ps.st)+1;
|
||||
break;
|
||||
case SPT_BITMAP:
|
||||
i+=((tempg->pwhu.width+7)&~7)*tempg->pwhu.height;
|
||||
i+=((tmpg->pwhu.width+7)&~7)*tmpg->pwhu.height;
|
||||
break;
|
||||
case SPT_POLYPT:
|
||||
i+=(tempg->npu.num*3+7)>>3;
|
||||
i+=(tmpg->npu.num*3+7)>>3;
|
||||
break;
|
||||
case SPT_BSPLINE2:
|
||||
case SPT_BSPLINE3:
|
||||
case SPT_BSPLINE2_CLOSED:
|
||||
case SPT_BSPLINE3_CLOSED:
|
||||
i+=tempg->nu.num*sizeof(CD3I32);
|
||||
i+=tmpg->nu.num*sizeof(CD3I32);
|
||||
break;
|
||||
case SPT_MESH:
|
||||
i+=tempg->mu.vertex_cnt*sizeof(CD3I32)+
|
||||
tempg->mu.tri_cnt*sizeof(CMeshTri);
|
||||
i+=tmpg->mu.vertex_cnt*sizeof(CD3I32)+
|
||||
tmpg->mu.tri_cnt*sizeof(CMeshTri);
|
||||
break;
|
||||
case SPT_SHIFTABLE_MESH:
|
||||
i+=tempg->pmu.vertex_cnt*sizeof(CD3I32)+
|
||||
tempg->pmu.tri_cnt*sizeof(CMeshTri);
|
||||
i+=tmpg->pmu.vertex_cnt*sizeof(CD3I32)+
|
||||
tmpg->pmu.tri_cnt*sizeof(CMeshTri);
|
||||
break;
|
||||
}
|
||||
return i;
|
||||
@@ -79,101 +79,101 @@ I64 SpriteElemSize(CSprite *tempg)
|
||||
|
||||
public I64 SpriteSize(U8 *elems)
|
||||
{//Walk sprite elements and return size of sprite as binary data.
|
||||
CSprite *tempg=elems-offset(CSprite.start),*tempg1=tempg;
|
||||
while (tempg->type)
|
||||
tempg(U8 *)+=SpriteElemSize(tempg);
|
||||
return tempg(U8 *)-tempg1(U8 *)+sprite_elem_base_sizes[SPT_END];
|
||||
CSprite *tmpg=elems-offset(CSprite.start),*tmpg1=tmpg;
|
||||
while (tmpg->type)
|
||||
tmpg(U8 *)+=SpriteElemSize(tmpg);
|
||||
return tmpg(U8 *)-tmpg1(U8 *)+sprite_elem_base_sizes[SPT_END];
|
||||
}
|
||||
|
||||
I64 SpriteTypeMask(U8 *elems)
|
||||
{
|
||||
I64 res=0;
|
||||
CSprite *tempg=elems-offset(CSprite.start);
|
||||
while (tempg->type) {
|
||||
if (tempg->type>=SPT_NUM_TYPES)
|
||||
CSprite *tmpg=elems-offset(CSprite.start);
|
||||
while (tmpg->type) {
|
||||
if (tmpg->type>=SPT_NUM_TYPES)
|
||||
return 1<<SPT_NUM_TYPES;
|
||||
Bts(&res,tempg->type);
|
||||
tempg(U8 *)+=SpriteElemSize(tempg);
|
||||
Bts(&res,tmpg->type);
|
||||
tmpg(U8 *)+=SpriteElemSize(tmpg);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public U8 *DC2Sprite(CDC *tempb)
|
||||
public U8 *DC2Sprite(CDC *tmpb)
|
||||
{//Convert device context to sprite.
|
||||
CSprite *tempg;
|
||||
tempg=CAlloc(sprite_elem_base_sizes[SPT_BITMAP]+
|
||||
tempb->width_internal*tempb->height+
|
||||
CSprite *tmpg;
|
||||
tmpg=CAlloc(sprite_elem_base_sizes[SPT_BITMAP]+
|
||||
tmpb->width_internal*tmpb->height+
|
||||
sprite_elem_base_sizes[SPT_END])
|
||||
(U8 *)-offset(CSprite.start);
|
||||
tempg->type=SPT_BITMAP;
|
||||
tempg->pwhu.width=tempb->width;
|
||||
tempg->pwhu.height=tempb->height;
|
||||
tempg->pwhu.x1=0;
|
||||
tempg->pwhu.y1=0;
|
||||
MemCpy(&tempg->pwhu.u,tempb->body,tempb->width_internal*tempb->height);
|
||||
return tempg(U8 *)+offset(CSprite.start);
|
||||
tmpg->type=SPT_BITMAP;
|
||||
tmpg->pwhu.width=tmpb->width;
|
||||
tmpg->pwhu.height=tmpb->height;
|
||||
tmpg->pwhu.x1=0;
|
||||
tmpg->pwhu.y1=0;
|
||||
MemCpy(&tmpg->pwhu.u,tmpb->body,tmpb->width_internal*tmpb->height);
|
||||
return tmpg(U8 *)+offset(CSprite.start);
|
||||
}
|
||||
|
||||
public U8 *SpriteElem2Summary(CSprite *tempg)
|
||||
public U8 *SpriteElem2Summary(CSprite *tmpg)
|
||||
{//Study $LK,"::/Demo/Graphics/SpriteText.HC"$.
|
||||
U8 buf[STR_LEN],buf2[STR_LEN];
|
||||
I32 *ptr;
|
||||
StrPrint(buf,"%Z",tempg->type,"ST_SPRITE_ELEM_TYPES");
|
||||
switch (tempg->type) {
|
||||
StrPrint(buf,"%Z",tmpg->type,"ST_SPRITE_ELEM_TYPES");
|
||||
switch (tmpg->type) {
|
||||
case SPT_COLOR:
|
||||
CatPrint(buf," %s",Color2Str(buf2,tempg->c.color));
|
||||
CatPrint(buf," %s",Color2Str(buf2,tmpg->c.color));
|
||||
break;
|
||||
case SPT_DITHER_COLOR:
|
||||
CatPrint(buf," %s",Color2Str(buf2,ROPF_DITHER|tempg->d.dither_color.u8[0]|
|
||||
tempg->d.dither_color.u8[1]<<COLORROP_BITS));
|
||||
CatPrint(buf," %s",Color2Str(buf2,ROPF_DITHER|tmpg->d.dither_color.u8[0]|
|
||||
tmpg->d.dither_color.u8[1]<<COLORROP_BITS));
|
||||
break;
|
||||
case SPT_PT:
|
||||
case SPT_FLOOD_FILL:
|
||||
case SPT_FLOOD_FILL_NOT:
|
||||
case SPT_SHIFT:
|
||||
CatPrint(buf," (%d,%d)",tempg->p.x1,tempg->p.y1);
|
||||
CatPrint(buf," (%d,%d)",tmpg->p.x1,tmpg->p.y1);
|
||||
break;
|
||||
case SPT_LINE:
|
||||
case SPT_ARROW:
|
||||
case SPT_PLANAR_SYMMETRY:
|
||||
case SPT_RECT:
|
||||
case SPT_ROTATED_RECT:
|
||||
CatPrint(buf," (%d,%d),(%d,%d)",tempg->pp.x1,tempg->pp.y1,
|
||||
tempg->pp.x2,tempg->pp.y2);
|
||||
CatPrint(buf," (%d,%d),(%d,%d)",tmpg->pp.x1,tmpg->pp.y1,
|
||||
tmpg->pp.x2,tmpg->pp.y2);
|
||||
break;
|
||||
case SPT_CIRCLE:
|
||||
CatPrint(buf," (%d,%d):%dR",tempg->pr.x1,tempg->pr.y1,tempg->pr.radius);
|
||||
CatPrint(buf," (%d,%d):%dR",tmpg->pr.x1,tmpg->pr.y1,tmpg->pr.radius);
|
||||
break;
|
||||
case SPT_WIDTH:
|
||||
CatPrint(buf," %d",tempg->w.width);
|
||||
CatPrint(buf," %d",tmpg->w.width);
|
||||
break;
|
||||
case SPT_TEXT:
|
||||
case SPT_TEXT_BOX:
|
||||
case SPT_TEXT_DIAMOND:
|
||||
CatPrint(buf," %d,%d:%-16tQ",tempg->ps.x1,tempg->ps.y1,tempg->ps.st);
|
||||
CatPrint(buf," %d,%d:%-16tQ",tmpg->ps.x1,tmpg->ps.y1,tmpg->ps.st);
|
||||
break;
|
||||
case SPT_POLYLINE:
|
||||
case SPT_POLYPT:
|
||||
ptr=&tempg->npu.x;
|
||||
CatPrint(buf," %d (%d,%d)",tempg->npu.num,ptr[0],ptr[1]);
|
||||
ptr=&tmpg->npu.x;
|
||||
CatPrint(buf," %d (%d,%d)",tmpg->npu.num,ptr[0],ptr[1]);
|
||||
break;
|
||||
case SPT_ELLIPSE:
|
||||
case SPT_POLYGON:
|
||||
case SPT_BITMAP:
|
||||
CatPrint(buf," (%d,%d):%dW,%dH",tempg->pwhu.x1,tempg->pwhu.y1,
|
||||
tempg->pwhu.width,tempg->pwhu.height);
|
||||
CatPrint(buf," (%d,%d):%dW,%dH",tmpg->pwhu.x1,tmpg->pwhu.y1,
|
||||
tmpg->pwhu.width,tmpg->pwhu.height);
|
||||
break;
|
||||
case SPT_BSPLINE2:
|
||||
case SPT_BSPLINE3:
|
||||
case SPT_BSPLINE2_CLOSED:
|
||||
case SPT_BSPLINE3_CLOSED:
|
||||
CatPrint(buf," %d",tempg->nu.num);
|
||||
CatPrint(buf," %d",tmpg->nu.num);
|
||||
break;
|
||||
case SPT_MESH:
|
||||
CatPrint(buf," %dV,%dT",tempg->mu.vertex_cnt,tempg->mu.tri_cnt);
|
||||
CatPrint(buf," %dV,%dT",tmpg->mu.vertex_cnt,tmpg->mu.tri_cnt);
|
||||
break;
|
||||
case SPT_SHIFTABLE_MESH:
|
||||
CatPrint(buf," %dV,%dT",tempg->pmu.vertex_cnt,tempg->pmu.tri_cnt);
|
||||
CatPrint(buf," %dV,%dT",tmpg->pmu.vertex_cnt,tmpg->pmu.tri_cnt);
|
||||
break;
|
||||
}
|
||||
return StrNew(buf);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#help_index "AutoFile;Help System/Training"
|
||||
#help_file "::/Doc/AutoFile"
|
||||
#help_index "InFile;Help System/Training"
|
||||
#help_file "::/Doc/InFile"
|
||||
|
||||
public U0 AFGetStr(U8 *st)
|
||||
public U0 InGetStr(U8 *st)
|
||||
{//Wait for user to type certain str.
|
||||
I64 ch,sc;
|
||||
U8 buf[256],*st2;
|
||||
@@ -23,7 +23,7 @@ public U0 AFGetStr(U8 *st)
|
||||
}
|
||||
}
|
||||
|
||||
public U0 AFPrint(I64 ms=100,U8 *fmt,...)
|
||||
public U0 InPrint(I64 ms=100,U8 *fmt,...)
|
||||
{//Print message with delay after each char.
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv),*st=buf;
|
||||
I64 ch;
|
||||
@@ -34,7 +34,7 @@ public U0 AFPrint(I64 ms=100,U8 *fmt,...)
|
||||
Free(buf);
|
||||
}
|
||||
|
||||
public U0 AFGetKey(I64 scan_code,I64 sc_mask=0xFF|SCF_SHIFT|SCF_CTRL|SCF_ALT)
|
||||
public U0 InGetKey(I64 scan_code,I64 sc_mask=0xFF|SCF_SHIFT|SCF_CTRL|SCF_ALT)
|
||||
{//Wait for user to press certain key.
|
||||
I64 sc,ch;
|
||||
U8 buf[STR_LEN],*st;
|
||||
@@ -55,7 +55,7 @@ public U0 AFGetKey(I64 scan_code,I64 sc_mask=0xFF|SCF_SHIFT|SCF_CTRL|SCF_ALT)
|
||||
Msg(MSG_KEY_DOWN,ch,sc);
|
||||
}
|
||||
|
||||
public I64 AFGetChar(...)
|
||||
public I64 InGetChar(...)
|
||||
{//Wait for user to press one of set of chars.
|
||||
I64 i,sc,ch;
|
||||
U8 buf[512],*st;
|
||||
@@ -84,7 +84,7 @@ public I64 AFGetChar(...)
|
||||
}
|
||||
}
|
||||
|
||||
public U0 AFUntilKey(I64 scan_code,I64 sc_mask=0xFF|SCF_SHIFT|SCF_CTRL|SCF_ALT)
|
||||
public U0 InUntilKey(I64 scan_code,I64 sc_mask=0xFF|SCF_SHIFT|SCF_CTRL|SCF_ALT)
|
||||
{//Let user type until he presses certain key.
|
||||
I64 sc,ch;
|
||||
do {
|
||||
@@ -93,7 +93,7 @@ public U0 AFUntilKey(I64 scan_code,I64 sc_mask=0xFF|SCF_SHIFT|SCF_CTRL|SCF_ALT)
|
||||
} while (sc&sc_mask!=scan_code&sc_mask);
|
||||
}
|
||||
|
||||
public I64 AFUntilChar(...)
|
||||
public I64 InUntilChar(...)
|
||||
{//Let user type until he presses one of set of chars.
|
||||
I64 i,sc,ch;
|
||||
while (TRUE) {
|
||||
@@ -105,16 +105,24 @@ public I64 AFUntilChar(...)
|
||||
}
|
||||
}
|
||||
|
||||
I64 af_l,af_r;
|
||||
public Bool InView()
|
||||
{//Let user type until <ESC> or <SHIFT-ESC>.
|
||||
Bool res=View;
|
||||
DocBottom;
|
||||
return res;
|
||||
}
|
||||
|
||||
Bool AFSetIPPlot(I64 ms,I64 x,I64 y,I64 z)
|
||||
#help_index "InFile;Help System/Training;Input Pointer"
|
||||
I64 in_plot_l,in_plot_r;
|
||||
|
||||
Bool InSetIPPlot(I64 ms,I64 x,I64 y,I64 z)
|
||||
{
|
||||
IPSet(x,y,z,af_l,af_r);
|
||||
IPSet(x,y,z,in_plot_l,in_plot_r);
|
||||
Sleep(ms);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
public U0 AFSetIP(I64 ms=7,I64 x=MAX_I64,I64 y=MAX_I64,I64 z=MAX_I64,
|
||||
public U0 InSetIP(I64 ms=7,I64 x=MAX_I64,I64 y=MAX_I64,I64 z=MAX_I64,
|
||||
I64 l=MAX_I64,I64 r=MAX_I64)
|
||||
{//Move input pointer (mouse) to spot at certain speed.
|
||||
if (!(0<=x<GR_WIDTH))
|
||||
@@ -127,13 +135,6 @@ public U0 AFSetIP(I64 ms=7,I64 x=MAX_I64,I64 y=MAX_I64,I64 z=MAX_I64,
|
||||
l=ip.lb;
|
||||
if (!(FALSE<=r<=TRUE))
|
||||
r=ip.rb;
|
||||
af_l=l; af_r=r;
|
||||
Line(ms,ip.pos.x,ip.pos.y,ip.pos.z,x,y,z,&AFSetIPPlot);
|
||||
}
|
||||
|
||||
public Bool AFView()
|
||||
{//Let user type until <ESC> or <SHIFT-ESC>.
|
||||
Bool res=View;
|
||||
DocBottom;
|
||||
return res;
|
||||
in_plot_l=l; in_plot_r=r;
|
||||
Line(ms,ip.pos.x,ip.pos.y,ip.pos.z,x,y,z,&InSetIPPlot);
|
||||
}
|
||||
+3
-3
@@ -9,14 +9,14 @@ Cd(__DIR__);;
|
||||
#include "Snd/MakeSnd"
|
||||
#include "ABlkDev/MakeABlkDev"
|
||||
#include "Menu"
|
||||
#include "WinA"
|
||||
#include "WinB"
|
||||
#include "Win"
|
||||
#include "WinMgr"
|
||||
#include "ADbg"
|
||||
#include "::/Adam/God/GodExt"
|
||||
#include "DolDoc/MakeDoc"
|
||||
LBts(&sys_run_level,RLf_DOC);
|
||||
#include "Ctrls/MakeCtrls"
|
||||
#include "AutoFile"
|
||||
#include "InFile"
|
||||
#include "ARegistry"
|
||||
#include "AutoComplete/MakeAC"
|
||||
#include "God/MakeGod"
|
||||
|
||||
+61
-61
@@ -26,41 +26,41 @@ public CMenuEntry *MenuEntryFind(CMenu *haystack_menu,U8 *needle_full_name)
|
||||
{//Find pulldown entry. Fs->cur_menu is probably the menu you want.
|
||||
//Just 2 levels -- across top and down are valid, currently.
|
||||
U8 *st,*st2;
|
||||
CMenuEntry *tempse;
|
||||
CMenuEntry *tmpse;
|
||||
if (!haystack_menu || !needle_full_name)
|
||||
return NULL;
|
||||
st=StrNew(needle_full_name);
|
||||
st2=StrNew(needle_full_name);
|
||||
tempse=(&haystack_menu->sub)(U8 *)-offset(CMenuEntry.sub);
|
||||
while (*st && tempse) {
|
||||
tmpse=(&haystack_menu->sub)(U8 *)-offset(CMenuEntry.sub);
|
||||
while (*st && tmpse) {
|
||||
StrFirstRem(st,"/",st2);
|
||||
tempse=MenuSubEntryFind(tempse->sub,st2);
|
||||
tmpse=MenuSubEntryFind(tmpse->sub,st2);
|
||||
}
|
||||
Free(st);
|
||||
Free(st2);
|
||||
return tempse;
|
||||
return tmpse;
|
||||
}
|
||||
|
||||
CMenuEntry *MenuNewSub(CCmpCtrl *cc,CTask *task)
|
||||
{
|
||||
CMenuEntry *tempme=NULL,*tempse;
|
||||
CMenuEntry *tmpme=NULL,*tmpse;
|
||||
if (cc->token==TK_IDENT) {
|
||||
tempme=CAlloc(sizeof(CMenuEntry),task);
|
||||
tmpme=CAlloc(sizeof(CMenuEntry),task);
|
||||
if (StrLen(cc->cur_str)>31)
|
||||
cc->cur_str[31]=0;
|
||||
StrCpy(tempme->name,cc->cur_str);
|
||||
StrCpy(tmpme->name,cc->cur_str);
|
||||
if (Lex(cc)=='(') {
|
||||
tempme->msg_code=MSG_KEY_DOWN_UP;
|
||||
tmpme->msg_code=MSG_KEY_DOWN_UP;
|
||||
if (Lex(cc)!=',' && cc->token!=')')
|
||||
tempme->msg_code=LexExpressionI64(cc);
|
||||
tmpme->msg_code=LexExpressionI64(cc);
|
||||
if (cc->token==',')
|
||||
Lex(cc);
|
||||
if (cc->token!=',' && cc->token!=')')
|
||||
tempme->a1=LexExpressionI64(cc);
|
||||
tmpme->a1=LexExpressionI64(cc);
|
||||
if (cc->token==',')
|
||||
Lex(cc);
|
||||
if (cc->token!=',' && cc->token!=')')
|
||||
tempme->a2=LexExpressionI64(cc);
|
||||
tmpme->a2=LexExpressionI64(cc);
|
||||
if (cc->token!=')')
|
||||
LexExcept(cc,"Missing ')' at ");
|
||||
if (Lex(cc)!=';')
|
||||
@@ -68,10 +68,10 @@ CMenuEntry *MenuNewSub(CCmpCtrl *cc,CTask *task)
|
||||
Lex(cc); //Skip ;
|
||||
} else if (cc->token=='{') {
|
||||
Lex(cc); //Skip {
|
||||
tempme->dir=TRUE;
|
||||
tempse=&tempme->sub;
|
||||
while (tempse && cc->token!='}')
|
||||
tempse=tempse->next=MenuNewSub(cc,task);
|
||||
tmpme->dir=TRUE;
|
||||
tmpse=&tmpme->sub;
|
||||
while (tmpse && cc->token!='}')
|
||||
tmpse=tmpse->next=MenuNewSub(cc,task);
|
||||
if (cc->token!='}')
|
||||
LexExcept(cc,"Missing '}' at ");
|
||||
else
|
||||
@@ -79,13 +79,13 @@ CMenuEntry *MenuNewSub(CCmpCtrl *cc,CTask *task)
|
||||
} else
|
||||
LexExcept(cc,"Expecting '{' at ");
|
||||
}
|
||||
return tempme;
|
||||
return tmpme;
|
||||
}
|
||||
|
||||
public CMenu *MenuNew(U8 *st,I64 flags=0,CTask *task=NULL)
|
||||
{//Parse a menu. You probably don't need this.
|
||||
CMenu *m;
|
||||
CMenuEntry *tempse;
|
||||
CMenuEntry *tmpse;
|
||||
CCmpCtrl *cc=CmpCtrlNew(st,CCF_DONT_FREE_BUF);
|
||||
if (!task) task=Fs;
|
||||
Lex(cc);
|
||||
@@ -93,9 +93,9 @@ public CMenu *MenuNew(U8 *st,I64 flags=0,CTask *task=NULL)
|
||||
m->task=task;
|
||||
m->flags=flags;
|
||||
m->attr =BLUE<<4+YELLOW;
|
||||
tempse=&m->sub;
|
||||
while (tempse)
|
||||
tempse=tempse->next=MenuNewSub(cc,task);
|
||||
tmpse=&m->sub;
|
||||
while (tmpse)
|
||||
tmpse=tmpse->next=MenuNewSub(cc,task);
|
||||
CmpCtrlDel(cc);
|
||||
return m;
|
||||
}
|
||||
@@ -109,40 +109,40 @@ public CMenu *MenuFile(U8 *filename,I64 flags=0,CTask *task=NULL)
|
||||
return m;
|
||||
}
|
||||
|
||||
U0 MenuDelSub(CMenuEntry *tempme)
|
||||
U0 MenuDelSub(CMenuEntry *tmpme)
|
||||
{
|
||||
CMenuEntry *tempse,*tempse1;
|
||||
if (tempme) {
|
||||
tempse=tempme->sub;
|
||||
while (tempse) {
|
||||
tempse1=tempse->next;
|
||||
MenuDelSub(tempse);
|
||||
tempse=tempse1;
|
||||
CMenuEntry *tmpse,*tmpse1;
|
||||
if (tmpme) {
|
||||
tmpse=tmpme->sub;
|
||||
while (tmpse) {
|
||||
tmpse1=tmpse->next;
|
||||
MenuDelSub(tmpse);
|
||||
tmpse=tmpse1;
|
||||
}
|
||||
Free(tempme);
|
||||
Free(tmpme);
|
||||
}
|
||||
}
|
||||
|
||||
public U0 MenuDel(CMenu *m)
|
||||
{//Delete a manu. You probably don't need this.
|
||||
CMenuEntry *tempme,*tempme1;
|
||||
CMenuEntry *tmpme,*tmpme1;
|
||||
if (!m) return;
|
||||
tempme=m->sub;
|
||||
while (tempme) {
|
||||
tempme1=tempme->next;
|
||||
MenuDelSub(tempme);
|
||||
tempme=tempme1;
|
||||
tmpme=m->sub;
|
||||
while (tmpme) {
|
||||
tmpme1=tmpme->next;
|
||||
MenuDelSub(tmpme);
|
||||
tmpme=tmpme1;
|
||||
}
|
||||
Free(m);
|
||||
}
|
||||
|
||||
I64 MenuEntryWidth(CMenuEntry *tempme)
|
||||
I64 MenuEntryWidth(CMenuEntry *tmpme)
|
||||
{
|
||||
I64 res=StrLen(tempme->name);
|
||||
CMenuEntry *tempse=tempme->sub;
|
||||
while (tempse) {
|
||||
res=MaxI64(res,StrLen(tempse->name));
|
||||
tempse=tempse->next;
|
||||
I64 res=StrLen(tmpme->name);
|
||||
CMenuEntry *tmpse=tmpme->sub;
|
||||
while (tmpse) {
|
||||
res=MaxI64(res,StrLen(tmpse->name));
|
||||
tmpse=tmpse->next;
|
||||
}
|
||||
return res+1;
|
||||
}
|
||||
@@ -174,7 +174,7 @@ public U0 MenuPop()
|
||||
U0 DrawMenu(CDC *dc)
|
||||
{
|
||||
CMenu *m;
|
||||
CMenuEntry *tempme,*tempse,*cur_submenu=NULL;
|
||||
CMenuEntry *tmpme,*tmpse,*cur_submenu=NULL;
|
||||
U8 *st=NULL;
|
||||
CTask *task=MenuTask;
|
||||
I64 i,w,x0,y0,x1=ip.pos.x,y1=ip.pos.y;
|
||||
@@ -185,9 +185,9 @@ U0 DrawMenu(CDC *dc)
|
||||
dc->color=m->attr>>4;
|
||||
GrRect(dc,0,0,GR_WIDTH,FONT_HEIGHT);
|
||||
x0=0;
|
||||
tempme=m->sub;
|
||||
while (tempme) {
|
||||
w=MenuEntryWidth(tempme)*FONT_WIDTH;
|
||||
tmpme=m->sub;
|
||||
while (tmpme) {
|
||||
w=MenuEntryWidth(tmpme)*FONT_WIDTH;
|
||||
if (x0<=x1<x0+w) {
|
||||
if (0<=y1<FONT_HEIGHT) {
|
||||
dc->color=m->attr&15;
|
||||
@@ -195,26 +195,26 @@ U0 DrawMenu(CDC *dc)
|
||||
dc->color=m->attr>>4;
|
||||
} else
|
||||
dc->color=m->attr&15;
|
||||
GrPrint(dc,x0,0,"%s",tempme->name);
|
||||
GrPrint(dc,x0,0,"%s",tmpme->name);
|
||||
y0=FONT_HEIGHT;
|
||||
tempse=tempme->sub;
|
||||
while (tempse) {
|
||||
if (tempse->checked)
|
||||
tmpse=tmpme->sub;
|
||||
while (tmpse) {
|
||||
if (tmpse->checked)
|
||||
i=m->attr^0xFF;
|
||||
else
|
||||
i=m->attr;
|
||||
if (y0<=y1<y0+FONT_HEIGHT) {
|
||||
if (tempse->msg_code==MSG_KEY_DOWN||
|
||||
tempse->msg_code==MSG_KEY_DOWN_UP) {
|
||||
if (!tempse->a2)
|
||||
tempse->a2=Char2ScanCode(tempse->a1);
|
||||
st=ScanCode2KeyName(tempse->a2);
|
||||
if (tmpse->msg_code==MSG_KEY_DOWN||
|
||||
tmpse->msg_code==MSG_KEY_DOWN_UP) {
|
||||
if (!tmpse->a2)
|
||||
tmpse->a2=Char2ScanCode(tmpse->a1);
|
||||
st=ScanCode2KeyName(tmpse->a2);
|
||||
}
|
||||
sys_cur_submenu_entry=cur_submenu=tempse;
|
||||
sys_cur_submenu_entry=cur_submenu=tmpse;
|
||||
dc->color=i&15;
|
||||
GrRect(dc,x0,y0,w,FONT_HEIGHT);
|
||||
dc->color=i>>4;
|
||||
GrPrint(dc,x0,y0,"%s",tempse->name);
|
||||
GrPrint(dc,x0,y0,"%s",tmpse->name);
|
||||
if (st) {
|
||||
dc->color=i>>4;
|
||||
GrRect(dc,x0+w,y0-FONT_HEIGHT,
|
||||
@@ -227,17 +227,17 @@ U0 DrawMenu(CDC *dc)
|
||||
dc->color=i>>4;
|
||||
GrRect(dc,x0,y0,w,FONT_HEIGHT);
|
||||
dc->color=i&15;
|
||||
GrPrint(dc,x0,y0,"%s",tempse->name);
|
||||
GrPrint(dc,x0,y0,"%s",tmpse->name);
|
||||
}
|
||||
y0+=FONT_HEIGHT;
|
||||
tempse=tempse->next;
|
||||
tmpse=tmpse->next;
|
||||
}
|
||||
} else {
|
||||
dc->color=m->attr&15;
|
||||
GrPrint(dc,x0,0,"%s",tempme->name);
|
||||
GrPrint(dc,x0,0,"%s",tmpme->name);
|
||||
}
|
||||
x0+=w;
|
||||
tempme=tempme->next;
|
||||
tmpme=tmpme->next;
|
||||
}
|
||||
sys_cur_submenu_entry=cur_submenu;
|
||||
}
|
||||
+112
-112
@@ -6,12 +6,12 @@ class CCDVDUserData //Create DVD
|
||||
short_dir_blks,long_dir_blks;
|
||||
};
|
||||
|
||||
I64 DVDFileCreate2(CFile *out_file,CDirEntry *tempde,CISO1DirEntry *tempi,
|
||||
CISO1DirEntry *tempi2,I64 *_cur_blk,CDirEntry *parent,Bool write,
|
||||
I64 DVDFileCreate2(CFile *out_file,CDirEntry *tmpde,CISO1DirEntry *tmpi,
|
||||
CISO1DirEntry *tmpi2,I64 *_cur_blk,CDirEntry *parent,Bool write,
|
||||
U8 *stage2_filename,I64 *_stage2_blk)
|
||||
{
|
||||
CCDVDUserData *tempc;
|
||||
CDirEntry *tempde1,*tempde2;
|
||||
CCDVDUserData *tmpc;
|
||||
CDirEntry *tmpde1,*tmpde2;
|
||||
CFile *in_file;
|
||||
U8 *buf=MAlloc(DVD_BLK_SIZE),*ptr1,*ptr2;
|
||||
CISO1DirEntry *dir_blk_buf =CAlloc(DVD_BLK_SIZE*128),
|
||||
@@ -20,12 +20,12 @@ I64 DVDFileCreate2(CFile *out_file,CDirEntry *tempde,CISO1DirEntry *tempi,
|
||||
*de2=dir_blk_buf2,*de12;
|
||||
I64 i,n;
|
||||
|
||||
tempc=parent->user_data;
|
||||
tmpc=parent->user_data;
|
||||
|
||||
de->len=sizeof(CISO1DirEntry)-1;
|
||||
de->ext_attr_len=0;
|
||||
FillU16Palindrome(&de->vol_seq_num,1);
|
||||
Date2ISO1(&de->date,tempde->datetime);
|
||||
Date2ISO1(&de->date,tmpde->datetime);
|
||||
de->flags=ISO1_ATTR_DIR;
|
||||
de->name_len=1;
|
||||
de->name=0;
|
||||
@@ -34,8 +34,8 @@ I64 DVDFileCreate2(CFile *out_file,CDirEntry *tempde,CISO1DirEntry *tempi,
|
||||
|
||||
de->len=sizeof(CISO1DirEntry)-1;
|
||||
de->ext_attr_len=0;
|
||||
FillU32Palindrome(&de->loc,tempc->loc);
|
||||
FillU32Palindrome(&de->size,tempc->short_dir_blks*DVD_BLK_SIZE);
|
||||
FillU32Palindrome(&de->loc,tmpc->loc);
|
||||
FillU32Palindrome(&de->size,tmpc->short_dir_blks*DVD_BLK_SIZE);
|
||||
FillU16Palindrome(&de->vol_seq_num,1);
|
||||
Date2ISO1(&de->date,parent->datetime);
|
||||
de->flags=ISO1_ATTR_DIR;
|
||||
@@ -47,7 +47,7 @@ I64 DVDFileCreate2(CFile *out_file,CDirEntry *tempde,CISO1DirEntry *tempi,
|
||||
de2->len=sizeof(CISO1DirEntry)-1;
|
||||
de2->ext_attr_len=0;
|
||||
FillU16Palindrome(&de2->vol_seq_num,1);
|
||||
Date2ISO1(&de2->date,tempde->datetime);
|
||||
Date2ISO1(&de2->date,tmpde->datetime);
|
||||
de2->flags=ISO1_ATTR_DIR;
|
||||
de2->name_len=1;
|
||||
de2->name=0;
|
||||
@@ -56,8 +56,8 @@ I64 DVDFileCreate2(CFile *out_file,CDirEntry *tempde,CISO1DirEntry *tempi,
|
||||
|
||||
de2->len=sizeof(CISO1DirEntry)-1;
|
||||
de2->ext_attr_len=0;
|
||||
FillU32Palindrome(&de2->loc,tempc->loc+tempc->short_dir_blks);
|
||||
FillU32Palindrome(&de2->size,tempc->long_dir_blks*DVD_BLK_SIZE);
|
||||
FillU32Palindrome(&de2->loc,tmpc->loc+tmpc->short_dir_blks);
|
||||
FillU32Palindrome(&de2->size,tmpc->long_dir_blks*DVD_BLK_SIZE);
|
||||
FillU16Palindrome(&de2->vol_seq_num,1);
|
||||
Date2ISO1(&de2->date,parent->datetime);
|
||||
de2->flags=ISO1_ATTR_DIR;
|
||||
@@ -66,49 +66,49 @@ I64 DVDFileCreate2(CFile *out_file,CDirEntry *tempde,CISO1DirEntry *tempi,
|
||||
de2->len+=de2->name_len;
|
||||
de2(U8 *)+=de2->len;
|
||||
|
||||
tempde1=tempde->sub;
|
||||
while (tempde1) {
|
||||
tempde2=tempde1->next;
|
||||
if (!write) tempde1->user_data=CAlloc(sizeof(CCDVDUserData));
|
||||
tmpde1=tmpde->sub;
|
||||
while (tmpde1) {
|
||||
tmpde2=tmpde1->next;
|
||||
if (!write) tmpde1->user_data=CAlloc(sizeof(CCDVDUserData));
|
||||
de1=de;
|
||||
de12=de2;
|
||||
if (tempde1->attr & RS_ATTR_DIR) {
|
||||
n=DVDFileCreate2(out_file,tempde1,de,de2,_cur_blk,
|
||||
tempde,write,stage2_filename,_stage2_blk);
|
||||
if (tmpde1->attr & RS_ATTR_DIR) {
|
||||
n=DVDFileCreate2(out_file,tmpde1,de,de2,_cur_blk,
|
||||
tmpde,write,stage2_filename,_stage2_blk);
|
||||
de(U8 *)+=sizeof(CISO1DirEntry)-1+n;
|
||||
de2(U8 *)+=sizeof(CISO1DirEntry)-1+n<<1;
|
||||
} else {
|
||||
tempc=tempde1->user_data;
|
||||
tmpc=tmpde1->user_data;
|
||||
de->len=sizeof(CISO1DirEntry)-1;
|
||||
de->ext_attr_len=0;
|
||||
FillU32Palindrome(&de->loc,*_cur_blk);
|
||||
tempc->loc=*_cur_blk;
|
||||
tmpc->loc=*_cur_blk;
|
||||
if (write) {
|
||||
if (stage2_filename && !StrCmp(tempde1->full_name,stage2_filename)) {
|
||||
if (stage2_filename && !StrCmp(tmpde1->full_name,stage2_filename)) {
|
||||
"$$RED$$!!! Boot Stage 2 !!!$$FG$$\n";
|
||||
if (_stage2_blk) *_stage2_blk=*_cur_blk;
|
||||
}
|
||||
"%X:%s\n",*_cur_blk,tempde1->full_name;
|
||||
"%X:%s\n",*_cur_blk,tmpde1->full_name;
|
||||
}
|
||||
FillU32Palindrome(&de->size,tempde1->size);
|
||||
FillU32Palindrome(&de->size,tmpde1->size);
|
||||
FillU16Palindrome(&de->vol_seq_num,1);
|
||||
Date2ISO1(&de->date,tempde1->datetime);
|
||||
Date2ISO1(&de->date,tmpde1->datetime);
|
||||
de->flags=0;
|
||||
de->name_len=StrLen(tempde1->name);
|
||||
StrCpy(&de->name,tempde1->name);
|
||||
de->name_len=StrLen(tmpde1->name);
|
||||
StrCpy(&de->name,tmpde1->name);
|
||||
de->len=de->len+de->name_len;
|
||||
de(U8 *)+=de->len;
|
||||
|
||||
de2->len=sizeof(CISO1DirEntry)-1;
|
||||
de2->ext_attr_len=0;
|
||||
FillU32Palindrome(&de2->loc,*_cur_blk);
|
||||
FillU32Palindrome(&de2->size,tempde1->size);
|
||||
FillU32Palindrome(&de2->size,tmpde1->size);
|
||||
FillU16Palindrome(&de2->vol_seq_num,1);
|
||||
Date2ISO1(&de2->date,tempde1->datetime);
|
||||
Date2ISO1(&de2->date,tmpde1->datetime);
|
||||
de2->flags=0;
|
||||
de2->name_len=StrLen(tempde1->name)<<1;
|
||||
de2->name_len=StrLen(tmpde1->name)<<1;
|
||||
ptr1=&de2->name;
|
||||
ptr2=&tempde1->name;
|
||||
ptr2=&tmpde1->name;
|
||||
for (i=0;i<de2->name_len;i=i+2) {
|
||||
ptr1++;
|
||||
*ptr1++=*ptr2++;
|
||||
@@ -116,7 +116,7 @@ I64 DVDFileCreate2(CFile *out_file,CDirEntry *tempde,CISO1DirEntry *tempi,
|
||||
de2->len+=de2->name_len;
|
||||
de2(U8 *)+=de2->len;
|
||||
|
||||
in_file=FOpen(tempde1->full_name,"r");
|
||||
in_file=FOpen(tmpde1->full_name,"r");
|
||||
for (i=0;i<(FSize(in_file)+DVD_BLK_SIZE-1)/DVD_BLK_SIZE;i++) {
|
||||
n=4;
|
||||
if ((i+1)<<2>(FSize(in_file)+BLK_SIZE-1)>>BLK_SIZE_BITS) {
|
||||
@@ -151,66 +151,66 @@ I64 DVDFileCreate2(CFile *out_file,CDirEntry *tempde,CISO1DirEntry *tempi,
|
||||
MemCpy(de2,buf,i);
|
||||
de2(U8 *)+=i;
|
||||
}
|
||||
tempde1=tempde2;
|
||||
tmpde1=tmpde2;
|
||||
}
|
||||
|
||||
tempc=tempde->user_data;
|
||||
tmpc=tmpde->user_data;
|
||||
|
||||
tempi->len=sizeof(CISO1DirEntry)-1;
|
||||
tempi->ext_attr_len=0;
|
||||
tempi->flags=ISO1_ATTR_DIR;
|
||||
if (!tempde->name[0]) {
|
||||
tempi->name_len=1;
|
||||
tempi->name=1;
|
||||
tmpi->len=sizeof(CISO1DirEntry)-1;
|
||||
tmpi->ext_attr_len=0;
|
||||
tmpi->flags=ISO1_ATTR_DIR;
|
||||
if (!tmpde->name[0]) {
|
||||
tmpi->name_len=1;
|
||||
tmpi->name=1;
|
||||
} else {
|
||||
tempi->name_len=StrLen(tempde->name);
|
||||
StrCpy(&tempi->name,tempde->name);
|
||||
tmpi->name_len=StrLen(tmpde->name);
|
||||
StrCpy(&tmpi->name,tmpde->name);
|
||||
}
|
||||
tempi->len+=tempi->name_len;
|
||||
tmpi->len+=tmpi->name_len;
|
||||
|
||||
n=de(U8 *)+1-dir_blk_buf(U8 *);
|
||||
n=(n+DVD_BLK_SIZE-1)/DVD_BLK_SIZE;
|
||||
FillU32Palindrome(&tempi->size,n*DVD_BLK_SIZE);
|
||||
FillU32Palindrome(&tempi->loc,*_cur_blk);
|
||||
tempc->short_dir_blks=n;
|
||||
tempc->loc=*_cur_blk;
|
||||
FillU32Palindrome(&tmpi->size,n*DVD_BLK_SIZE);
|
||||
FillU32Palindrome(&tmpi->loc,*_cur_blk);
|
||||
tmpc->short_dir_blks=n;
|
||||
tmpc->loc=*_cur_blk;
|
||||
FillU32Palindrome(&dir_blk_buf->size,n*DVD_BLK_SIZE);
|
||||
FillU32Palindrome(&dir_blk_buf->loc,*_cur_blk);
|
||||
FillU16Palindrome(&tempi->vol_seq_num,1);
|
||||
Date2ISO1(&tempi->date,tempde->datetime);
|
||||
FillU16Palindrome(&tmpi->vol_seq_num,1);
|
||||
Date2ISO1(&tmpi->date,tmpde->datetime);
|
||||
if (write)
|
||||
"%X:%s\n",*_cur_blk,tempde->full_name;
|
||||
"%X:%s\n",*_cur_blk,tmpde->full_name;
|
||||
if (write)
|
||||
FWBlks(out_file,dir_blk_buf,*_cur_blk<<2,n<<2);
|
||||
*_cur_blk+=n;
|
||||
|
||||
tempi2->len=sizeof(CISO1DirEntry)-1;
|
||||
tempi2->ext_attr_len=0;
|
||||
tempi2->flags=ISO1_ATTR_DIR;
|
||||
if (!tempde->name[0]) {
|
||||
tempi2->name_len=1;
|
||||
tempi->name=1;
|
||||
tmpi2->len=sizeof(CISO1DirEntry)-1;
|
||||
tmpi2->ext_attr_len=0;
|
||||
tmpi2->flags=ISO1_ATTR_DIR;
|
||||
if (!tmpde->name[0]) {
|
||||
tmpi2->name_len=1;
|
||||
tmpi->name=1;
|
||||
} else {
|
||||
tempi2->name_len=StrLen(tempde->name)<<1;
|
||||
ptr1=&tempi2->name;
|
||||
ptr2=&tempde->name;
|
||||
for (i=0;i<tempi2->name_len;i=i+2) {
|
||||
tmpi2->name_len=StrLen(tmpde->name)<<1;
|
||||
ptr1=&tmpi2->name;
|
||||
ptr2=&tmpde->name;
|
||||
for (i=0;i<tmpi2->name_len;i=i+2) {
|
||||
ptr1++;
|
||||
*ptr1++=*ptr2++;
|
||||
}
|
||||
}
|
||||
tempi2->len+=tempi2->name_len;
|
||||
tmpi2->len+=tmpi2->name_len;
|
||||
n=de2(U8 *)+1-dir_blk_buf2(U8 *);
|
||||
n=(n+DVD_BLK_SIZE-1)/DVD_BLK_SIZE;
|
||||
FillU32Palindrome(&tempi2->size,n*DVD_BLK_SIZE);
|
||||
FillU32Palindrome(&tempi2->loc,*_cur_blk);
|
||||
tempc->long_dir_blks=n;
|
||||
FillU32Palindrome(&tmpi2->size,n*DVD_BLK_SIZE);
|
||||
FillU32Palindrome(&tmpi2->loc,*_cur_blk);
|
||||
tmpc->long_dir_blks=n;
|
||||
FillU32Palindrome(&dir_blk_buf2->size,n*DVD_BLK_SIZE);
|
||||
FillU32Palindrome(&dir_blk_buf2->loc,*_cur_blk);
|
||||
FillU16Palindrome(&tempi2->vol_seq_num,1);
|
||||
Date2ISO1(&tempi2->date,tempde->datetime);
|
||||
FillU16Palindrome(&tmpi2->vol_seq_num,1);
|
||||
Date2ISO1(&tmpi2->date,tmpde->datetime);
|
||||
if (write)
|
||||
"%X:%s\n",*_cur_blk,tempde->full_name;
|
||||
"%X:%s\n",*_cur_blk,tmpde->full_name;
|
||||
if (write)
|
||||
FWBlks(out_file,dir_blk_buf2,*_cur_blk<<2,n<<2);
|
||||
*_cur_blk+=n;
|
||||
@@ -218,26 +218,26 @@ I64 DVDFileCreate2(CFile *out_file,CDirEntry *tempde,CISO1DirEntry *tempi,
|
||||
Free(dir_blk_buf);
|
||||
Free(dir_blk_buf2);
|
||||
Free(buf);
|
||||
return tempi->name_len;
|
||||
return tmpi->name_len;
|
||||
}
|
||||
|
||||
I64 DVDTableLen(CDirEntry *tempde,I64 *size1,I64 *size2,I64 cur_depth)
|
||||
I64 DVDTableLen(CDirEntry *tmpde,I64 *size1,I64 *size2,I64 cur_depth)
|
||||
{//Returns depth
|
||||
CDirEntry *tempde1=tempde->sub;
|
||||
CDirEntry *tmpde1=tmpde->sub;
|
||||
I64 max_depth=cur_depth,i;
|
||||
while (tempde1) {
|
||||
if (tempde1->attr & RS_ATTR_DIR) {
|
||||
*size1+=sizeof(CISO1PathEntry)-2+ (StrLen(tempde1->name)+1)&-0x2;
|
||||
*size2+=sizeof(CISO1PathEntry)-2+StrLen(tempde1->name)<<1;
|
||||
i=DVDTableLen(tempde1,size1,size2,cur_depth+1);
|
||||
while (tmpde1) {
|
||||
if (tmpde1->attr & RS_ATTR_DIR) {
|
||||
*size1+=sizeof(CISO1PathEntry)-2+ (StrLen(tmpde1->name)+1)&-0x2;
|
||||
*size2+=sizeof(CISO1PathEntry)-2+StrLen(tmpde1->name)<<1;
|
||||
i=DVDTableLen(tmpde1,size1,size2,cur_depth+1);
|
||||
if (i>max_depth) max_depth=i;
|
||||
}
|
||||
tempde1=tempde1->next;
|
||||
tmpde1=tmpde1->next;
|
||||
}
|
||||
return max_depth;
|
||||
}
|
||||
|
||||
U0 DVDFillPathTable(CDirEntry *tempde,
|
||||
U0 DVDFillPathTable(CDirEntry *tmpde,
|
||||
CISO1PathEntry **_itabbuf,CISO1PathEntry **_itabbuf2,
|
||||
I64 parent_entry_num,Bool big_endian,I64 *first_free,
|
||||
I64 cur_level,I64 output_level)
|
||||
@@ -245,59 +245,59 @@ U0 DVDFillPathTable(CDirEntry *tempde,
|
||||
U8 *ptr1,*ptr2;
|
||||
I64 i;
|
||||
CISO1PathEntry *tabbuf=*_itabbuf,*tabbuf2=*_itabbuf2;
|
||||
CDirEntry *tempde1=tempde->sub,*tempde2;
|
||||
CCDVDUserData *tempc;
|
||||
CDirEntry *tmpde1=tmpde->sub,*tmpde2;
|
||||
CCDVDUserData *tmpc;
|
||||
|
||||
if (cur_level==output_level) {
|
||||
while (tempde1) {
|
||||
if (tempde1->attr & RS_ATTR_DIR) {
|
||||
tempc=tempde1->user_data;
|
||||
tempc->path_entry_num=*first_free;
|
||||
tabbuf->name_len=StrLen(tempde1->name);
|
||||
while (tmpde1) {
|
||||
if (tmpde1->attr & RS_ATTR_DIR) {
|
||||
tmpc=tmpde1->user_data;
|
||||
tmpc->path_entry_num=*first_free;
|
||||
tabbuf->name_len=StrLen(tmpde1->name);
|
||||
if (big_endian) {
|
||||
tabbuf->blk=EndianU32(tempc->loc);
|
||||
tabbuf->blk=EndianU32(tmpc->loc);
|
||||
tabbuf->parent_entry_num=EndianU16(parent_entry_num);
|
||||
} else {
|
||||
tabbuf->blk=tempc->loc;
|
||||
tabbuf->blk=tmpc->loc;
|
||||
tabbuf->parent_entry_num=parent_entry_num;
|
||||
}
|
||||
StrCpy(&tabbuf->name,tempde1->name);
|
||||
StrCpy(&tabbuf->name,tmpde1->name);
|
||||
|
||||
tabbuf(U8 *)+=sizeof(CISO1PathEntry)-2+
|
||||
(StrLen(tempde1->name)+1) & -0x2;
|
||||
(StrLen(tmpde1->name)+1) & -0x2;
|
||||
|
||||
tabbuf2->name_len=StrLen(tempde1->name)<<1;
|
||||
tabbuf2->name_len=StrLen(tmpde1->name)<<1;
|
||||
if (big_endian) {
|
||||
tabbuf2->blk=EndianU32(tempc->loc+tempc->short_dir_blks);
|
||||
tabbuf2->blk=EndianU32(tmpc->loc+tmpc->short_dir_blks);
|
||||
tabbuf2->parent_entry_num=EndianU16(parent_entry_num);
|
||||
} else {
|
||||
tabbuf2->blk=tempc->loc+tempc->short_dir_blks;
|
||||
tabbuf2->blk=tmpc->loc+tmpc->short_dir_blks;
|
||||
tabbuf2->parent_entry_num=parent_entry_num;
|
||||
}
|
||||
ptr1=&tabbuf2->name;
|
||||
ptr2=&tempde1->name;
|
||||
ptr2=&tmpde1->name;
|
||||
for (i=0;i<tabbuf2->name_len;i=i+2) {
|
||||
ptr1++;
|
||||
*ptr1++=*ptr2++;
|
||||
}
|
||||
tabbuf2(U8 *)+=sizeof(CISO1PathEntry)-2+
|
||||
StrLen(tempde1->name)<<1;
|
||||
StrLen(tmpde1->name)<<1;
|
||||
*first_free+=1;
|
||||
}
|
||||
tempde1=tempde1->next;
|
||||
tmpde1=tmpde1->next;
|
||||
}
|
||||
*_itabbuf=tabbuf;
|
||||
*_itabbuf2=tabbuf2;
|
||||
}
|
||||
tempde1=tempde->sub;
|
||||
while (tempde1) {
|
||||
tempde2=tempde1->next;
|
||||
if (tempde1->attr & RS_ATTR_DIR) {
|
||||
tempc=tempde1->user_data;
|
||||
DVDFillPathTable(tempde1,_itabbuf,_itabbuf2,tempc->path_entry_num,
|
||||
tmpde1=tmpde->sub;
|
||||
while (tmpde1) {
|
||||
tmpde2=tmpde1->next;
|
||||
if (tmpde1->attr & RS_ATTR_DIR) {
|
||||
tmpc=tmpde1->user_data;
|
||||
DVDFillPathTable(tmpde1,_itabbuf,_itabbuf2,tmpc->path_entry_num,
|
||||
big_endian,first_free,cur_level+1,output_level);
|
||||
}
|
||||
tempde1=tempde2;
|
||||
tmpde1=tmpde2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,8 +320,8 @@ public I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask,
|
||||
*zero_buf=CAlloc(DVD_BLK_SIZE);
|
||||
CISO1PathEntry *tabbuf=NULL,*tabbuf2=NULL,*itabbuf,*itabbuf2;
|
||||
CFile *out_file=NULL;
|
||||
CISO1DirEntry *tempi;
|
||||
CCDVDUserData *tempc;
|
||||
CISO1DirEntry *tmpi;
|
||||
CCDVDUserData *tmpc;
|
||||
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
@@ -339,8 +339,8 @@ public I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask,
|
||||
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;
|
||||
tmpc=headdir->user_data;
|
||||
tmpc->path_entry_num=1;
|
||||
|
||||
cur_blk=20<<2>>2;
|
||||
if (stage2_filename) //preboot and bootloader
|
||||
@@ -419,14 +419,14 @@ public I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask,
|
||||
tabbuf=CAlloc(tabsize*DVD_BLK_SIZE);
|
||||
iso_pri->type_l_path_table=cur_blk;
|
||||
tabbuf->name_len=2; //Fill-in adam entry
|
||||
tempi=&iso_pri->root_dir_record;
|
||||
tabbuf->blk=tempi->loc.little;
|
||||
tmpi=&iso_pri->root_dir_record;
|
||||
tabbuf->blk=tmpi->loc.little;
|
||||
tabbuf->parent_entry_num=1;
|
||||
tabbuf2=CAlloc(tabsize2*DVD_BLK_SIZE);
|
||||
iso_sup->type_l_path_table=cur_blk+tabsize;
|
||||
tabbuf2->name_len=2; //Fill-in adam entry
|
||||
tempi=&iso_sup->root_dir_record;
|
||||
tabbuf2->blk=tempi->loc.little;
|
||||
tmpi=&iso_sup->root_dir_record;
|
||||
tabbuf2->blk=tmpi->loc.little;
|
||||
tabbuf2->parent_entry_num=1;
|
||||
itabbuf=tabbuf+1;
|
||||
itabbuf2=tabbuf2+1;
|
||||
@@ -443,14 +443,14 @@ public I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask,
|
||||
MemSet(tabbuf,0,tabsize*DVD_BLK_SIZE);
|
||||
iso_pri->type_m_path_table=EndianU32(cur_blk);
|
||||
tabbuf->name_len=2; //Fill-in adam entry
|
||||
tempi=&iso_pri->root_dir_record;
|
||||
tabbuf->blk=tempi->loc.big;
|
||||
tmpi=&iso_pri->root_dir_record;
|
||||
tabbuf->blk=tmpi->loc.big;
|
||||
tabbuf->parent_entry_num=EndianU16(1);
|
||||
MemSet(tabbuf2,0,tabsize2*DVD_BLK_SIZE);
|
||||
iso_sup->type_m_path_table=EndianU32(cur_blk+tabsize);
|
||||
tabbuf2->name_len=2; //Fill-in adam entry
|
||||
tempi=&iso_sup->root_dir_record;
|
||||
tabbuf2->blk=tempi->loc.big;
|
||||
tmpi=&iso_sup->root_dir_record;
|
||||
tabbuf2->blk=tmpi->loc.big;
|
||||
tabbuf2->parent_entry_num=EndianU16(1);
|
||||
itabbuf=tabbuf+1;
|
||||
itabbuf2=tabbuf2+1;
|
||||
|
||||
@@ -108,18 +108,18 @@ U0 RedSeaISO9660(U8 *iso_filename,U8 drv_let,I64 stage2_blk=0,I64 stage2_size=0)
|
||||
Free(iso_term);
|
||||
}
|
||||
|
||||
I64 RedSeaISOPass1(CDirEntry *tempde)
|
||||
I64 RedSeaISOPass1(CDirEntry *tmpde)
|
||||
{
|
||||
I64 dir_entry_cnt=3+LinkedLstCnt(tempde),res=0;
|
||||
while (tempde) {
|
||||
if (tempde->attr & RS_ATTR_DIR) {
|
||||
if (tempde->sub)
|
||||
res+=RedSeaISOPass1(tempde->sub);
|
||||
I64 dir_entry_cnt=3+LinkedLstCnt(tmpde),res=0;
|
||||
while (tmpde) {
|
||||
if (tmpde->attr & RS_ATTR_DIR) {
|
||||
if (tmpde->sub)
|
||||
res+=RedSeaISOPass1(tmpde->sub);
|
||||
else
|
||||
res+=BLK_SIZE; //Empty dir
|
||||
} else
|
||||
res+=CeilU64(tempde->size,BLK_SIZE);
|
||||
tempde=tempde->next;
|
||||
res+=CeilU64(tmpde->size,BLK_SIZE);
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
res+=CeilU64(dir_entry_cnt<<6,BLK_SIZE); //Size in bytes
|
||||
#assert CDIR_SIZE==64
|
||||
@@ -129,7 +129,7 @@ public I64 RedSeaISO(U8 *_iso_filename=NULL,U8 *_src_dir,
|
||||
U8 *_stage2_filename=NULL)
|
||||
{//See $LK,"::/Misc/DoDistro.HC"$. Must be ISO.C
|
||||
I64 i,res,root_cnt,root_dir_blks,bitmap_blks,bitmap_blks1;
|
||||
CDirEntry *tempde,de;
|
||||
CDirEntry *tmpde,de;
|
||||
U8 buf[STR_LEN],*iso_filename,*src_dir,*stage2_filename;
|
||||
CDrv *dv=DrvMakeFreeSlot(DrvNextFreeLet('Q')); //First $LK,"BDT_ISO_FILE_WRITE",A="MN:BDT_ISO_FILE_WRITE"$
|
||||
CBlkDev *bd=BlkDevNextFreeSlot(dv->drv_let,BDT_ISO_FILE_WRITE);
|
||||
@@ -147,10 +147,10 @@ public I64 RedSeaISO(U8 *_iso_filename=NULL,U8 *_src_dir,
|
||||
StrCpy(stage2_filename+3,stage2_filename+i);
|
||||
} else
|
||||
stage2_filename=NULL;
|
||||
tempde=FilesFind(src_dir,FUF_RECURSE);
|
||||
root_cnt=LinkedLstCnt(tempde)+3;
|
||||
tmpde=FilesFind(src_dir,FUF_RECURSE);
|
||||
root_cnt=LinkedLstCnt(tmpde)+3;
|
||||
root_dir_blks=CeilU64(root_cnt<<6,BLK_SIZE)>>BLK_SIZE_BITS;
|
||||
if (res=RedSeaISOPass1(tempde)>>BLK_SIZE_BITS) {
|
||||
if (res=RedSeaISOPass1(tmpde)>>BLK_SIZE_BITS) {
|
||||
bd->drv_offset=19<<2+(DVD_BLK_SIZE*2+DVD_BOOT_LOADER_SIZE)/BLK_SIZE;
|
||||
bitmap_blks=1;
|
||||
do {
|
||||
|
||||
+17
-17
@@ -219,17 +219,17 @@ 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_head.next,
|
||||
*tempb2=doc2->bin_head.next;
|
||||
CDocBin *tmpb1=doc1->bin_head.next,
|
||||
*tmpb2=doc2->bin_head.next;
|
||||
|
||||
if (tempb1->last->last->num!=tempb2->last->last->num)
|
||||
if (tmpb1->last->last->num!=tmpb2->last->last->num)
|
||||
return TRUE;
|
||||
while (tempb1!=&doc1->bin_head) {
|
||||
if (tempb1->size!=tempb2->size ||
|
||||
MemCmp(tempb1->data,tempb2->data,tempb1->size))
|
||||
while (tmpb1!=&doc1->bin_head) {
|
||||
if (tmpb1->size!=tmpb2->size ||
|
||||
MemCmp(tmpb1->data,tmpb2->data,tmpb1->size))
|
||||
return TRUE;
|
||||
tempb1=tempb1->next;
|
||||
tempb2=tempb2->next;
|
||||
tmpb1=tmpb1->next;
|
||||
tmpb2=tmpb2->next;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@@ -323,24 +323,24 @@ public U0 ZipRep(U8 *files_find_mask="/*",U8 *fu_flags=NULL,
|
||||
//Dft is just src files. (Used to spot
|
||||
//src files with redundancy in them.)
|
||||
I64 i=0,cnt,size,fuf_flags=0;
|
||||
CDirEntry *tempde,*tempde1,**sort_buf;
|
||||
CDirEntry *tmpde,*tmpde1,**sort_buf;
|
||||
U8 *buf;
|
||||
CArcCompress *arc;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+F+S");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
||||
cnt=FileCnt(tempde);
|
||||
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||
cnt=FileCnt(tmpde);
|
||||
sort_buf=MAlloc(sizeof(CDirEntry *)*cnt);
|
||||
while (tempde) {
|
||||
sort_buf[i++]=tempde;
|
||||
buf=FileRead(tempde->full_name,&size);
|
||||
while (tmpde) {
|
||||
sort_buf[i++]=tmpde;
|
||||
buf=FileRead(tmpde->full_name,&size);
|
||||
if (just_text_not_graphics)
|
||||
size=StrLen(buf);
|
||||
arc=CompressBuf(buf,size);
|
||||
Free(buf);
|
||||
tempde->user_data(F64)=100.0*arc->compressed_size/arc->expanded_size;
|
||||
tmpde->user_data(F64)=100.0*arc->compressed_size/arc->expanded_size;
|
||||
Free(arc);
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
QSortI64(sort_buf,cnt,&ZRepCompare);
|
||||
for (i=0;i<cnt;i++) {
|
||||
@@ -349,5 +349,5 @@ public U0 ZipRep(U8 *files_find_mask="/*",U8 *fu_flags=NULL,
|
||||
'\n';
|
||||
}
|
||||
Free(sort_buf);
|
||||
DirTreeDel(tempde1);
|
||||
DirTreeDel(tmpde1);
|
||||
}
|
||||
@@ -333,10 +333,10 @@ public U0 DocBMP(CDoc *doc=NULL,U8 *filename,Bool dither_probability=FALSE,
|
||||
DCDel(dc);
|
||||
}
|
||||
|
||||
#help_index "Graphics/Windows BMP Files;Graphics/Screen"
|
||||
public I64 BMPScreenCapture(U8 *filename,I64 bits=4,Bool include_zoom=TRUE)
|
||||
{//Capture screen as BMP file.
|
||||
CDC *dc=DCScreenCapture(include_zoom);
|
||||
#help_index "Graphics/Windows BMP Files;Graphics/Scrn"
|
||||
public I64 BMPScrnCapture(U8 *filename,I64 bits=4,Bool include_zoom=TRUE)
|
||||
{//Capture scrn as BMP file.
|
||||
CDC *dc=DCScrnCapture(include_zoom);
|
||||
I64 size=BMPWrite(filename,dc,bits);
|
||||
DCDel(dc);
|
||||
return size;
|
||||
|
||||
@@ -161,21 +161,21 @@ before or after "dd" are label characters.
|
||||
"+la"=only checks for label chars after.
|
||||
*/
|
||||
I64 cnt=0,fuf_flags=0;
|
||||
CDirEntry *tempde,*tempde1;
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+i+f+F+T");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
if (fuf_flags&~(FUG_FILES_FIND|FUF_IGNORE|FUF_ALL|
|
||||
FUF_WHOLE_LABELS|FUF_WHOLE_LABELS_BEFORE|FUF_WHOLE_LABELS_AFTER))
|
||||
throw('FUF');
|
||||
LBEqu(&fuf_flags,FUf_REPLACE,replace_text);
|
||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND);
|
||||
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND);
|
||||
fuf_flags&=FUF_ALL|FUF_REPLACE|FUF_IGNORE|FUF_WHOLE_LABELS|
|
||||
FUF_WHOLE_LABELS_BEFORE|FUF_WHOLE_LABELS_AFTER;
|
||||
while (tempde && !Bt(&fuf_flags,FUf_CANCEL)) {
|
||||
cnt+=FindFile(needle_str,tempde->full_name,&fuf_flags,replace_text);
|
||||
tempde=tempde->next;
|
||||
while (tmpde && !Bt(&fuf_flags,FUf_CANCEL)) {
|
||||
cnt+=FindFile(needle_str,tmpde->full_name,&fuf_flags,replace_text);
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
DirTreeDel(tmpde1);
|
||||
return cnt;
|
||||
}
|
||||
|
||||
|
||||
+41
-41
@@ -25,19 +25,19 @@ CHeapLogHash *heaplog_head=NULL;
|
||||
|
||||
U0 HeapLogMAlloc(U8 *addr)
|
||||
{
|
||||
CHeapLog *temphl;
|
||||
CHeapLog *tmphl;
|
||||
I64 i;
|
||||
if (MHeapCtrl(addr)==heaplog_hc_watched) {
|
||||
temphl=MAlloc(sizeof(CHeapLog),heaplog_hc);
|
||||
temphl->addr=addr;
|
||||
tmphl=MAlloc(sizeof(CHeapLog),heaplog_hc);
|
||||
tmphl->addr=addr;
|
||||
for (i=0;i<HL_CALLER_DEPTH;i++)
|
||||
temphl->caller[i]=Caller(i+2);
|
||||
tmphl->caller[i]=Caller(i+2);
|
||||
i=addr>>3 &(HL_HASH_SIZE-1);
|
||||
PUSHFD
|
||||
CLI
|
||||
while (LBts(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0))
|
||||
PAUSE
|
||||
QueIns(temphl,heaplog_head[i].last);
|
||||
QueIns(tmphl,heaplog_head[i].last);
|
||||
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
|
||||
POPFD
|
||||
}
|
||||
@@ -46,7 +46,7 @@ U0 HeapLogMAlloc(U8 *addr)
|
||||
U0 HeapLogFree(U8 *addr)
|
||||
{
|
||||
I64 i;
|
||||
CHeapLog *temphl;
|
||||
CHeapLog *tmphl;
|
||||
if (!addr) return;
|
||||
if (MHeapCtrl(addr)==heaplog_hc_watched) {
|
||||
i=addr>>3 &(HL_HASH_SIZE-1);
|
||||
@@ -54,16 +54,16 @@ U0 HeapLogFree(U8 *addr)
|
||||
CLI
|
||||
while (LBts(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0))
|
||||
PAUSE
|
||||
temphl=heaplog_head[i].next;
|
||||
while (temphl!=&heaplog_head[i]) {
|
||||
if (addr==temphl->addr) {
|
||||
QueRem(temphl);
|
||||
tmphl=heaplog_head[i].next;
|
||||
while (tmphl!=&heaplog_head[i]) {
|
||||
if (addr==tmphl->addr) {
|
||||
QueRem(tmphl);
|
||||
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
|
||||
POPFD
|
||||
Free(temphl);
|
||||
Free(tmphl);
|
||||
return;
|
||||
}
|
||||
temphl=temphl->next;
|
||||
tmphl=tmphl->next;
|
||||
}
|
||||
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
|
||||
POPFD
|
||||
@@ -115,7 +115,7 @@ public Bool HeapLog(Bool val=ON,CTask *task=NULL)
|
||||
public U0 HeapLogAddrRep(Bool leave_it=OFF)
|
||||
{//Call $LK,"HeapLog",A="MN:HeapLog"$() first and collect data.
|
||||
I64 i,j,total=0;
|
||||
CHeapLog *temphl,hl;
|
||||
CHeapLog *tmphl,hl;
|
||||
if (!LBtr(&sys_semas[SYS_SEMA_HEAPLOG_ACTIVE],0)) {
|
||||
"HeapLog Not Active\n";
|
||||
return;
|
||||
@@ -124,16 +124,16 @@ 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_head[i].next;
|
||||
while (temphl!=&heaplog_head[i]) {
|
||||
tmphl=heaplog_head[i].next;
|
||||
while (tmphl!=&heaplog_head[i]) {
|
||||
//Take snapshot in case modified. (while we work)
|
||||
MemCpy(&hl,temphl,sizeof(CHeapLog));
|
||||
MemCpy(&hl,tmphl,sizeof(CHeapLog));
|
||||
"$$PURPLE$$%08X$$FG$$ %08X",MSize(hl.addr),hl.addr;
|
||||
for (j=0;j<HL_CALLER_DEPTH;j++)
|
||||
" %P",hl.caller[j];
|
||||
'\n';
|
||||
total+=MSize(hl.addr);
|
||||
temphl=hl.next;
|
||||
tmphl=hl.next;
|
||||
}
|
||||
}
|
||||
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
|
||||
@@ -146,7 +146,7 @@ public U0 HeapLogAddrRep(Bool leave_it=OFF)
|
||||
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;
|
||||
CHeapLog *tmphla,hla,*tmphls,*tmphls1;
|
||||
CHeapLogHash *size_head;
|
||||
if (!LBtr(&sys_semas[SYS_SEMA_HEAPLOG_ACTIVE],0)) {
|
||||
"HeapLog Not Active\n";
|
||||
@@ -161,45 +161,45 @@ public U0 HeapLogSizeRep(Bool leave_it=OFF)
|
||||
while (LBts(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0))
|
||||
PAUSE
|
||||
for (i=0;i<HL_HASH_SIZE;i++) {
|
||||
temphla=heaplog_head[i].next;
|
||||
while (temphla!=&heaplog_head[i]) {
|
||||
tmphla=heaplog_head[i].next;
|
||||
while (tmphla!=&heaplog_head[i]) {
|
||||
//Take snapshot in case modified. (while we work)
|
||||
MemCpy(&hla,temphla,sizeof(CHeapLog));
|
||||
MemCpy(&hla,tmphla,sizeof(CHeapLog));
|
||||
k=(MSize(hla.addr)>>3+hla.caller[0])&(HL_HASH_SIZE-1);
|
||||
temphls=size_head[k].next;
|
||||
while (temphls!=&size_head[k]) {
|
||||
if (MSize(hla.addr)==temphls->size) {
|
||||
tmphls=size_head[k].next;
|
||||
while (tmphls!=&size_head[k]) {
|
||||
if (MSize(hla.addr)==tmphls->size) {
|
||||
for (j=0;j<HL_CALLER_DEPTH;j++)
|
||||
if (hla.caller[j]!=temphls->caller[j])
|
||||
if (hla.caller[j]!=tmphls->caller[j])
|
||||
goto hl_next;
|
||||
temphls->cnt++;
|
||||
tmphls->cnt++;
|
||||
goto hl_found;
|
||||
}
|
||||
hl_next:
|
||||
temphls=temphls->next;
|
||||
tmphls=tmphls->next;
|
||||
}
|
||||
temphls=MAlloc(sizeof(CHeapLog),heaplog_hc);
|
||||
MemCpy(temphls,&hla,sizeof(CHeapLog));
|
||||
temphls->cnt=1;
|
||||
temphls->size=MSize(hla.addr);
|
||||
QueIns(temphls,size_head[k].last);
|
||||
tmphls=MAlloc(sizeof(CHeapLog),heaplog_hc);
|
||||
MemCpy(tmphls,&hla,sizeof(CHeapLog));
|
||||
tmphls->cnt=1;
|
||||
tmphls->size=MSize(hla.addr);
|
||||
QueIns(tmphls,size_head[k].last);
|
||||
hl_found:
|
||||
temphla=hla.next;
|
||||
tmphla=hla.next;
|
||||
}
|
||||
}
|
||||
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
|
||||
|
||||
for (i=0;i<HL_HASH_SIZE;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;
|
||||
tmphls=size_head[i].next;
|
||||
while (tmphls!=&size_head[i]) {
|
||||
tmphls1=tmphls->next;
|
||||
"%08X*%08X=%08X",tmphls->size,tmphls->cnt,tmphls->size*tmphls->cnt;
|
||||
for (j=0;j<HL_CALLER_DEPTH;j++)
|
||||
" %P",temphls->caller[j];
|
||||
" %P",tmphls->caller[j];
|
||||
'\n';
|
||||
total+=temphls->size*temphls->cnt;
|
||||
Free(temphls);
|
||||
temphls=temphls1;
|
||||
total+=tmphls->size*tmphls->cnt;
|
||||
Free(tmphls);
|
||||
tmphls=tmphls1;
|
||||
}
|
||||
}
|
||||
Free(size_head);
|
||||
|
||||
+42
-42
@@ -1,107 +1,107 @@
|
||||
#help_index "Cmd Line (Typically)"
|
||||
|
||||
I64 LineRep1(CDirEntry *tempde)
|
||||
I64 LineRep1(CDirEntry *tmpde)
|
||||
{
|
||||
CDoc *doc;
|
||||
I64 res=0,i;
|
||||
while (tempde) {
|
||||
while (tmpde) {
|
||||
i=0;
|
||||
if (tempde->attr&RS_ATTR_DIR)
|
||||
i=LineRep1(tempde->sub);
|
||||
if (tmpde->attr&RS_ATTR_DIR)
|
||||
i=LineRep1(tmpde->sub);
|
||||
else {
|
||||
doc=DocRead(tempde->full_name);
|
||||
doc=DocRead(tmpde->full_name);
|
||||
if (doc->head.next!=doc)
|
||||
i=doc->head.last->y+2;
|
||||
DocDel(doc);
|
||||
}
|
||||
tempde->user_data=i;
|
||||
tmpde->user_data=i;
|
||||
res+=i;
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
U0 LineRep2(CDoc *doc,CDirEntry *tempde)
|
||||
U0 LineRep2(CDoc *doc,CDirEntry *tmpde)
|
||||
{
|
||||
while (tempde) {
|
||||
if (tempde->attr&RS_ATTR_DIR) {
|
||||
DocPrint(doc,"%8,d $$TR+C,\"%s\"$$\n$$ID,2$$",tempde->user_data,tempde->name);
|
||||
LineRep2(doc,tempde->sub);
|
||||
while (tmpde) {
|
||||
if (tmpde->attr&RS_ATTR_DIR) {
|
||||
DocPrint(doc,"%8,d $$TR+C,\"%s\"$$\n$$ID,2$$",tmpde->user_data,tmpde->name);
|
||||
LineRep2(doc,tmpde->sub);
|
||||
DocPrint(doc,"$$ID,-2$$");
|
||||
} else
|
||||
DocPrint(doc,"%8,d $$LK,\"%s\",A=\"FI:%s\"$$\n",
|
||||
tempde->user_data,tempde->name,tempde->full_name);
|
||||
tempde=tempde->next;
|
||||
tmpde->user_data,tmpde->name,tmpde->full_name);
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
}
|
||||
public I64 LineRep(U8 *files_find_mask="/*",U8 *fu_flags=NULL)
|
||||
{//Source line-of-code count report.
|
||||
I64 fuf_flags=0,res=0;
|
||||
CDoc *doc=DocNew;
|
||||
CDirEntry *tempde1=NULL;
|
||||
CDirEntry *tmpde1=NULL;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+S");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
if (tempde1=FilesFind(files_find_mask,fuf_flags)) {
|
||||
res=LineRep1(tempde1);
|
||||
if (tmpde1=FilesFind(files_find_mask,fuf_flags)) {
|
||||
res=LineRep1(tmpde1);
|
||||
DocPrint(doc,"%8,d $$TR+C,\"%s\"$$\n$$ID,2$$",res,files_find_mask);
|
||||
LineRep2(doc,tempde1);
|
||||
LineRep2(doc,tmpde1);
|
||||
DocPrint(doc,"$$ID,-2$$");
|
||||
DirTreeDel(tempde1);
|
||||
DirTreeDel(tmpde1);
|
||||
}
|
||||
DocInsDoc(DocPut,doc);
|
||||
DocDel(doc);
|
||||
return res;
|
||||
}
|
||||
|
||||
I64 SizeRep1(CDirEntry *tempde,I64 *_fuf_flags)
|
||||
I64 SizeRep1(CDirEntry *tmpde,I64 *_fuf_flags)
|
||||
{
|
||||
I64 res=0,i;
|
||||
U8 buf[BLK_SIZE];
|
||||
CDrv *dv;
|
||||
while (tempde) {
|
||||
if (tempde->attr&RS_ATTR_DIR)
|
||||
i=SizeRep1(tempde->sub,_fuf_flags);
|
||||
else if ((i=tempde->size) && Bt(_fuf_flags,FUf_EXPAND) &&
|
||||
FileAttr(tempde->name)&RS_ATTR_COMPRESSED) {
|
||||
dv=Let2Drv(*tempde->full_name);
|
||||
RBlks(dv,buf,Cluster2Blk(dv,tempde->cluster),1);
|
||||
while (tmpde) {
|
||||
if (tmpde->attr&RS_ATTR_DIR)
|
||||
i=SizeRep1(tmpde->sub,_fuf_flags);
|
||||
else if ((i=tmpde->size) && Bt(_fuf_flags,FUf_EXPAND) &&
|
||||
FileAttr(tmpde->name)&RS_ATTR_COMPRESSED) {
|
||||
dv=Let2Drv(*tmpde->full_name);
|
||||
RBlks(dv,buf,Cluster2Blk(dv,tmpde->cluster),1);
|
||||
i=(&buf)(CArcCompress *)->expanded_size;
|
||||
}
|
||||
tempde->user_data=i;
|
||||
tmpde->user_data=i;
|
||||
res+=i;
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
U0 SizeRep2(CDoc *doc,CDirEntry *tempde)
|
||||
U0 SizeRep2(CDoc *doc,CDirEntry *tmpde)
|
||||
{
|
||||
while (tempde) {
|
||||
if (tempde->attr&RS_ATTR_DIR) {
|
||||
while (tmpde) {
|
||||
if (tmpde->attr&RS_ATTR_DIR) {
|
||||
DocPrint(doc,"%10,d $$TR+C,\"%s\"$$\n$$ID,2$$",
|
||||
tempde->user_data,tempde->name);
|
||||
SizeRep2(doc,tempde->sub);
|
||||
tmpde->user_data,tmpde->name);
|
||||
SizeRep2(doc,tmpde->sub);
|
||||
DocPrint(doc,"$$ID,-2$$");
|
||||
} else {
|
||||
DocPrint(doc,"%10,d ",tempde->user_data);
|
||||
DocPrint(doc,"%10,d ",tmpde->user_data);
|
||||
DocPrint(doc,"$$LK,\"%s\",A=\"FI:%s\"$$\n",
|
||||
tempde->name,tempde->full_name);
|
||||
tmpde->name,tmpde->full_name);
|
||||
}
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
}
|
||||
public I64 SizeRep(U8 *files_find_mask="/*",U8 *fu_flags=NULL)
|
||||
{//Report file sizes. "+x" for expanded size of compressed files.
|
||||
I64 fuf_flags=0,res=0;
|
||||
CDoc *doc=DocNew;
|
||||
CDirEntry *tempde1=NULL;
|
||||
CDirEntry *tmpde1=NULL;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
if (tempde1=FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND)) {
|
||||
if (tmpde1=FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND)) {
|
||||
fuf_flags&=FUF_EXPAND;
|
||||
res=SizeRep1(tempde1,&fuf_flags);
|
||||
res=SizeRep1(tmpde1,&fuf_flags);
|
||||
DocPrint(doc,"%10,d $$TR+C,\"%s\"$$\n$$ID,2$$",res,files_find_mask);
|
||||
SizeRep2(doc,tempde1);
|
||||
SizeRep2(doc,tmpde1);
|
||||
DocPrint(doc,"$$ID,-2$$");
|
||||
DirTreeDel(tempde1);
|
||||
DirTreeDel(tmpde1);
|
||||
}
|
||||
DocInsDoc(DocPut,doc);
|
||||
DocDel(doc);
|
||||
|
||||
@@ -16,7 +16,7 @@ I64 LinkChkDoc(CDoc *doc,I64 *_fuf_flags)
|
||||
old_doc=DocPut;
|
||||
DocLock(old_doc);
|
||||
Fs->put_doc=doc;
|
||||
found=DocLinkChk(st);
|
||||
found=DocLinkChk(doc,st);
|
||||
Fs->put_doc=old_doc;
|
||||
DocUnlock(old_doc);
|
||||
if (!found) {
|
||||
@@ -47,14 +47,14 @@ I64 LinkChkFile(U8 *filename,I64 *_fuf_flags)
|
||||
public I64 LinkChk(U8 *files_find_mask="/*",U8 *fu_flags=NULL)
|
||||
{//Check documents for broken file links.
|
||||
I64 fuf_flags=0,res=0;
|
||||
CDirEntry *tempde,*tempde1;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+T+f+F+O");
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+$$+f+F+O");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
||||
while (tempde && !Bt(&fuf_flags,FUf_CANCEL)) {
|
||||
res+=LinkChkFile(tempde->full_name,&fuf_flags);
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||
while (tmpde && !Bt(&fuf_flags,FUf_CANCEL)) {
|
||||
res+=LinkChkFile(tmpde->full_name,&fuf_flags);
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
DirTreeDel(tmpde1);
|
||||
return res;
|
||||
}
|
||||
+20
-20
@@ -14,46 +14,46 @@ I64 PenBrushesSize()
|
||||
return res;
|
||||
}
|
||||
|
||||
I64 ScreenZoomTablesSize()
|
||||
I64 ScrnZoomTablesSize()
|
||||
{
|
||||
I64 res=0,i;
|
||||
for (i=1;i<=GR_MAX_SCREEN_ZOOM;i++)
|
||||
res+=MSize2(gr.screen_zoom_tables[i]);
|
||||
for (i=1;i<=GR_MAX_SCRN_ZOOM;i++)
|
||||
res+=MSize2(gr.scrn_zoom_tables[i]);
|
||||
return res;
|
||||
}
|
||||
|
||||
I64 TaskStkSize(CTask *task)
|
||||
{
|
||||
CTaskStk *temps=task->stk;
|
||||
CTaskStk *tmps=task->stk;
|
||||
I64 res=0;
|
||||
while (temps) {
|
||||
res+=MSize2(temps);
|
||||
temps=temps->next_stk;
|
||||
while (tmps) {
|
||||
res+=MSize2(tmps);
|
||||
tmps=tmps->next_stk;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
I64 TaskQueSize(CTask *task)
|
||||
{
|
||||
CSrvCmd *tempc,*tempc1;
|
||||
CSrvCmd *tmpc,*tmpc1;
|
||||
I64 res=0;
|
||||
PUSHFD
|
||||
CLI
|
||||
while (LBts(&task->srv_ctrl.flags,SVCRf_LOCKED))
|
||||
PAUSE
|
||||
|
||||
tempc1=&task->srv_ctrl.next_waiting;
|
||||
tempc=tempc1->next;
|
||||
while (tempc!=tempc1) {
|
||||
res+=MSize2(tempc)+MSize2(tempc->aux_str);
|
||||
tempc=tempc->next;
|
||||
tmpc1=&task->srv_ctrl.next_waiting;
|
||||
tmpc=tmpc1->next;
|
||||
while (tmpc!=tmpc1) {
|
||||
res+=MSize2(tmpc)+MSize2(tmpc->aux_str);
|
||||
tmpc=tmpc->next;
|
||||
}
|
||||
|
||||
tempc1=&task->srv_ctrl.next_done;
|
||||
tempc=tempc1->next;
|
||||
while (tempc!=tempc1) {
|
||||
res+=MSize2(tempc)+MSize2(tempc->aux_str);
|
||||
tempc=tempc->next;
|
||||
tmpc1=&task->srv_ctrl.next_done;
|
||||
tmpc=tmpc1->next;
|
||||
while (tmpc!=tmpc1) {
|
||||
res+=MSize2(tmpc)+MSize2(tmpc->aux_str);
|
||||
tmpc=tmpc->next;
|
||||
}
|
||||
|
||||
LBtr(&task->srv_ctrl.flags,SVCRf_LOCKED);
|
||||
@@ -136,7 +136,7 @@ Bool MemRepTask(CTask *task,Bool override_validate=FALSE)
|
||||
|
||||
if (task==sys_winmgr_task) {
|
||||
"gr.pen_brushes\t:%010X\n",PenBrushesSize;
|
||||
"gr_screen_zoom_tbles:%010X\n",ScreenZoomTablesSize;
|
||||
"gr_scrn_zoom_tbles:%010X\n",ScrnZoomTablesSize;
|
||||
} else if (task==adam_task) {
|
||||
j=0;k=0;m=0;n=0;
|
||||
for (i=0;i<mp_cnt;i++) {
|
||||
@@ -182,7 +182,7 @@ Bool MemRepTask(CTask *task,Bool override_validate=FALSE)
|
||||
"gr.dc1\t\t:%010X\n",DCSize(gr.dc1);
|
||||
"gr.dc2\t\t:%010X\n",DCSize(gr.dc2);
|
||||
"gr.dc_cache\t\t:%010X\n",DCSize(gr.dc_cache);
|
||||
"gr.screen_image\t:%010X\n",DCSize(gr.screen_image);
|
||||
"gr.scrn_image\t:%010X\n",DCSize(gr.scrn_image);
|
||||
"gr.zoomed_dc\t:%010X\n",DCSize(gr.zoomed_dc);
|
||||
}
|
||||
"$$ID,-2$$";
|
||||
|
||||
+26
-26
@@ -10,28 +10,28 @@ CDirEntry MGFind(CDirEntry *needle_entry,CDirEntry *haystack_lst)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
U0 Merge2(CDirEntry *tempde1,CDirEntry *tempde2,I64 *_fuf_flags,I64 *_df_flags)
|
||||
U0 Merge2(CDirEntry *tmpde1,CDirEntry *tmpde2,I64 *_fuf_flags,I64 *_df_flags)
|
||||
{
|
||||
CDirEntry *tempde;
|
||||
while (tempde1 && !(*_df_flags & DF_ABORT_ALL_FILES)) {
|
||||
tempde=MGFind(tempde1,tempde2);
|
||||
if (!tempde)
|
||||
"$$BROWN$$Does Not Exist:%s$$FG$$\n",tempde1->full_name;
|
||||
CDirEntry *tmpde;
|
||||
while (tmpde1 && !(*_df_flags & DF_ABORT_ALL_FILES)) {
|
||||
tmpde=MGFind(tmpde1,tmpde2);
|
||||
if (!tmpde)
|
||||
"$$BROWN$$Does Not Exist:%s$$FG$$\n",tmpde1->full_name;
|
||||
else {
|
||||
if (tempde1->attr & RS_ATTR_DIR)
|
||||
Merge2(tempde1->sub,tempde->sub,_fuf_flags,_df_flags);
|
||||
if (tmpde1->attr & RS_ATTR_DIR)
|
||||
Merge2(tmpde1->sub,tmpde->sub,_fuf_flags,_df_flags);
|
||||
else {
|
||||
if (AbsI64(tempde1->datetime-tempde->datetime)>CDATE_FREQ*2) {//slop
|
||||
"%s",tempde1->full_name;
|
||||
if (AbsI64(tmpde1->datetime-tmpde->datetime)>CDATE_FREQ*2) {//slop
|
||||
"%s",tmpde1->full_name;
|
||||
'\n';
|
||||
if (Bt(_fuf_flags,FUf_DIFF)) {
|
||||
if (FilesFindMatch(tempde1->full_name,FILEMASK_TXT))
|
||||
Diff(tempde->full_name,tempde1->full_name,_df_flags);
|
||||
if (FilesFindMatch(tmpde1->full_name,FILEMASK_TXT))
|
||||
Diff(tmpde->full_name,tmpde1->full_name,_df_flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
tempde1=tempde1->next;
|
||||
tmpde1=tmpde1->next;
|
||||
}
|
||||
}
|
||||
public U0 Merge(U8 *dst_files_find_mask="/*",U8 *src_files_find_mask="/*",
|
||||
@@ -44,18 +44,18 @@ merge changes from source files into
|
||||
destination files.
|
||||
*/
|
||||
I64 df_flags=0,fuf_flags=0;
|
||||
CDirEntry *tempde1=NULL,*tempde2=NULL;
|
||||
CDirEntry *tmpde1=NULL,*tmpde2=NULL;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
if (fuf_flags&~(FUG_FILES_FIND|FUF_DIFF))
|
||||
throw('FUF');
|
||||
PrintWarn("This is based strictly on file dates.\n");
|
||||
tempde1=FilesFind(src_files_find_mask,fuf_flags&FUG_FILES_FIND);
|
||||
tempde2=FilesFind(dst_files_find_mask,fuf_flags&FUG_FILES_FIND);
|
||||
tmpde1=FilesFind(src_files_find_mask,fuf_flags&FUG_FILES_FIND);
|
||||
tmpde2=FilesFind(dst_files_find_mask,fuf_flags&FUG_FILES_FIND);
|
||||
fuf_flags&=FUF_DIFF;
|
||||
Merge2(tempde1,tempde2,&fuf_flags,&df_flags);
|
||||
DirTreeDel(tempde1);
|
||||
DirTreeDel(tempde2);
|
||||
Merge2(tmpde1,tmpde2,&fuf_flags,&df_flags);
|
||||
DirTreeDel(tmpde1);
|
||||
DirTreeDel(tmpde2);
|
||||
}
|
||||
|
||||
#help_index "Utils;Cmd Line (Typically)"
|
||||
@@ -63,15 +63,15 @@ destination files.
|
||||
public U0 NewFiles(U8 *files_find_mask="/*",CDate cdt=0,U8 *fu_flags=NULL)
|
||||
{//Report files newer than a certain date.
|
||||
I64 fuf_flags=0;
|
||||
CDirEntry *tempde,*tempde1;
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
if (!cdt) cdt=sys_compile_time;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+F");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
||||
while (tempde) {
|
||||
if (tempde->datetime>cdt)
|
||||
"%s\n",tempde->full_name;
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||
while (tmpde) {
|
||||
if (tmpde->datetime>cdt)
|
||||
"%s\n",tmpde->full_name;
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
DirTreeDel(tmpde1);
|
||||
}
|
||||
+18
-18
@@ -105,15 +105,15 @@ public I64 Words(U8 *files_find_mask="*",U32 *chars_bmp=chars_bmp_alpha,
|
||||
{//Break file into list of not-unique words.
|
||||
I64 fuf_flags=0,res=0;
|
||||
CDoc *doc_out=DocNew;
|
||||
CDirEntry *tempde,*tempde1;
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+T");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
||||
while (tempde) {
|
||||
res+=DocWordsFile(doc_out,tempde->full_name,chars_bmp);
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||
while (tmpde) {
|
||||
res+=DocWordsFile(doc_out,tmpde->full_name,chars_bmp);
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
DirTreeDel(tmpde1);
|
||||
DocInsDoc(NULL,doc_out);
|
||||
DocDel(doc_out);
|
||||
return res;
|
||||
@@ -140,16 +140,16 @@ I64 LongLinesFile(U8 *filename,I64 cols)
|
||||
public I64 LongLines(U8 *files_find_mask="*",I64 cols=80,U8 *fu_flags=NULL)
|
||||
{//Report files with lines of too many cols.
|
||||
I64 res=0,fuf_flags=0;
|
||||
CDirEntry *tempde,*tempde1;
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F+S");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
||||
while (tempde) {
|
||||
if (LongLinesFile(tempde->full_name,cols))
|
||||
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||
while (tmpde) {
|
||||
if (LongLinesFile(tmpde->full_name,cols))
|
||||
res++;
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
DirTreeDel(tmpde1);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -187,15 +187,15 @@ public U0 SU(U8 *files_find_mask,I64 suf_flags,U8 *fu_flags=NULL,
|
||||
//or removing trailing spaces on lines.
|
||||
//See $LK,"SUF Flags",A="MN:SUF_SINGLE_SPACE"$.
|
||||
I64 fuf_flags=0;
|
||||
CDirEntry *tempde,*tempde1;
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+f+F+T");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
||||
while (tempde) {
|
||||
SUFile(tempde->full_name,suf_flags,indent_scale_factor);
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||
while (tmpde) {
|
||||
SUFile(tmpde->full_name,suf_flags,indent_scale_factor);
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
DirTreeDel(tmpde1);
|
||||
}
|
||||
|
||||
public U0 S2T(U8 *files_find_mask,U8 *fu_flags=NULL)
|
||||
|
||||
@@ -4,16 +4,16 @@ public U0 ToDolDoc(U8 *files_find_mask,U8 *fu_flags=NULL)
|
||||
{//Convert text file to $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ by making double $$'s.
|
||||
CDoc *doc;
|
||||
I64 fuf_flags=0;
|
||||
CDirEntry *tempde,*tempde1;
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+f+F");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
||||
while (tempde) {
|
||||
"%s\n",tempde->full_name;
|
||||
doc=DocRead(tempde->full_name,DOCF_PLAIN_TEXT|DOCF_DBL_DOLLARS);
|
||||
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||
while (tmpde) {
|
||||
"%s\n",tmpde->full_name;
|
||||
doc=DocRead(tmpde->full_name,DOCF_PLAIN_TEXT|DOCF_DBL_DOLLARS);
|
||||
DocWrite(doc);
|
||||
DocDel(doc);
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
DirTreeDel(tmpde1);
|
||||
}
|
||||
@@ -197,7 +197,7 @@ U0 MusicSettingsRst()
|
||||
music.note_len=1.0;
|
||||
music.meter_top=4;
|
||||
music.meter_bottom=4;
|
||||
|
||||
SndRst;
|
||||
PUSHFD
|
||||
CLI
|
||||
if (mp_cnt>1)
|
||||
|
||||
+3
-6
@@ -2,14 +2,11 @@
|
||||
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,
|
||||
st,desc;
|
||||
"%h*c$$MA,T=\"%08X\",LM=\"Kill(0x%X);\n\",$$ $$BLACK$$#%d$$FG$$ "
|
||||
"$$TX,\"%$$Q...\",SCX=16$$\n",indent,CH_SPACE,task,task,task->task_num,
|
||||
task->task_title;
|
||||
"%h*c%08X %04X:%04X:%08X\n",indent+2,CH_SPACE,TaskMemAlloced(task),
|
||||
task->task_flags,task->display_flags,task->win_inhibit;
|
||||
Free(st);
|
||||
Free(desc);
|
||||
task1=task->next_child_task;
|
||||
while (task1!=(&task->next_child_task)(U8 *)
|
||||
-offset(CTask.next_sibling_task)) {
|
||||
|
||||
+61
-61
@@ -5,116 +5,116 @@ public CTaskSettings *SettingsPush(CTask *task=NULL,I64 flags=0)
|
||||
//It saves many settings so they can be restored
|
||||
//at the end of the application with $LK,"SettingsPop",A="MN:SettingsPop"$().
|
||||
|
||||
CTaskSettings *tempse;
|
||||
CTaskSettings *tmpse;
|
||||
CDoc *doc;
|
||||
if (!task) task=Fs;
|
||||
if (!TaskValidate(task)) return NULL;
|
||||
tempse=CAlloc(sizeof(CTaskSettings),task);
|
||||
tempse->cur_dir=CurDir(task,task);
|
||||
tempse->draw_it=task->draw_it;
|
||||
GrPaletteGet(tempse->palette);
|
||||
tempse->task_end_cb=task->task_end_cb;
|
||||
tmpse=CAlloc(sizeof(CTaskSettings),task);
|
||||
tmpse->cur_dir=CurDir(task,task);
|
||||
tmpse->draw_it=task->draw_it;
|
||||
GrPaletteGet(tmpse->palette);
|
||||
tmpse->task_end_cb=task->task_end_cb;
|
||||
|
||||
if (!(flags&TSF_SAME_SONG)) {
|
||||
if (tempse->song_task=task->song_task) {
|
||||
if (tmpse->song_task=task->song_task) {
|
||||
Suspend(task->song_task);
|
||||
Snd(0);
|
||||
}
|
||||
task->song_task=NULL;
|
||||
}
|
||||
|
||||
if (tempse->animate_task=task->animate_task)
|
||||
if (tmpse->animate_task=task->animate_task)
|
||||
Suspend(task->animate_task);
|
||||
task->animate_task=NULL;
|
||||
|
||||
if (doc=DocPut(task)) {
|
||||
tempse->hide_cursor=!Bt(&doc->flags,DOCf_HIDE_CURSOR);
|
||||
tempse->highlight_cursor=!Bt(&doc->flags,DOCf_DONT_HIGHLIGHT_CURSOR);
|
||||
tempse->scroll=!Bt(&doc->flags,DOCf_NO_SCROLL_BARS);
|
||||
tmpse->hide_cursor=!Bt(&doc->flags,DOCf_HIDE_CURSOR);
|
||||
tmpse->highlight_cursor=!Bt(&doc->flags,DOCf_DONT_HIGHLIGHT_CURSOR);
|
||||
tmpse->scroll=!Bt(&doc->flags,DOCf_NO_SCROLL_BARS);
|
||||
}
|
||||
|
||||
tempse->left=task->win_left;
|
||||
tempse->right=task->win_right;
|
||||
tempse->top=task->win_top;
|
||||
tempse->bottom=task->win_bottom;
|
||||
tmpse->left=task->win_left;
|
||||
tmpse->right=task->win_right;
|
||||
tmpse->top=task->win_top;
|
||||
tmpse->bottom=task->win_bottom;
|
||||
|
||||
tempse->scroll_x=task->scroll_x;
|
||||
tempse->scroll_y=task->scroll_y;
|
||||
tempse->scroll_z=task->scroll_z;
|
||||
tmpse->scroll_x=task->scroll_x;
|
||||
tmpse->scroll_y=task->scroll_y;
|
||||
tmpse->scroll_z=task->scroll_z;
|
||||
|
||||
tempse->win_inhibit=task->win_inhibit;
|
||||
tempse->text_attr=task->text_attr;
|
||||
StrCpy(tempse->task_title,task->task_title);
|
||||
tempse->title_src =task->title_src;
|
||||
tempse->border_attr=task->border_attr;
|
||||
tempse->border_src =task->border_src;
|
||||
tempse->border=!Bt(&task->display_flags,DISPLAYf_NO_BORDER);
|
||||
tmpse->win_inhibit=task->win_inhibit;
|
||||
tmpse->text_attr=task->text_attr;
|
||||
StrCpy(tmpse->task_title,task->task_title);
|
||||
tmpse->title_src =task->title_src;
|
||||
tmpse->border_attr=task->border_attr;
|
||||
tmpse->border_src =task->border_src;
|
||||
tmpse->border=!Bt(&task->display_flags,DISPLAYf_NO_BORDER);
|
||||
if (TaskValidate(ac.task))
|
||||
tempse->autocomplete=TRUE;
|
||||
tmpse->autocomplete=TRUE;
|
||||
else
|
||||
tempse->autocomplete=FALSE;
|
||||
tmpse->autocomplete=FALSE;
|
||||
|
||||
tempse->next=task->next_settings;
|
||||
task->next_settings=tempse;
|
||||
return tempse;
|
||||
tmpse->next=task->next_settings;
|
||||
task->next_settings=tmpse;
|
||||
return tmpse;
|
||||
}
|
||||
|
||||
U0 SettingsPop2(CTask *task,CTaskSettings *tempse)
|
||||
U0 SettingsPop2(CTask *task,CTaskSettings *tmpse)
|
||||
{
|
||||
CDoc *doc;
|
||||
|
||||
if (doc=DocPut(task)) {
|
||||
LBEqu(&doc->flags,DOCf_HIDE_CURSOR,!tempse->hide_cursor);
|
||||
LBEqu(&doc->flags,DOCf_DONT_HIGHLIGHT_CURSOR,!tempse->highlight_cursor);
|
||||
LBEqu(&doc->flags,DOCf_NO_SCROLL_BARS,!tempse->scroll);
|
||||
LBEqu(&doc->flags,DOCf_HIDE_CURSOR,!tmpse->hide_cursor);
|
||||
LBEqu(&doc->flags,DOCf_DONT_HIGHLIGHT_CURSOR,!tmpse->highlight_cursor);
|
||||
LBEqu(&doc->flags,DOCf_NO_SCROLL_BARS,!tmpse->scroll);
|
||||
}
|
||||
|
||||
WinBorder(tempse->border,task);
|
||||
WinHorz(tempse->left,tempse->right,task);
|
||||
WinVert(tempse->top,tempse->bottom,task);
|
||||
task->scroll_x=tempse->scroll_x;
|
||||
task->scroll_y=tempse->scroll_y;
|
||||
task->scroll_z=tempse->scroll_z;
|
||||
task->win_inhibit=tempse->win_inhibit;
|
||||
task->text_attr=tempse->text_attr;
|
||||
task->border_attr=tempse->border_attr;
|
||||
task->border_src =tempse->border_src;
|
||||
task->title_src =tempse->title_src;
|
||||
StrCpy(task->task_title,tempse->task_title);
|
||||
AutoComplete(tempse->autocomplete);
|
||||
GrPaletteSet(tempse->palette);
|
||||
WinBorder(tmpse->border,task);
|
||||
WinHorz(tmpse->left,tmpse->right,task);
|
||||
WinVert(tmpse->top,tmpse->bottom,task);
|
||||
task->scroll_x=tmpse->scroll_x;
|
||||
task->scroll_y=tmpse->scroll_y;
|
||||
task->scroll_z=tmpse->scroll_z;
|
||||
task->win_inhibit=tmpse->win_inhibit;
|
||||
task->text_attr=tmpse->text_attr;
|
||||
task->border_attr=tmpse->border_attr;
|
||||
task->border_src =tmpse->border_src;
|
||||
task->title_src =tmpse->title_src;
|
||||
StrCpy(task->task_title,tmpse->task_title);
|
||||
AutoComplete(tmpse->autocomplete);
|
||||
GrPaletteSet(tmpse->palette);
|
||||
Snd(0);
|
||||
}
|
||||
|
||||
public U0 SettingsPop(CTask *task=NULL,I64 flags=0)
|
||||
{//Typically, called at end of an application.
|
||||
CTaskSettings *tempse;
|
||||
CTaskSettings *tmpse;
|
||||
if (!task) task=Fs;
|
||||
if (!TaskValidate(task))
|
||||
return;
|
||||
if (tempse=task->next_settings) {
|
||||
task->next_settings=tempse->next;
|
||||
Cd(tempse->cur_dir);
|
||||
Free(tempse->cur_dir);
|
||||
task->draw_it=tempse->draw_it;
|
||||
task->task_end_cb=tempse->task_end_cb;
|
||||
if (tmpse=task->next_settings) {
|
||||
task->next_settings=tmpse->next;
|
||||
Cd(tmpse->cur_dir);
|
||||
Free(tmpse->cur_dir);
|
||||
task->draw_it=tmpse->draw_it;
|
||||
task->task_end_cb=tmpse->task_end_cb;
|
||||
|
||||
if (task->animate_task)
|
||||
Kill(task->animate_task);
|
||||
if (task->animate_task=tempse->animate_task)
|
||||
if (task->animate_task=tmpse->animate_task)
|
||||
Suspend(task->animate_task,FALSE);
|
||||
|
||||
if (!(flags&TSF_SAME_SONG)) {
|
||||
if (task->song_task)
|
||||
Kill(task->song_task);
|
||||
if (task->song_task=tempse->song_task)
|
||||
if (task->song_task=tmpse->song_task)
|
||||
Suspend(task->song_task,FALSE);
|
||||
}
|
||||
|
||||
SettingsPop2(task,tempse); //Do it to get ress fast
|
||||
WinMgrSync(,TRUE);
|
||||
SettingsPop2(task,tempse); //Redo in case was lost by old update
|
||||
SettingsPop2(task,tmpse); //Do it to get ress fast
|
||||
Refresh(,TRUE);
|
||||
SettingsPop2(task,tmpse); //Redo in case was lost by old update
|
||||
|
||||
Free(tempse);
|
||||
Free(tmpse);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -109,7 +109,7 @@ U0 KeyMapFamily2(U8 **entries,CTask *task,I64 scf)
|
||||
PutKey(a1,a2);
|
||||
else
|
||||
PostMsg(task,MSG_KEY_DOWN,a1,a2);
|
||||
WinMgrSync(0,TRUE);
|
||||
Refresh(0,TRUE);
|
||||
Sleep(1); //Open loop because might be no response. TODO: Drops msgs.
|
||||
}
|
||||
if (*keydev.desc && StrNCmp(keydev.desc,"Char /",7))
|
||||
|
||||
@@ -190,7 +190,7 @@ U0 WinFinalUpdate(CDC *dc)
|
||||
DrawInputPtr(dc);
|
||||
}
|
||||
|
||||
gr.fp_final_screen_update=&WinFinalUpdate;
|
||||
gr.fp_final_scrn_update=&WinFinalUpdate;
|
||||
|
||||
U0 WinIPUpdate()
|
||||
{
|
||||
@@ -215,15 +215,15 @@ U0 WinIPUpdate()
|
||||
}
|
||||
} else
|
||||
ip.speed*=0.95;
|
||||
if (gr.screen_zoom!=1) {
|
||||
if (gr.scrn_zoom!=1) {
|
||||
if (gr.continuous_scroll)
|
||||
GrScaleZoom(1.0);
|
||||
else {
|
||||
dd=(ip.pos.x-gr.sx)*gr.screen_zoom;
|
||||
dd=(ip.pos.x-gr.sx)*gr.scrn_zoom;
|
||||
if (!(8<=dd<GR_WIDTH-8))
|
||||
GrScaleZoom(1.0);
|
||||
else {
|
||||
dd=(ip.pos.y-gr.sy)*gr.screen_zoom;
|
||||
dd=(ip.pos.y-gr.sy)*gr.scrn_zoom;
|
||||
if (!(8<=dd<GR_HEIGHT-8))
|
||||
GrScaleZoom(1.0);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
#help_index "Windows;Task/Delay"
|
||||
|
||||
public U0 WinMgrSync(I64 cnt=1,Bool force=FALSE)
|
||||
{//Wait for win manager to start and finish updating screen.
|
||||
public U0 Refresh(I64 cnt=1,Bool force=FALSE)
|
||||
{//Wait for 30fps WinMgr to start & finish scrn refresh.
|
||||
//0,FALSE Cnt Sync to WinMgr. (not used)
|
||||
//0,TRUE Pump Msgs.
|
||||
//1 Cnt Wait and Pump Msgs.
|
||||
@@ -266,7 +266,7 @@ I64 WinMgrSleep(Bool flush_msgs=FALSE)
|
||||
if (!LBtr(&sys_semas[SYS_SEMA_JUST_PUMP_MSGS],0)) {
|
||||
timeout_val=cnts.jiffies+JIFFY_FREQ/WINMGR_FPS;
|
||||
LBts(&sys_semas[SYS_SEMA_REFRESH_IN_PROGRESS],0);
|
||||
GrUpdateScreen;
|
||||
GrUpdateScrn;
|
||||
LBtr(&sys_semas[SYS_SEMA_REFRESH_IN_PROGRESS],0);
|
||||
|
||||
if (sys_focus_task && !Bt(&sys_focus_task->task_flags,TASKf_HAS_SONG)) {
|
||||
@@ -331,7 +331,7 @@ Bool WinKeyNavMenu()
|
||||
I64 i,old_key_cnt;
|
||||
CD3I64 old_pos,new_pos;
|
||||
CMenu *m;
|
||||
CMenuEntry *tempme;
|
||||
CMenuEntry *tmpme;
|
||||
CTask *focus=MenuTask;
|
||||
if (Bt(kbd.down_bitmap,SC_GUI) && focus && (m=focus->cur_menu)) {
|
||||
winmgr.show_menu=TRUE;
|
||||
@@ -345,14 +345,14 @@ Bool WinKeyNavMenu()
|
||||
WinMgrSleep(TRUE);
|
||||
if (new_pos.x) {
|
||||
i=0;
|
||||
tempme=m->sub;
|
||||
while (tempme) {
|
||||
if (i+MenuEntryWidth(tempme)*FONT_WIDTH==new_pos.x) {
|
||||
tmpme=m->sub;
|
||||
while (tmpme) {
|
||||
if (i+MenuEntryWidth(tmpme)*FONT_WIDTH==new_pos.x) {
|
||||
new_pos.x=i;
|
||||
break;
|
||||
}
|
||||
i+=MenuEntryWidth(tempme)*FONT_WIDTH;
|
||||
tempme=tempme->next;
|
||||
i+=MenuEntryWidth(tmpme)*FONT_WIDTH;
|
||||
tmpme=tmpme->next;
|
||||
}
|
||||
}
|
||||
new_pos.y=0;
|
||||
@@ -360,15 +360,15 @@ Bool WinKeyNavMenu()
|
||||
while (Bt(kbd.down_bitmap,SC_CURSOR_RIGHT) && kbd.cnt==old_key_cnt)
|
||||
WinMgrSleep(TRUE);
|
||||
i=0;
|
||||
tempme=m->sub;
|
||||
while (tempme) {
|
||||
tmpme=m->sub;
|
||||
while (tmpme) {
|
||||
if (i==new_pos.x) {
|
||||
if (tempme->next)
|
||||
new_pos.x=i+MenuEntryWidth(tempme)*FONT_WIDTH;
|
||||
if (tmpme->next)
|
||||
new_pos.x=i+MenuEntryWidth(tmpme)*FONT_WIDTH;
|
||||
break;
|
||||
}
|
||||
i+=MenuEntryWidth(tempme)*FONT_WIDTH;
|
||||
tempme=tempme->next;
|
||||
i+=MenuEntryWidth(tmpme)*FONT_WIDTH;
|
||||
tmpme=tmpme->next;
|
||||
}
|
||||
new_pos.y=0;
|
||||
} else if (Bt(kbd.down_bitmap,SC_CURSOR_UP)) {
|
||||
@@ -132,7 +132,7 @@ Bool TakeTurn()
|
||||
}
|
||||
res=TRUE;
|
||||
}
|
||||
WinMgrSync;
|
||||
Refresh;
|
||||
Fs->song_task=NULL;
|
||||
return res;
|
||||
}
|
||||
@@ -151,7 +151,7 @@ U0 TMsg(CDC *dc,U8 *msg)
|
||||
dc->color=YELLOW;
|
||||
GrPrint(dc,(GR_WIDTH-StrLen(msg)*FONT_WIDTH)/2,
|
||||
GR_HEIGHT-5*FONT_HEIGHT/2,"%s",msg);
|
||||
WinMgrSync;
|
||||
Refresh;
|
||||
if (ScanChar)
|
||||
throw;
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -2,25 +2,25 @@ U0 ViewComics()
|
||||
{
|
||||
I64 i=0;
|
||||
U8 *st;
|
||||
CDirEntry *tempde=FilesFind("Comics/*.DD*"),*tempde1=tempde;
|
||||
CDirEntry *tmpde=FilesFind("Comics/*.DD*"),*tmpde1=tmpde;
|
||||
CDoc *doc=DocNew;
|
||||
DocPrint(doc,"$$LTBLUE$$");
|
||||
while (tempde) {
|
||||
st=StrNew(tempde->name);
|
||||
while (tmpde) {
|
||||
st=StrNew(tmpde->name);
|
||||
FileExtRem(st);
|
||||
tempde->user_data=DocPrint(doc,"$$MU-UL,\"%-10ts\",LE=%d$$ ",st,tempde);
|
||||
tmpde->user_data=DocPrint(doc,"$$MU-UL,\"%-10ts\",LE=%d$$ ",st,tmpde);
|
||||
Free(st);
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde->next;
|
||||
if ((i++&3)==3)
|
||||
DocPrint(doc,"\n");
|
||||
}
|
||||
while (TRUE) {
|
||||
if ((tempde=PopUpMenu(doc))>0)
|
||||
Ed(tempde->full_name);
|
||||
if ((tmpde=PopUpMenu(doc))>0)
|
||||
Ed(tmpde->full_name);
|
||||
else
|
||||
break;
|
||||
}
|
||||
DocDel(doc);
|
||||
DirTreeDel(tempde1);
|
||||
DirTreeDel(tmpde1);
|
||||
}
|
||||
|
||||
+23
-23
@@ -7,47 +7,47 @@ U0 MPDrawHoreb(CDC *dc2)
|
||||
CDC *dc=DCAlias(dc2,task);
|
||||
I64 i,j,dx,dy,dz,w=task->pix_width,h=task->pix_height,r[16],cx=w>>1;
|
||||
F64 s,m,a,x1,y1,x2,y2;
|
||||
Obj *tempo;
|
||||
Obj *tmpo;
|
||||
|
||||
Mat4x4IdentEqu(r);
|
||||
Mat4x4RotY(r,-é);
|
||||
Mat4x4RotX(r,77*ã/180);
|
||||
for (i=Gs->num;i<O_NUM_OBJS+O_NUM_PEBBLES;i+=mp_cnt) {
|
||||
tempo=&objs[i];
|
||||
tempo->x1=tempo->x+vx; tempo->y1=tempo->y; tempo->z1=tempo->z+vz;
|
||||
Mat4x4MulXYZ(r,&tempo->x1,&tempo->y1,&tempo->z1);
|
||||
if (tempo->type==OT_SHEEP ||
|
||||
tempo->type==OT_GOAT1 || tempo->type==OT_GOAT2) {
|
||||
dx=100*tempo->dx; dy=100*tempo->dy; dz=100*tempo->dz;
|
||||
tmpo=&objs[i];
|
||||
tmpo->x1=tmpo->x+vx; tmpo->y1=tmpo->y; tmpo->z1=tmpo->z+vz;
|
||||
Mat4x4MulXYZ(r,&tmpo->x1,&tmpo->y1,&tmpo->z1);
|
||||
if (tmpo->type==OT_SHEEP ||
|
||||
tmpo->type==OT_GOAT1 || tmpo->type==OT_GOAT2) {
|
||||
dx=100*tmpo->dx; dy=100*tmpo->dy; dz=100*tmpo->dz;
|
||||
Mat4x4MulXYZ(r,&dx,&dy,&dz);
|
||||
if (dx<0)
|
||||
tempo->sym=TRUE;
|
||||
tmpo->sym=TRUE;
|
||||
else
|
||||
tempo->sym=FALSE;
|
||||
tmpo->sym=FALSE;
|
||||
}
|
||||
if (tempo->z1>=0) {
|
||||
s=100.0/(AbsI64(tempo->z1)+50);
|
||||
if (tempo->type) {
|
||||
if (tmpo->z1>=0) {
|
||||
s=100.0/(AbsI64(tmpo->z1)+50);
|
||||
if (tmpo->type) {
|
||||
Mat4x4IdentEqu(dc->r);
|
||||
Mat4x4Scale(dc->r,s*2);
|
||||
DCMat4x4Set(dc,dc->r);
|
||||
dc->flags|=DCF_TRANSFORMATION;
|
||||
if (tempo->sym) {
|
||||
if (tmpo->sym) {
|
||||
dc->flags|=DCF_SYMMETRY|DCF_JUST_MIRROR;
|
||||
DCSymmetrySet(dc,s*tempo->x1+cx,s*tempo->y1+h,
|
||||
s*tempo->x1+cx,s*tempo->y1+h+10);
|
||||
DCSymmetrySet(dc,s*tmpo->x1+cx,s*tmpo->y1+h,
|
||||
s*tmpo->x1+cx,s*tmpo->y1+h+10);
|
||||
}
|
||||
Sprite3B(dc,s*tempo->x1+cx,s*tempo->y1+h,tempo->z1,imgs[tempo->type]);
|
||||
Sprite3B(dc,s*tmpo->x1+cx,s*tmpo->y1+h,tmpo->z1,imgs[tmpo->type]);
|
||||
} else {
|
||||
dc->flags&=~DCF_TRANSFORMATION;
|
||||
dc->color=pebble_colors[tempo->num&3];
|
||||
GrPlot3(dc,s*tempo->x1+cx,s*tempo->y1+h,tempo->z1);
|
||||
dc->color=pebble_colors[tmpo->num&3];
|
||||
GrPlot3(dc,s*tmpo->x1+cx,s*tmpo->y1+h,tmpo->z1);
|
||||
}
|
||||
dc->flags&=~(DCF_SYMMETRY|DCF_JUST_MIRROR);
|
||||
if (tempo==&objs[O_BURNING_BUSH]) {//draw burning bush
|
||||
dc->x=s*tempo->x1+cx;
|
||||
dc->y=s*tempo->y1+h;
|
||||
dc->z=tempo->z1;
|
||||
if (tmpo==&objs[O_BURNING_BUSH]) {//draw burning bush
|
||||
dc->x=s*tmpo->x1+cx;
|
||||
dc->y=s*tmpo->y1+h;
|
||||
dc->z=tmpo->z1;
|
||||
dc->pen_width=1;
|
||||
dc->color=winmgr.updates&15;
|
||||
for (j=0;j<45;j++) {
|
||||
@@ -57,7 +57,7 @@ U0 MPDrawHoreb(CDC *dc2)
|
||||
P2R(&x2,&y2,m,a);
|
||||
GrLine3(dc,20*x1,20*y1-25,0,20*x2,20*y2-25,0);
|
||||
}
|
||||
if (SqrI64(s*tempo->x1)+SqrI64(s*tempo->y1)<300*300)
|
||||
if (SqrI64(s*tmpo->x1)+SqrI64(s*tmpo->y1)<300*300)
|
||||
horeb_done=TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
+23
-23
@@ -12,7 +12,7 @@ U0 DrawHoreb(CTask *task,CDC *dc)
|
||||
h=task->pix_height,r[16],
|
||||
cx=w>>1,cy=h>>1;
|
||||
F64 s,m,a,x1,y1,x2,y2;
|
||||
Obj *o_sort[O_NUM_OBJS+O_NUM_PEBBLES],*tempo;
|
||||
Obj *o_sort[O_NUM_OBJS+O_NUM_PEBBLES],*tmpo;
|
||||
|
||||
Mat4x4IdentEqu(r);
|
||||
Mat4x4RotY(r,-é);
|
||||
@@ -30,46 +30,46 @@ U0 DrawHoreb(CTask *task,CDC *dc)
|
||||
}
|
||||
|
||||
for (i=0;i<O_NUM_OBJS+O_NUM_PEBBLES;i++) {
|
||||
tempo=&objs[i];
|
||||
o_sort[i]=tempo;
|
||||
tempo->x1=tempo->x+vx; tempo->y1=tempo->y; tempo->z1=tempo->z+vz;
|
||||
Mat4x4MulXYZ(r,&tempo->x1,&tempo->y1,&tempo->z1);
|
||||
if (tempo->type==OT_SHEEP ||
|
||||
tempo->type==OT_GOAT1 || tempo->type==OT_GOAT2) {
|
||||
dx=100*tempo->dx; dy=100*tempo->dy; dz=100*tempo->dz;
|
||||
tmpo=&objs[i];
|
||||
o_sort[i]=tmpo;
|
||||
tmpo->x1=tmpo->x+vx; tmpo->y1=tmpo->y; tmpo->z1=tmpo->z+vz;
|
||||
Mat4x4MulXYZ(r,&tmpo->x1,&tmpo->y1,&tmpo->z1);
|
||||
if (tmpo->type==OT_SHEEP ||
|
||||
tmpo->type==OT_GOAT1 || tmpo->type==OT_GOAT2) {
|
||||
dx=100*tmpo->dx; dy=100*tmpo->dy; dz=100*tmpo->dz;
|
||||
Mat4x4MulXYZ(r,&dx,&dy,&dz);
|
||||
if (dx<0)
|
||||
tempo->sym=TRUE;
|
||||
tmpo->sym=TRUE;
|
||||
else
|
||||
tempo->sym=FALSE;
|
||||
tmpo->sym=FALSE;
|
||||
}
|
||||
}
|
||||
QSortI64(o_sort,O_NUM_OBJS+O_NUM_PEBBLES,&ObjCompare);
|
||||
|
||||
for (i=0;i<O_NUM_OBJS+O_NUM_PEBBLES;i++) {
|
||||
tempo=o_sort[i];
|
||||
if (tempo->z1<0) break;
|
||||
s=100.0/(AbsI64(tempo->z1)+50);
|
||||
if (tempo->type) {
|
||||
tmpo=o_sort[i];
|
||||
if (tmpo->z1<0) break;
|
||||
s=100.0/(AbsI64(tmpo->z1)+50);
|
||||
if (tmpo->type) {
|
||||
Mat4x4IdentEqu(dc->r);
|
||||
Mat4x4Scale(dc->r,s*2);
|
||||
DCMat4x4Set(dc,dc->r);
|
||||
dc->flags|=DCF_TRANSFORMATION;
|
||||
if (tempo->sym) {
|
||||
if (tmpo->sym) {
|
||||
dc->flags|=DCF_SYMMETRY|DCF_JUST_MIRROR;
|
||||
DCSymmetrySet(dc,s*tempo->x1+cx,s*tempo->y1+h,
|
||||
s*tempo->x1+cx,s*tempo->y1+h+10);
|
||||
DCSymmetrySet(dc,s*tmpo->x1+cx,s*tmpo->y1+h,
|
||||
s*tmpo->x1+cx,s*tmpo->y1+h+10);
|
||||
}
|
||||
Sprite3B(dc,s*tempo->x1+cx,s*tempo->y1+h,0,imgs[tempo->type]);
|
||||
Sprite3B(dc,s*tmpo->x1+cx,s*tmpo->y1+h,0,imgs[tmpo->type]);
|
||||
} else {
|
||||
dc->flags&=~DCF_TRANSFORMATION;
|
||||
dc->color=pebble_colors[tempo->num&3];
|
||||
GrPlot3(dc,s*tempo->x1+cx,s*tempo->y1+h,tempo->z1);
|
||||
dc->color=pebble_colors[tmpo->num&3];
|
||||
GrPlot3(dc,s*tmpo->x1+cx,s*tmpo->y1+h,tmpo->z1);
|
||||
}
|
||||
dc->flags&=~(DCF_SYMMETRY|DCF_JUST_MIRROR);
|
||||
if (o_sort[i]==&objs[O_BURNING_BUSH]) {//draw burning bush
|
||||
dc->x=s*tempo->x1+cx;
|
||||
dc->y=s*tempo->y1+h;
|
||||
dc->x=s*tmpo->x1+cx;
|
||||
dc->y=s*tmpo->y1+h;
|
||||
dc->z=0;
|
||||
|
||||
dc->pen_width=1;
|
||||
@@ -82,7 +82,7 @@ U0 DrawHoreb(CTask *task,CDC *dc)
|
||||
GrLine3(dc,20*x1,20*y1-25,0,20*x2,20*y2-25,0);
|
||||
}
|
||||
|
||||
if (SqrI64(s*tempo->x1)+SqrI64(s*tempo->y1)<300*300)
|
||||
if (SqrI64(s*tmpo->x1)+SqrI64(s*tmpo->y1)<300*300)
|
||||
horeb_done=TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
+19
-19
@@ -2,18 +2,18 @@ U0 AnimateTask(I64)
|
||||
{
|
||||
I64 i;
|
||||
F64 t;
|
||||
Obj *tempo;
|
||||
Obj *tmpo;
|
||||
while (TRUE) {
|
||||
t=tS;
|
||||
for (i=0;i<O_NUM_OBJS+O_NUM_PEBBLES;i++) {
|
||||
tempo=&objs[i];
|
||||
if (tempo->type==OT_SHEEP ||
|
||||
tempo->type==OT_GOAT1 || tempo->type==OT_GOAT2) {
|
||||
tempo->x+=tempo->dx;
|
||||
tempo->y+=tempo->dy;
|
||||
tempo->z+=tempo->dz;
|
||||
tempo->dx=5*Cos(0.5*t+tempo->é);
|
||||
tempo->dz=5*Sin(0.5*t+tempo->é);
|
||||
tmpo=&objs[i];
|
||||
if (tmpo->type==OT_SHEEP ||
|
||||
tmpo->type==OT_GOAT1 || tmpo->type==OT_GOAT2) {
|
||||
tmpo->x+=tmpo->dx;
|
||||
tmpo->y+=tmpo->dy;
|
||||
tmpo->z+=tmpo->dz;
|
||||
tmpo->dx=5*Cos(0.5*t+tmpo->é);
|
||||
tmpo->dz=5*Sin(0.5*t+tmpo->é);
|
||||
}
|
||||
}
|
||||
Sleep(20);
|
||||
@@ -22,7 +22,7 @@ U0 AnimateTask(I64)
|
||||
|
||||
U0 Init()
|
||||
{
|
||||
Obj *tempo;
|
||||
Obj *tmpo;
|
||||
I64 i,j,k,total=0;
|
||||
|
||||
for (i=0;i<OT_NUM_TYPES;i++)
|
||||
@@ -30,13 +30,13 @@ U0 Init()
|
||||
|
||||
MemSet(objs,0,sizeof(objs));
|
||||
for (i=0;i<O_NUM_OBJS+O_NUM_PEBBLES;i++) {
|
||||
tempo=&objs[i];
|
||||
tempo->num=i;
|
||||
tempo->x=RandU32&0x1FFF-0x1000;
|
||||
tempo->y=0;
|
||||
tempo->z=RandU32&0x1FFF-0x1000;
|
||||
tempo->é=2*ã*Rand;
|
||||
tempo->sym=RandU16&1;
|
||||
tmpo=&objs[i];
|
||||
tmpo->num=i;
|
||||
tmpo->x=RandU32&0x1FFF-0x1000;
|
||||
tmpo->y=0;
|
||||
tmpo->z=RandU32&0x1FFF-0x1000;
|
||||
tmpo->é=2*ã*Rand;
|
||||
tmpo->sym=RandU16&1;
|
||||
|
||||
if (i<O_NUM_OBJS) {
|
||||
k=0;
|
||||
@@ -48,9 +48,9 @@ U0 Init()
|
||||
else
|
||||
k++;
|
||||
}
|
||||
tempo->type=k;
|
||||
tmpo->type=k;
|
||||
} else
|
||||
tempo->type=OT_PEBBLE;
|
||||
tmpo->type=OT_PEBBLE;
|
||||
}
|
||||
objs[O_BURNING_BUSH].type=OT_BUSH1;
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+22
-22
@@ -1,24 +1,24 @@
|
||||
U0 BgtAcctsUpdate()
|
||||
{
|
||||
CBgtEntry *tempb;
|
||||
CBgtTemplate *tempt;
|
||||
tempb=b_head.next;
|
||||
while (tempb!=&b_head) {
|
||||
if (tempb->type!=BE_TEMPLATE_COPY) {
|
||||
tempb->credit_idx=StrFileAdd(tempb->credit,
|
||||
CBgtEntry *tmpb;
|
||||
CBgtTemplate *tmpt;
|
||||
tmpb=b_head.next;
|
||||
while (tmpb!=&b_head) {
|
||||
if (tmpb->type!=BE_TEMPLATE_COPY) {
|
||||
tmpb->credit_idx=StrFileAdd(tmpb->credit,
|
||||
&accts_table_strs,accts_table);
|
||||
tempb->debit_idx =StrFileAdd(tempb->debit,
|
||||
tmpb->debit_idx =StrFileAdd(tmpb->debit,
|
||||
&accts_table_strs,accts_table);
|
||||
}
|
||||
tempb=tempb->next;
|
||||
tmpb=tmpb->next;
|
||||
}
|
||||
tempt=t_head.next;
|
||||
while (tempt!=&t_head) {
|
||||
tempt->b.credit_idx=StrFileAdd(tempt->b.credit,
|
||||
tmpt=t_head.next;
|
||||
while (tmpt!=&t_head) {
|
||||
tmpt->b.credit_idx=StrFileAdd(tmpt->b.credit,
|
||||
&accts_table_strs,accts_table);
|
||||
tempt->b.debit_idx =StrFileAdd(tempt->b.debit,
|
||||
tmpt->b.debit_idx =StrFileAdd(tmpt->b.debit,
|
||||
&accts_table_strs,accts_table);
|
||||
tempt=tempt->next;
|
||||
tmpt=tmpt->next;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,9 +44,9 @@ U0 BgtAcctsRead()
|
||||
|
||||
I64 BgtAcctColor(U8 *st)
|
||||
{
|
||||
CHashGeneric *temph;
|
||||
if (temph=HashFind(st,accts_table,SFT_GENERIC))
|
||||
return temph->user_data1;
|
||||
CHashGeneric *tmph;
|
||||
if (tmph=HashFind(st,accts_table,SFT_GENERIC))
|
||||
return tmph->user_data1;
|
||||
else
|
||||
return BLACK;
|
||||
}
|
||||
@@ -57,19 +57,19 @@ U8 *BgtPopUpAcct(U8 *header=NULL,U8 *dft=NULL)
|
||||
U8 *res;
|
||||
CDoc *doc=DocNew;
|
||||
CDocEntry *doc_e,*doc_dft=NULL;
|
||||
CHashGeneric *temph;
|
||||
CHashGeneric *tmph;
|
||||
|
||||
if (header)
|
||||
DocPrint(doc,"%s",header);
|
||||
|
||||
for (i=0;i<=accts_table->mask;i++) {
|
||||
temph=accts_table->body[i];
|
||||
while (temph) {
|
||||
tmph=accts_table->body[i];
|
||||
while (tmph) {
|
||||
doc_e=DocPrint(doc,"$$FG,%d$$$$MU-UL,\"%s\",LE=0x%X$$\n",
|
||||
temph->user_data1,temph->str,temph->str);
|
||||
if (dft && !StrCmp(dft,temph->str))
|
||||
tmph->user_data1,tmph->str,tmph->str);
|
||||
if (dft && !StrCmp(dft,tmph->str))
|
||||
doc_dft=doc_e;
|
||||
temph=temph->next;
|
||||
tmph=tmph->next;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+24
-24
@@ -1,24 +1,24 @@
|
||||
U0 BgtEntryDel2(CBgtEntry *tempb)
|
||||
U0 BgtEntryDel2(CBgtEntry *tmpb)
|
||||
{
|
||||
if (tempb->type!=BE_TEMPLATE_COPY) {
|
||||
Free(tempb->credit);
|
||||
Free(tempb->debit);
|
||||
Free(tempb->desc);
|
||||
if (tmpb->type!=BE_TEMPLATE_COPY) {
|
||||
Free(tmpb->credit);
|
||||
Free(tmpb->debit);
|
||||
Free(tmpb->desc);
|
||||
}
|
||||
}
|
||||
|
||||
U0 BgtEntryDel(CBgtEntry *tempb)
|
||||
U0 BgtEntryDel(CBgtEntry *tmpb)
|
||||
{
|
||||
BgtEntryDel2(tempb);
|
||||
Free(tempb);
|
||||
BgtEntryDel2(tmpb);
|
||||
Free(tmpb);
|
||||
}
|
||||
|
||||
U0 BgtIns(CBgtEntry *tempb)
|
||||
U0 BgtIns(CBgtEntry *tmpb)
|
||||
{
|
||||
CBgtEntry *tempb1=b_head.next;
|
||||
while (tempb1!=&b_head && tempb1->date<tempb->date)
|
||||
tempb1=tempb1->next;
|
||||
QueIns(tempb,tempb1->last);
|
||||
CBgtEntry *tmpb1=b_head.next;
|
||||
while (tmpb1!=&b_head && tmpb1->date<tmpb->date)
|
||||
tmpb1=tmpb1->next;
|
||||
QueIns(tmpb,tmpb1->last);
|
||||
}
|
||||
|
||||
class CBgtEntryForm
|
||||
@@ -33,7 +33,7 @@ class CBgtEntryForm
|
||||
CBgtEntry *BgtEntryPmt(CBgtEntry *dft=NULL)
|
||||
{
|
||||
CBgtEntryForm b;
|
||||
CBgtEntry *tempb;
|
||||
CBgtEntry *tmpb;
|
||||
U8 *st;
|
||||
MemSet(&b,0,sizeof(CBgtEntryForm));
|
||||
StrCpy(&b.date,"*");
|
||||
@@ -55,16 +55,16 @@ CBgtEntry *BgtEntryPmt(CBgtEntry *dft=NULL)
|
||||
if (st!=DOCM_CANCEL)
|
||||
StrCpy(b.debit,st);
|
||||
} else {
|
||||
tempb=CAlloc(sizeof(CBgtEntry));
|
||||
tempb->date =Str2Date(b.date);
|
||||
tempb->amount=b.amount;
|
||||
tempb->credit=StrNew(b.credit);
|
||||
tempb->debit =StrNew(b.debit);
|
||||
tempb->desc =StrNew(b.desc);
|
||||
tempb->type =BE_NORMAL;
|
||||
StrFileAdd(tempb->credit,&accts_table_strs,accts_table);
|
||||
StrFileAdd(tempb->debit,&accts_table_strs,accts_table);
|
||||
return tempb;
|
||||
tmpb=CAlloc(sizeof(CBgtEntry));
|
||||
tmpb->date =Str2Date(b.date);
|
||||
tmpb->amount=b.amount;
|
||||
tmpb->credit=StrNew(b.credit);
|
||||
tmpb->debit =StrNew(b.debit);
|
||||
tmpb->desc =StrNew(b.desc);
|
||||
tmpb->type =BE_NORMAL;
|
||||
StrFileAdd(tmpb->credit,&accts_table_strs,accts_table);
|
||||
StrFileAdd(tmpb->debit,&accts_table_strs,accts_table);
|
||||
return tmpb;
|
||||
}
|
||||
} else
|
||||
return NULL;
|
||||
|
||||
+59
-59
@@ -1,7 +1,7 @@
|
||||
U0 BgtDataRead()
|
||||
{
|
||||
CBgtEntry *tempb;
|
||||
CBgtTemplate *tempt;
|
||||
CBgtEntry *tmpb;
|
||||
CBgtTemplate *tmpt;
|
||||
I64 i,cnt,size;
|
||||
U8 *b,*ptr;
|
||||
I64 max_num;
|
||||
@@ -17,26 +17,26 @@ U0 BgtDataRead()
|
||||
if (ptr=b=FileRead(BGT_DATA_FILE,&size)) {
|
||||
cnt=*ptr(I64 *)++;
|
||||
for (i=0;i<cnt;i++) {
|
||||
tempb=CAlloc(sizeof(CBgtEntry));
|
||||
MemCpy(&tempb->start,ptr,BE_SIZE);
|
||||
tempb->credit=StrNew(s[tempb->credit_idx]);
|
||||
tempb->debit =StrNew(s[tempb->debit_idx]);
|
||||
tempb->desc =StrNew(s[tempb->desc_idx]);
|
||||
QueIns(tempb,b_head.last);
|
||||
tmpb=CAlloc(sizeof(CBgtEntry));
|
||||
MemCpy(&tmpb->start,ptr,BE_SIZE);
|
||||
tmpb->credit=StrNew(s[tmpb->credit_idx]);
|
||||
tmpb->debit =StrNew(s[tmpb->debit_idx]);
|
||||
tmpb->desc =StrNew(s[tmpb->desc_idx]);
|
||||
QueIns(tmpb,b_head.last);
|
||||
ptr+=BE_SIZE;
|
||||
}
|
||||
|
||||
cnt=*ptr(I64 *)++;
|
||||
for (i=0;i<cnt;i++) {
|
||||
tempt=CAlloc(sizeof(CBgtTemplate));
|
||||
MemCpy(&tempt->start,ptr,BT_SIZE);
|
||||
tmpt=CAlloc(sizeof(CBgtTemplate));
|
||||
MemCpy(&tmpt->start,ptr,BT_SIZE);
|
||||
ptr+=BT_SIZE;
|
||||
MemCpy(&tempt->b.start,ptr,BE_SIZE);
|
||||
MemCpy(&tmpt->b.start,ptr,BE_SIZE);
|
||||
ptr+=BE_SIZE;
|
||||
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_head.last);
|
||||
tmpt->b.credit=StrNew(s[tmpt->b.credit_idx]);
|
||||
tmpt->b.debit =StrNew(s[tmpt->b.debit_idx]);
|
||||
tmpt->b.desc =StrNew(s[tmpt->b.desc_idx]);
|
||||
QueIns(tmpt,t_head.last);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,39 +50,39 @@ U0 BgtDataWrite()
|
||||
{
|
||||
I64 i,num=0,size,cnt1,cnt2;
|
||||
CHashTable *table=HashTableNew(1024);
|
||||
CBgtEntry *tempb;
|
||||
CBgtTemplate *tempt;
|
||||
CHashGeneric *temph;
|
||||
CBgtEntry *tmpb;
|
||||
CBgtTemplate *tmpt;
|
||||
CHashGeneric *tmph;
|
||||
U8 *buf,*ptr;
|
||||
|
||||
for (i=0;i<=accts_table->mask;i++) {
|
||||
temph=accts_table->body[i];
|
||||
while (temph) {
|
||||
StrFileAdd(temph->str,&num,table); //Cosmetics -- make accts appear first.
|
||||
temph=temph->next;
|
||||
tmph=accts_table->body[i];
|
||||
while (tmph) {
|
||||
StrFileAdd(tmph->str,&num,table); //Cosmetics -- make accts appear first.
|
||||
tmph=tmph->next;
|
||||
}
|
||||
}
|
||||
|
||||
tempb=b_head.next;
|
||||
tmpb=b_head.next;
|
||||
cnt1=0;
|
||||
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);
|
||||
tempb->desc_idx =StrFileAdd(tempb->desc,&num,table);
|
||||
while (tmpb!=&b_head) {
|
||||
if (tmpb->type!=BE_TEMPLATE_COPY) {
|
||||
tmpb->credit_idx =StrFileAdd(tmpb->credit,&num,table);
|
||||
tmpb->debit_idx =StrFileAdd(tmpb->debit,&num,table);
|
||||
tmpb->desc_idx =StrFileAdd(tmpb->desc,&num,table);
|
||||
cnt1++;
|
||||
}
|
||||
tempb=tempb->next;
|
||||
tmpb=tmpb->next;
|
||||
}
|
||||
|
||||
tempt=t_head.next;
|
||||
tmpt=t_head.next;
|
||||
cnt2=0;
|
||||
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);
|
||||
while (tmpt!=&t_head) {
|
||||
tmpt->b.credit_idx =StrFileAdd(tmpt->b.credit,&num,table);
|
||||
tmpt->b.debit_idx =StrFileAdd(tmpt->b.debit,&num,table);
|
||||
tmpt->b.desc_idx =StrFileAdd(tmpt->b.desc,&num,table);
|
||||
cnt2++;
|
||||
tempt=tempt->next;
|
||||
tmpt=tmpt->next;
|
||||
}
|
||||
StrFileWrite(BGT_STRINGS_FILE,table);
|
||||
StrFileDel(table);
|
||||
@@ -92,24 +92,24 @@ U0 BgtDataWrite()
|
||||
|
||||
MemCpy(ptr,&cnt1,sizeof(I64));
|
||||
ptr+=sizeof(I64);
|
||||
tempb=b_head.next;
|
||||
while (tempb!=&b_head) {
|
||||
if (tempb->type!=BE_TEMPLATE_COPY) {
|
||||
MemCpy(ptr,&tempb->start,BE_SIZE);
|
||||
tmpb=b_head.next;
|
||||
while (tmpb!=&b_head) {
|
||||
if (tmpb->type!=BE_TEMPLATE_COPY) {
|
||||
MemCpy(ptr,&tmpb->start,BE_SIZE);
|
||||
ptr+=BE_SIZE;
|
||||
}
|
||||
tempb=tempb->next;
|
||||
tmpb=tmpb->next;
|
||||
}
|
||||
|
||||
MemCpy(ptr,&cnt2,sizeof(I64));
|
||||
ptr+=sizeof(I64);
|
||||
tempt=t_head.next;
|
||||
while (tempt!=&t_head) {
|
||||
MemCpy(ptr,&tempt->start,BT_SIZE);
|
||||
tmpt=t_head.next;
|
||||
while (tmpt!=&t_head) {
|
||||
MemCpy(ptr,&tmpt->start,BT_SIZE);
|
||||
ptr+=BT_SIZE;
|
||||
MemCpy(ptr,&tempt->b.start,BE_SIZE);
|
||||
MemCpy(ptr,&tmpt->b.start,BE_SIZE);
|
||||
ptr+=BE_SIZE;
|
||||
tempt=tempt->next;
|
||||
tmpt=tmpt->next;
|
||||
}
|
||||
|
||||
FileWrite(BGT_DATA_FILE,buf,size);
|
||||
@@ -118,21 +118,21 @@ U0 BgtDataWrite()
|
||||
|
||||
U0 BgtDel()
|
||||
{
|
||||
CBgtEntry *tempb,*tempb1;
|
||||
CBgtTemplate *tempt,*tempt1;
|
||||
tempb=b_head.next;
|
||||
while (tempb!=&b_head) {
|
||||
tempb1=tempb->next;
|
||||
BgtEntryDel2(tempb);
|
||||
Free(tempb);
|
||||
tempb=tempb1;
|
||||
CBgtEntry *tmpb,*tmpb1;
|
||||
CBgtTemplate *tmpt,*tmpt1;
|
||||
tmpb=b_head.next;
|
||||
while (tmpb!=&b_head) {
|
||||
tmpb1=tmpb->next;
|
||||
BgtEntryDel2(tmpb);
|
||||
Free(tmpb);
|
||||
tmpb=tmpb1;
|
||||
}
|
||||
tempt=t_head.next;
|
||||
while (tempt!=&t_head) {
|
||||
tempt1=tempt->next;
|
||||
BgtEntryDel2(&tempt->b);
|
||||
Free(tempt);
|
||||
tempt=tempt1;
|
||||
tmpt=t_head.next;
|
||||
while (tmpt!=&t_head) {
|
||||
tmpt1=tmpt->next;
|
||||
BgtEntryDel2(&tmpt->b);
|
||||
Free(tmpt);
|
||||
tmpt=tmpt1;
|
||||
}
|
||||
StrFileDel(accts_table);
|
||||
accts_table=NULL;
|
||||
|
||||
+49
-49
@@ -3,30 +3,30 @@ extern U0 BgtRegen();
|
||||
Bool BgtPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
|
||||
{//ch=ASCII; sc=scan_code
|
||||
no_warn sc;
|
||||
CBgtEntry *tempb,*tempb1;
|
||||
CBgtTemplate *tempt,*tempt1;
|
||||
CBgtEntry *tmpb,*tmpb1;
|
||||
CBgtTemplate *tmpt,*tmpt1;
|
||||
CDocEntry *doc_ce;
|
||||
U8 *st;
|
||||
switch (ch) {
|
||||
case '\n':
|
||||
if ((doc_ce=doc->cur_entry) && doc_ce!=doc &&
|
||||
doc_ce->type_u8==DOCT_MENU_VAL) {
|
||||
tempb=doc_ce->user_data;
|
||||
if (tempt=tempb->template) {
|
||||
if (tempt1=BgtTemplatePmt(tempt)) {
|
||||
QueRem(tempt);
|
||||
BgtTemplatePurge(tempt);
|
||||
BgtEntryDel2(&tempt->b);
|
||||
Free(tempt);
|
||||
QueIns(tempt1,t_head.last);
|
||||
BgtTemplateExpand(tempt1);
|
||||
tmpb=doc_ce->user_data;
|
||||
if (tmpt=tmpb->template) {
|
||||
if (tmpt1=BgtTemplatePmt(tmpt)) {
|
||||
QueRem(tmpt);
|
||||
BgtTemplatePurge(tmpt);
|
||||
BgtEntryDel2(&tmpt->b);
|
||||
Free(tmpt);
|
||||
QueIns(tmpt1,t_head.last);
|
||||
BgtTemplateExpand(tmpt1);
|
||||
BgtRegen;
|
||||
}
|
||||
} else {
|
||||
if (tempb1=BgtEntryPmt(tempb)) {
|
||||
QueRem(tempb);
|
||||
BgtEntryDel(tempb);
|
||||
BgtIns(tempb1);
|
||||
if (tmpb1=BgtEntryPmt(tmpb)) {
|
||||
QueRem(tmpb);
|
||||
BgtEntryDel(tmpb);
|
||||
BgtIns(tmpb1);
|
||||
BgtRegen;
|
||||
}
|
||||
}
|
||||
@@ -35,15 +35,15 @@ Bool BgtPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
|
||||
case CH_CTRLY:
|
||||
if ((doc_ce=doc->cur_entry) && doc_ce!=doc &&
|
||||
doc_ce->type_u8==DOCT_MENU_VAL) {
|
||||
tempb=doc_ce->user_data;
|
||||
if (tempt=tempb->template) {
|
||||
QueRem(tempt);
|
||||
BgtTemplatePurge(tempt);
|
||||
BgtEntryDel2(&tempt->b);
|
||||
Free(tempt);
|
||||
tmpb=doc_ce->user_data;
|
||||
if (tmpt=tmpb->template) {
|
||||
QueRem(tmpt);
|
||||
BgtTemplatePurge(tmpt);
|
||||
BgtEntryDel2(&tmpt->b);
|
||||
Free(tmpt);
|
||||
} else {
|
||||
QueRem(tempb);
|
||||
BgtEntryDel(tempb);
|
||||
QueRem(tmpb);
|
||||
BgtEntryDel(tmpb);
|
||||
}
|
||||
BgtRegen;
|
||||
}
|
||||
@@ -64,26 +64,26 @@ Bool BgtPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
|
||||
}
|
||||
return TRUE;
|
||||
case 'n':
|
||||
if (tempb1=BgtEntryPmt) {
|
||||
BgtIns(tempb1);
|
||||
if (tmpb1=BgtEntryPmt) {
|
||||
BgtIns(tmpb1);
|
||||
BgtRegen;
|
||||
}
|
||||
return TRUE;
|
||||
case 't':
|
||||
if (tempt1=BgtTemplatePmt) {
|
||||
QueIns(tempt1,t_head.last);
|
||||
BgtTemplateExpand(tempt1);
|
||||
if (tmpt1=BgtTemplatePmt) {
|
||||
QueIns(tmpt1,t_head.last);
|
||||
BgtTemplateExpand(tmpt1);
|
||||
BgtRegen;
|
||||
}
|
||||
return TRUE;
|
||||
case 'c':
|
||||
if ((doc_ce=doc->cur_entry) && doc_ce!=doc &&
|
||||
doc_ce->type_u8==DOCT_MENU_VAL)
|
||||
tempb=doc_ce->user_data;
|
||||
tmpb=doc_ce->user_data;
|
||||
else
|
||||
tempb=NULL;
|
||||
if (tempb1=BgtEntryPmt(tempb)) {
|
||||
BgtIns(tempb1);
|
||||
tmpb=NULL;
|
||||
if (tmpb1=BgtEntryPmt(tmpb)) {
|
||||
BgtIns(tmpb1);
|
||||
BgtRegen;
|
||||
}
|
||||
return TRUE;
|
||||
@@ -97,24 +97,24 @@ U0 BgtRegen()
|
||||
F64 balance=0;
|
||||
CDoc *doc,*pdoc,*ddoc;
|
||||
CDocEntry *doc_ce;
|
||||
CBgtEntry *tempb=b_head.next,*tempb_ce;
|
||||
CBgtEntry *tmpb=b_head.next,*tmpb_ce;
|
||||
doc=DocNew;
|
||||
doc->flags|=DOCF_FORM;
|
||||
while (tempb!=&b_head) {
|
||||
if (!StrCmp(view_acct,tempb->credit))
|
||||
balance-=tempb->amount;
|
||||
if (!StrCmp(view_acct,tempb->debit))
|
||||
balance+=tempb->amount;
|
||||
c=BgtAcctColor(tempb->credit);
|
||||
while (tmpb!=&b_head) {
|
||||
if (!StrCmp(view_acct,tmpb->credit))
|
||||
balance-=tmpb->amount;
|
||||
if (!StrCmp(view_acct,tmpb->debit))
|
||||
balance+=tmpb->amount;
|
||||
c=BgtAcctColor(tmpb->credit);
|
||||
if (c!=color) {
|
||||
color=c;
|
||||
DocPrint(doc,"$$FG,%d$$",color);
|
||||
}
|
||||
tempb->doc_e=DocPrint(doc,
|
||||
tmpb->doc_e=DocPrint(doc,
|
||||
"$$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;
|
||||
tmpb->date,tmpb->credit,tmpb->debit,balance,
|
||||
tmpb->amount,tmpb->desc,tmpb);
|
||||
tmpb=tmpb->next;
|
||||
}
|
||||
DocRecalc(doc);
|
||||
|
||||
@@ -130,19 +130,19 @@ U0 BgtRegen()
|
||||
doc_ce=pdoc->cur_entry;
|
||||
timeout_jiffy=cnts.jiffies+JIFFY_FREQ; //Max one second.
|
||||
while (doc_ce!=pdoc && cnts.jiffies<timeout_jiffy) {
|
||||
while (doc_ce->type_u8!=DOCT_MENU_VAL || !(tempb_ce=doc_ce->user_data)) {
|
||||
while (doc_ce->type_u8!=DOCT_MENU_VAL || !(tmpb_ce=doc_ce->user_data)) {
|
||||
doc_ce=doc_ce->next;
|
||||
if (doc_ce==pdoc) goto br_cont;
|
||||
}
|
||||
tempb=b_head.next;
|
||||
while (tempb!=&b_head) {
|
||||
if (tempb==tempb_ce) {
|
||||
doc->cur_entry=tempb->doc_e;
|
||||
tmpb=b_head.next;
|
||||
while (tmpb!=&b_head) {
|
||||
if (tmpb==tmpb_ce) {
|
||||
doc->cur_entry=tmpb->doc_e;
|
||||
doc->cur_col=0;
|
||||
DocCenter(doc);
|
||||
goto br_cont;
|
||||
}
|
||||
tempb=tempb->next;
|
||||
tmpb=tmpb->next;
|
||||
}
|
||||
doc_ce=doc_ce->next;
|
||||
}
|
||||
|
||||
+27
-27
@@ -57,18 +57,18 @@ public U0 StrFileArrDel(U8 **a,I64 max_num)
|
||||
public I64 StrFileAdd(U8 *st,I64 *_num,
|
||||
CHashTable *table,I64 color=COLOR_INVALID)
|
||||
{
|
||||
CHashGeneric *temph;
|
||||
CHashGeneric *tmph;
|
||||
if (!st) return 0;
|
||||
if (!(temph=HashFind(st,table,SFT_GENERIC))) {
|
||||
temph=CAlloc(sizeof(CHashGeneric));
|
||||
temph->type=SFT_GENERIC;
|
||||
temph->str=StrNew(st);
|
||||
temph->user_data0=(*_num)++;
|
||||
HashAdd(temph,table);
|
||||
if (!(tmph=HashFind(st,table,SFT_GENERIC))) {
|
||||
tmph=CAlloc(sizeof(CHashGeneric));
|
||||
tmph->type=SFT_GENERIC;
|
||||
tmph->str=StrNew(st);
|
||||
tmph->user_data0=(*_num)++;
|
||||
HashAdd(tmph,table);
|
||||
}
|
||||
if (color!=COLOR_INVALID)
|
||||
temph->user_data1=color;
|
||||
return temph->user_data0;
|
||||
tmph->user_data1=color;
|
||||
return tmph->user_data0;
|
||||
}
|
||||
|
||||
I64 StrEntriesCompare(CHashGeneric *h1,CHashGeneric *h2)
|
||||
@@ -80,7 +80,7 @@ public U0 StrFileWrite(U8 *name,CHashTable *table,Bool no_nums=FALSE)
|
||||
{
|
||||
I64 i,j,cnt,color=BLACK;
|
||||
CDoc *doc=DocNew(name);
|
||||
CHashGeneric *temph,**a;
|
||||
CHashGeneric *tmph,**a;
|
||||
if (table) {
|
||||
cnt=0; //Count Strings
|
||||
for (i=0;i<=table->mask;i++)
|
||||
@@ -88,23 +88,23 @@ public U0 StrFileWrite(U8 *name,CHashTable *table,Bool no_nums=FALSE)
|
||||
a=MAlloc(cnt*sizeof(CHashGeneric *));
|
||||
j=0; //Load Strings
|
||||
for (i=0;i<=table->mask;i++) {
|
||||
temph=table->body[i];
|
||||
while (temph) {
|
||||
a[j++]=temph;
|
||||
temph=temph->next;
|
||||
tmph=table->body[i];
|
||||
while (tmph) {
|
||||
a[j++]=tmph;
|
||||
tmph=tmph->next;
|
||||
}
|
||||
}
|
||||
QSortI64(a,cnt,&StrEntriesCompare);
|
||||
for (i=0;i<cnt;i++) {
|
||||
temph=a[i];
|
||||
if (temph->user_data1&15!=color) {
|
||||
DocPrint(doc,"$$FG,%d$$",temph->user_data1&15);
|
||||
color=temph->user_data1&15;
|
||||
tmph=a[i];
|
||||
if (tmph->user_data1&15!=color) {
|
||||
DocPrint(doc,"$$FG,%d$$",tmph->user_data1&15);
|
||||
color=tmph->user_data1&15;
|
||||
}
|
||||
if (no_nums)
|
||||
DocPrint(doc,"%s\n",temph->str);
|
||||
DocPrint(doc,"%s\n",tmph->str);
|
||||
else
|
||||
DocPrint(doc,"%d,%s\n",temph->user_data0,temph->str);
|
||||
DocPrint(doc,"%d,%s\n",tmph->user_data0,tmph->str);
|
||||
}
|
||||
Free(a);
|
||||
}
|
||||
@@ -116,15 +116,15 @@ public U0 StrFileWrite(U8 *name,CHashTable *table,Bool no_nums=FALSE)
|
||||
public U0 StrFileDel(CHashTable *table)
|
||||
{
|
||||
I64 i;
|
||||
CHashGeneric *temph,*temph1;
|
||||
CHashGeneric *tmph,*tmph1;
|
||||
if (!table) return;
|
||||
for (i=0;i<=table->mask;i++) {
|
||||
temph=table->body[i];
|
||||
while (temph) {
|
||||
temph1=temph->next;
|
||||
Free(temph->str);
|
||||
Free(temph);
|
||||
temph=temph1;
|
||||
tmph=table->body[i];
|
||||
while (tmph) {
|
||||
tmph1=tmph->next;
|
||||
Free(tmph->str);
|
||||
Free(tmph);
|
||||
tmph=tmph1;
|
||||
}
|
||||
}
|
||||
Free(table->body);
|
||||
|
||||
+54
-54
@@ -1,37 +1,37 @@
|
||||
U0 BgtTemplatePurge(CBgtTemplate *tempt)
|
||||
U0 BgtTemplatePurge(CBgtTemplate *tmpt)
|
||||
{
|
||||
CBgtEntry *tempb,*tempb1;
|
||||
tempb=b_head.next;
|
||||
while (tempb!=&b_head) {
|
||||
tempb1=tempb->next;
|
||||
if (tempb->template==tempt) {
|
||||
QueRem(tempb);
|
||||
BgtEntryDel2(tempb);
|
||||
Free(tempb);
|
||||
CBgtEntry *tmpb,*tmpb1;
|
||||
tmpb=b_head.next;
|
||||
while (tmpb!=&b_head) {
|
||||
tmpb1=tmpb->next;
|
||||
if (tmpb->template==tmpt) {
|
||||
QueRem(tmpb);
|
||||
BgtEntryDel2(tmpb);
|
||||
Free(tmpb);
|
||||
}
|
||||
tempb=tempb1;
|
||||
tmpb=tmpb1;
|
||||
}
|
||||
}
|
||||
|
||||
U0 BgtTemplateExpand(CBgtTemplate *tempt)
|
||||
U0 BgtTemplateExpand(CBgtTemplate *tmpt)
|
||||
{
|
||||
CDate d,start,end;
|
||||
CDateStruct ds;
|
||||
CBgtEntry *tempb;
|
||||
CBgtEntry *tmpb;
|
||||
|
||||
start=MyStr2Date(tempt->start_date);
|
||||
end =MyStr2Date(tempt->end_date);
|
||||
tempt->b.template=tempt;
|
||||
switch (tempt->type) {
|
||||
start=MyStr2Date(tmpt->start_date);
|
||||
end =MyStr2Date(tmpt->end_date);
|
||||
tmpt->b.template=tmpt;
|
||||
switch (tmpt->type) {
|
||||
case BT_INTERVAL:
|
||||
d=start;
|
||||
while (d<=end) {
|
||||
tempb=CAlloc(sizeof(CBgtEntry));
|
||||
MemCpy(tempb,&tempt->b,sizeof(CBgtEntry));
|
||||
tempb->date=d;
|
||||
tempb->type=BE_TEMPLATE_COPY;
|
||||
BgtIns(tempb);
|
||||
d+=tempt->period*0x100000000;
|
||||
tmpb=CAlloc(sizeof(CBgtEntry));
|
||||
MemCpy(tmpb,&tmpt->b,sizeof(CBgtEntry));
|
||||
tmpb->date=d;
|
||||
tmpb->type=BE_TEMPLATE_COPY;
|
||||
BgtIns(tmpb);
|
||||
d+=tmpt->period*0x100000000;
|
||||
}
|
||||
break;
|
||||
case BT_MONTHLY:
|
||||
@@ -39,11 +39,11 @@ U0 BgtTemplateExpand(CBgtTemplate *tempt)
|
||||
while (TRUE) {
|
||||
d=Struct2Date(&ds);
|
||||
if (d<=end) {
|
||||
tempb=CAlloc(sizeof(CBgtEntry));
|
||||
MemCpy(tempb,&tempt->b,sizeof(CBgtEntry));
|
||||
tempb->date=d;
|
||||
tempb->type=BE_TEMPLATE_COPY;
|
||||
BgtIns(tempb);
|
||||
tmpb=CAlloc(sizeof(CBgtEntry));
|
||||
MemCpy(tmpb,&tmpt->b,sizeof(CBgtEntry));
|
||||
tmpb->date=d;
|
||||
tmpb->type=BE_TEMPLATE_COPY;
|
||||
BgtIns(tmpb);
|
||||
} else
|
||||
break;
|
||||
if (++ds.mon>11) {
|
||||
@@ -57,11 +57,11 @@ U0 BgtTemplateExpand(CBgtTemplate *tempt)
|
||||
while (TRUE) {
|
||||
d=Struct2Date(&ds);
|
||||
if (d<=end) {
|
||||
tempb=CAlloc(sizeof(CBgtEntry));
|
||||
MemCpy(tempb,&tempt->b,sizeof(CBgtEntry));
|
||||
tempb->date=d;
|
||||
tempb->type=BE_TEMPLATE_COPY;
|
||||
BgtIns(tempb);
|
||||
tmpb=CAlloc(sizeof(CBgtEntry));
|
||||
MemCpy(tmpb,&tmpt->b,sizeof(CBgtEntry));
|
||||
tmpb->date=d;
|
||||
tmpb->type=BE_TEMPLATE_COPY;
|
||||
BgtIns(tmpb);
|
||||
} else
|
||||
break;
|
||||
ds.mon+=2;
|
||||
@@ -76,11 +76,11 @@ U0 BgtTemplateExpand(CBgtTemplate *tempt)
|
||||
while (TRUE) {
|
||||
d=Struct2Date(&ds);
|
||||
if (d<=end) {
|
||||
tempb=CAlloc(sizeof(CBgtEntry));
|
||||
MemCpy(tempb,&tempt->b,sizeof(CBgtEntry));
|
||||
tempb->date=d;
|
||||
tempb->type=BE_TEMPLATE_COPY;
|
||||
BgtIns(tempb);
|
||||
tmpb=CAlloc(sizeof(CBgtEntry));
|
||||
MemCpy(tmpb,&tmpt->b,sizeof(CBgtEntry));
|
||||
tmpb->date=d;
|
||||
tmpb->type=BE_TEMPLATE_COPY;
|
||||
BgtIns(tmpb);
|
||||
} else
|
||||
break;
|
||||
ds.mon+=6;
|
||||
@@ -95,11 +95,11 @@ U0 BgtTemplateExpand(CBgtTemplate *tempt)
|
||||
while (TRUE) {
|
||||
d=Struct2Date(&ds);
|
||||
if (d<=end) {
|
||||
tempb=CAlloc(sizeof(CBgtEntry));
|
||||
MemCpy(tempb,&tempt->b,sizeof(CBgtEntry));
|
||||
tempb->date=d;
|
||||
tempb->type=BE_TEMPLATE_COPY;
|
||||
BgtIns(tempb);
|
||||
tmpb=CAlloc(sizeof(CBgtEntry));
|
||||
MemCpy(tmpb,&tmpt->b,sizeof(CBgtEntry));
|
||||
tmpb->date=d;
|
||||
tmpb->type=BE_TEMPLATE_COPY;
|
||||
BgtIns(tmpb);
|
||||
} else
|
||||
break;
|
||||
ds.year++;
|
||||
@@ -110,17 +110,17 @@ U0 BgtTemplateExpand(CBgtTemplate *tempt)
|
||||
|
||||
U0 CBgtTemplatesExpand()
|
||||
{
|
||||
CBgtTemplate *tempt=t_head.next;
|
||||
while (tempt!=&t_head) {
|
||||
BgtTemplateExpand(tempt);
|
||||
tempt=tempt->next;
|
||||
CBgtTemplate *tmpt=t_head.next;
|
||||
while (tmpt!=&t_head) {
|
||||
BgtTemplateExpand(tmpt);
|
||||
tmpt=tmpt->next;
|
||||
}
|
||||
}
|
||||
|
||||
CBgtTemplate *BgtTemplatePmt(CBgtTemplate *dft_t=NULL)
|
||||
{
|
||||
CBgtTemplate t,*tempt;
|
||||
CBgtEntry *tempb,*dft_b;
|
||||
CBgtTemplate t,*tmpt;
|
||||
CBgtEntry *tmpb,*dft_b;
|
||||
MemSet(&t,0,sizeof(CBgtTemplate));
|
||||
if (dft_t) {
|
||||
MemCpy(&t.start,&dft_t->start,BT_SIZE);
|
||||
@@ -134,12 +134,12 @@ CBgtTemplate *BgtTemplatePmt(CBgtTemplate *dft_t=NULL)
|
||||
while (TRUE)
|
||||
if (PopUpForm(&t) && ((t.type==BT_INTERVAL && t.period>0) ||
|
||||
t.type>BT_INTERVAL)) {
|
||||
if (tempb=BgtEntryPmt(dft_b)) {
|
||||
tempt=CAlloc(sizeof(CBgtTemplate));
|
||||
MemCpy(&tempt->start,&t.start,BT_SIZE);
|
||||
MemCpy(&tempt->b,tempb,sizeof(CBgtEntry));
|
||||
Free(tempb);
|
||||
return tempt;
|
||||
if (tmpb=BgtEntryPmt(dft_b)) {
|
||||
tmpt=CAlloc(sizeof(CBgtTemplate));
|
||||
MemCpy(&tmpt->start,&t.start,BT_SIZE);
|
||||
MemCpy(&tmpt->b,tmpb,sizeof(CBgtEntry));
|
||||
Free(tmpb);
|
||||
return tmpt;
|
||||
}
|
||||
} else
|
||||
break;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#define BGT_STRINGS_FILE "~/Budget/Strs.DD.Z"
|
||||
#define BGT_ACCTS_FILE "~/Budget/Accts.DD.Z"
|
||||
#define BGT_DATA_FILE "~/Budget/Bgt.DAT.Z"
|
||||
#define BGT_DATA_FILE "~/Budget/Bgt.DATA.Z"
|
||||
|
||||
#define BE_NORMAL 0
|
||||
#define BE_GAS 1
|
||||
|
||||
@@ -267,7 +267,7 @@ just to be different.
|
||||
|
||||
U0 DrawObj(CDC *dc,Obj *o,F64 tt)
|
||||
{
|
||||
U8 *temps;
|
||||
U8 *tmps;
|
||||
F64 r1=Max(9-0.1*o->z,1),r2=Max(r1/4,1);
|
||||
|
||||
if (o==human)
|
||||
@@ -280,11 +280,11 @@ U0 DrawObj(CDC *dc,Obj *o,F64 tt)
|
||||
if (o==ball)
|
||||
Sprite3(dc,o->x,(o->y-o->z)/2,GR_Z_ALL-o->y,$IB,"<1>",BI=1$);
|
||||
else {
|
||||
temps=SpriteInterpolate((tt-o->last_t0)/(o->next_t0-o->last_t0),
|
||||
tmps=SpriteInterpolate((tt-o->last_t0)/(o->next_t0-o->last_t0),
|
||||
imgs[o->last_img].img[o->team],
|
||||
imgs[o->next_img].img[o->team]);
|
||||
SpriteY3B(dc,o->x,(o->y-o->z)/2,GR_Z_ALL-o->y,temps,o->é);
|
||||
Free(temps);
|
||||
SpriteY3B(dc,o->x,(o->y-o->z)/2,GR_Z_ALL-o->y,tmps,o->é);
|
||||
Free(tmps);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -616,7 +616,7 @@ U0 AnimateTask(CTask *parent_task)
|
||||
}
|
||||
}
|
||||
}
|
||||
WinMgrSync;
|
||||
Refresh;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -580,7 +580,7 @@ U0 DigitalLogic()
|
||||
Fs->draw_it=&DrawIt;
|
||||
GetChar;
|
||||
DocClear;
|
||||
WinMgrSync(2,TRUE);
|
||||
Refresh(2,TRUE);
|
||||
DocBottom;
|
||||
}
|
||||
} catch
|
||||
|
||||
+24
-24
@@ -18,20 +18,20 @@ CTask *SingleSong(U8 *msg,U8 *name)
|
||||
Bool JBPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
|
||||
{//ch=ASCII; sc=scan_code
|
||||
CDocEntry *doc_ce=doc->cur_entry,*doc_e;
|
||||
CDirEntry *tempde;
|
||||
CDirEntry *tmpde;
|
||||
CDoc *s;
|
||||
if (!(sc&(SCF_ALT|SCF_CTRL|SCF_SHIFT))
|
||||
&& doc_ce->type_u8==DOCT_MENU_VAL && doc_ce->left_exp>=0) {
|
||||
tempde=doc_ce->left_exp;
|
||||
tmpde=doc_ce->left_exp;
|
||||
if (sc.u8[0]==SC_DELETE ) {
|
||||
Beep;
|
||||
Silent;
|
||||
Del(tempde->full_name);
|
||||
Del(tmpde->full_name);
|
||||
Silent(OFF);
|
||||
} else if ('0'<=ch<='9') {
|
||||
if (StrLen(doc_ce->tag)>1)
|
||||
doc_ce->tag[0]=ch;
|
||||
s=DocRead(tempde->full_name);
|
||||
s=DocRead(tmpde->full_name);
|
||||
doc_e=s->head.next;
|
||||
while (doc_e!=s && doc_e->type_u8!=DOCT_TEXT)
|
||||
doc_e=doc_e->next;
|
||||
@@ -42,7 +42,7 @@ Bool JBPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
|
||||
DocDel(s);
|
||||
return TRUE;
|
||||
} else if (ch==CH_SPACE||ch==CH_ESC)
|
||||
tempde->user_data++; //JB_RUN_LEVEL++
|
||||
tmpde->user_data++; //JB_RUN_LEVEL++
|
||||
//<SPACE> is followed by <ESC> --> JB_RUN_LEVEL_TWO
|
||||
//Actual <ESC> just exits --> JB_RUN_LEVEL_ONE
|
||||
}
|
||||
@@ -53,7 +53,7 @@ public U0 JukeBox(U8 *dirname="~/Psalmody",U8 **_filename=NULL)
|
||||
{//_filename is for using this as a song-chooser program.
|
||||
I64 i=0,rating;
|
||||
U8 *st,*st2;
|
||||
CDirEntry *tempde,*tempde1;
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
CDoc *doc=DocNew,*s;
|
||||
CDocEntry *doc_e;
|
||||
CTask *task=NULL;
|
||||
@@ -61,7 +61,7 @@ public U0 JukeBox(U8 *dirname="~/Psalmody",U8 **_filename=NULL)
|
||||
*_filename=NULL;
|
||||
dirname=StrNew(dirname);
|
||||
st=MStrPrint("%s/*.HC.Z",dirname);
|
||||
tempde=tempde1=FilesFind(st);
|
||||
tmpde=tmpde1=FilesFind(st);
|
||||
Free(st);
|
||||
Free(dirname);
|
||||
doc->user_put_key=&JBPutKey;
|
||||
@@ -70,13 +70,13 @@ public U0 JukeBox(U8 *dirname="~/Psalmody",U8 **_filename=NULL)
|
||||
"$$BLACK$$Incomplete $$CYAN$$Special$$FG$$\n\n"
|
||||
"$$GREEN$$<DELETE>$$FG$$ to delete a song.\n"
|
||||
"Press a number to rate a song.\n");
|
||||
while (tempde) {
|
||||
while (tmpde) {
|
||||
if (!(i++%5))
|
||||
DocPrint(doc,"\n");
|
||||
if (FileOcc("Play(",tempde->full_name,"")) {
|
||||
st=StrNew(tempde->name);
|
||||
if (FileOcc("Play(",tmpde->full_name,"")) {
|
||||
st=StrNew(tmpde->name);
|
||||
FileExtRem(st);
|
||||
s=DocRead(tempde->full_name);
|
||||
s=DocRead(tmpde->full_name);
|
||||
doc_e=s->head.next;
|
||||
while (doc_e!=s && doc_e->type_u8!=DOCT_TEXT)
|
||||
doc_e=doc_e->next;
|
||||
@@ -94,7 +94,7 @@ public U0 JukeBox(U8 *dirname="~/Psalmody",U8 **_filename=NULL)
|
||||
DocPrint(doc,"$$CYAN$$");
|
||||
else if (StrMatch("no nothing",doc_e->tag)) {
|
||||
DocPrint(doc,"$$RED$$");
|
||||
if (FileOcc("\\0",tempde->full_name,"")) {
|
||||
if (FileOcc("\\0",tmpde->full_name,"")) {
|
||||
s->cur_entry=doc_e->next;
|
||||
s->cur_col=0;
|
||||
DocEntryDel(s,doc_e);
|
||||
@@ -102,37 +102,37 @@ public U0 JukeBox(U8 *dirname="~/Psalmody",U8 **_filename=NULL)
|
||||
DocWrite(s);
|
||||
}
|
||||
}
|
||||
DocPrint(doc,"$$MU-UL,\"%c%-8ts\",LE=%d$$ ",rating,st,tempde);
|
||||
tempde->user_data=JB_RUN_LEVEL_NULL;
|
||||
DocPrint(doc,"$$MU-UL,\"%c%-8ts\",LE=%d$$ ",rating,st,tmpde);
|
||||
tmpde->user_data=JB_RUN_LEVEL_NULL;
|
||||
}
|
||||
DocDel(s);
|
||||
Free(st);
|
||||
}
|
||||
tempde=tempde->next;
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
DocPrint(doc,"\n$$CYAN$$$$MU-UL,\"DONE\",LE=%d$$\n",DOCM_CANCEL);
|
||||
while (TRUE) {
|
||||
if (_filename)
|
||||
tempde=PopUpMenu(doc,DOF_INTERCEPT_TASK_END);
|
||||
tmpde=PopUpMenu(doc,DOF_INTERCEPT_TASK_END);
|
||||
else
|
||||
tempde=PopUpMenu(doc);
|
||||
tmpde=PopUpMenu(doc);
|
||||
if (task)
|
||||
Kill(task);
|
||||
if (tempde<=0) break;
|
||||
st2=StrNew(tempde->name);
|
||||
if (tmpde<=0) break;
|
||||
st2=StrNew(tmpde->name);
|
||||
if (_filename) {
|
||||
Free(*_filename);
|
||||
*_filename=StrNew(tempde->full_name);
|
||||
*_filename=StrNew(tmpde->full_name);
|
||||
}
|
||||
if (tempde->user_data==JB_RUN_LEVEL_ONE) break; //<ESC>
|
||||
tempde->user_data=JB_RUN_LEVEL_NULL; //Rst from <SPACE>
|
||||
if (tmpde->user_data==JB_RUN_LEVEL_ONE) break; //<ESC>
|
||||
tmpde->user_data=JB_RUN_LEVEL_NULL; //Rst from <SPACE>
|
||||
FileExtRem(st2);
|
||||
st=MStrPrint("ExeFile(\"%s\");",tempde->full_name);
|
||||
st=MStrPrint("ExeFile(\"%s\");",tmpde->full_name);
|
||||
MusicSettingsRst;
|
||||
task=SingleSong(st,st2);
|
||||
Free(st2);
|
||||
Free(st);
|
||||
}
|
||||
DocDel(doc);
|
||||
DirTreeDel(tempde1);
|
||||
DirTreeDel(tmpde1);
|
||||
}
|
||||
+11
-11
@@ -2,13 +2,13 @@ U0 SongPuppet(CTask *task,I64 passes)
|
||||
{
|
||||
CDbgInfo *dbg_info;
|
||||
I64 i,start,end,rip,last_rip;
|
||||
CHashFun *tempf=NULL;
|
||||
CHashFun *tmpf=NULL;
|
||||
for (i=0;i<250 && TaskValidate(task);i++) {
|
||||
if (tempf=HashFind("Song",task->hash_table,HTT_FUN))
|
||||
if (tmpf=HashFind("Song",task->hash_table,HTT_FUN))
|
||||
break;
|
||||
Sleep(1);
|
||||
}
|
||||
if (tempf && (dbg_info=tempf->dbg_info)) {
|
||||
if (tmpf && (dbg_info=tmpf->dbg_info)) {
|
||||
start=dbg_info->body[0];
|
||||
end =dbg_info->body[dbg_info->max_line+1-dbg_info->min_line];
|
||||
last_rip=0;
|
||||
@@ -74,16 +74,16 @@ public U0 JukeSongsPuppet(U8 *dirname="~/Psalmody",I64 passes=2,
|
||||
I64 start_song=0,I64 end_song=MAX_I64)
|
||||
{//Help make music video by puppeting JukeBox task.
|
||||
I64 i;
|
||||
CDirEntry *tempde,*tempde1;
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
CTask *juke_task=User("JukeBox(0x%X);\n",dirname);
|
||||
Cd(dirname);
|
||||
tempde1=FilesFind("*",FUF_RECURSE|FUF_JUST_TXT|FUF_JUST_FILES);
|
||||
for (tempde=tempde1,i=0;tempde && i<start_song;i++)
|
||||
tempde=tempde->next;
|
||||
for (i=start_song;tempde && i<end_song;i++) {
|
||||
JukeSongPuppet(juke_task,passes,i,tempde->name);
|
||||
tempde=tempde->next;
|
||||
tmpde1=FilesFind("*",FUF_RECURSE|FUF_JUST_TXT|FUF_JUST_FILES);
|
||||
for (tmpde=tmpde1,i=0;tmpde && i<start_song;i++)
|
||||
tmpde=tmpde->next;
|
||||
for (i=start_song;tmpde && i<end_song;i++) {
|
||||
JukeSongPuppet(juke_task,passes,i,tmpde->name);
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
DirTreeDel(tempde1);
|
||||
DirTreeDel(tmpde1);
|
||||
Kill(juke_task);
|
||||
}
|
||||
@@ -19,7 +19,7 @@ This uses four types of output
|
||||
|
||||
4) The Fs->next_ctrl for the tempo/stacatto sliders.
|
||||
|
||||
See $LK,"GrUpdateTaskWin",A="MN:GrUpdateTaskWin"$(), $LK,"GrUpdateTasks",A="MN:GrUpdateTasks"$() and $LK,"GrUpdateScreen",A="MN:GrUpdateScreen"$().
|
||||
See $LK,"GrUpdateTaskWin",A="MN:GrUpdateTaskWin"$(), $LK,"GrUpdateTasks",A="MN:GrUpdateTasks"$() and $LK,"GrUpdateScrn",A="MN:GrUpdateScrn"$().
|
||||
$WW,1$$WW,0$*/
|
||||
|
||||
#define NOTE_REST MIN_I64
|
||||
@@ -62,20 +62,13 @@ class PsmCtrl
|
||||
PsmNote head;
|
||||
PsmNote clipboard;
|
||||
CMenuEntry *incomplete_entry,*record_entry;
|
||||
I64 screen_x,
|
||||
I64 scrn_x,
|
||||
tool;
|
||||
PsmNote *cur_note;
|
||||
CDC *dc2;
|
||||
Bool playing;
|
||||
} oc;
|
||||
} psm;
|
||||
|
||||
U8 *psm_note_lst="A\0A#\0B\0C\0C#\0D\0D#\0E\0F\0F#\0G\0G#\0";
|
||||
U8 psm_note_map[12]={6,6,5,4,4,3,3,2,1,1,0,0};
|
||||
U8 psm_note_inverse_map[7]={10,8,7,5,3,2,0};
|
||||
|
||||
#define PSMPM_NORMAL 0
|
||||
#define PSMPM_REVERB1 1
|
||||
#define PSMPM_NUM_PLAY_MODES 2
|
||||
I64 psm_play_mode=0;
|
||||
F64 psm_play_f=0;
|
||||
|
||||
Loaded 100 of 376 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user