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.
|
//it will be stored uncompressed.
|
||||||
Bool res=TRUE;
|
Bool res=TRUE;
|
||||||
CDirContext *dirc;
|
CDirContext *dirc;
|
||||||
CDirEntry *tempde,*tempde1;
|
CDirEntry *tmpde,*tmpde1;
|
||||||
U8 *st;
|
U8 *st;
|
||||||
if (!(tempde1=FilesFind(src_files_find_mask,FUF_CLUSTER_ORDER)))
|
if (!(tmpde1=FilesFind(src_files_find_mask,FUF_CLUSTER_ORDER)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (IsDir(dst_files_find_mask)) {
|
if (IsDir(dst_files_find_mask)) {
|
||||||
if (dirc=DirContextNew(dst_files_find_mask,TRUE)) {
|
if (dirc=DirContextNew(dst_files_find_mask,TRUE)) {
|
||||||
tempde=tempde1;
|
tmpde=tmpde1;
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
if (!(tempde->attr & RS_ATTR_DIR)) {
|
if (!(tmpde->attr & RS_ATTR_DIR)) {
|
||||||
st=FileNameAbs(tempde->name);
|
st=FileNameAbs(tmpde->name);
|
||||||
if (!CopySingle(tempde->full_name,st))
|
if (!CopySingle(tmpde->full_name,st))
|
||||||
res=FALSE;
|
res=FALSE;
|
||||||
Free(st);
|
Free(st);
|
||||||
}
|
}
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
DirContextDel(dirc);
|
DirContextDel(dirc);
|
||||||
}
|
}
|
||||||
DirTreeDel(tempde1);
|
DirTreeDel(tmpde1);
|
||||||
return res;
|
return res;
|
||||||
} else {
|
} else {
|
||||||
DirTreeDel(tempde1);
|
DirTreeDel(tmpde1);
|
||||||
return CopySingle(src_files_find_mask,dst_files_find_mask);
|
return CopySingle(src_files_find_mask,dst_files_find_mask);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -100,22 +100,22 @@ public Bool Move(U8 *f1,U8 *f2)
|
|||||||
return FALSE;
|
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;
|
U8 *st;
|
||||||
I64 res=1;
|
I64 res=1;
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
st=MAlloc(StrLen(tempde->full_name)+dst_dir_len+2);
|
st=MAlloc(StrLen(tmpde->full_name)+dst_dir_len+2);
|
||||||
MemCpy(st,dst_dir,dst_dir_len);
|
MemCpy(st,dst_dir,dst_dir_len);
|
||||||
StrCpy(st+dst_dir_len,tempde->full_name+src_dir_len);
|
StrCpy(st+dst_dir_len,tmpde->full_name+src_dir_len);
|
||||||
if (tempde->attr & RS_ATTR_DIR) {
|
if (tmpde->attr & RS_ATTR_DIR) {
|
||||||
MkDir(st,LinkedLstCnt(tempde->sub));
|
MkDir(st,LinkedLstCnt(tmpde->sub));
|
||||||
res+=CopyTree2(tempde->sub,src_dir_len,dst_dir_len,dst_dir);
|
res+=CopyTree2(tmpde->sub,src_dir_len,dst_dir_len,dst_dir);
|
||||||
} else
|
} else
|
||||||
if (CopySingle(tempde->full_name,st))
|
if (CopySingle(tmpde->full_name,st))
|
||||||
res++;
|
res++;
|
||||||
Free(st);
|
Free(st);
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -124,7 +124,7 @@ public I64 CopyTree(U8 *src_files_find_mask,U8 *dst_files_find_mask,
|
|||||||
{//Copy directory tree.
|
{//Copy directory tree.
|
||||||
//Returns the count of copied files (not dirs).
|
//Returns the count of copied files (not dirs).
|
||||||
CDirContext *dirc;
|
CDirContext *dirc;
|
||||||
CDirEntry *tempde=NULL;
|
CDirEntry *tmpde=NULL;
|
||||||
I64 res=0,i1,i2;
|
I64 res=0,i1,i2;
|
||||||
U8 *st1,*st2;
|
U8 *st1,*st2;
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ public I64 CopyTree(U8 *src_files_find_mask,U8 *dst_files_find_mask,
|
|||||||
Free(st1);
|
Free(st1);
|
||||||
Free(st2);
|
Free(st2);
|
||||||
if (dirc=DirContextNew(src_files_find_mask,TRUE,,no_mask)) {
|
if (dirc=DirContextNew(src_files_find_mask,TRUE,,no_mask)) {
|
||||||
tempde=FilesFind(dirc->mask,FUF_RECURSE);
|
tmpde=FilesFind(dirc->mask,FUF_RECURSE);
|
||||||
st1=CurDir;
|
st1=CurDir;
|
||||||
DirContextDel(dirc);
|
DirContextDel(dirc);
|
||||||
i1=StrLen(st1);
|
i1=StrLen(st1);
|
||||||
@@ -148,45 +148,45 @@ public I64 CopyTree(U8 *src_files_find_mask,U8 *dst_files_find_mask,
|
|||||||
st2=CurDir;
|
st2=CurDir;
|
||||||
i2=StrLen(st2);
|
i2=StrLen(st2);
|
||||||
if (i2==3) i2--;
|
if (i2==3) i2--;
|
||||||
res=CopyTree2(tempde,i1,i2,st2);
|
res=CopyTree2(tmpde,i1,i2,st2);
|
||||||
DirContextDel(dirc);
|
DirContextDel(dirc);
|
||||||
Free(st2);
|
Free(st2);
|
||||||
}
|
}
|
||||||
DirTreeDel(tempde);
|
DirTreeDel(tmpde);
|
||||||
Free(st1);
|
Free(st1);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
I64 DelTreeDirs(CDirEntry *tempde1)
|
I64 DelTreeDirs(CDirEntry *tmpde1)
|
||||||
{
|
{
|
||||||
I64 res=0;
|
I64 res=0;
|
||||||
CDirEntry *tempde2;
|
CDirEntry *tmpde2;
|
||||||
while (tempde1) {
|
while (tmpde1) {
|
||||||
tempde2=tempde1->next;
|
tmpde2=tmpde1->next;
|
||||||
if (tempde1->attr & RS_ATTR_DIR) {
|
if (tmpde1->attr & RS_ATTR_DIR) {
|
||||||
if (tempde1->sub)
|
if (tmpde1->sub)
|
||||||
res+=DelTreeDirs(tempde1->sub);
|
res+=DelTreeDirs(tmpde1->sub);
|
||||||
res+=Del(tempde1->full_name,TRUE,TRUE);
|
res+=Del(tmpde1->full_name,TRUE,TRUE);
|
||||||
}
|
}
|
||||||
DirEntryDel(tempde1);
|
DirEntryDel(tmpde1);
|
||||||
tempde1=tempde2;
|
tmpde1=tmpde2;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
I64 DelTreeFiles(CDirEntry *tempde1)
|
I64 DelTreeFiles(CDirEntry *tmpde1)
|
||||||
{
|
{
|
||||||
I64 res=0;
|
I64 res=0;
|
||||||
CDirEntry *tempde2;
|
CDirEntry *tmpde2;
|
||||||
while (tempde1) {
|
while (tmpde1) {
|
||||||
tempde2=tempde1->next;
|
tmpde2=tmpde1->next;
|
||||||
if (tempde1->attr & RS_ATTR_DIR) {
|
if (tmpde1->attr & RS_ATTR_DIR) {
|
||||||
if (tempde1->sub)
|
if (tmpde1->sub)
|
||||||
res+=DelTreeFiles(tempde1->sub);
|
res+=DelTreeFiles(tmpde1->sub);
|
||||||
} else
|
} else
|
||||||
res+=Del(tempde1->full_name,FALSE,TRUE);
|
res+=Del(tmpde1->full_name,FALSE,TRUE);
|
||||||
DirEntryDel(tempde1);
|
DirEntryDel(tmpde1);
|
||||||
tempde1=tempde2;
|
tmpde1=tmpde2;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -240,13 +240,13 @@ To Set DateL:
|
|||||||
Touch(filename,"",,datetime);
|
Touch(filename,"",,datetime);
|
||||||
*/
|
*/
|
||||||
I64 fuf_flags=0;
|
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"),"+f+F");
|
||||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
TouchFile(tempde->full_name,attr,cdt);
|
TouchFile(tmpde->full_name,attr,cdt);
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
DirTreeDel(tempde1);
|
DirTreeDel(tmpde1);
|
||||||
}
|
}
|
||||||
+78
-78
@@ -1,102 +1,102 @@
|
|||||||
#help_index "File/Internal"
|
#help_index "File/Internal"
|
||||||
I64 DirTreeSerializeSize(CDirEntry *tempde)
|
I64 DirTreeSerializeSize(CDirEntry *tmpde)
|
||||||
{
|
{
|
||||||
I64 res=0;
|
I64 res=0;
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
res+=CDIR_SIZE+1;
|
res+=CDIR_SIZE+1;
|
||||||
if (tempde->attr & RS_ATTR_DIR)
|
if (tmpde->attr & RS_ATTR_DIR)
|
||||||
res+=DirTreeSerializeSize(tempde->sub);
|
res+=DirTreeSerializeSize(tmpde->sub);
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
return res+1;
|
return res+1;
|
||||||
}
|
}
|
||||||
I64 DirTreeSerializeFill(CDirEntry *tempde,U8 *dst)
|
I64 DirTreeSerializeFill(CDirEntry *tmpde,U8 *dst)
|
||||||
{
|
{
|
||||||
I64 res=0,i;
|
I64 res=0,i;
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
*dst++=1;
|
*dst++=1;
|
||||||
res++;
|
res++;
|
||||||
MemCpy(dst,&tempde->start,CDIR_SIZE);
|
MemCpy(dst,&tmpde->start,CDIR_SIZE);
|
||||||
dst+=CDIR_SIZE;
|
dst+=CDIR_SIZE;
|
||||||
res+=CDIR_SIZE;
|
res+=CDIR_SIZE;
|
||||||
if (tempde->attr & RS_ATTR_DIR) {
|
if (tmpde->attr & RS_ATTR_DIR) {
|
||||||
i=DirTreeSerializeFill(tempde->sub,dst);
|
i=DirTreeSerializeFill(tmpde->sub,dst);
|
||||||
dst+=i;
|
dst+=i;
|
||||||
res+=i;
|
res+=i;
|
||||||
}
|
}
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
*dst=0;
|
*dst=0;
|
||||||
return res+1;
|
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.
|
{//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);
|
U8 *buf=MAlloc(size);
|
||||||
DirTreeSerializeFill(tempde,buf);
|
DirTreeSerializeFill(tmpde,buf);
|
||||||
if (_size) *_size=size;
|
if (_size) *_size=size;
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
U8 *DirTreeUnserialize2(U8 *src,CDirEntry **tempde)
|
U8 *DirTreeUnserialize2(U8 *src,CDirEntry **tmpde)
|
||||||
{
|
{
|
||||||
CDirEntry *tempde1;
|
CDirEntry *tmpde1;
|
||||||
if (*src++) {
|
if (*src++) {
|
||||||
tempde1=CAlloc(sizeof(CDirEntry));
|
tmpde1=CAlloc(sizeof(CDirEntry));
|
||||||
*tempde=tempde1;
|
*tmpde=tmpde1;
|
||||||
MemCpy(&tempde1->start,src,CDIR_SIZE);
|
MemCpy(&tmpde1->start,src,CDIR_SIZE);
|
||||||
src+=CDIR_SIZE;
|
src+=CDIR_SIZE;
|
||||||
if (tempde1->attr & RS_ATTR_DIR)
|
if (tmpde1->attr & RS_ATTR_DIR)
|
||||||
src=DirTreeUnserialize2(src,&tempde1->sub);
|
src=DirTreeUnserialize2(src,&tmpde1->sub);
|
||||||
src=DirTreeUnserialize2(src,&tempde1->next);
|
src=DirTreeUnserialize2(src,&tmpde1->next);
|
||||||
} else
|
} else
|
||||||
*tempde=NULL;
|
*tmpde=NULL;
|
||||||
return src;
|
return src;
|
||||||
}
|
}
|
||||||
public CDirEntry *DirTreeUnserialize(U8 *src)
|
public CDirEntry *DirTreeUnserialize(U8 *src)
|
||||||
{//Unserialize tree to make it like a tree returned from $LK,"FilesFind",A="MN:FilesFind"$().
|
{//Unserialize tree to make it like a tree returned from $LK,"FilesFind",A="MN:FilesFind"$().
|
||||||
CDirEntry *tempde=NULL;
|
CDirEntry *tmpde=NULL;
|
||||||
DirTreeUnserialize2(src,&tempde);
|
DirTreeUnserialize2(src,&tmpde);
|
||||||
return tempde;
|
return tmpde;
|
||||||
}
|
}
|
||||||
|
|
||||||
#help_index "File/Program Routines"
|
#help_index "File/Program Routines"
|
||||||
U0 FOFlatten(CDirEntry *tempde,CDirEntry **a,I64 *i)
|
U0 FOFlatten(CDirEntry *tmpde,CDirEntry **a,I64 *i)
|
||||||
{
|
{
|
||||||
CDirEntry *tempde1;
|
CDirEntry *tmpde1;
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
tempde1=tempde->next;
|
tmpde1=tmpde->next;
|
||||||
if (tempde->attr&RS_ATTR_DIR) {
|
if (tmpde->attr&RS_ATTR_DIR) {
|
||||||
FOFlatten(tempde->sub,a,i);
|
FOFlatten(tmpde->sub,a,i);
|
||||||
DirEntryDel(tempde);
|
DirEntryDel(tmpde);
|
||||||
} else {
|
} else {
|
||||||
a[*i]=tempde;
|
a[*i]=tmpde;
|
||||||
*i=*i+1;
|
*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];
|
U8 buf[BLK_SIZE];
|
||||||
I64 res=0,i;
|
I64 res=0,i;
|
||||||
CDrv *dv;
|
CDrv *dv;
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
if ((i=tempde->size) && Bt(_fuf_flags,FUf_EXPAND) &&
|
if ((i=tmpde->size) && Bt(_fuf_flags,FUf_EXPAND) &&
|
||||||
!(tempde->attr&RS_ATTR_DIR) &&
|
!(tmpde->attr&RS_ATTR_DIR) &&
|
||||||
FileAttr(tempde->name)&RS_ATTR_COMPRESSED) {
|
FileAttr(tmpde->name)&RS_ATTR_COMPRESSED) {
|
||||||
dv=Let2Drv(*tempde->full_name);
|
dv=Let2Drv(*tmpde->full_name);
|
||||||
RBlks(dv,buf,Cluster2Blk(dv,tempde->cluster),1);
|
RBlks(dv,buf,Cluster2Blk(dv,tmpde->cluster),1);
|
||||||
i=(&buf)(CArcCompress *)->expanded_size;
|
i=(&buf)(CArcCompress *)->expanded_size;
|
||||||
}
|
}
|
||||||
if (round_to)
|
if (round_to)
|
||||||
i=CeilU64(tempde->size,round_to);
|
i=CeilU64(tmpde->size,round_to);
|
||||||
if (tempde->attr&RS_ATTR_DIR)
|
if (tmpde->attr&RS_ATTR_DIR)
|
||||||
i+=Size1(tempde->sub,_fuf_flags,round_to);
|
i+=Size1(tmpde->sub,_fuf_flags,round_to);
|
||||||
tempde->user_data=i;
|
tmpde->user_data=i;
|
||||||
res+=i;
|
res+=i;
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
return res;
|
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 not include directory size of base directory, but
|
||||||
//does include size of sub directories.
|
//does include size of sub directories.
|
||||||
I64 fuf_flags=0,res=0;
|
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"),"+r");
|
||||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
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;
|
fuf_flags&=FUF_EXPAND;
|
||||||
res=Size1(tempde1,&fuf_flags,round_to);
|
res=Size1(tmpde1,&fuf_flags,round_to);
|
||||||
DirTreeDel(tempde1);
|
DirTreeDel(tmpde1);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
public I64 FileCnt(CDirEntry *tempde)
|
public I64 FileCnt(CDirEntry *tmpde)
|
||||||
{//Cnt of files in $LK,"CDirEntry",A="MN:CDirEntry"$ tree.
|
{//Cnt of files in $LK,"CDirEntry",A="MN:CDirEntry"$ tree.
|
||||||
I64 cnt=0;
|
I64 cnt=0;
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
if (tempde->attr&RS_ATTR_DIR)
|
if (tmpde->attr&RS_ATTR_DIR)
|
||||||
cnt+=FileCnt(tempde->sub);
|
cnt+=FileCnt(tmpde->sub);
|
||||||
else
|
else
|
||||||
cnt++;
|
cnt++;
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
return cnt;
|
return cnt;
|
||||||
}
|
}
|
||||||
@@ -133,37 +133,37 @@ public I64 FileCnt(CDirEntry *tempde)
|
|||||||
public I64 FF(U8 *files_find_mask,U8 *fu_flags=NULL)
|
public I64 FF(U8 *files_find_mask,U8 *fu_flags=NULL)
|
||||||
{//Files find. List files matching mask.
|
{//Files find. List files matching mask.
|
||||||
I64 cnt=0,fuf_flags=0;
|
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"),"+r+f+F");
|
||||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
PutFileLink(tempde->full_name);
|
PutFileLink(tmpde->full_name);
|
||||||
'\n';
|
'\n';
|
||||||
cnt++;
|
cnt++;
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
DirTreeDel(tempde1);
|
DirTreeDel(tmpde1);
|
||||||
return cnt;
|
return cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
public I64 Zip(U8 *files_find_mask="*",U8 *fu_flags=NULL)
|
public I64 Zip(U8 *files_find_mask="*",U8 *fu_flags=NULL)
|
||||||
{//Compress files by moving to .Z filename.
|
{//Compress files by moving to .Z filename.
|
||||||
U8 *st;
|
U8 *st;
|
||||||
CDirEntry *tempde,*tempde1;
|
CDirEntry *tmpde,*tmpde1;
|
||||||
I64 res=0,fuf_flags=0;
|
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"),"+r+f+F+O");
|
||||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
if (!IsDotZ(tempde->full_name)) {
|
if (!IsDotZ(tmpde->full_name)) {
|
||||||
st=MStrPrint("%s.Z",tempde->full_name);
|
st=MStrPrint("%s.Z",tmpde->full_name);
|
||||||
res+=Move(tempde->full_name,st);
|
res+=Move(tmpde->full_name,st);
|
||||||
Free(st);
|
Free(st);
|
||||||
}
|
}
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
DirTreeDel(tempde1);
|
DirTreeDel(tmpde1);
|
||||||
return res;
|
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.
|
//You don't have to do this for normal operation.
|
||||||
//It automatically unzips ".Z" files.
|
//It automatically unzips ".Z" files.
|
||||||
U8 *st;
|
U8 *st;
|
||||||
CDirEntry *tempde,*tempde1;
|
CDirEntry *tmpde,*tmpde1;
|
||||||
I64 res=0,fuf_flags=0;
|
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"),"+r+f+F+O");
|
||||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
if (IsDotZ(tempde->full_name)) {
|
if (IsDotZ(tmpde->full_name)) {
|
||||||
st=StrNew(tempde->full_name);
|
st=StrNew(tmpde->full_name);
|
||||||
StrLastRem(st,".");
|
StrLastRem(st,".");
|
||||||
res+=Move(tempde->full_name,st);
|
res+=Move(tmpde->full_name,st);
|
||||||
Free(st);
|
Free(st);
|
||||||
}
|
}
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
DirTreeDel(tempde1);
|
DirTreeDel(tmpde1);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
+35
-35
@@ -10,36 +10,36 @@ Bool ChkDskConfirm(Bool *_fix,Bool *_confirm)
|
|||||||
return *_fix;
|
return *_fix;
|
||||||
}
|
}
|
||||||
|
|
||||||
I64 RedSeaChkDskLst(CDrv *dv,CDirEntry *tempde1,
|
I64 RedSeaChkDskLst(CDrv *dv,CDirEntry *tmpde1,
|
||||||
U8 *bits,U8 *bits2,I64 size,I64 bpc)
|
U8 *bits,U8 *bits2,I64 size,I64 bpc)
|
||||||
{
|
{
|
||||||
CDirEntry *tempde2;
|
CDirEntry *tmpde2;
|
||||||
I64 i,j,errs=0;
|
I64 i,j,errs=0;
|
||||||
while (tempde1) {
|
while (tmpde1) {
|
||||||
tempde2=tempde1->next;
|
tmpde2=tmpde1->next;
|
||||||
if (tempde1->attr & RS_ATTR_DIR && tempde1->sub)
|
if (tmpde1->attr & RS_ATTR_DIR && tmpde1->sub)
|
||||||
errs+=RedSeaChkDskLst(dv,tempde1->sub,bits,bits2,size,bpc);
|
errs+=RedSeaChkDskLst(dv,tmpde1->sub,bits,bits2,size,bpc);
|
||||||
j=(tempde1->size+bpc-1)/bpc;
|
j=(tmpde1->size+bpc-1)/bpc;
|
||||||
for (i=0;i<j;i++) {
|
for (i=0;i<j;i++) {
|
||||||
if (i+tempde1->cluster-dv->data_area>size) {
|
if (i+tmpde1->cluster-dv->data_area>size) {
|
||||||
PrintErr("Invalid Cluster:%s Cluster:%X\n",tempde1->full_name,
|
PrintErr("Invalid Cluster:%s Cluster:%X\n",tmpde1->full_name,
|
||||||
i+tempde1->cluster);
|
i+tmpde1->cluster);
|
||||||
errs++;
|
errs++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (LBts(bits,i+tempde1->cluster-dv->data_area)) {
|
if (LBts(bits,i+tmpde1->cluster-dv->data_area)) {
|
||||||
PrintErr("Dbl Alloc:%s Cluster:%X\n",tempde1->full_name,
|
PrintErr("Dbl Alloc:%s Cluster:%X\n",tmpde1->full_name,
|
||||||
i+tempde1->cluster);
|
i+tmpde1->cluster);
|
||||||
errs++;
|
errs++;
|
||||||
}
|
}
|
||||||
if (!LBtr(bits2,i+tempde1->cluster-dv->data_area)) {
|
if (!LBtr(bits2,i+tmpde1->cluster-dv->data_area)) {
|
||||||
PrintErr("UnAlloc:%s Cluster:%X\n",tempde1->full_name,
|
PrintErr("UnAlloc:%s Cluster:%X\n",tmpde1->full_name,
|
||||||
i+tempde1->cluster);
|
i+tmpde1->cluster);
|
||||||
errs++;
|
errs++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DirEntryDel(tempde1);
|
DirEntryDel(tmpde1);
|
||||||
tempde1=tempde2;
|
tmpde1=tmpde2;
|
||||||
}
|
}
|
||||||
return errs;
|
return errs;
|
||||||
}
|
}
|
||||||
@@ -103,48 +103,48 @@ I64 RedSeaChkDsk(U8 drv_let,Bool *_fix,Bool *_confirm)
|
|||||||
return errs;
|
return errs;
|
||||||
}
|
}
|
||||||
|
|
||||||
I64 FAT32ChkDskLst(CDrv *dv,CDirEntry *tempde1,
|
I64 FAT32ChkDskLst(CDrv *dv,CDirEntry *tmpde1,
|
||||||
U8 *bits,U32 *bits2,I64 size,I64 bpc)
|
U8 *bits,U32 *bits2,I64 size,I64 bpc)
|
||||||
{
|
{
|
||||||
CDirEntry *tempde2;
|
CDirEntry *tmpde2;
|
||||||
I64 i,c,errs=0;
|
I64 i,c,errs=0;
|
||||||
while (tempde1) {
|
while (tmpde1) {
|
||||||
tempde2=tempde1->next;
|
tmpde2=tmpde1->next;
|
||||||
if (tempde1->attr & RS_ATTR_DIR && tempde1->sub)
|
if (tmpde1->attr & RS_ATTR_DIR && tmpde1->sub)
|
||||||
errs+=FAT32ChkDskLst(dv,tempde1->sub,bits,bits2,size,bpc);
|
errs+=FAT32ChkDskLst(dv,tmpde1->sub,bits,bits2,size,bpc);
|
||||||
i=0;
|
i=0;
|
||||||
c=tempde1->cluster;
|
c=tmpde1->cluster;
|
||||||
while (0<c<0x0FFFFFF8) {
|
while (0<c<0x0FFFFFF8) {
|
||||||
if (c>size) {
|
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++;
|
errs++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (LBts(bits,c)) {
|
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++;
|
errs++;
|
||||||
}
|
}
|
||||||
if (!bits2[c]) {
|
if (!bits2[c]) {
|
||||||
PrintErr("UnAlloc:%s Cluster:%X\n",tempde1->full_name,c);
|
PrintErr("UnAlloc:%s Cluster:%X\n",tmpde1->full_name,c);
|
||||||
errs++;
|
errs++;
|
||||||
} else
|
} else
|
||||||
bits2[c]=0;
|
bits2[c]=0;
|
||||||
c=ClusterNumNext(dv,c);
|
c=ClusterNumNext(dv,c);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
if (!(tempde1->attr & RS_ATTR_DIR)) {
|
if (!(tmpde1->attr & RS_ATTR_DIR)) {
|
||||||
i*=bpc;
|
i*=bpc;
|
||||||
if (tempde1->size>i) {
|
if (tmpde1->size>i) {
|
||||||
PrintErr("Alloced File Too Short:%s\n",tempde1->full_name);
|
PrintErr("Alloced File Too Short:%s\n",tmpde1->full_name);
|
||||||
errs++;
|
errs++;
|
||||||
}
|
}
|
||||||
if (i>tempde1->size+bpc-1) {
|
if (i>tmpde1->size+bpc-1) {
|
||||||
PrintWarn("Alloced File Too Long:%s\n",tempde1->full_name);
|
PrintWarn("Alloced File Too Long:%s\n",tmpde1->full_name);
|
||||||
errs++;
|
errs++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DirEntryDel(tempde1);
|
DirEntryDel(tmpde1);
|
||||||
tempde1=tempde2;
|
tmpde1=tmpde2;
|
||||||
}
|
}
|
||||||
return errs;
|
return errs;
|
||||||
}
|
}
|
||||||
|
|||||||
+196
-196
@@ -1,18 +1,18 @@
|
|||||||
#help_index "DolDoc/Output;StdOut/DolDoc"
|
#help_index "DolDoc/Output;StdOut/DolDoc"
|
||||||
U0 DirFileDoc(CDoc *doc,CDirEntry *tempde)
|
U0 DirFileDoc(CDoc *doc,CDirEntry *tmpde)
|
||||||
{
|
{
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
if (tempde->attr & RS_ATTR_DIR) {
|
if (tmpde->attr & RS_ATTR_DIR) {
|
||||||
tempde->user_data=DocPrint(doc,"$$TR,\"%s\",U=0x%X$$",tempde->name,tempde);
|
tmpde->user_data=DocPrint(doc,"$$TR,\"%s\",U=0x%X$$",tmpde->name,tmpde);
|
||||||
DocPrint(doc,"\n$$ID,+2$$");
|
DocPrint(doc,"\n$$ID,+2$$");
|
||||||
if (tempde->sub)
|
if (tmpde->sub)
|
||||||
DirFileDoc(doc,tempde->sub);
|
DirFileDoc(doc,tmpde->sub);
|
||||||
DocPrint(doc,"$$ID,-2$$");
|
DocPrint(doc,"$$ID,-2$$");
|
||||||
} else {
|
} 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");
|
DocPrint(doc,"\n");
|
||||||
}
|
}
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,16 +31,16 @@ class CFMUncollapsedLst
|
|||||||
CFMUncollapsedLst *FMCollectUncollapsedLst(CDoc *doc)
|
CFMUncollapsedLst *FMCollectUncollapsedLst(CDoc *doc)
|
||||||
{
|
{
|
||||||
CDocEntry *doc_e=doc->head.next;
|
CDocEntry *doc_e=doc->head.next;
|
||||||
CFMUncollapsedLst *res=NULL,*tempc;
|
CFMUncollapsedLst *res=NULL,*tmpc;
|
||||||
CDirEntry *tempde;
|
CDirEntry *tmpde;
|
||||||
while (doc_e!=doc) {
|
while (doc_e!=doc) {
|
||||||
if (doc_e->type_u8==DOCT_TREE) {
|
if (doc_e->type_u8==DOCT_TREE) {
|
||||||
if (!(doc_e->de_flags&DOCEF_CHECKED_COLLAPSED)) {
|
if (!(doc_e->de_flags&DOCEF_CHECKED_COLLAPSED)) {
|
||||||
if (tempde=doc_e->user_data) {
|
if (tmpde=doc_e->user_data) {
|
||||||
tempc=MAlloc(sizeof(CFMUncollapsedLst));
|
tmpc=MAlloc(sizeof(CFMUncollapsedLst));
|
||||||
tempc->next=res;
|
tmpc->next=res;
|
||||||
res=tempc;
|
res=tmpc;
|
||||||
tempc->name=StrNew(tempde->full_name);
|
tmpc->name=StrNew(tmpde->full_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -49,49 +49,49 @@ CFMUncollapsedLst *FMCollectUncollapsedLst(CDoc *doc)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 FMMarkUncollapsed(CDoc *doc,CFMUncollapsedLst *tempc,
|
U0 FMMarkUncollapsed(CDoc *doc,CFMUncollapsedLst *tmpc,
|
||||||
U8 *cur_entry,U8 *next_entry)
|
U8 *cur_entry,U8 *next_entry)
|
||||||
{
|
{
|
||||||
CDocEntry *doc_e=doc->head.next;
|
CDocEntry *doc_e=doc->head.next;
|
||||||
CFMUncollapsedLst *tempc1;
|
CFMUncollapsedLst *tmpc1;
|
||||||
CDirEntry *tempde;
|
CDirEntry *tmpde;
|
||||||
while (doc_e!=doc) {
|
while (doc_e!=doc) {
|
||||||
if (doc_e->type_u8==DOCT_TREE) {
|
if (doc_e->type_u8==DOCT_TREE) {
|
||||||
tempde=doc_e->user_data;
|
tmpde=doc_e->user_data;
|
||||||
tempc1=tempc;
|
tmpc1=tmpc;
|
||||||
while (tempc1) {
|
while (tmpc1) {
|
||||||
if (!StrCmp(tempc1->name,tempde->full_name)) {
|
if (!StrCmp(tmpc1->name,tmpde->full_name)) {
|
||||||
doc_e->de_flags&=~DOCEF_CHECKED_COLLAPSED;
|
doc_e->de_flags&=~DOCEF_CHECKED_COLLAPSED;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
tempc1=tempc1->next;
|
tmpc1=tmpc1->next;
|
||||||
}
|
}
|
||||||
if (cur_entry) {
|
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;
|
doc->cur_entry=doc_e;
|
||||||
if (StrLen(tempde->full_name)==StrLen(cur_entry))
|
if (StrLen(tmpde->full_name)==StrLen(cur_entry))
|
||||||
cur_entry=NULL;
|
cur_entry=NULL;
|
||||||
} else if (next_entry) {
|
} else if (next_entry) {
|
||||||
if (!StrNCmp(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;
|
doc->cur_entry=doc_e;
|
||||||
if (StrLen(tempde->full_name)==StrLen(next_entry))
|
if (StrLen(tmpde->full_name)==StrLen(next_entry))
|
||||||
cur_entry=NULL;
|
cur_entry=NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (doc_e->type_u8==DOCT_MENU_VAL) {
|
} else if (doc_e->type_u8==DOCT_MENU_VAL) {
|
||||||
tempde=doc_e->user_data;
|
tmpde=doc_e->user_data;
|
||||||
if (cur_entry) {
|
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;
|
doc->cur_entry=doc_e;
|
||||||
if (StrLen(tempde->full_name)==StrLen(cur_entry))
|
if (StrLen(tmpde->full_name)==StrLen(cur_entry))
|
||||||
cur_entry=NULL;
|
cur_entry=NULL;
|
||||||
} else if (next_entry) {
|
} else if (next_entry) {
|
||||||
if (!StrNCmp(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;
|
doc->cur_entry=doc_e;
|
||||||
if (StrLen(tempde->full_name)==StrLen(next_entry))
|
if (StrLen(tmpde->full_name)==StrLen(next_entry))
|
||||||
cur_entry=NULL;
|
cur_entry=NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -101,44 +101,44 @@ U0 FMMarkUncollapsed(CDoc *doc,CFMUncollapsedLst *tempc,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 FMDelUncollapsedLst(CFMUncollapsedLst *tempc)
|
U0 FMDelUncollapsedLst(CFMUncollapsedLst *tmpc)
|
||||||
{
|
{
|
||||||
CFMUncollapsedLst *tempc1;
|
CFMUncollapsedLst *tmpc1;
|
||||||
while (tempc) {
|
while (tmpc) {
|
||||||
tempc1=tempc->next;
|
tmpc1=tmpc->next;
|
||||||
Free(tempc->name);
|
Free(tmpc->name);
|
||||||
Free(tempc);
|
Free(tmpc);
|
||||||
tempc=tempc1;
|
tmpc=tmpc1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CDirEntry *FMRebuildDocDrv(U8 drv_let,CDoc *doc,CDirEntry **_head,Bool init)
|
CDirEntry *FMRebuildDocDrv(U8 drv_let,CDoc *doc,CDirEntry **_head,Bool init)
|
||||||
{
|
{
|
||||||
CDirEntry *tempde,*tempde1;
|
CDirEntry *tmpde,*tmpde1;
|
||||||
U8 *st;
|
U8 *st;
|
||||||
tempde=CAlloc(sizeof(CDirEntry));
|
tmpde=CAlloc(sizeof(CDirEntry));
|
||||||
tempde->full_name=MStrPrint("%C:/",drv_let);
|
tmpde->full_name=MStrPrint("%C:/",drv_let);
|
||||||
tempde->attr=RS_ATTR_DIR;
|
tmpde->attr=RS_ATTR_DIR;
|
||||||
st=MStrPrint("%c:/*",drv_let);
|
st=MStrPrint("%c:/*",drv_let);
|
||||||
if (init)
|
if (init)
|
||||||
tempde->sub=tempde1=FilesFind(st,FUF_RECURSE);
|
tmpde->sub=tmpde1=FilesFind(st,FUF_RECURSE);
|
||||||
else
|
else
|
||||||
tempde1=NULL;
|
tmpde1=NULL;
|
||||||
Free(st);
|
Free(st);
|
||||||
tempde->user_data=DocPrint(doc,"$$TR,\"%s\",U=0x%X$$",tempde->full_name,tempde);
|
tmpde->user_data=DocPrint(doc,"$$TR,\"%s\",U=0x%X$$",tmpde->full_name,tmpde);
|
||||||
tempde->next=*_head;
|
tmpde->next=*_head;
|
||||||
*_head=tempde;
|
*_head=tmpde;
|
||||||
DocPrint(doc,"\n$$ID,+2$$");
|
DocPrint(doc,"\n$$ID,+2$$");
|
||||||
DocBottom(doc);
|
DocBottom(doc);
|
||||||
if (init) {
|
if (init) {
|
||||||
DirFileDoc(doc,tempde1);
|
DirFileDoc(doc,tmpde1);
|
||||||
while (tempde1) {
|
while (tmpde1) {
|
||||||
tempde1->parent=tempde;
|
tmpde1->parent=tmpde;
|
||||||
tempde1=tempde1->next;
|
tmpde1=tmpde1->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DocPrint(doc,"$$ID,-2$$");
|
DocPrint(doc,"$$ID,-2$$");
|
||||||
return tempde;
|
return tmpde;
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 FMRebuildDoc(CDoc **_doc,CDirEntry **_head,I64 mode)
|
U0 FMRebuildDoc(CDoc **_doc,CDirEntry **_head,I64 mode)
|
||||||
@@ -146,17 +146,17 @@ U0 FMRebuildDoc(CDoc **_doc,CDirEntry **_head,I64 mode)
|
|||||||
CDrv *dv;
|
CDrv *dv;
|
||||||
I64 i;
|
I64 i;
|
||||||
CDoc *doc=*_doc,*doc2=sys_clipboard_doc,*parent_doc;
|
CDoc *doc=*_doc,*doc2=sys_clipboard_doc,*parent_doc;
|
||||||
CFMUncollapsedLst *tempc=NULL;
|
CFMUncollapsedLst *tmpc=NULL;
|
||||||
U8 *cur_entry=NULL,*next_entry=NULL;
|
U8 *cur_entry=NULL,*next_entry=NULL;
|
||||||
CDocEntry *doc_ce;
|
CDocEntry *doc_ce;
|
||||||
CDirEntry *tempde,*tempde1,*cur_tree_entry;
|
CDirEntry *tmpde,*tmpde1,*cur_tree_entry;
|
||||||
if (!doc)
|
if (!doc)
|
||||||
parent_doc=DocPut;
|
parent_doc=DocPut;
|
||||||
else {
|
else {
|
||||||
parent_doc=doc->parent_doc;
|
parent_doc=doc->parent_doc;
|
||||||
Fs->put_doc=Fs->display_doc=NULL;
|
Fs->put_doc=Fs->display_doc=NULL;
|
||||||
DocUnlock(doc);
|
DocUnlock(doc);
|
||||||
WinMgrSync;
|
Refresh;
|
||||||
DocLock(doc);
|
DocLock(doc);
|
||||||
cur_tree_entry=NULL;
|
cur_tree_entry=NULL;
|
||||||
doc_ce=doc->cur_entry;
|
doc_ce=doc->cur_entry;
|
||||||
@@ -164,32 +164,32 @@ U0 FMRebuildDoc(CDoc **_doc,CDirEntry **_head,I64 mode)
|
|||||||
cur_tree_entry=doc_ce->user_data;
|
cur_tree_entry=doc_ce->user_data;
|
||||||
if (cur_tree_entry)
|
if (cur_tree_entry)
|
||||||
cur_entry=StrNew(cur_tree_entry->full_name);
|
cur_entry=StrNew(cur_tree_entry->full_name);
|
||||||
tempde=NULL;
|
tmpde=NULL;
|
||||||
if (doc_ce!=doc)
|
if (doc_ce!=doc)
|
||||||
doc_ce=doc_ce->next;
|
doc_ce=doc_ce->next;
|
||||||
while (doc_ce!=doc) {
|
while (doc_ce!=doc) {
|
||||||
if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL)
|
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
|
else
|
||||||
tempde=NULL;
|
tmpde=NULL;
|
||||||
if (tempde) {
|
if (tmpde) {
|
||||||
tempde1=tempde->parent;
|
tmpde1=tmpde->parent;
|
||||||
while (tempde1) {
|
while (tmpde1) {
|
||||||
if (tempde1==cur_tree_entry) {
|
if (tmpde1==cur_tree_entry) {
|
||||||
tempde=NULL;
|
tmpde=NULL;
|
||||||
break;
|
break;
|
||||||
} else
|
} else
|
||||||
tempde1=tempde1->parent;
|
tmpde1=tmpde1->parent;
|
||||||
}
|
}
|
||||||
if (tempde)
|
if (tmpde)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
doc_ce=doc_ce->next;
|
doc_ce=doc_ce->next;
|
||||||
}
|
}
|
||||||
if (tempde)
|
if (tmpde)
|
||||||
next_entry=StrNew(tempde->full_name);
|
next_entry=StrNew(tmpde->full_name);
|
||||||
|
|
||||||
tempc=FMCollectUncollapsedLst(doc);
|
tmpc=FMCollectUncollapsedLst(doc);
|
||||||
DocDel(doc);
|
DocDel(doc);
|
||||||
}
|
}
|
||||||
if (*_head) {
|
if (*_head) {
|
||||||
@@ -219,19 +219,19 @@ U0 FMRebuildDoc(CDoc **_doc,CDirEntry **_head,I64 mode)
|
|||||||
dv=&blkdev.drvs[i];
|
dv=&blkdev.drvs[i];
|
||||||
if (dv->bd->type==BDT_ATAPI) {
|
if (dv->bd->type==BDT_ATAPI) {
|
||||||
if (dv->bd->flags&BDF_INITIALIZED)
|
if (dv->bd->flags&BDF_INITIALIZED)
|
||||||
tempde=FMRebuildDocDrv(Drv2Let(dv),doc,_head,TRUE);
|
tmpde=FMRebuildDocDrv(Drv2Let(dv),doc,_head,TRUE);
|
||||||
else {
|
else {
|
||||||
tempde=FMRebuildDocDrv(Drv2Let(dv),doc,_head,FALSE);
|
tmpde=FMRebuildDocDrv(Drv2Let(dv),doc,_head,FALSE);
|
||||||
tempde->flags|=DEF_NOT_INITIALIZED;
|
tmpde->flags|=DEF_NOT_INITIALIZED;
|
||||||
}
|
}
|
||||||
} else if (dv->fs_type==FSt_REDSEA || dv->fs_type==FSt_FAT32)
|
} else if (dv->fs_type==FSt_REDSEA || dv->fs_type==FSt_FAT32)
|
||||||
FMRebuildDocDrv(Drv2Let(dv),doc,_head,TRUE);
|
FMRebuildDocDrv(Drv2Let(dv),doc,_head,TRUE);
|
||||||
}
|
}
|
||||||
DocTop(doc);
|
DocTop(doc);
|
||||||
FMMarkUncollapsed(doc,tempc,cur_entry,next_entry);
|
FMMarkUncollapsed(doc,tmpc,cur_entry,next_entry);
|
||||||
DocCenter(doc);
|
DocCenter(doc);
|
||||||
DocRst(doc2,TRUE);
|
DocRst(doc2,TRUE);
|
||||||
FMDelUncollapsedLst(tempc);
|
FMDelUncollapsedLst(tmpc);
|
||||||
Free(cur_entry);
|
Free(cur_entry);
|
||||||
Free(next_entry);
|
Free(next_entry);
|
||||||
*_doc=doc;
|
*_doc=doc;
|
||||||
@@ -243,28 +243,28 @@ U0 FMRename(CDoc *doc)
|
|||||||
{
|
{
|
||||||
CEdFileName fn;
|
CEdFileName fn;
|
||||||
CDocEntry *doc_e=doc->cur_entry;
|
CDocEntry *doc_e=doc->cur_entry;
|
||||||
CDirEntry *tempde=NULL,*parent;
|
CDirEntry *tmpde=NULL,*parent;
|
||||||
if (doc_e->type_u8==DOCT_MENU_VAL) {
|
if (doc_e->type_u8==DOCT_MENU_VAL) {
|
||||||
tempde=doc_e->user_data;
|
tmpde=doc_e->user_data;
|
||||||
if (parent=tempde->parent) {
|
if (parent=tmpde->parent) {
|
||||||
Cd(parent->full_name);
|
Cd(parent->full_name);
|
||||||
StrCpy(fn.name,tempde->name);
|
StrCpy(fn.name,tmpde->name);
|
||||||
if (DocForm(&fn)) {
|
if (DocForm(&fn)) {
|
||||||
Silent;
|
Silent;
|
||||||
Move(tempde->name,fn.name);
|
Move(tmpde->name,fn.name);
|
||||||
Silent(OFF);
|
Silent(OFF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (doc_e->type_u8==DOCT_TREE) {
|
} else if (doc_e->type_u8==DOCT_TREE) {
|
||||||
tempde=doc_e->user_data;
|
tmpde=doc_e->user_data;
|
||||||
if (parent=tempde->parent) {
|
if (parent=tmpde->parent) {
|
||||||
Cd(parent->full_name);
|
Cd(parent->full_name);
|
||||||
StrCpy(fn.name,tempde->name);
|
StrCpy(fn.name,tmpde->name);
|
||||||
if (DocForm(&fn)) {
|
if (DocForm(&fn)) {
|
||||||
if (StrCmp(tempde->name,fn.name)) {
|
if (StrCmp(tmpde->name,fn.name)) {
|
||||||
Silent;
|
Silent;
|
||||||
if (CopyTree(tempde->name,fn.name))
|
if (CopyTree(tmpde->name,fn.name))
|
||||||
DelTree(tempde->name);
|
DelTree(tmpde->name);
|
||||||
Silent(OFF);
|
Silent(OFF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -276,11 +276,11 @@ U0 FMMkDir(CDoc *doc)
|
|||||||
{
|
{
|
||||||
CEdFileName fn;
|
CEdFileName fn;
|
||||||
CDocEntry *doc_e=doc->cur_entry;
|
CDocEntry *doc_e=doc->cur_entry;
|
||||||
CDirEntry *tempde=NULL,*parent;
|
CDirEntry *tmpde=NULL,*parent;
|
||||||
*fn.name=0;
|
*fn.name=0;
|
||||||
if (doc_e->type_u8==DOCT_MENU_VAL) {
|
if (doc_e->type_u8==DOCT_MENU_VAL) {
|
||||||
tempde=doc_e->user_data;
|
tmpde=doc_e->user_data;
|
||||||
if (parent=tempde->parent) {
|
if (parent=tmpde->parent) {
|
||||||
Cd(parent->full_name);
|
Cd(parent->full_name);
|
||||||
if (DocForm(&fn)) {
|
if (DocForm(&fn)) {
|
||||||
Silent;
|
Silent;
|
||||||
@@ -289,8 +289,8 @@ U0 FMMkDir(CDoc *doc)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (doc_e->type_u8==DOCT_TREE) {
|
} else if (doc_e->type_u8==DOCT_TREE) {
|
||||||
tempde=doc_e->user_data;
|
tmpde=doc_e->user_data;
|
||||||
Cd(tempde->full_name);
|
Cd(tmpde->full_name);
|
||||||
if (DocForm(&fn)) {
|
if (DocForm(&fn)) {
|
||||||
Silent;
|
Silent;
|
||||||
MkDir(fn.name);
|
MkDir(fn.name);
|
||||||
@@ -303,21 +303,21 @@ U0 FMDelete(CDoc *doc)
|
|||||||
{
|
{
|
||||||
U8 *st;
|
U8 *st;
|
||||||
CDocEntry *doc_ce=doc->cur_entry;
|
CDocEntry *doc_ce=doc->cur_entry;
|
||||||
CDirEntry *tempde;
|
CDirEntry *tmpde;
|
||||||
if (doc_ce->type_u8==DOCT_MENU_VAL) {
|
if (doc_ce->type_u8==DOCT_MENU_VAL) {
|
||||||
tempde=doc_ce->user_data;
|
tmpde=doc_ce->user_data;
|
||||||
Silent;
|
Silent;
|
||||||
st=MStrPrint("Delete: %s",tempde->full_name);
|
st=MStrPrint("Delete: %s",tmpde->full_name);
|
||||||
if (PopUpCancelOk(st))
|
if (PopUpCancelOk(st))
|
||||||
Del(tempde->full_name);
|
Del(tmpde->full_name);
|
||||||
Free(st);
|
Free(st);
|
||||||
Silent(OFF);
|
Silent(OFF);
|
||||||
} else if (doc_ce->type_u8==DOCT_TREE) {
|
} else if (doc_ce->type_u8==DOCT_TREE) {
|
||||||
tempde=doc_ce->user_data;
|
tmpde=doc_ce->user_data;
|
||||||
Silent;
|
Silent;
|
||||||
st=MStrPrint("Delete: %s",tempde->full_name);
|
st=MStrPrint("Delete: %s",tmpde->full_name);
|
||||||
if (PopUpCancelOk(st))
|
if (PopUpCancelOk(st))
|
||||||
DelTree(tempde->full_name);
|
DelTree(tmpde->full_name);
|
||||||
Free(st);
|
Free(st);
|
||||||
Silent(OFF);
|
Silent(OFF);
|
||||||
}
|
}
|
||||||
@@ -326,16 +326,16 @@ U0 FMDelete(CDoc *doc)
|
|||||||
U0 FMChgDsk(CDoc *doc)
|
U0 FMChgDsk(CDoc *doc)
|
||||||
{
|
{
|
||||||
CDocEntry *doc_ce=doc->cur_entry;
|
CDocEntry *doc_ce=doc->cur_entry;
|
||||||
CDirEntry *tempde;
|
CDirEntry *tmpde;
|
||||||
if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL)
|
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
|
else
|
||||||
tempde=NULL;
|
tmpde=NULL;
|
||||||
if (tempde) {
|
if (tmpde) {
|
||||||
while (tempde->parent)
|
while (tmpde->parent)
|
||||||
tempde=tempde->parent;
|
tmpde=tmpde->parent;
|
||||||
Silent;
|
Silent;
|
||||||
ChgDsk(*tempde->full_name);
|
ChgDsk(*tmpde->full_name);
|
||||||
Silent(OFF);
|
Silent(OFF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -343,24 +343,24 @@ U0 FMChgDsk(CDoc *doc)
|
|||||||
U0 FMMountISO(CDoc *doc)
|
U0 FMMountISO(CDoc *doc)
|
||||||
{
|
{
|
||||||
CDocEntry *doc_ce=doc->cur_entry;
|
CDocEntry *doc_ce=doc->cur_entry;
|
||||||
CDirEntry *tempde;
|
CDirEntry *tmpde;
|
||||||
if (doc_ce->type_u8==DOCT_MENU_VAL && (tempde=doc_ce->user_data))
|
if (doc_ce->type_u8==DOCT_MENU_VAL && (tmpde=doc_ce->user_data))
|
||||||
MountFile(tempde->full_name);
|
MountFile(tmpde->full_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 FMUnmount(CDoc *doc)
|
U0 FMUnmount(CDoc *doc)
|
||||||
{
|
{
|
||||||
CDocEntry *doc_ce=doc->cur_entry;
|
CDocEntry *doc_ce=doc->cur_entry;
|
||||||
CDirEntry *tempde;
|
CDirEntry *tmpde;
|
||||||
I64 drv_let;
|
I64 drv_let;
|
||||||
if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL)
|
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
|
else
|
||||||
tempde=NULL;
|
tmpde=NULL;
|
||||||
if (tempde) {
|
if (tmpde) {
|
||||||
while (tempde->parent)
|
while (tmpde->parent)
|
||||||
tempde=tempde->parent;
|
tmpde=tmpde->parent;
|
||||||
drv_let=*tempde->full_name;
|
drv_let=*tmpde->full_name;
|
||||||
if (Let2BlkDev(drv_let)!=Let2BlkDev(':'))
|
if (Let2BlkDev(drv_let)!=Let2BlkDev(':'))
|
||||||
Unmount(drv_let);
|
Unmount(drv_let);
|
||||||
}
|
}
|
||||||
@@ -369,19 +369,19 @@ U0 FMUnmount(CDoc *doc)
|
|||||||
U0 FMFmtDrv(CDoc *doc)
|
U0 FMFmtDrv(CDoc *doc)
|
||||||
{
|
{
|
||||||
CDocEntry *doc_ce=doc->cur_entry;
|
CDocEntry *doc_ce=doc->cur_entry;
|
||||||
CDirEntry *tempde;
|
CDirEntry *tmpde;
|
||||||
U8 *st=NULL;
|
U8 *st=NULL;
|
||||||
if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL)
|
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
|
else
|
||||||
tempde=NULL;
|
tmpde=NULL;
|
||||||
if (tempde) {
|
if (tmpde) {
|
||||||
while (tempde->parent)
|
while (tmpde->parent)
|
||||||
tempde=tempde->parent;
|
tmpde=tmpde->parent;
|
||||||
st=MStrPrint("Format Drive '%c'?\nAre You Sure?\n",*tempde->full_name);
|
st=MStrPrint("Format Drive '%c'?\nAre You Sure?\n",*tmpde->full_name);
|
||||||
if (PopUpCancelOk(st)) {
|
if (PopUpCancelOk(st)) {
|
||||||
Silent;
|
Silent;
|
||||||
Fmt(*tempde->full_name,,FALSE);
|
Fmt(*tmpde->full_name,,FALSE);
|
||||||
Silent(OFF);
|
Silent(OFF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -391,21 +391,21 @@ U0 FMFmtDrv(CDoc *doc)
|
|||||||
U0 FMMakeISO(CDoc *doc)
|
U0 FMMakeISO(CDoc *doc)
|
||||||
{
|
{
|
||||||
CDocEntry *doc_ce=doc->cur_entry;
|
CDocEntry *doc_ce=doc->cur_entry;
|
||||||
CDirEntry *tempde;
|
CDirEntry *tmpde;
|
||||||
U8 *st;
|
U8 *st;
|
||||||
if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL)
|
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
|
else
|
||||||
tempde=NULL;
|
tmpde=NULL;
|
||||||
if (tempde) {
|
if (tmpde) {
|
||||||
if (doc_ce->type_u8==DOCT_MENU_VAL)
|
if (doc_ce->type_u8==DOCT_MENU_VAL)
|
||||||
tempde=tempde->parent;
|
tmpde=tmpde->parent;
|
||||||
if (tempde && *tempde->full_name) {
|
if (tmpde && *tmpde->full_name) {
|
||||||
Silent;
|
Silent;
|
||||||
if (tempde->full_name[StrLen(tempde->full_name)-1]=='/')
|
if (tmpde->full_name[StrLen(tmpde->full_name)-1]=='/')
|
||||||
st=MStrPrint("%s*",tempde->full_name);
|
st=MStrPrint("%s*",tmpde->full_name);
|
||||||
else
|
else
|
||||||
st=MStrPrint("%s/*",tempde->full_name);
|
st=MStrPrint("%s/*",tmpde->full_name);
|
||||||
ISO9660ISO(,st);
|
ISO9660ISO(,st);
|
||||||
Free(st);
|
Free(st);
|
||||||
Silent(OFF);
|
Silent(OFF);
|
||||||
@@ -416,16 +416,16 @@ U0 FMMakeISO(CDoc *doc)
|
|||||||
U0 FMBurnISO(CDoc *doc)
|
U0 FMBurnISO(CDoc *doc)
|
||||||
{
|
{
|
||||||
CDocEntry *doc_ce=doc->cur_entry;
|
CDocEntry *doc_ce=doc->cur_entry;
|
||||||
CDirEntry *tempde;
|
CDirEntry *tmpde;
|
||||||
if (doc_ce->type_u8==DOCT_TREE || doc_ce->type_u8==DOCT_MENU_VAL)
|
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
|
else
|
||||||
tempde=NULL;
|
tmpde=NULL;
|
||||||
if (tempde) {
|
if (tmpde) {
|
||||||
while (tempde->parent)
|
while (tmpde->parent)
|
||||||
tempde=tempde->parent;
|
tmpde=tmpde->parent;
|
||||||
Silent;
|
Silent;
|
||||||
DVDImageWrite(*tempde->full_name);
|
DVDImageWrite(*tmpde->full_name);
|
||||||
Silent(OFF);
|
Silent(OFF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -435,37 +435,37 @@ U0 FMCopy(CDoc *doc)
|
|||||||
CDoc *doc2=sys_clipboard_doc;
|
CDoc *doc2=sys_clipboard_doc;
|
||||||
U8 *st;
|
U8 *st;
|
||||||
CDocEntry *doc_ce=doc->cur_entry,*doc_e;
|
CDocEntry *doc_ce=doc->cur_entry,*doc_e;
|
||||||
CDirEntry *tempde,*tempde1=NULL,*tempde2;
|
CDirEntry *tmpde,*tmpde1=NULL,*tmpde2;
|
||||||
Bool unlock_doc2=DocLock(doc2);
|
Bool unlock_doc2=DocLock(doc2);
|
||||||
doc_e=doc2->head.next;
|
doc_e=doc2->head.next;
|
||||||
|
|
||||||
tempde1=doc_ce->user_data;
|
tmpde1=doc_ce->user_data;
|
||||||
if (doc_ce->type_u8==DOCT_MENU_VAL)
|
if (doc_ce->type_u8==DOCT_MENU_VAL)
|
||||||
tempde1=tempde1->parent;
|
tmpde1=tmpde1->parent;
|
||||||
else if (doc_ce->type_u8!=DOCT_TREE)
|
else if (doc_ce->type_u8!=DOCT_TREE)
|
||||||
tempde1=NULL;
|
tmpde1=NULL;
|
||||||
if (tempde1) {
|
if (tmpde1) {
|
||||||
while (doc_e!=doc2) {
|
while (doc_e!=doc2) {
|
||||||
if (doc_e->type_u8==DOCT_MENU_VAL) {
|
if (doc_e->type_u8==DOCT_MENU_VAL) {
|
||||||
tempde=doc_e->user_data;
|
tmpde=doc_e->user_data;
|
||||||
tempde->flags|=DEF_PROCESSED;
|
tmpde->flags|=DEF_PROCESSED;
|
||||||
tempde2=tempde->parent;
|
tmpde2=tmpde->parent;
|
||||||
if (!tempde2 || !(tempde2->flags&DEF_PROCESSED)) {
|
if (!tmpde2 || !(tmpde2->flags&DEF_PROCESSED)) {
|
||||||
Silent;
|
Silent;
|
||||||
Copy(tempde->full_name,tempde1->full_name);
|
Copy(tmpde->full_name,tmpde1->full_name);
|
||||||
Silent(OFF);
|
Silent(OFF);
|
||||||
}
|
}
|
||||||
} else if (doc_e->type_u8==DOCT_TREE) {
|
} else if (doc_e->type_u8==DOCT_TREE) {
|
||||||
tempde=doc_e->user_data;
|
tmpde=doc_e->user_data;
|
||||||
tempde->flags|=DEF_PROCESSED;
|
tmpde->flags|=DEF_PROCESSED;
|
||||||
tempde2=tempde->parent;
|
tmpde2=tmpde->parent;
|
||||||
if (!tempde2 || !(tempde2->flags&DEF_PROCESSED)) {
|
if (!tmpde2 || !(tmpde2->flags&DEF_PROCESSED)) {
|
||||||
Silent;
|
Silent;
|
||||||
if (*tempde1->name)
|
if (*tmpde1->name)
|
||||||
st=MStrPrint("%s/%s",tempde1->full_name,tempde->name);
|
st=MStrPrint("%s/%s",tmpde1->full_name,tmpde->name);
|
||||||
else
|
else
|
||||||
st=MStrPrint("%s%s",tempde1->full_name,tempde->name);
|
st=MStrPrint("%s%s",tmpde1->full_name,tmpde->name);
|
||||||
CopyTree(tempde->full_name,st);
|
CopyTree(tmpde->full_name,st);
|
||||||
Free(st);
|
Free(st);
|
||||||
Silent(OFF);
|
Silent(OFF);
|
||||||
}
|
}
|
||||||
@@ -567,20 +567,20 @@ U0 FMRightClick()
|
|||||||
}
|
}
|
||||||
|
|
||||||
U8 *fm_ip_str=NULL;
|
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) {
|
if (fm_ip_str) {
|
||||||
dc->color=LTRED;
|
dc->color=LTRED;
|
||||||
GrPrint(dc,ip.pos.x,ip.pos.y,"%s",fm_ip_str);
|
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)
|
public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
|
||||||
{//File manager. Also, used to choose files and dirs.
|
{//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;
|
I64 sc,ch,a1,a2,msg_code;
|
||||||
CDoc *doc=NULL,*old_put_doc=DocPut,*old_display_doc=DocDisplay;
|
CDoc *doc=NULL,*old_put_doc=DocPut,*old_display_doc=DocDisplay;
|
||||||
U8 *res=NULL,*st,*st2,*old_cur_dir=CurDir;
|
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;
|
Bool okay;
|
||||||
|
|
||||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
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");
|
MenuFilePush("::/Doc/FileMgrPullDown.DD");
|
||||||
FMRebuildDoc(&doc,&head,mode);
|
FMRebuildDoc(&doc,&head,mode);
|
||||||
if (tempde1=Cd2DirEntry(head,old_cur_dir))
|
if (tmpde1=Cd2DirEntry(head,old_cur_dir))
|
||||||
doc->cur_entry=tempde1->user_data;
|
doc->cur_entry=tmpde1->user_data;
|
||||||
while (tempde1) {
|
while (tmpde1) {
|
||||||
if (tempde1->attr&RS_ATTR_DIR)
|
if (tmpde1->attr&RS_ATTR_DIR)
|
||||||
tempde1->user_data(CDocEntry *)->de_flags&=~DOCEF_CHECKED_COLLAPSED;
|
tmpde1->user_data(CDocEntry *)->de_flags&=~DOCEF_CHECKED_COLLAPSED;
|
||||||
tempde1=tempde1->parent;
|
tmpde1=tmpde1->parent;
|
||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
DocUnlock(doc);
|
DocUnlock(doc);
|
||||||
@@ -613,51 +613,51 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
|
|||||||
case MSG_IP_L_DOWN:
|
case MSG_IP_L_DOWN:
|
||||||
doc_ce=doc->cur_entry;
|
doc_ce=doc->cur_entry;
|
||||||
fm_ip_str=doc_ce->tag;
|
fm_ip_str=doc_ce->tag;
|
||||||
gr.fp_final_screen_update=&FMFinalScreenUpdate;
|
gr.fp_final_scrn_update=&FMFinalScrnUpdate;
|
||||||
break;
|
break;
|
||||||
case MSG_IP_L_UP:
|
case MSG_IP_L_UP:
|
||||||
if (doc_ce) {
|
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,
|
if (WinCursorPosSet(Fs,a1+Fs->pix_left+Fs->scroll_x,
|
||||||
a2+Fs->pix_top+Fs->scroll_y,TRUE)) {
|
a2+Fs->pix_top+Fs->scroll_y,TRUE)) {
|
||||||
doc_e=doc->cur_entry;
|
doc_e=doc->cur_entry;
|
||||||
if (doc_e!=doc_ce) {
|
if (doc_e!=doc_ce) {
|
||||||
st2=NULL;
|
st2=NULL;
|
||||||
if (doc_e->type_u8==DOCT_MENU_VAL) {
|
if (doc_e->type_u8==DOCT_MENU_VAL) {
|
||||||
tempde1=doc_e->user_data;
|
tmpde1=doc_e->user_data;
|
||||||
if (tempde1=tempde1->parent)
|
if (tmpde1=tmpde1->parent)
|
||||||
st2=StrNew(tempde1->full_name);
|
st2=StrNew(tmpde1->full_name);
|
||||||
} else if (doc_e->type_u8==DOCT_TREE) {
|
} else if (doc_e->type_u8==DOCT_TREE) {
|
||||||
tempde1=doc_e->user_data;
|
tmpde1=doc_e->user_data;
|
||||||
st2=StrNew(tempde1->full_name);
|
st2=StrNew(tmpde1->full_name);
|
||||||
}
|
}
|
||||||
if (st2 && doc_ce->type_u8==DOCT_MENU_VAL) {
|
if (st2 && doc_ce->type_u8==DOCT_MENU_VAL) {
|
||||||
tempde=doc_ce->user_data;
|
tmpde=doc_ce->user_data;
|
||||||
Silent;
|
Silent;
|
||||||
Move(tempde->full_name,st2);
|
Move(tmpde->full_name,st2);
|
||||||
Silent(OFF);
|
Silent(OFF);
|
||||||
FMRebuildDoc(&doc,&head,mode);
|
FMRebuildDoc(&doc,&head,mode);
|
||||||
} else if (st2 && doc_ce->type_u8==DOCT_TREE) {
|
} else if (st2 && doc_ce->type_u8==DOCT_TREE) {
|
||||||
tempde=doc_ce->user_data;
|
tmpde=doc_ce->user_data;
|
||||||
okay=TRUE;
|
okay=TRUE;
|
||||||
tempde2=tempde1;
|
tmpde2=tmpde1;
|
||||||
while (tempde2) {
|
while (tmpde2) {
|
||||||
if (tempde2!=tempde)
|
if (tmpde2!=tmpde)
|
||||||
tempde2=tempde2->parent;
|
tmpde2=tmpde2->parent;
|
||||||
else {
|
else {
|
||||||
okay=FALSE;
|
okay=FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (okay) {
|
if (okay) {
|
||||||
if (*tempde1->name)
|
if (*tmpde1->name)
|
||||||
st=MStrPrint("%s/%s",tempde1->full_name,tempde->name);
|
st=MStrPrint("%s/%s",tmpde1->full_name,tmpde->name);
|
||||||
else
|
else
|
||||||
st=MStrPrint("%s%s",tempde1->full_name,tempde->name);
|
st=MStrPrint("%s%s",tmpde1->full_name,tmpde->name);
|
||||||
if (StrCmp(tempde->full_name,st)) {
|
if (StrCmp(tmpde->full_name,st)) {
|
||||||
Silent;
|
Silent;
|
||||||
CopyTree(tempde->full_name,st);
|
CopyTree(tmpde->full_name,st);
|
||||||
DelTree(tempde->full_name);
|
DelTree(tmpde->full_name);
|
||||||
Silent(OFF);
|
Silent(OFF);
|
||||||
FMRebuildDoc(&doc,&head,mode);
|
FMRebuildDoc(&doc,&head,mode);
|
||||||
}
|
}
|
||||||
@@ -743,15 +743,15 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
|
|||||||
break;
|
break;
|
||||||
case CH_ESC:
|
case CH_ESC:
|
||||||
doc_ce=doc->cur_entry;
|
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)
|
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) {
|
else if (mode==FM_PICK_DIR) {
|
||||||
if (doc_ce->type_u8==DOCT_TREE)
|
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 &&
|
else if (doc_ce->type_u8==DOCT_MENU_VAL &&
|
||||||
(tempde=tempde->parent))
|
(tmpde=tmpde->parent))
|
||||||
res=StrNew(tempde->full_name,mem_task);
|
res=StrNew(tmpde->full_name,mem_task);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -760,12 +760,12 @@ public U8 *FileMgr(I64 mode=FM_NORMAL,CTask *mem_task=NULL)
|
|||||||
FMRebuildDoc(&doc,&head,mode);
|
FMRebuildDoc(&doc,&head,mode);
|
||||||
} else if (sc.u8[0]==SC_F5) {
|
} else if (sc.u8[0]==SC_F5) {
|
||||||
if (doc->cur_entry->type_u8==DOCT_MENU_VAL) {
|
if (doc->cur_entry->type_u8==DOCT_MENU_VAL) {
|
||||||
tempde=doc->cur_entry->user_data;
|
tmpde=doc->cur_entry->user_data;
|
||||||
DocUnlock(doc);
|
DocUnlock(doc);
|
||||||
if (sc&SCF_SHIFT)
|
if (sc&SCF_SHIFT)
|
||||||
AdamFile(tempde->full_name);
|
AdamFile(tmpde->full_name);
|
||||||
else
|
else
|
||||||
PopUpFile(tempde->full_name);
|
PopUpFile(tmpde->full_name);
|
||||||
DocLock(doc);
|
DocLock(doc);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -778,7 +778,7 @@ fm_regular_key:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while (ch!=CH_ESC && ch!=CH_SHIFT_ESC);
|
} 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->put_doc =old_put_doc;
|
||||||
Fs->display_doc=old_display_doc;
|
Fs->display_doc=old_display_doc;
|
||||||
SettingsPop;
|
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;
|
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],
|
U8 blks_buf[STR_LEN],addr_buf[STR_LEN],base0_buf[STR_LEN],base1_buf[STR_LEN],
|
||||||
*filename=NULL,*filename2=NULL;
|
*filename=NULL,*filename2=NULL;
|
||||||
CATARep *head=NULL,*tempha;
|
CATARep *head=NULL,*tmpha;
|
||||||
Bool one_drv,make_free;
|
Bool one_drv,make_free;
|
||||||
CDoc *doc;
|
CDoc *doc;
|
||||||
boot_drv_let=ToUpper(boot_drv_let);
|
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);
|
GetS(base0_buf,STR_LEN);
|
||||||
} while (!Str2I64(base0_buf) && (type!=BDT_ATAPI || !boot_drv_let));
|
} while (!Str2I64(base0_buf) && (type!=BDT_ATAPI || !boot_drv_let));
|
||||||
if (1<=Str2I64(base0_buf)<=num_hints) {
|
if (1<=Str2I64(base0_buf)<=num_hints) {
|
||||||
tempha=ATARepFind(head,Str2I64(base0_buf));
|
tmpha=ATARepFind(head,Str2I64(base0_buf));
|
||||||
StrPrint(base0_buf,"0x%X",tempha->base0);
|
StrPrint(base0_buf,"0x%X",tmpha->base0);
|
||||||
StrPrint(base1_buf,"0x%X",tempha->base1);
|
StrPrint(base1_buf,"0x%X",tmpha->base1);
|
||||||
unit=tempha->unit;
|
unit=tmpha->unit;
|
||||||
} else if (type!=BDT_ATAPI || *base0_buf) {
|
} else if (type!=BDT_ATAPI || *base0_buf) {
|
||||||
if (type==BDT_ATAPI)
|
if (type==BDT_ATAPI)
|
||||||
StrCpy(base1_buf,"0");
|
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
|
//drv_let=0 means add new drive that
|
||||||
//is not already mounted.
|
//is not already mounted.
|
||||||
CBlkDev *bd;
|
CBlkDev *bd;
|
||||||
CPlannedDrv head,*temppp;
|
CPlannedDrv head,*tmppp;
|
||||||
CMasterBoot mbr;
|
CMasterBoot mbr;
|
||||||
Bool pri=TRUE;
|
Bool pri=TRUE;
|
||||||
I64 ext_base,drv_let2,pri_cnt=0,
|
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;
|
drv_let2=bd->first_drv_let;
|
||||||
remaining=FloorU64(bd->max_blk+1,ROUND_DRV_TO);
|
remaining=FloorU64(bd->max_blk+1,ROUND_DRV_TO);
|
||||||
while (FloorU64(remaining,ROUND_DRV_TO)>=ROUND_DRV_TO) {
|
while (FloorU64(remaining,ROUND_DRV_TO)>=ROUND_DRV_TO) {
|
||||||
temppp=MAlloc(sizeof(CPlannedDrv));
|
tmppp=MAlloc(sizeof(CPlannedDrv));
|
||||||
do {
|
do {
|
||||||
"$$RED$$Partition %C$$FG$$\n",drv_let2;
|
"$$RED$$Partition %C$$FG$$\n",drv_let2;
|
||||||
temppp->pri=FALSE;
|
tmppp->pri=FALSE;
|
||||||
if (pri) {
|
if (pri) {
|
||||||
"Primary Partition";
|
"Primary Partition";
|
||||||
if (YorN) {
|
if (YorN) {
|
||||||
pri_cnt++;
|
pri_cnt++;
|
||||||
temppp->pri=TRUE;
|
tmppp->pri=TRUE;
|
||||||
if (pri_cnt==3)
|
if (pri_cnt==3)
|
||||||
pri=FALSE;
|
pri=FALSE;
|
||||||
} else
|
} else
|
||||||
@@ -65,31 +65,31 @@ public I64 PrtDsk(U8 drv_let=0)
|
|||||||
}
|
}
|
||||||
"Blocks Remaining:%d (0x%X)\n",
|
"Blocks Remaining:%d (0x%X)\n",
|
||||||
remaining-DRV_HEADER,remaining-DRV_HEADER;
|
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);
|
remaining-DRV_HEADER)+DRV_HEADER,ROUND_DRV_TO);
|
||||||
} while (!(ROUND_DRV_TO<=temppp->size<=FloorU64(remaining,ROUND_DRV_TO)));
|
} while (!(ROUND_DRV_TO<=tmppp->size<=FloorU64(remaining,ROUND_DRV_TO)));
|
||||||
QueIns(temppp,head.last);
|
QueIns(tmppp,head.last);
|
||||||
remaining-=temppp->size;
|
remaining-=tmppp->size;
|
||||||
drv_let2++;
|
drv_let2++;
|
||||||
}
|
}
|
||||||
|
|
||||||
"\n\n!!! Repartition Drive !!!\n\n";
|
"\n\n!!! Repartition Drive !!!\n\n";
|
||||||
temppp=head.next;
|
tmppp=head.next;
|
||||||
drv_let2=bd->first_drv_let;
|
drv_let2=bd->first_drv_let;
|
||||||
while (temppp!=&head) {
|
while (tmppp!=&head) {
|
||||||
"Drive %C:%08X ",drv_let2,temppp->size;
|
"Drive %C:%08X ",drv_let2,tmppp->size;
|
||||||
if (temppp->pri)
|
if (tmppp->pri)
|
||||||
"Primary\n";
|
"Primary\n";
|
||||||
else
|
else
|
||||||
"Logical\n";
|
"Logical\n";
|
||||||
temppp=temppp->next;
|
tmppp=tmppp->next;
|
||||||
drv_let2++;
|
drv_let2++;
|
||||||
}
|
}
|
||||||
if (!AreYouSure)
|
if (!AreYouSure)
|
||||||
goto pd_done;
|
goto pd_done;
|
||||||
|
|
||||||
remaining=FloorU64(bd->max_blk+1,ROUND_DRV_TO)-ROUND_DRV_TO;
|
remaining=FloorU64(bd->max_blk+1,ROUND_DRV_TO)-ROUND_DRV_TO;
|
||||||
temppp=head.next;
|
tmppp=head.next;
|
||||||
MemSet(&mbr,0,BLK_SIZE);
|
MemSet(&mbr,0,BLK_SIZE);
|
||||||
mbr.signature=0xAA55;
|
mbr.signature=0xAA55;
|
||||||
offset=0;
|
offset=0;
|
||||||
@@ -101,13 +101,13 @@ public I64 PrtDsk(U8 drv_let=0)
|
|||||||
mbr.p[i].end_head=0xFE;
|
mbr.p[i].end_head=0xFE;
|
||||||
mbr.p[i].end_cyl=0xFFFF;
|
mbr.p[i].end_cyl=0xFFFF;
|
||||||
mbr.p[i].offset=DRV_HEADER+offset;
|
mbr.p[i].offset=DRV_HEADER+offset;
|
||||||
mbr.p[i].size=temppp->size-DRV_HEADER;
|
mbr.p[i].size=tmppp->size-DRV_HEADER;
|
||||||
offset+=temppp->size;
|
offset+=tmppp->size;
|
||||||
remaining-=temppp->size;
|
remaining-=tmppp->size;
|
||||||
temppp=temppp->next;
|
tmppp=tmppp->next;
|
||||||
}
|
}
|
||||||
if (!i) i++;
|
if (!i) i++;
|
||||||
if (temppp!=&head) {
|
if (tmppp!=&head) {
|
||||||
mbr.p[i].active=0x80;
|
mbr.p[i].active=0x80;
|
||||||
mbr.p[i].start_head=0;
|
mbr.p[i].start_head=0;
|
||||||
mbr.p[i].start_cyl=0x101;
|
mbr.p[i].start_cyl=0x101;
|
||||||
@@ -120,7 +120,7 @@ public I64 PrtDsk(U8 drv_let=0)
|
|||||||
}
|
}
|
||||||
ATAWriteBlks(bd,&mbr,0,1);
|
ATAWriteBlks(bd,&mbr,0,1);
|
||||||
|
|
||||||
while (temppp!=&head) {
|
while (tmppp!=&head) {
|
||||||
start_offset=offset;
|
start_offset=offset;
|
||||||
MemSet(&mbr,0,BLK_SIZE);
|
MemSet(&mbr,0,BLK_SIZE);
|
||||||
mbr.signature=0xAA55;
|
mbr.signature=0xAA55;
|
||||||
@@ -132,10 +132,10 @@ public I64 PrtDsk(U8 drv_let=0)
|
|||||||
mbr.p[0].end_head=0xFE;
|
mbr.p[0].end_head=0xFE;
|
||||||
mbr.p[0].end_cyl=0xFFFF;
|
mbr.p[0].end_cyl=0xFFFF;
|
||||||
mbr.p[0].offset=DRV_HEADER;
|
mbr.p[0].offset=DRV_HEADER;
|
||||||
mbr.p[0].size=temppp->size-DRV_HEADER;
|
mbr.p[0].size=tmppp->size-DRV_HEADER;
|
||||||
offset+=temppp->size;
|
offset+=tmppp->size;
|
||||||
temppp=temppp->next;
|
tmppp=tmppp->next;
|
||||||
if (temppp!=&head) {
|
if (tmppp!=&head) {
|
||||||
mbr.p[1].active=0x80;
|
mbr.p[1].active=0x80;
|
||||||
mbr.p[1].start_head=0;
|
mbr.p[1].start_head=0;
|
||||||
mbr.p[1].start_cyl=0x101;
|
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_head=0xFE;
|
||||||
mbr.p[1].end_cyl=0xFFFF;
|
mbr.p[1].end_cyl=0xFFFF;
|
||||||
mbr.p[1].offset=offset-ext_base;
|
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);
|
ATAWriteBlks(bd,&mbr,start_offset,1);
|
||||||
}
|
}
|
||||||
@@ -155,9 +155,9 @@ public I64 PrtDsk(U8 drv_let=0)
|
|||||||
|
|
||||||
pd_done:
|
pd_done:
|
||||||
while (head.next!=&head) {
|
while (head.next!=&head) {
|
||||||
temppp=head.next;
|
tmppp=head.next;
|
||||||
QueRem(temppp);
|
QueRem(tmppp);
|
||||||
Free(temppp);
|
Free(tmppp);
|
||||||
}
|
}
|
||||||
return drv_dsk_dsk_size;
|
return drv_dsk_dsk_size;
|
||||||
}
|
}
|
||||||
+40
-40
@@ -6,32 +6,32 @@ Bool ClassRep2(CDoc *doc,U8 *_d,U8 *class_name=lastclass,
|
|||||||
CMemberLst *ml;
|
CMemberLst *ml;
|
||||||
CDocEntry *doc_e;
|
CDocEntry *doc_e;
|
||||||
Bool unlock;
|
Bool unlock;
|
||||||
CHashClass *tempc,*tempc2;
|
CHashClass *tmpc,*tmpc2;
|
||||||
if (depth>=max_depth) return TRUE;
|
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");
|
DocPrint(doc,"Class Not Found.\n");
|
||||||
return FALSE;
|
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);
|
DocPrint(doc,"Bad Ptr:%016X\n",_d);
|
||||||
return FALSE;
|
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))
|
depth,max_depth,dynamic,types,offset))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
unlock=DocLock(doc);
|
unlock=DocLock(doc);
|
||||||
DocPrint(doc,"Class:\"%s\"\n",class_name);
|
DocPrint(doc,"Class:\"%s\"\n",class_name);
|
||||||
ml=tempc->member_lst_and_root;
|
ml=tmpc->member_lst_and_root;
|
||||||
while (ml) {
|
while (ml) {
|
||||||
tempc2=ml->member_class;
|
tmpc2=ml->member_class;
|
||||||
ptr=_d(U8 *)+ml->offset;
|
ptr=_d(U8 *)+ml->offset;
|
||||||
DocPrint(doc,"%08X ",ptr(U8 *)+offset);
|
DocPrint(doc,"%08X ",ptr(U8 *)+offset);
|
||||||
stars=tempc2->ptr_stars_cnt;
|
stars=tmpc2->ptr_stars_cnt;
|
||||||
tempc2=OptClassFwd(tempc2);
|
tmpc2=OptClassFwd(tmpc2);
|
||||||
tempc2-=tempc2->ptr_stars_cnt;
|
tmpc2-=tmpc2->ptr_stars_cnt;
|
||||||
if (tempc2->type & HTT_INTERNAL_TYPE) {
|
if (tmpc2->type & HTT_INTERNAL_TYPE) {
|
||||||
DocPrint(doc,"$$GREEN$$%-20ts:$$FG$$",ml->str);
|
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;
|
ptr=*ptr;
|
||||||
if (ChkPtr(ptr)) {
|
if (ChkPtr(ptr)) {
|
||||||
if (dynamic) {
|
if (dynamic) {
|
||||||
@@ -43,7 +43,7 @@ Bool ClassRep2(CDoc *doc,U8 *_d,U8 *class_name=lastclass,
|
|||||||
}
|
}
|
||||||
} else if (!stars) {
|
} else if (!stars) {
|
||||||
j=MinI64(ml->dim.total_cnt,32);
|
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 (j==1) {
|
||||||
if (dynamic) {
|
if (dynamic) {
|
||||||
doc_e=DocPrint(doc,"$$DA-TRM+RD+UD,RT=U8,A=\"%%c\"$$\n");
|
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++) {
|
for (i=0;i<j;i++) {
|
||||||
switch (tempc2->raw_type) {
|
switch (tmpc2->raw_type) {
|
||||||
case RT_I0:
|
case RT_I0:
|
||||||
case RT_U0:
|
case RT_U0:
|
||||||
break;
|
break;
|
||||||
@@ -143,9 +143,9 @@ Bool ClassRep2(CDoc *doc,U8 *_d,U8 *class_name=lastclass,
|
|||||||
DocPrint(doc,"$$TR,\"%s\"$$\n",ml->str);
|
DocPrint(doc,"$$TR,\"%s\"$$\n",ml->str);
|
||||||
DocPrint(doc,"$$ID,2$$");
|
DocPrint(doc,"$$ID,2$$");
|
||||||
if (!stars)
|
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)
|
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$$");
|
DocPrint(doc,"$$ID,-2$$");
|
||||||
}
|
}
|
||||||
} else
|
} 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;
|
CMemberLst *ml;
|
||||||
CHashClass *tempc;
|
CHashClass *tmpc;
|
||||||
ml=tempf->member_lst_and_root;
|
ml=tmpf->member_lst_and_root;
|
||||||
while (ml) {
|
while (ml) {
|
||||||
if (ml->reg!=REG_NONE) {
|
if (ml->reg!=REG_NONE) {
|
||||||
tempc=OptClassFwd(ml->member_class);
|
tmpc=OptClassFwd(ml->member_class);
|
||||||
MemCpy(_b+ml->offset,TaskRegAddr(task,ml->reg),tempc->size);
|
MemCpy(_b+ml->offset,TaskRegAddr(task,ml->reg),tmpc->size);
|
||||||
}
|
}
|
||||||
ml=ml->next;
|
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.
|
{//Shows names and vals of a fun's local vars using compiler's info.
|
||||||
I64 size;
|
I64 size;
|
||||||
U8 *img;
|
U8 *img;
|
||||||
CHashFun *tempf=HashFind(st,Fs->hash_table,HTT_FUN);
|
CHashFun *tmpf=HashFind(st,Fs->hash_table,HTT_FUN);
|
||||||
CMemberLst *tempm;
|
CMemberLst *tmpm;
|
||||||
if (tempf) {
|
if (tmpf) {
|
||||||
if (rbp) {
|
if (rbp) {
|
||||||
if (task) {
|
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 .
|
//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);
|
img=MAlloc(size);
|
||||||
MemCpy(img,rbp+tempf->size,size);
|
MemCpy(img,rbp+tmpf->size,size);
|
||||||
UpdateRegVarImg(tempf,img-tempf->size,task);
|
UpdateRegVarImg(tmpf,img-tmpf->size,task);
|
||||||
ClassRep(img-tempf->size,st,max_depth,TRUE,rbp-img+tempf->size);
|
ClassRep(img-tmpf->size,st,max_depth,TRUE,rbp-img+tmpf->size);
|
||||||
Free(img);
|
Free(img);
|
||||||
} else
|
} else
|
||||||
ClassRep(rbp,st,max_depth,TRUE);
|
ClassRep(rbp,st,max_depth,TRUE);
|
||||||
} else {
|
} else {
|
||||||
tempm=tempf->member_lst_and_root;
|
tmpm=tmpf->member_lst_and_root;
|
||||||
while (tempm) {
|
while (tmpm) {
|
||||||
if (0<=tempm->reg<NUM_REGS)
|
if (0<=tmpm->reg<NUM_REGS)
|
||||||
"%08Z %s\n",tempm->reg,"ST_U64_REGS",tempm->str;
|
"%08Z %s\n",tmpm->reg,"ST_U64_REGS",tmpm->str;
|
||||||
else
|
else
|
||||||
"%08tX %s\n",tempm->offset,tempm->str;
|
"%08tX %s\n",tmpm->offset,tmpm->str;
|
||||||
tempm=tempm->next;
|
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)
|
public U0 Uf(U8 *st)
|
||||||
{//Unassembles a named fun
|
{//Unassembles a named fun
|
||||||
I64 i;
|
I64 i;
|
||||||
CHashSrcSym *tempf;
|
CHashSrcSym *tmpf;
|
||||||
CDbgInfo *dbg_info;
|
CDbgInfo *dbg_info;
|
||||||
if (tempf=HashFind(st,Fs->hash_table,HTT_FUN|HTT_EXPORT_SYS_SYM)) {
|
if (tmpf=HashFind(st,Fs->hash_table,HTT_FUN|HTT_EXPORT_SYS_SYM)) {
|
||||||
if (tempf->type&HTT_FUN)
|
if (tmpf->type&HTT_FUN)
|
||||||
FunRep(st);
|
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]
|
i=dbg_info->body[dbg_info->max_line+1-dbg_info->min_line]
|
||||||
-dbg_info->body[0];
|
-dbg_info->body[0];
|
||||||
Un(dbg_info->body[0],i);
|
Un(dbg_info->body[0],i);
|
||||||
"Code Size:%04X\n",i;
|
"Code Size:%04X\n",i;
|
||||||
} else
|
} 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.
|
//This is cut and replaced when I generate a distro.
|
||||||
//See $LK,"DD_TEMPLEOS_LOC",A="FF:::/Demo/AcctExample/TOSDistro.HC,DD_TEMPLEOS_LOC"$.
|
//See $LK,"DD_TEMPLEOS_LOC",A="FF:::/Demo/AcctExample/TOSDistro.HC,DD_TEMPLEOS_LOC"$.
|
||||||
$TR-C,"LineRep"$
|
$TR-C,"LineRep"$
|
||||||
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","120,264");
|
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","119,939");
|
||||||
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","81,209");
|
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","81,264");
|
||||||
$ID,-4$
|
$ID,-4$
|
||||||
DefinePrint("DD_KERNEL","%08X",bfh);
|
DefinePrint("DD_KERNEL","%08X",bfh);
|
||||||
bfh(I64)+=bfh->file_size-1;
|
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 U0 ClipboardDel();
|
||||||
extern CCtrl *CtrlFindUnique(CTask *haystack_task,I64 needle_type);
|
extern CCtrl *CtrlFindUnique(CTask *haystack_task,I64 needle_type);
|
||||||
extern Bool CtrlInside(CCtrl *c,I64 x,I64 y);
|
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,
|
extern U0 DocBMP(CDoc *doc=NULL,U8 *filename,
|
||||||
Bool dither_probability=FALSE,Bool use_ms_paint_palette=FALSE);
|
Bool dither_probability=FALSE,Bool use_ms_paint_palette=FALSE);
|
||||||
extern U0 DocBinDel(CDoc *doc,CDocBin *b);
|
extern U0 DocBinDel(CDoc *doc,CDocBin *b);
|
||||||
@@ -78,6 +78,7 @@ extern Bool PopUpOk(U8 *header=NULL,U8 *footer=NULL);
|
|||||||
extern I64 PopUpRangeI64(
|
extern I64 PopUpRangeI64(
|
||||||
I64 lo,I64 hi,I64 step=1,U8 *header=NULL,U8 *footer=NULL);
|
I64 lo,I64 hi,I64 step=1,U8 *header=NULL,U8 *footer=NULL);
|
||||||
extern Bool PopUpTransform(I64 *r);
|
extern Bool PopUpTransform(I64 *r);
|
||||||
|
extern U0 Refresh(I64 cnt=1,Bool force=FALSE);
|
||||||
extern U0 RegOneTimePopUp(I64 flag_num,U8 *msg);
|
extern U0 RegOneTimePopUp(I64 flag_num,U8 *msg);
|
||||||
extern U0 SettingsPop(CTask *task=NULL,I64 flags=0);
|
extern U0 SettingsPop(CTask *task=NULL,I64 flags=0);
|
||||||
extern CTaskSettings *SettingsPush(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 CDoc *WinCursorPosSet(CTask *task,I64 ipx,I64 ipy,Bool set_cursor=TRUE);
|
||||||
extern Bool WinHorz(I64 left,I64 right,CTask *task=NULL);
|
extern Bool WinHorz(I64 left,I64 right,CTask *task=NULL);
|
||||||
extern U0 WinMax(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 WinScrollNull(CTask *task,CD3I64 *s);
|
||||||
extern U0 WinScrollRestore(CTask *task,CD3I64 *s);
|
extern U0 WinScrollRestore(CTask *task,CD3I64 *s);
|
||||||
extern U0 WinScrollsInit(CTask *task);
|
extern U0 WinScrollsInit(CTask *task);
|
||||||
|
|||||||
+38
-38
@@ -17,13 +17,13 @@ I64 HashEntriesCompare(CWho *h1,CWho *h2)
|
|||||||
|
|
||||||
I64 HashEntriesCompare2(CWho *h1,CWho *h2)
|
I64 HashEntriesCompare2(CWho *h1,CWho *h2)
|
||||||
{
|
{
|
||||||
CHashFun *tempf1=h1->h,*tempf2=h2->h;
|
CHashFun *tmpf1=h1->h,*tmpf2=h2->h;
|
||||||
I64 i1=HashVal(tempf1),i2=HashVal(tempf2);
|
I64 i1=HashVal(tmpf1),i2=HashVal(tmpf2);
|
||||||
if (i1==i2) {
|
if (i1==i2) {
|
||||||
i1=HashTypeNum(tempf1);
|
i1=HashTypeNum(tmpf1);
|
||||||
i2=HashTypeNum(tempf2);
|
i2=HashTypeNum(tmpf2);
|
||||||
if (i1==i2)
|
if (i1==i2)
|
||||||
return StrCmp(tempf1->str,tempf2->str);
|
return StrCmp(tmpf1->str,tmpf2->str);
|
||||||
}
|
}
|
||||||
return i1-i2;
|
return i1-i2;
|
||||||
}
|
}
|
||||||
@@ -67,7 +67,7 @@ U8 *HelpIndexStr(U8 **_ptr,U8 *idx)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
U8 *HelpComment(CTask *task,CHash *temph,U8 *_src_link)
|
U8 *HelpComment(CTask *task,CHash *tmph,U8 *_src_link)
|
||||||
{
|
{
|
||||||
CDoc *doc;
|
CDoc *doc;
|
||||||
CDocEntry *doc_e;
|
CDocEntry *doc_e;
|
||||||
@@ -80,9 +80,9 @@ U8 *HelpComment(CTask *task,CHash *temph,U8 *_src_link)
|
|||||||
|
|
||||||
doc=DocPut(task);
|
doc=DocPut(task);
|
||||||
doc_e=doc->cur_entry;
|
doc_e=doc->cur_entry;
|
||||||
if (temph->type&HTT_FUN) {
|
if (tmph->type&HTT_FUN) {
|
||||||
if (Bt(&temph(CHashFun *)->flags,Ff__EXTERN) ||
|
if (Bt(&tmph(CHashFun *)->flags,Ff__EXTERN) ||
|
||||||
Bt(&temph(CHashFun *)->flags,Ff_INTERNAL))
|
Bt(&tmph(CHashFun *)->flags,Ff_INTERNAL))
|
||||||
while (doc_e!=doc &&
|
while (doc_e!=doc &&
|
||||||
(!(doc_e->de_flags&DOCEF_TAG)||!StrOcc(doc_e->tag,';')))
|
(!(doc_e->de_flags&DOCEF_TAG)||!StrOcc(doc_e->tag,';')))
|
||||||
doc_e=doc_e->next;
|
doc_e=doc_e->next;
|
||||||
@@ -153,7 +153,7 @@ U8 *idx=NULL,CDoc *doc=NULL)
|
|||||||
// "+m" to order by number (normally alphabetical)
|
// "+m" to order by number (normally alphabetical)
|
||||||
// "-r" just local hash table
|
// "-r" just local hash table
|
||||||
CHashTable *table;
|
CHashTable *table;
|
||||||
CHashSrcSym *temph;
|
CHashSrcSym *tmph;
|
||||||
CHashGeneric *ptr;
|
CHashGeneric *ptr;
|
||||||
CWho *lst;
|
CWho *lst;
|
||||||
I64 cnt,i,j,k,f=0;
|
I64 cnt,i,j,k,f=0;
|
||||||
@@ -182,16 +182,16 @@ U8 *idx=NULL,CDoc *doc=NULL)
|
|||||||
table=h;
|
table=h;
|
||||||
while (table) {
|
while (table) {
|
||||||
for (i=0;i<=table->mask;i++) {
|
for (i=0;i<=table->mask;i++) {
|
||||||
temph=table->body[i];
|
tmph=table->body[i];
|
||||||
while (temph) {
|
while (tmph) {
|
||||||
if (!(temph->type & (HTF_IMPORT | HTF_PRIVATE)) &&
|
if (!(tmph->type & (HTF_IMPORT | HTF_PRIVATE)) &&
|
||||||
(temph->type & HTF_PUBLIC || !publics)) {
|
(tmph->type & HTF_PUBLIC || !publics)) {
|
||||||
if (!idx)
|
if (!idx)
|
||||||
cnt++;
|
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);
|
cnt+=HelpIndexCnt(cur_idx,idx);
|
||||||
}
|
}
|
||||||
temph=temph->next;
|
tmph=tmph->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (recurse)
|
if (recurse)
|
||||||
@@ -206,19 +206,19 @@ U8 *idx=NULL,CDoc *doc=NULL)
|
|||||||
table=h;
|
table=h;
|
||||||
while (table) {
|
while (table) {
|
||||||
for (i=0;i<=table->mask;i++) {
|
for (i=0;i<=table->mask;i++) {
|
||||||
temph=table->body[i];
|
tmph=table->body[i];
|
||||||
while (temph) {
|
while (tmph) {
|
||||||
if (!(temph->type & (HTF_IMPORT | HTF_PRIVATE)) &&
|
if (!(tmph->type & (HTF_IMPORT | HTF_PRIVATE)) &&
|
||||||
(temph->type & HTF_PUBLIC || !publics))
|
(tmph->type & HTF_PUBLIC || !publics))
|
||||||
if (!idx)
|
if (!idx)
|
||||||
lst[j++].h=temph;
|
lst[j++].h=tmph;
|
||||||
else if (temph->type&HTG_SRC_SYM && (cur_idx=temph->idx) &&
|
else if (tmph->type&HTG_SRC_SYM && (cur_idx=tmph->idx) &&
|
||||||
(k=HelpIndexCnt(cur_idx,idx)))
|
(k=HelpIndexCnt(cur_idx,idx)))
|
||||||
while (k--) {
|
while (k--) {
|
||||||
lst[j].idx=HelpIndexStr(&cur_idx,idx);
|
lst[j].idx=HelpIndexStr(&cur_idx,idx);
|
||||||
lst[j++].h=temph;
|
lst[j++].h=tmph;
|
||||||
}
|
}
|
||||||
temph=temph->next;
|
tmph=tmph->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (recurse)
|
if (recurse)
|
||||||
@@ -331,13 +331,13 @@ public I64 HashDepthRep(CHashTable *table=NULL)
|
|||||||
{//Hash table linked-list chain depth report.
|
{//Hash table linked-list chain depth report.
|
||||||
//Histogram of collision count.
|
//Histogram of collision count.
|
||||||
I64 i,j,longest=0,cnt=0,a[HDR_MAX];
|
I64 i,j,longest=0,cnt=0,a[HDR_MAX];
|
||||||
CHash *temph;
|
CHash *tmph;
|
||||||
if (!table) table=Fs->hash_table;
|
if (!table) table=Fs->hash_table;
|
||||||
MemSet(a,0,sizeof(a));
|
MemSet(a,0,sizeof(a));
|
||||||
for (i=0;i<=table->mask;i++) {
|
for (i=0;i<=table->mask;i++) {
|
||||||
temph=table->body[i];
|
tmph=table->body[i];
|
||||||
if (temph) {
|
if (tmph) {
|
||||||
j=LinkedLstCnt(temph);
|
j=LinkedLstCnt(tmph);
|
||||||
if (j<HDR_MAX)
|
if (j<HDR_MAX)
|
||||||
a[j]++;
|
a[j]++;
|
||||||
cnt+=j;
|
cnt+=j;
|
||||||
@@ -377,14 +377,14 @@ public U0 MapFileLoad(U8 *filename)
|
|||||||
*absname=FileNameAbs(name);
|
*absname=FileNameAbs(name);
|
||||||
CDoc *doc=DocRead(name);
|
CDoc *doc=DocRead(name);
|
||||||
CDocEntry *doc_e;
|
CDocEntry *doc_e;
|
||||||
CHashSrcSym *temph;
|
CHashSrcSym *tmph;
|
||||||
I64 i,j,base=0;
|
I64 i,j,base=0;
|
||||||
CDbgInfo *dbg_info;
|
CDbgInfo *dbg_info;
|
||||||
|
|
||||||
FileExtRem(absname);
|
FileExtRem(absname);
|
||||||
if (absname[1]==':' && StrLen(absname)>2 &&
|
if (absname[1]==':' && StrLen(absname)>2 &&
|
||||||
(temph=HashSingleTableFind(absname+2,Fs->hash_table,HTT_MODULE)))
|
(tmph=HashSingleTableFind(absname+2,Fs->hash_table,HTT_MODULE)))
|
||||||
base=temph(CHashGeneric *)->user_data0+sizeof(CBinFile);
|
base=tmph(CHashGeneric *)->user_data0+sizeof(CBinFile);
|
||||||
|
|
||||||
if (!doc) return;
|
if (!doc) return;
|
||||||
doc_e=doc->head.next;
|
doc_e=doc->head.next;
|
||||||
@@ -394,11 +394,11 @@ public U0 MapFileLoad(U8 *filename)
|
|||||||
st=MStrUtil(doc_e->tag,SUF_REM_TRAILING);
|
st=MStrUtil(doc_e->tag,SUF_REM_TRAILING);
|
||||||
else
|
else
|
||||||
st=MStrUtil(doc_e->aux_str,SUF_REM_TRAILING);
|
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) {
|
if (*doc_e->tag) {
|
||||||
Free(temph->src_link);
|
Free(tmph->src_link);
|
||||||
temph->src_link=doc_e->aux_str;
|
tmph->src_link=doc_e->aux_str;
|
||||||
ptr=temph->src_link;
|
ptr=tmph->src_link;
|
||||||
if (ptr[0] && ptr[1] && ptr[2]==':') {
|
if (ptr[0] && ptr[1] && ptr[2]==':') {
|
||||||
if (ptr[3]==':')
|
if (ptr[3]==':')
|
||||||
ptr[3]=blkdev.boot_drv_let;
|
ptr[3]=blkdev.boot_drv_let;
|
||||||
@@ -407,14 +407,14 @@ public U0 MapFileLoad(U8 *filename)
|
|||||||
}
|
}
|
||||||
doc_e->aux_str=NULL;
|
doc_e->aux_str=NULL;
|
||||||
}
|
}
|
||||||
if (temph->type&(HTT_FUN|HTT_EXPORT_SYS_SYM) &&
|
if (tmph->type&(HTT_FUN|HTT_EXPORT_SYS_SYM) &&
|
||||||
!(dbg_info=temph->dbg_info) && doc_e->bin_data &&
|
!(dbg_info=tmph->dbg_info) && doc_e->bin_data &&
|
||||||
(dbg_info=doc_e->bin_data->data)) {
|
(dbg_info=doc_e->bin_data->data)) {
|
||||||
if (doc_e->bin_data->size>MSize(dbg_info))
|
if (doc_e->bin_data->size>MSize(dbg_info))
|
||||||
"Corrupt Map Entry\n";
|
"Corrupt Map Entry\n";
|
||||||
else {
|
else {
|
||||||
doc_e->bin_data->data=NULL;
|
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++) {
|
for (i=dbg_info->min_line;i<=dbg_info->max_line+1;i++) {
|
||||||
j=i-dbg_info->min_line;
|
j=i-dbg_info->min_line;
|
||||||
if (dbg_info->body[j])
|
if (dbg_info->body[j])
|
||||||
|
|||||||
+160
-160
@@ -17,14 +17,14 @@ U0 ODERstPtrs(CMathODE *ode)
|
|||||||
ode->state_scale=ptr; ptr(I64)+=s;
|
ode->state_scale=ptr; ptr(I64)+=s;
|
||||||
ode->DstateDt=ptr; ptr(I64)+=s;
|
ode->DstateDt=ptr; ptr(I64)+=s;
|
||||||
ode->initial_state=ptr; ptr(I64)+=s;
|
ode->initial_state=ptr; ptr(I64)+=s;
|
||||||
ode->temp0=ptr; ptr(I64)+=s;
|
ode->tmp0=ptr; ptr(I64)+=s;
|
||||||
ode->temp1=ptr; ptr(I64)+=s;
|
ode->tmp1=ptr; ptr(I64)+=s;
|
||||||
ode->temp2=ptr; ptr(I64)+=s;
|
ode->tmp2=ptr; ptr(I64)+=s;
|
||||||
ode->temp3=ptr; ptr(I64)+=s;
|
ode->tmp3=ptr; ptr(I64)+=s;
|
||||||
ode->temp4=ptr; ptr(I64)+=s;
|
ode->tmp4=ptr; ptr(I64)+=s;
|
||||||
ode->temp5=ptr; ptr(I64)+=s;
|
ode->tmp5=ptr; ptr(I64)+=s;
|
||||||
ode->temp6=ptr; ptr(I64)+=s;
|
ode->tmp6=ptr; ptr(I64)+=s;
|
||||||
ode->temp7=ptr;
|
ode->tmp7=ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CMathODE *ODENew(I64 n,F64 max_tolerance=1e-6,I64 flags=0)
|
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,
|
COrder2D3 *ptr1=state(F64 *)+ode->n,
|
||||||
*ptr2=DstateDt(F64 *)+ode->n;
|
*ptr2=DstateDt(F64 *)+ode->n;
|
||||||
CMass *tempm=ode->next_mass;
|
CMass *tmpm=ode->next_mass;
|
||||||
while (tempm!=&ode->next_mass) {
|
while (tmpm!=&ode->next_mass) {
|
||||||
tempm->state=ptr1++;
|
tmpm->state=ptr1++;
|
||||||
tempm->DstateDt=ptr2++;
|
tmpm->DstateDt=ptr2++;
|
||||||
tempm=tempm->next;
|
tmpm=tmpm->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 ODEState2Internal(CMathODE *ode)
|
U0 ODEState2Internal(CMathODE *ode)
|
||||||
{
|
{
|
||||||
CMass *tempm;
|
CMass *tmpm;
|
||||||
F64 *old_array_base;
|
F64 *old_array_base;
|
||||||
I64 mass_cnt;
|
I64 mass_cnt;
|
||||||
|
|
||||||
if (ode->flags&ODEF_HAS_MASSES) {
|
if (ode->flags&ODEF_HAS_MASSES) {
|
||||||
mass_cnt=0;
|
mass_cnt=0;
|
||||||
tempm=ode->next_mass;
|
tmpm=ode->next_mass;
|
||||||
while (tempm!=&ode->next_mass) {
|
while (tmpm!=&ode->next_mass) {
|
||||||
mass_cnt++;
|
mass_cnt++;
|
||||||
tempm=tempm->next;
|
tmpm=tmpm->next;
|
||||||
}
|
}
|
||||||
old_array_base=ode->array_base;
|
old_array_base=ode->array_base;
|
||||||
ode->n_internal=ode->n+6*mass_cnt;
|
ode->n_internal=ode->n+6*mass_cnt;
|
||||||
@@ -107,10 +107,10 @@ U0 ODEState2Internal(CMathODE *ode)
|
|||||||
ODERstPtrs(ode);
|
ODERstPtrs(ode);
|
||||||
|
|
||||||
ODESetMassesPtrs(ode,ode->state_internal,ode->state_internal);
|
ODESetMassesPtrs(ode,ode->state_internal,ode->state_internal);
|
||||||
tempm=ode->next_mass;
|
tmpm=ode->next_mass;
|
||||||
while (tempm!=&ode->next_mass) {
|
while (tmpm!=&ode->next_mass) {
|
||||||
MemCpy(tempm->state,&tempm->saved_state,sizeof(COrder2D3));
|
MemCpy(tmpm->state,&tmpm->saved_state,sizeof(COrder2D3));
|
||||||
tempm=tempm->next;
|
tmpm=tmpm->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MemCpy(ode->state_internal,ode->state,ode->n*sizeof(F64));
|
MemCpy(ode->state_internal,ode->state,ode->n*sizeof(F64));
|
||||||
@@ -118,14 +118,14 @@ U0 ODEState2Internal(CMathODE *ode)
|
|||||||
|
|
||||||
U0 ODEInternal2State(CMathODE *ode)
|
U0 ODEInternal2State(CMathODE *ode)
|
||||||
{
|
{
|
||||||
CMass *tempm;
|
CMass *tmpm;
|
||||||
MemCpy(ode->state,ode->state_internal,ode->n*sizeof(F64));
|
MemCpy(ode->state,ode->state_internal,ode->n*sizeof(F64));
|
||||||
if (ode->flags&ODEF_HAS_MASSES) {
|
if (ode->flags&ODEF_HAS_MASSES) {
|
||||||
ODESetMassesPtrs(ode,ode->state_internal,ode->state_internal);
|
ODESetMassesPtrs(ode,ode->state_internal,ode->state_internal);
|
||||||
tempm=ode->next_mass;
|
tmpm=ode->next_mass;
|
||||||
while (tempm!=&ode->next_mass) {
|
while (tmpm!=&ode->next_mass) {
|
||||||
MemCpy(&tempm->saved_state,tempm->state,sizeof(COrder2D3));
|
MemCpy(&tmpm->saved_state,tmpm->state,sizeof(COrder2D3));
|
||||||
tempm=tempm->next;
|
tmpm=tmpm->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -133,58 +133,58 @@ U0 ODEInternal2State(CMathODE *ode)
|
|||||||
public U0 ODERenum(CMathODE *ode)
|
public U0 ODERenum(CMathODE *ode)
|
||||||
{//Renumber masses and springs.
|
{//Renumber masses and springs.
|
||||||
I64 i;
|
I64 i;
|
||||||
CSpring *temps;
|
CSpring *tmps;
|
||||||
CMass *tempm;
|
CMass *tmpm;
|
||||||
|
|
||||||
i=0;
|
i=0;
|
||||||
tempm=ode->next_mass;
|
tmpm=ode->next_mass;
|
||||||
while (tempm!=&ode->next_mass) {
|
while (tmpm!=&ode->next_mass) {
|
||||||
tempm->num=i++;
|
tmpm->num=i++;
|
||||||
tempm=tempm->next;
|
tmpm=tmpm->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
i=0;
|
i=0;
|
||||||
temps=ode->next_spring;
|
tmps=ode->next_spring;
|
||||||
while (temps!=&ode->next_spring) {
|
while (tmps!=&ode->next_spring) {
|
||||||
temps->num=i++;
|
tmps->num=i++;
|
||||||
temps->end1_num=temps->end1->num;
|
tmps->end1_num=tmps->end1->num;
|
||||||
temps->end2_num=temps->end2->num;
|
tmps->end2_num=tmps->end2->num;
|
||||||
temps=temps->next;
|
tmps=tmps->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public CMass *MassFind(CMathODE *ode,F64 x,F64 y,F64 z=0)
|
public CMass *MassFind(CMathODE *ode,F64 x,F64 y,F64 z=0)
|
||||||
{//Search for mass nearest to x,y,z.
|
{//Search for mass nearest to x,y,z.
|
||||||
CMass *tempm,*best_mass=NULL;
|
CMass *tmpm,*best_mass=NULL;
|
||||||
F64 dd,best_dd=MAX_F64;
|
F64 dd,best_dd=MAX_F64;
|
||||||
|
|
||||||
tempm=ode->next_mass;
|
tmpm=ode->next_mass;
|
||||||
while (tempm!=&ode->next_mass) {
|
while (tmpm!=&ode->next_mass) {
|
||||||
dd=Sqr(tempm->x-x)+Sqr(tempm->y-y)+Sqr(tempm->z-z);
|
dd=Sqr(tmpm->x-x)+Sqr(tmpm->y-y)+Sqr(tmpm->z-z);
|
||||||
if (dd<best_dd) {
|
if (dd<best_dd) {
|
||||||
best_dd=dd;
|
best_dd=dd;
|
||||||
best_mass=tempm;
|
best_mass=tmpm;
|
||||||
}
|
}
|
||||||
tempm=tempm->next;
|
tmpm=tmpm->next;
|
||||||
}
|
}
|
||||||
return best_mass;
|
return best_mass;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CSpring *SpringFind(CMathODE *ode,F64 x,F64 y,F64 z=0)
|
public CSpring *SpringFind(CMathODE *ode,F64 x,F64 y,F64 z=0)
|
||||||
{//Find spring midpoint nearest x,y,z.
|
{//Find spring midpoint nearest x,y,z.
|
||||||
CSpring *temps,*best_spring=NULL;
|
CSpring *tmps,*best_spring=NULL;
|
||||||
F64 dd,best_dd=MAX_F64;
|
F64 dd,best_dd=MAX_F64;
|
||||||
|
|
||||||
temps=ode->next_spring;
|
tmps=ode->next_spring;
|
||||||
while (temps!=&ode->next_spring) {
|
while (tmps!=&ode->next_spring) {
|
||||||
dd=Sqr((temps->end1->x+temps->end2->x)/2-x)+
|
dd=Sqr((tmps->end1->x+tmps->end2->x)/2-x)+
|
||||||
Sqr((temps->end1->y+temps->end2->y)/2-y)+
|
Sqr((tmps->end1->y+tmps->end2->y)/2-y)+
|
||||||
Sqr((temps->end1->z+temps->end2->z)/2-z);
|
Sqr((tmps->end1->z+tmps->end2->z)/2-z);
|
||||||
if (dd<best_dd) {
|
if (dd<best_dd) {
|
||||||
best_dd=dd;
|
best_dd=dd;
|
||||||
best_spring=temps;
|
best_spring=tmps;
|
||||||
}
|
}
|
||||||
temps=temps->next;
|
tmps=tmps->next;
|
||||||
}
|
}
|
||||||
return best_spring;
|
return best_spring;
|
||||||
}
|
}
|
||||||
@@ -193,31 +193,31 @@ public U0 MassOrSpringFind(
|
|||||||
CMathODE *ode,CMass **res_mass,CSpring **res_spring,
|
CMathODE *ode,CMass **res_mass,CSpring **res_spring,
|
||||||
F64 x,F64 y,F64 z=0)
|
F64 x,F64 y,F64 z=0)
|
||||||
{//Find spring or mass nearest x,y,z.
|
{//Find spring or mass nearest x,y,z.
|
||||||
CMass *tempm,*best_mass=NULL;
|
CMass *tmpm,*best_mass=NULL;
|
||||||
CSpring *temps,*best_spring=NULL;
|
CSpring *tmps,*best_spring=NULL;
|
||||||
F64 dd,best_dd=MAX_F64;
|
F64 dd,best_dd=MAX_F64;
|
||||||
|
|
||||||
tempm=ode->next_mass;
|
tmpm=ode->next_mass;
|
||||||
while (tempm!=&ode->next_mass) {
|
while (tmpm!=&ode->next_mass) {
|
||||||
dd=Sqr(tempm->x-x)+Sqr(tempm->y-y)+Sqr(tempm->z-z);
|
dd=Sqr(tmpm->x-x)+Sqr(tmpm->y-y)+Sqr(tmpm->z-z);
|
||||||
if (dd<best_dd) {
|
if (dd<best_dd) {
|
||||||
best_dd=dd;
|
best_dd=dd;
|
||||||
best_mass=tempm;
|
best_mass=tmpm;
|
||||||
}
|
}
|
||||||
tempm=tempm->next;
|
tmpm=tmpm->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
temps=ode->next_spring;
|
tmps=ode->next_spring;
|
||||||
while (temps!=&ode->next_spring) {
|
while (tmps!=&ode->next_spring) {
|
||||||
dd=Sqr((temps->end1->x+temps->end2->x)/2-x)+
|
dd=Sqr((tmps->end1->x+tmps->end2->x)/2-x)+
|
||||||
Sqr((temps->end1->y+temps->end2->y)/2-y)+
|
Sqr((tmps->end1->y+tmps->end2->y)/2-y)+
|
||||||
Sqr((temps->end1->z+temps->end2->z)/2-z);
|
Sqr((tmps->end1->z+tmps->end2->z)/2-z);
|
||||||
if (dd<best_dd) {
|
if (dd<best_dd) {
|
||||||
best_dd=dd;
|
best_dd=dd;
|
||||||
best_spring=temps;
|
best_spring=tmps;
|
||||||
best_mass=NULL;
|
best_mass=NULL;
|
||||||
}
|
}
|
||||||
temps=temps->next;
|
tmps=tmps->next;
|
||||||
}
|
}
|
||||||
if (res_mass) *res_mass =best_mass;
|
if (res_mass) *res_mass =best_mass;
|
||||||
if (res_spring) *res_spring=best_spring;
|
if (res_spring) *res_spring=best_spring;
|
||||||
@@ -225,126 +225,126 @@ public U0 MassOrSpringFind(
|
|||||||
|
|
||||||
public CMass *MassFindNum(CMathODE *ode,I64 num)
|
public CMass *MassFindNum(CMathODE *ode,I64 num)
|
||||||
{//Return mass number N.
|
{//Return mass number N.
|
||||||
CMass *tempm=ode->next_mass;
|
CMass *tmpm=ode->next_mass;
|
||||||
while (tempm!=&ode->next_mass) {
|
while (tmpm!=&ode->next_mass) {
|
||||||
if (tempm->num==num)
|
if (tmpm->num==num)
|
||||||
return tempm;
|
return tmpm;
|
||||||
tempm=tempm->next;
|
tmpm=tmpm->next;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
public U0 ODERstInactive(CMathODE *ode)
|
public U0 ODERstInactive(CMathODE *ode)
|
||||||
{//Set all masses and springs to ACTIVE for new trial.
|
{//Set all masses and springs to ACTIVE for new trial.
|
||||||
CMass *tempm;
|
CMass *tmpm;
|
||||||
CSpring *temps;
|
CSpring *tmps;
|
||||||
tempm=ode->next_mass;
|
tmpm=ode->next_mass;
|
||||||
while (tempm!=&ode->next_mass) {
|
while (tmpm!=&ode->next_mass) {
|
||||||
tempm->flags&=~MSF_INACTIVE;
|
tmpm->flags&=~MSF_INACTIVE;
|
||||||
tempm=tempm->next;
|
tmpm=tmpm->next;
|
||||||
}
|
}
|
||||||
temps=ode->next_spring;
|
tmps=ode->next_spring;
|
||||||
while (temps!=&ode->next_spring) {
|
while (tmps!=&ode->next_spring) {
|
||||||
temps->flags&=~SSF_INACTIVE;
|
tmps->flags&=~SSF_INACTIVE;
|
||||||
temps=temps->next;
|
tmps=tmps->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 ODECalcSprings(CMathODE *ode)
|
U0 ODECalcSprings(CMathODE *ode)
|
||||||
{
|
{
|
||||||
CSpring *temps=ode->next_spring;
|
CSpring *tmps=ode->next_spring;
|
||||||
CMass *e1,*e2;
|
CMass *e1,*e2;
|
||||||
F64 d;
|
F64 d;
|
||||||
CD3 p;
|
CD3 p;
|
||||||
while (temps!=&ode->next_spring) {
|
while (tmps!=&ode->next_spring) {
|
||||||
if (temps->flags&SSF_INACTIVE) {
|
if (tmps->flags&SSF_INACTIVE) {
|
||||||
temps->displacement=0;
|
tmps->displacement=0;
|
||||||
temps->f=0;
|
tmps->f=0;
|
||||||
} else {
|
} else {
|
||||||
e1=temps->end1;
|
e1=tmps->end1;
|
||||||
e2=temps->end2;
|
e2=tmps->end2;
|
||||||
d=D3Norm(D3Sub(&p,&e2->state->x,&e1->state->x));
|
d=D3Norm(D3Sub(&p,&e2->state->x,&e1->state->x));
|
||||||
temps->displacement=d-temps->rest_len;
|
tmps->displacement=d-tmps->rest_len;
|
||||||
temps->f=temps->displacement*temps->const;
|
tmps->f=tmps->displacement*tmps->const;
|
||||||
if (temps->f>0 && temps->flags&SSF_NO_TENSION)
|
if (tmps->f>0 && tmps->flags&SSF_NO_TENSION)
|
||||||
temps->f=0;
|
tmps->f=0;
|
||||||
else if (temps->f<0 && temps->flags&SSF_NO_COMPRESSION)
|
else if (tmps->f<0 && tmps->flags&SSF_NO_COMPRESSION)
|
||||||
temps->f=0;
|
tmps->f=0;
|
||||||
if (d>0) {
|
if (d>0) {
|
||||||
D3MulEqu(&p,temps->f/d);
|
D3MulEqu(&p,tmps->f/d);
|
||||||
D3AddEqu(&e1->DstateDt->DxDt,&p);
|
D3AddEqu(&e1->DstateDt->DxDt,&p);
|
||||||
D3SubEqu(&e2->DstateDt->DxDt,&p);
|
D3SubEqu(&e2->DstateDt->DxDt,&p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
temps=temps->next;
|
tmps=tmps->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 ODECalcDrag(CMathODE *ode)
|
U0 ODECalcDrag(CMathODE *ode)
|
||||||
{
|
{
|
||||||
CMass *tempm;
|
CMass *tmpm;
|
||||||
F64 d,dd;
|
F64 d,dd;
|
||||||
CD3 p;
|
CD3 p;
|
||||||
if (ode->drag_v || ode->drag_v2 || ode->drag_v3) {
|
if (ode->drag_v || ode->drag_v2 || ode->drag_v3) {
|
||||||
tempm=ode->next_mass;
|
tmpm=ode->next_mass;
|
||||||
while (tempm!=&ode->next_mass) {
|
while (tmpm!=&ode->next_mass) {
|
||||||
if (!(tempm->flags & MSF_INACTIVE) &&
|
if (!(tmpm->flags & MSF_INACTIVE) &&
|
||||||
tempm->drag_profile_factor &&
|
tmpm->drag_profile_factor &&
|
||||||
(dd=D3NormSqr(&tempm->state->DxDt))) {
|
(dd=D3NormSqr(&tmpm->state->DxDt))) {
|
||||||
d=ode->drag_v;
|
d=ode->drag_v;
|
||||||
if (ode->drag_v2)
|
if (ode->drag_v2)
|
||||||
d+=ode->drag_v2*Sqrt(dd);
|
d+=ode->drag_v2*Sqrt(dd);
|
||||||
if (ode->drag_v3)
|
if (ode->drag_v3)
|
||||||
d+=dd*ode->drag_v3;
|
d+=dd*ode->drag_v3;
|
||||||
D3SubEqu(&tempm->DstateDt->DxDt,
|
D3SubEqu(&tmpm->DstateDt->DxDt,
|
||||||
D3Mul(&p,d*tempm->drag_profile_factor,&tempm->state->DxDt));
|
D3Mul(&p,d*tmpm->drag_profile_factor,&tmpm->state->DxDt));
|
||||||
}
|
}
|
||||||
tempm=tempm->next;
|
tmpm=tmpm->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 ODEApplyAccelerationLimit(CMathODE *ode)
|
U0 ODEApplyAccelerationLimit(CMathODE *ode)
|
||||||
{
|
{
|
||||||
CMass *tempm;
|
CMass *tmpm;
|
||||||
F64 d;
|
F64 d;
|
||||||
if (ode->acceleration_limit) {
|
if (ode->acceleration_limit) {
|
||||||
tempm=ode->next_mass;
|
tmpm=ode->next_mass;
|
||||||
while (tempm!=&ode->next_mass) {
|
while (tmpm!=&ode->next_mass) {
|
||||||
if (!(tempm->flags & MSF_INACTIVE) &&
|
if (!(tmpm->flags & MSF_INACTIVE) &&
|
||||||
(d=D3Norm(&tempm->DstateDt->DxDt))>ode->acceleration_limit)
|
(d=D3Norm(&tmpm->DstateDt->DxDt))>ode->acceleration_limit)
|
||||||
D3MulEqu(&tempm->DstateDt->DxDt,ode->acceleration_limit/d);
|
D3MulEqu(&tmpm->DstateDt->DxDt,ode->acceleration_limit/d);
|
||||||
tempm=tempm->next;
|
tmpm=tmpm->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 ODECallDerivative(CMathODE *ode,F64 t,F64 *state,F64 *DstateDt)
|
U0 ODECallDerivative(CMathODE *ode,F64 t,F64 *state,F64 *DstateDt)
|
||||||
{
|
{
|
||||||
CMass *tempm;
|
CMass *tmpm;
|
||||||
if (ode->flags&ODEF_HAS_MASSES) {
|
if (ode->flags&ODEF_HAS_MASSES) {
|
||||||
ODESetMassesPtrs(ode,state,DstateDt);
|
ODESetMassesPtrs(ode,state,DstateDt);
|
||||||
tempm=ode->next_mass;
|
tmpm=ode->next_mass;
|
||||||
while (tempm!=&ode->next_mass) {
|
while (tmpm!=&ode->next_mass) {
|
||||||
if (!(tempm->flags&MSF_INACTIVE)) {
|
if (!(tmpm->flags&MSF_INACTIVE)) {
|
||||||
D3Zero(&tempm->DstateDt->DxDt);
|
D3Zero(&tmpm->DstateDt->DxDt);
|
||||||
D3Copy(&tempm->DstateDt->x,&tempm->state->DxDt);
|
D3Copy(&tmpm->DstateDt->x,&tmpm->state->DxDt);
|
||||||
}
|
}
|
||||||
tempm=tempm->next;
|
tmpm=tmpm->next;
|
||||||
}
|
}
|
||||||
ODECalcSprings(ode);
|
ODECalcSprings(ode);
|
||||||
ODECalcDrag(ode);
|
ODECalcDrag(ode);
|
||||||
(*ode->derivative)(ode,t,state,DstateDt);
|
(*ode->derivative)(ode,t,state,DstateDt);
|
||||||
tempm=ode->next_mass;
|
tmpm=ode->next_mass;
|
||||||
while (tempm!=&ode->next_mass) {
|
while (tmpm!=&ode->next_mass) {
|
||||||
if (!(tempm->flags&MSF_INACTIVE)) {
|
if (!(tmpm->flags&MSF_INACTIVE)) {
|
||||||
if (tempm->flags&MSF_FIXED) {
|
if (tmpm->flags&MSF_FIXED) {
|
||||||
D3Zero(&tempm->DstateDt->DxDt);
|
D3Zero(&tmpm->DstateDt->DxDt);
|
||||||
D3Zero(&tempm->DstateDt->x);
|
D3Zero(&tmpm->DstateDt->x);
|
||||||
} else if (tempm->mass)
|
} else if (tmpm->mass)
|
||||||
D3DivEqu(&tempm->DstateDt->DxDt,tempm->mass);
|
D3DivEqu(&tmpm->DstateDt->DxDt,tmpm->mass);
|
||||||
}
|
}
|
||||||
tempm=tempm->next;
|
tmpm=tmpm->next;
|
||||||
}
|
}
|
||||||
ODEApplyAccelerationLimit(ode);
|
ODEApplyAccelerationLimit(ode);
|
||||||
} else
|
} else
|
||||||
@@ -365,10 +365,10 @@ U0 ODERK4OneStep(CMathODE *ode)
|
|||||||
I64 i,n=ode->n_internal;
|
I64 i,n=ode->n_internal;
|
||||||
F64 xh,hh,h6,*dym,*dyt,*yt,*DstateDt;
|
F64 xh,hh,h6,*dym,*dyt,*yt,*DstateDt;
|
||||||
|
|
||||||
dym =ode->temp0;
|
dym =ode->tmp0;
|
||||||
dyt =ode->temp1;
|
dyt =ode->tmp1;
|
||||||
yt =ode->temp2;
|
yt =ode->tmp2;
|
||||||
DstateDt=ode->temp3;
|
DstateDt=ode->tmp3;
|
||||||
hh =0.5*ode->h;
|
hh =0.5*ode->h;
|
||||||
h6 =ode->h / 6.0;
|
h6 =ode->h / 6.0;
|
||||||
xh =ode->t + hh;
|
xh =ode->t + hh;
|
||||||
@@ -425,34 +425,34 @@ U0 ODECashKarp(CMathODE *ode)
|
|||||||
I64 i,n=ode->n_internal;
|
I64 i,n=ode->n_internal;
|
||||||
F64 h=ode->h,*state=ode->state_internal,
|
F64 h=ode->h,*state=ode->state_internal,
|
||||||
*DstateDt=ode->DstateDt,*ak2,*ak3,*ak4,*ak5,*ak6,
|
*DstateDt=ode->DstateDt,*ak2,*ak3,*ak4,*ak5,*ak6,
|
||||||
*tempstate,*stateerr,*outstate;
|
*tmpstate,*stateerr,*outstate;
|
||||||
|
|
||||||
ak2=ode->temp0;
|
ak2=ode->tmp0;
|
||||||
ak3=ode->temp1;
|
ak3=ode->tmp1;
|
||||||
ak4=ode->temp2;
|
ak4=ode->tmp2;
|
||||||
ak5=ode->temp3;
|
ak5=ode->tmp3;
|
||||||
ak6=ode->temp4;
|
ak6=ode->tmp4;
|
||||||
tempstate=ode->temp5;
|
tmpstate=ode->tmp5;
|
||||||
outstate=ode->temp6;
|
outstate=ode->tmp6;
|
||||||
stateerr=ode->temp7;
|
stateerr=ode->tmp7;
|
||||||
|
|
||||||
for (i=0;i<n;i++)
|
for (i=0;i<n;i++)
|
||||||
tempstate[i]=state[i]+ODEb21*h*DstateDt[i];
|
tmpstate[i]=state[i]+ODEb21*h*DstateDt[i];
|
||||||
ODECallDerivative(ode,ode->t+ODEa2*h,tempstate,ak2);
|
ODECallDerivative(ode,ode->t+ODEa2*h,tmpstate,ak2);
|
||||||
for (i=0;i<n;i++)
|
for (i=0;i<n;i++)
|
||||||
tempstate[i]=state[i]+h*(ODEb31*DstateDt[i]+ODEb32*ak2[i]);
|
tmpstate[i]=state[i]+h*(ODEb31*DstateDt[i]+ODEb32*ak2[i]);
|
||||||
ODECallDerivative(ode,ode->t+ODEa3*h,tempstate,ak3);
|
ODECallDerivative(ode,ode->t+ODEa3*h,tmpstate,ak3);
|
||||||
for (i=0;i<n;i++)
|
for (i=0;i<n;i++)
|
||||||
tempstate[i]=state[i]+h*(ODEb41*DstateDt[i]+ODEb42*ak2[i]+ODEb43*ak3[i]);
|
tmpstate[i]=state[i]+h*(ODEb41*DstateDt[i]+ODEb42*ak2[i]+ODEb43*ak3[i]);
|
||||||
ODECallDerivative(ode,ode->t+ODEa4*h,tempstate,ak4);
|
ODECallDerivative(ode,ode->t+ODEa4*h,tmpstate,ak4);
|
||||||
for (i=0;i<n;i++)
|
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]);
|
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++)
|
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]);
|
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++)
|
for (i=0;i<n;i++)
|
||||||
outstate[i]=state[i]+h*(ODEc1*DstateDt[i]+
|
outstate[i]=state[i]+h*(ODEc1*DstateDt[i]+
|
||||||
ODEc3*ak3[i]+ODEc4*ak4[i]+ODEc6*ak6[i]);
|
ODEc3*ak3[i]+ODEc4*ak4[i]+ODEc6*ak6[i]);
|
||||||
@@ -469,23 +469,23 @@ U0 ODECashKarp(CMathODE *ode)
|
|||||||
U0 ODERK5OneStep(CMathODE *ode)
|
U0 ODERK5OneStep(CMathODE *ode)
|
||||||
{
|
{
|
||||||
I64 i;
|
I64 i;
|
||||||
F64 errmax,temp,*tempstate=ode->temp6,*stateerr=ode->temp7;
|
F64 errmax,tmp,*tmpstate=ode->tmp6,*stateerr=ode->tmp7;
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
ode->h=Clamp(ode->h,ode->h_min,ode->h_max);
|
ode->h=Clamp(ode->h,ode->h_min,ode->h_max);
|
||||||
ODECashKarp(ode);
|
ODECashKarp(ode);
|
||||||
errmax=0.0;
|
errmax=0.0;
|
||||||
for (i=0;i<ode->n_internal;i++) {
|
for (i=0;i<ode->n_internal;i++) {
|
||||||
temp=Abs(stateerr[i]/ode->state_scale[i]);
|
tmp=Abs(stateerr[i]/ode->state_scale[i]);
|
||||||
if (temp>errmax)
|
if (tmp>errmax)
|
||||||
errmax=temp;
|
errmax=tmp;
|
||||||
}
|
}
|
||||||
errmax/=ode->tolerance_internal;
|
errmax/=ode->tolerance_internal;
|
||||||
if (errmax<=1.0 || ode->h==ode->h_min) break;
|
if (errmax<=1.0 || ode->h==ode->h_min) break;
|
||||||
temp=ode->h*SAFETY*errmax`PSHRNK;
|
tmp=ode->h*SAFETY*errmax`PSHRNK;
|
||||||
if (temp<0.1*ode->h)
|
if (tmp<0.1*ode->h)
|
||||||
ode->h*=0.1;
|
ode->h*=0.1;
|
||||||
else
|
else
|
||||||
ode->h=temp;
|
ode->h=tmp;
|
||||||
}
|
}
|
||||||
ode->t+=ode->h;
|
ode->t+=ode->h;
|
||||||
if (errmax>ERRCON)
|
if (errmax>ERRCON)
|
||||||
@@ -493,13 +493,13 @@ U0 ODERK5OneStep(CMathODE *ode)
|
|||||||
else
|
else
|
||||||
ode->h*=5.0;
|
ode->h*=5.0;
|
||||||
ode->h=Clamp(ode->h,ode->h_min,ode->h_max);
|
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;
|
F64 ode_alloced_factor=0.75;
|
||||||
|
|
||||||
U0 ODEsUpdate(CTask *task)
|
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
|
basis to allow real-time simulation. It is intended
|
||||||
to provide ress good enough for games. It uses a runge-kutta
|
to provide ress good enough for games. It uses a runge-kutta
|
||||||
integrator which is a better algorithm than doing it with Euler.
|
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)
|
public U8 *ACDDefGet(U8 *st,I64 def_num=1)
|
||||||
{//MAlloc str holding single dict definition of word.
|
{//MAlloc str holding single dict definition of word.
|
||||||
CFile *f;
|
CFile *f;
|
||||||
CHashGeneric *temph;
|
CHashGeneric *tmph;
|
||||||
U8 *res=NULL,*buf,*in_ptr,
|
U8 *res=NULL,*buf,*in_ptr,
|
||||||
*st2=MStrUtil(st,SUF_TO_UPPER);
|
*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);
|
Free(st2);
|
||||||
if (temph) {
|
if (tmph) {
|
||||||
if (f=FOpen(ACD_DEF_FILENAME,"r")) {
|
if (f=FOpen(ACD_DEF_FILENAME,"r")) {
|
||||||
buf=MAlloc(ACD_BLK_SIZE*2+1);
|
buf=MAlloc(ACD_BLK_SIZE*2+1);
|
||||||
buf[ACD_BLK_SIZE*2]=0; //terminate
|
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);
|
ACD_BLK_SIZE*2/BLK_SIZE);
|
||||||
FClose(f);
|
FClose(f);
|
||||||
in_ptr=buf;
|
in_ptr=buf;
|
||||||
@@ -46,16 +46,16 @@ public U8 *ACDDefGet(U8 *st,I64 def_num=1)
|
|||||||
public U8 *ACDDefsGet(U8 *st)
|
public U8 *ACDDefsGet(U8 *st)
|
||||||
{//MAlloc str with all dict definitions of word.
|
{//MAlloc str with all dict definitions of word.
|
||||||
CFile *f;
|
CFile *f;
|
||||||
CHashGeneric *temph;
|
CHashGeneric *tmph;
|
||||||
U8 *res=NULL,*buf,*in_ptr,*in_ptr2,
|
U8 *res=NULL,*buf,*in_ptr,*in_ptr2,
|
||||||
*st2=MStrUtil(st,SUF_TO_UPPER);
|
*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);
|
Free(st2);
|
||||||
if (temph) {
|
if (tmph) {
|
||||||
if (f=FOpen(ACD_DEF_FILENAME,"r")) {
|
if (f=FOpen(ACD_DEF_FILENAME,"r")) {
|
||||||
buf=MAlloc(ACD_BLK_SIZE*2+1);
|
buf=MAlloc(ACD_BLK_SIZE*2+1);
|
||||||
buf[ACD_BLK_SIZE*2]=0; //terminate
|
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);
|
ACD_BLK_SIZE*2/BLK_SIZE);
|
||||||
FClose(f);
|
FClose(f);
|
||||||
in_ptr=buf;
|
in_ptr=buf;
|
||||||
@@ -143,7 +143,7 @@ U0 ACDFillin(I64 n)
|
|||||||
s=acd.fillins[n]+1;
|
s=acd.fillins[n]+1;
|
||||||
len=StrLen(s);
|
len=StrLen(s);
|
||||||
if (len>ac.partial_len)
|
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) {
|
if (0<=--n<ac.num_fillins) {
|
||||||
s=ac.fillin_matches[n]->str;
|
s=ac.fillin_matches[n]->str;
|
||||||
if (StrLen(s)>ac.partial_len)
|
if (StrLen(s)>ac.partial_len)
|
||||||
Auto(s+ac.partial_len);
|
In(s+ac.partial_len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 ACMan(I64 n,CTask *parent_task=NULL)
|
U0 ACMan(I64 n,CTask *parent_task=NULL)
|
||||||
{
|
{
|
||||||
CHashAC *tempw;
|
CHashAC *tmpw;
|
||||||
CHashSrcSym *temph;
|
CHashSrcSym *tmph;
|
||||||
if (0<=--n<ac.num_fillins && (tempw=ac.fillin_matches[n]) &&
|
if (0<=--n<ac.num_fillins && (tmpw=ac.fillin_matches[n]) &&
|
||||||
(temph=HashFind(tempw->str,Fs->hash_table,HTG_SRC_SYM)) &&
|
(tmph=HashFind(tmpw->str,Fs->hash_table,HTG_SRC_SYM)) &&
|
||||||
temph->src_link)
|
tmph->src_link)
|
||||||
PopUpEd(temph->src_link,parent_task);
|
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()
|
public U0 ACDWordsLoad()
|
||||||
{//Put words from word list into hash table.
|
{//Put words from word list into hash table.
|
||||||
I64 size;
|
I64 size;
|
||||||
CHashGeneric *temph;
|
CHashGeneric *tmph;
|
||||||
U8 *in_ptr,*in_start,*st2;
|
U8 *in_ptr,*in_start,*st2;
|
||||||
U16 *d;
|
U16 *d;
|
||||||
acd.num_words=0;
|
acd.num_words=0;
|
||||||
@@ -21,17 +21,17 @@ public U0 ACDWordsLoad()
|
|||||||
in_ptr++;
|
in_ptr++;
|
||||||
if (*in_ptr) {
|
if (*in_ptr) {
|
||||||
st2=MStrUtil(in_ptr,SUF_TO_UPPER);
|
st2=MStrUtil(in_ptr,SUF_TO_UPPER);
|
||||||
temph=ACAlloc(sizeof(CHashGeneric)+StrLen(st2)+1);
|
tmph=ACAlloc(sizeof(CHashGeneric)+StrLen(st2)+1);
|
||||||
StrCpy(temph+1,st2);
|
StrCpy(tmph+1,st2);
|
||||||
Free(st2);
|
Free(st2);
|
||||||
in_ptr+=StrLen(in_ptr)+1;
|
in_ptr+=StrLen(in_ptr)+1;
|
||||||
temph->str=temph+1;
|
tmph->str=tmph+1;
|
||||||
temph->use_cnt=1;
|
tmph->use_cnt=1;
|
||||||
temph->type=HTT_DICT_WORD;
|
tmph->type=HTT_DICT_WORD;
|
||||||
d=in_ptr;
|
d=in_ptr;
|
||||||
temph->user_data0=*d;
|
tmph->user_data0=*d;
|
||||||
in_ptr+=2;
|
in_ptr+=2;
|
||||||
HashAdd(temph,ac.hash_table);
|
HashAdd(tmph,ac.hash_table);
|
||||||
acd.num_words++;
|
acd.num_words++;
|
||||||
} else
|
} else
|
||||||
in_ptr+=3;
|
in_ptr+=3;
|
||||||
@@ -43,19 +43,19 @@ public U0 ACDWordsLoad()
|
|||||||
#help_index "AutoComplete"
|
#help_index "AutoComplete"
|
||||||
CHashAC *ACHashAdd(U8 *w)
|
CHashAC *ACHashAdd(U8 *w)
|
||||||
{
|
{
|
||||||
CHashAC *tempw=HashFind(w,ac.hash_table,HTT_WORD);
|
CHashAC *tmpw=HashFind(w,ac.hash_table,HTT_WORD);
|
||||||
if (tempw) {
|
if (tmpw) {
|
||||||
tempw->hits++;
|
tmpw->hits++;
|
||||||
return tempw;
|
return tmpw;
|
||||||
}
|
}
|
||||||
tempw=ACAlloc(sizeof(CHashAC));
|
tmpw=ACAlloc(sizeof(CHashAC));
|
||||||
tempw->str=AStrNew(w);
|
tmpw->str=AStrNew(w);
|
||||||
tempw->type=HTT_WORD;
|
tmpw->type=HTT_WORD;
|
||||||
tempw->use_cnt=1;
|
tmpw->use_cnt=1;
|
||||||
tempw->hits=1;
|
tmpw->hits=1;
|
||||||
HashAdd(tempw,ac.hash_table);
|
HashAdd(tmpw,ac.hash_table);
|
||||||
ac.num_words++;
|
ac.num_words++;
|
||||||
return tempw;
|
return tmpw;
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 ACSingleFileAdd(U8 *buf)
|
U0 ACSingleFileAdd(U8 *buf)
|
||||||
@@ -93,20 +93,20 @@ U0 ACSingleFileAdd(U8 *buf)
|
|||||||
U0 ACMainFileLstTraverse(U8 *files_find_mask)
|
U0 ACMainFileLstTraverse(U8 *files_find_mask)
|
||||||
{
|
{
|
||||||
U8 *buf;
|
U8 *buf;
|
||||||
CDirEntry *tempde,*tempde1;
|
CDirEntry *tmpde,*tmpde1;
|
||||||
try {
|
try {
|
||||||
tempde=tempde1=FilesFind(files_find_mask,
|
tmpde=tmpde1=FilesFind(files_find_mask,
|
||||||
FUF_RECURSE|FUF_JUST_TXT|FUF_JUST_FILES|FUF_CLUSTER_ORDER);
|
FUF_RECURSE|FUF_JUST_TXT|FUF_JUST_FILES|FUF_CLUSTER_ORDER);
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
"%s\n",tempde->full_name;
|
"%s\n",tmpde->full_name;
|
||||||
buf=FileRead(tempde->full_name);
|
buf=FileRead(tmpde->full_name);
|
||||||
ACSingleFileAdd(buf);
|
ACSingleFileAdd(buf);
|
||||||
Free(buf);
|
Free(buf);
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
} catch
|
} catch
|
||||||
Fs->catch_except=TRUE;
|
Fs->catch_except=TRUE;
|
||||||
DirTreeDel(tempde1);
|
DirTreeDel(tmpde1);
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 ACProgressTask(Bool *_start_flag)
|
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;
|
return i+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 ACFillInAdd(CHashAC *tempw)
|
U0 ACFillInAdd(CHashAC *tmpw)
|
||||||
{
|
{
|
||||||
I64 k;
|
I64 k;
|
||||||
if (ac.num_fillins<AC_MAX_FILLINS ||
|
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--) {
|
for (k=ac.num_fillins-1;k>=0;k--) {
|
||||||
if (tempw->hits<=ac.fillin_hits[k])
|
if (tmpw->hits<=ac.fillin_hits[k])
|
||||||
break;
|
break;
|
||||||
else {
|
else {
|
||||||
ac.fillin_matches[k+1]=ac.fillin_matches[k];
|
ac.fillin_matches[k+1]=ac.fillin_matches[k];
|
||||||
ac.fillin_hits[k+1] =ac.fillin_hits[k];
|
ac.fillin_hits[k+1] =ac.fillin_hits[k];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ac.fillin_matches[k+1]=tempw;
|
ac.fillin_matches[k+1]=tmpw;
|
||||||
ac.fillin_hits[k+1] =tempw->hits;
|
ac.fillin_hits[k+1] =tmpw->hits;
|
||||||
if (ac.num_fillins<AC_MAX_FILLINS)
|
if (ac.num_fillins<AC_MAX_FILLINS)
|
||||||
ac.num_fillins++;
|
ac.num_fillins++;
|
||||||
}
|
}
|
||||||
@@ -85,9 +85,9 @@ U0 ACPutChoices(CDoc *focus_l,CDocEntry *doc_e,CTask *focus_task,
|
|||||||
{
|
{
|
||||||
I64 i,data_col;
|
I64 i,data_col;
|
||||||
U8 *buf,*buf1,*src=NULL,*st;
|
U8 *buf,*buf1,*src=NULL,*st;
|
||||||
CHashAC *tempw;
|
CHashAC *tmpw;
|
||||||
F64 timeout_time=tS+0.5;
|
F64 timeout_time=tS+0.5;
|
||||||
CHashSrcSym *temph;
|
CHashSrcSym *tmph;
|
||||||
|
|
||||||
src=DocScanLine(focus_l,doc_e,&data_col);
|
src=DocScanLine(focus_l,doc_e,&data_col);
|
||||||
DocUnlock(focus_l);
|
DocUnlock(focus_l);
|
||||||
@@ -108,11 +108,11 @@ U0 ACPutChoices(CDoc *focus_l,CDocEntry *doc_e,CTask *focus_task,
|
|||||||
ac.num_fillins=0;
|
ac.num_fillins=0;
|
||||||
if (*ac.cur_word)
|
if (*ac.cur_word)
|
||||||
for (i=0;i<=ac.hash_table->mask && tS<timeout_time;i++) {
|
for (i=0;i<=ac.hash_table->mask && tS<timeout_time;i++) {
|
||||||
tempw=ac.hash_table->body[i];
|
tmpw=ac.hash_table->body[i];
|
||||||
while (tempw) {
|
while (tmpw) {
|
||||||
if (!MemCmp(ac.cur_word,tempw->str,StrLen(ac.cur_word)))
|
if (!MemCmp(ac.cur_word,tmpw->str,StrLen(ac.cur_word)))
|
||||||
ACFillInAdd(tempw);
|
ACFillInAdd(tmpw);
|
||||||
tempw=tempw->next;
|
tmpw=tmpw->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ACDocRst(51,13);
|
ACDocRst(51,13);
|
||||||
@@ -122,11 +122,11 @@ U0 ACPutChoices(CDoc *focus_l,CDocEntry *doc_e,CTask *focus_task,
|
|||||||
st=ac.fillin_matches[i]->str;
|
st=ac.fillin_matches[i]->str;
|
||||||
"$$GREEN$$F%02d$$FG$$ ",i+1;
|
"$$GREEN$$F%02d$$FG$$ ",i+1;
|
||||||
if (TaskValidate(focus_task) &&
|
if (TaskValidate(focus_task) &&
|
||||||
(temph=HashFind(st,focus_task->hash_table,HTG_SRC_SYM)) &&
|
(tmph=HashFind(st,focus_task->hash_table,HTG_SRC_SYM)) &&
|
||||||
temph->src_link) {
|
tmph->src_link) {
|
||||||
if (temph->type&HTF_PUBLIC)
|
if (tmph->type&HTF_PUBLIC)
|
||||||
"$$RED$$";
|
"$$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
|
} else
|
||||||
"%s\n",st;
|
"%s\n",st;
|
||||||
}
|
}
|
||||||
|
|||||||
File renamed without changes.
+11
-11
@@ -18,15 +18,15 @@ U0 CtrlsUpdate(CTask *task)
|
|||||||
if (c->update_derived_vals)
|
if (c->update_derived_vals)
|
||||||
(*c->update_derived_vals)(c);
|
(*c->update_derived_vals)(c);
|
||||||
if (c->flags&CTRLF_BORDER) {
|
if (c->flags&CTRLF_BORDER) {
|
||||||
c->screen_left =gr.pan_text_x+task->pix_left+c->left-FONT_WIDTH;
|
c->scrn_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->scrn_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->scrn_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_bottom=gr.pan_text_y+task->pix_top+c->bottom-FONT_HEIGHT;
|
||||||
} else {
|
} else {
|
||||||
c->screen_left =gr.pan_text_x+task->pix_left+c->left;
|
c->scrn_left =gr.pan_text_x+task->pix_left+c->left;
|
||||||
c->screen_right =gr.pan_text_x+task->pix_left+c->right;
|
c->scrn_right =gr.pan_text_x+task->pix_left+c->right;
|
||||||
c->screen_top =gr.pan_text_y+task->pix_top+c->top;
|
c->scrn_top =gr.pan_text_y+task->pix_top+c->top;
|
||||||
c->screen_bottom=gr.pan_text_y+task->pix_top+c->bottom;
|
c->scrn_bottom=gr.pan_text_y+task->pix_top+c->bottom;
|
||||||
}
|
}
|
||||||
c=c->next;
|
c=c->next;
|
||||||
}
|
}
|
||||||
@@ -35,9 +35,9 @@ U0 CtrlsUpdate(CTask *task)
|
|||||||
fp_update_ctrls=&CtrlsUpdate;
|
fp_update_ctrls=&CtrlsUpdate;
|
||||||
|
|
||||||
Bool CtrlInsideRect(CCtrl *c,I64 x,I64 y)
|
Bool CtrlInsideRect(CCtrl *c,I64 x,I64 y)
|
||||||
{//screen coordinates
|
{//scrn coordinates
|
||||||
if (c->screen_left<=x<=c->screen_right &&
|
if (c->scrn_left<=x<=c->scrn_right &&
|
||||||
c->screen_top<=y<=c->screen_bottom)
|
c->scrn_top<=y<=c->scrn_bottom)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|||||||
+33
-33
@@ -14,7 +14,7 @@ class CTemplateCS
|
|||||||
|
|
||||||
CTemplateCS *CtrlSliderGet()
|
CTemplateCS *CtrlSliderGet()
|
||||||
{
|
{
|
||||||
CTemplateCSSlider *temps;
|
CTemplateCSSlider *tmps;
|
||||||
U8 *st,pmt[STR_LEN];
|
U8 *st,pmt[STR_LEN];
|
||||||
CTemplateCS *res=CAlloc(sizeof(CTemplateCS));
|
CTemplateCS *res=CAlloc(sizeof(CTemplateCS));
|
||||||
|
|
||||||
@@ -33,10 +33,10 @@ CTemplateCS *CtrlSliderGet()
|
|||||||
Free(st);
|
Free(st);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
temps=CAlloc(sizeof(CTemplateCSSlider));
|
tmps=CAlloc(sizeof(CTemplateCSSlider));
|
||||||
temps->name=st;
|
tmps->name=st;
|
||||||
QueIns(temps,res->last_slider);
|
QueIns(tmps,res->last_slider);
|
||||||
temps->num=res->num_sliders++;
|
tmps->num=res->num_sliders++;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -45,7 +45,7 @@ U0 TemplateCtrlSlider(CDoc *doc)
|
|||||||
{
|
{
|
||||||
CTask *task;
|
CTask *task;
|
||||||
CTemplateCS *m=NULL;
|
CTemplateCS *m=NULL;
|
||||||
CTemplateCSSlider *temps;
|
CTemplateCSSlider *tmps;
|
||||||
I64 i;
|
I64 i;
|
||||||
|
|
||||||
DocUnlock(doc);
|
DocUnlock(doc);
|
||||||
@@ -65,10 +65,10 @@ class CSliderState
|
|||||||
{
|
{
|
||||||
",m->range,m->spacing,m->border);
|
",m->range,m->spacing,m->border);
|
||||||
|
|
||||||
temps=m->next_slider;
|
tmps=m->next_slider;
|
||||||
while (temps!=&m->next_slider) {
|
while (tmps!=&m->next_slider) {
|
||||||
DocPrint(doc," I64 %s;\n",temps->name);
|
DocPrint(doc," I64 %s;\n",tmps->name);
|
||||||
temps=temps->next;
|
tmps=tmps->next;
|
||||||
}
|
}
|
||||||
if (*m->glbl_name)
|
if (*m->glbl_name)
|
||||||
DocPrint(doc,"} %s;\n",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");
|
DocPrint(doc," dc->color=LTRED;\n");
|
||||||
|
|
||||||
temps=m->next_slider;
|
tmps=m->next_slider;
|
||||||
while (temps!=&m->next_slider) {
|
while (tmps!=&m->next_slider) {
|
||||||
DocPrint(doc,
|
DocPrint(doc,
|
||||||
" GrPrint(dc,c->left+%d*SLIDER_SPACING+%d-FONT_WIDTH/2,
|
" GrPrint(dc,c->left+%d*SLIDER_SPACING+%d-FONT_WIDTH/2,
|
||||||
c->top+SLIDER_SPACING+SLIDER_RANGE+3,
|
c->top+SLIDER_SPACING+SLIDER_RANGE+3,
|
||||||
\"%%d\",s->%s*10/SLIDER_RANGE);\n",
|
\"%%d\",s->%s*10/SLIDER_RANGE);\n",
|
||||||
temps->num+1,temps->num,temps->name);
|
tmps->num+1,tmps->num,tmps->name);
|
||||||
temps=temps->next;
|
tmps=tmps->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
temps=m->next_slider;
|
tmps=m->next_slider;
|
||||||
while (temps!=&m->next_slider) {
|
while (tmps!=&m->next_slider) {
|
||||||
DocPrint(doc,
|
DocPrint(doc,
|
||||||
" GrRect(dc,c->left+%d*SLIDER_SPACING+%d-3,"
|
" GrRect(dc,c->left+%d*SLIDER_SPACING+%d-3,"
|
||||||
"c->top+SLIDER_SPACING+SLIDER_RANGE-1-s->%s-2,7,5);\n",
|
"c->top+SLIDER_SPACING+SLIDER_RANGE-1-s->%s-2,7,5);\n",
|
||||||
temps->num+1,temps->num,temps->name);
|
tmps->num+1,tmps->num,tmps->name);
|
||||||
temps=temps->next;
|
tmps=tmps->next;
|
||||||
}
|
}
|
||||||
DocPrint(doc," dc->color=YELLOW;\n");
|
DocPrint(doc," dc->color=YELLOW;\n");
|
||||||
|
|
||||||
temps=m->next_slider;
|
tmps=m->next_slider;
|
||||||
while (temps!=&m->next_slider) {
|
while (tmps!=&m->next_slider) {
|
||||||
DocPrint(doc," GrRect(dc,c->left+%d*SLIDER_SPACING+%d-2,"
|
DocPrint(doc," GrRect(dc,c->left+%d*SLIDER_SPACING+%d-2,"
|
||||||
"c->top+SLIDER_SPACING+SLIDER_RANGE-1-s->%s-1,5,3);\n",
|
"c->top+SLIDER_SPACING+SLIDER_RANGE-1-s->%s-1,5,3);\n",
|
||||||
temps->num+1,temps->num,temps->name);
|
tmps->num+1,tmps->num,tmps->name);
|
||||||
temps=temps->next;
|
tmps=tmps->next;
|
||||||
}
|
}
|
||||||
DocPrint(doc,
|
DocPrint(doc,
|
||||||
"}
|
"}
|
||||||
@@ -137,11 +137,11 @@ U0 UpdateDerivedCtrlSlider(CCtrl *c)
|
|||||||
c->bottom=c->top+SLIDER_SPACING*2+SLIDER_RANGE;
|
c->bottom=c->top+SLIDER_SPACING*2+SLIDER_RANGE;
|
||||||
",m->num_sliders+1,m->num_sliders);
|
",m->num_sliders+1,m->num_sliders);
|
||||||
|
|
||||||
temps=m->next_slider;
|
tmps=m->next_slider;
|
||||||
while (temps!=&m->next_slider) {
|
while (tmps!=&m->next_slider) {
|
||||||
DocPrint(doc," s->%s=ClampI64(s->%s,0,SLIDER_RANGE-1);\n",
|
DocPrint(doc," s->%s=ClampI64(s->%s,0,SLIDER_RANGE-1);\n",
|
||||||
temps->name,temps->name);
|
tmps->name,tmps->name);
|
||||||
temps=temps->next;
|
tmps=tmps->next;
|
||||||
}
|
}
|
||||||
DocPrint(doc,
|
DocPrint(doc,
|
||||||
"}
|
"}
|
||||||
@@ -152,19 +152,19 @@ U0 LeftClickSlider(CCtrl *c,I64 x,I64 y,Bool down)
|
|||||||
CSliderState *s=c->state;
|
CSliderState *s=c->state;
|
||||||
");
|
");
|
||||||
|
|
||||||
temps=m->next_slider;
|
tmps=m->next_slider;
|
||||||
while (temps!=&m->next_slider) {
|
while (tmps!=&m->next_slider) {
|
||||||
DocPrint(doc," ");
|
DocPrint(doc," ");
|
||||||
if (temps!=m->next_slider)
|
if (tmps!=m->next_slider)
|
||||||
DocPrint(doc,"else ");
|
DocPrint(doc,"else ");
|
||||||
if (temps->next==&m->next_slider)
|
if (tmps->next==&m->next_slider)
|
||||||
DocPrint(doc,"\n");
|
DocPrint(doc,"\n");
|
||||||
else
|
else
|
||||||
DocPrint(doc,"if (x<c->left+%d*SLIDER_SPACING+%d+SLIDER_SPACING/2)\n",
|
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",
|
DocPrint(doc," s->%s=SLIDER_RANGE-1-(y-(c->top+SLIDER_SPACING));\n",
|
||||||
temps->name);
|
tmps->name);
|
||||||
temps=temps->next;
|
tmps=tmps->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
DocPrint(doc,
|
DocPrint(doc,
|
||||||
|
|||||||
+23
-23
@@ -117,7 +117,7 @@ U0 PCILookUpSingle(CDoc *doc,I64 m,I64 d,U8 **_vendor,U8 **_dev)
|
|||||||
|
|
||||||
U0 PCILookUpDevs()
|
U0 PCILookUpDevs()
|
||||||
{
|
{
|
||||||
CPCIDev *temppci;
|
CPCIDev *tmppci;
|
||||||
I64 w1,w2,b,d,f,timeout=32*8*2;
|
I64 w1,w2,b,d,f,timeout=32*8*2;
|
||||||
CDoc *doc;
|
CDoc *doc;
|
||||||
if (dev.pci_head.next!=&dev.pci_head)
|
if (dev.pci_head.next!=&dev.pci_head)
|
||||||
@@ -128,16 +128,16 @@ U0 PCILookUpDevs()
|
|||||||
for (f=0;f<8;f++) {
|
for (f=0;f<8;f++) {
|
||||||
w1=PCIReadU16(b,d,f,0);
|
w1=PCIReadU16(b,d,f,0);
|
||||||
if (w1!=0xFFFF) {
|
if (w1!=0xFFFF) {
|
||||||
temppci=ACAlloc(sizeof(CPCIDev));
|
tmppci=ACAlloc(sizeof(CPCIDev));
|
||||||
temppci->bus=b;
|
tmppci->bus=b;
|
||||||
temppci->dev=d;
|
tmppci->dev=d;
|
||||||
temppci->fun=f;
|
tmppci->fun=f;
|
||||||
temppci->vendor=w1;
|
tmppci->vendor=w1;
|
||||||
temppci->dev_id=w2=PCIReadU16(b,d,f,2);
|
tmppci->dev_id=w2=PCIReadU16(b,d,f,2);
|
||||||
temppci->sub_code=PCIReadU8(b,d,f,0xA);
|
tmppci->sub_code=PCIReadU8(b,d,f,0xA);
|
||||||
temppci->base_code=PCIReadU8(b,d,f,0xB);
|
tmppci->base_code=PCIReadU8(b,d,f,0xB);
|
||||||
PCILookUpSingle(doc,w1,w2,&temppci->vendor_str,&temppci->dev_id_str);
|
PCILookUpSingle(doc,w1,w2,&tmppci->vendor_str,&tmppci->dev_id_str);
|
||||||
QueIns(temppci,dev.pci_head.last);
|
QueIns(tmppci,dev.pci_head.last);
|
||||||
timeout=32*8*2;
|
timeout=32*8*2;
|
||||||
} else if (sys_pci_busses==256 && --timeout<=0)
|
} else if (sys_pci_busses==256 && --timeout<=0)
|
||||||
goto lud_done;
|
goto lud_done;
|
||||||
@@ -148,20 +148,20 @@ lud_done:
|
|||||||
|
|
||||||
public U0 PCIRep()
|
public U0 PCIRep()
|
||||||
{//Report description of PCI devices.
|
{//Report description of PCI devices.
|
||||||
CPCIDev *temppci;
|
CPCIDev *tmppci;
|
||||||
"PCI Busses:%d\n",sys_pci_busses;
|
"PCI Busses:%d\n",sys_pci_busses;
|
||||||
if (!FileFind(PCI_DEV_FILE)) {
|
if (!FileFind(PCI_DEV_FILE)) {
|
||||||
"You don't have the PCI device file.\n";
|
"You don't have the PCI device file.\n";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PCILookUpDevs;
|
PCILookUpDevs;
|
||||||
temppci=dev.pci_head.next;
|
tmppci=dev.pci_head.next;
|
||||||
while (temppci!=&dev.pci_head) {
|
while (tmppci!=&dev.pci_head) {
|
||||||
"%02X:%02X:%01X %02X%02X $$GREEN$$%s $$CYAN$$%s$$FG$$\n",
|
"%02X:%02X:%01X %02X%02X $$GREEN$$%s $$CYAN$$%s$$FG$$\n",
|
||||||
temppci->bus,temppci->dev,temppci->fun,
|
tmppci->bus,tmppci->dev,tmppci->fun,
|
||||||
temppci->base_code,temppci->sub_code,
|
tmppci->base_code,tmppci->sub_code,
|
||||||
temppci->vendor_str,temppci->dev_id_str;
|
tmppci->vendor_str,tmppci->dev_id_str;
|
||||||
temppci=temppci->next;
|
tmppci=tmppci->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,18 +243,18 @@ public U0 MemBIOSRep()
|
|||||||
{//Report the memory ranges reported by the BIOS at boot.
|
{//Report the memory ranges reported by the BIOS at boot.
|
||||||
U16 *m01=SYS_MEM_E801;
|
U16 *m01=SYS_MEM_E801;
|
||||||
CMemE820 *m20=SYS_MEM_E820;
|
CMemE820 *m20=SYS_MEM_E820;
|
||||||
CMemRange *tempmr;
|
CMemRange *tmpmr;
|
||||||
"Standard Addresses\n"
|
"Standard Addresses\n"
|
||||||
"0x000A0000-0x000BFFFF VGA\n"
|
"0x000A0000-0x000BFFFF VGA\n"
|
||||||
"0xFEE00000-0xFEE00FFF See $$LK,\"APIC\",A=\"MN:LAPIC_BASE\"$$\n\n"
|
"0xFEE00000-0xFEE00FFF See $$LK,\"APIC\",A=\"MN:LAPIC_BASE\"$$\n\n"
|
||||||
"32 Bit Device Mem\n";
|
"32 Bit Device Mem\n";
|
||||||
while (LBts(&sys_semas[SYS_SEMA_DEV_MEM],0))
|
while (LBts(&sys_semas[SYS_SEMA_DEV_MEM],0))
|
||||||
Yield;
|
Yield;
|
||||||
tempmr=dev.mem32_head.next;
|
tmpmr=dev.mem32_head.next;
|
||||||
while (tempmr!=&dev.mem32_head) {
|
while (tmpmr!=&dev.mem32_head) {
|
||||||
"%02X:0x%016X-0x%016X\n",
|
"%02X:0x%016X-0x%016X\n",
|
||||||
tempmr->type,tempmr->base,tempmr->base+tempmr->size-1;
|
tmpmr->type,tmpmr->base,tmpmr->base+tmpmr->size-1;
|
||||||
tempmr=tempmr->next;
|
tmpmr=tmpmr->next;
|
||||||
}
|
}
|
||||||
LBtr(&sys_semas[SYS_SEMA_DEV_MEM],0);
|
LBtr(&sys_semas[SYS_SEMA_DEV_MEM],0);
|
||||||
|
|
||||||
|
|||||||
+16
-16
@@ -34,7 +34,7 @@ U0 DocBinsValidate(CDoc *doc)
|
|||||||
b=doc->bin_head.next;
|
b=doc->bin_head.next;
|
||||||
while (b!=&doc->bin_head) {
|
while (b!=&doc->bin_head) {
|
||||||
b->use_cnt=0;
|
b->use_cnt=0;
|
||||||
b->temp_use_cnt=0;
|
b->tmp_use_cnt=0;
|
||||||
b->renum_num=-1;
|
b->renum_num=-1;
|
||||||
Free(b->tag);
|
Free(b->tag);
|
||||||
b->tag=NULL;
|
b->tag=NULL;
|
||||||
@@ -46,7 +46,7 @@ U0 DocBinsValidate(CDoc *doc)
|
|||||||
if (doc_e->de_flags & DOCEF_HAS_BIN) {
|
if (doc_e->de_flags & DOCEF_HAS_BIN) {
|
||||||
if (b=doc_e->bin_data=DocBinFindNum(doc,doc_e->bin_num)) {
|
if (b=doc_e->bin_data=DocBinFindNum(doc,doc_e->bin_num)) {
|
||||||
if (doc_e->de_flags & DOCEF_BIN_PTR_LINK)
|
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++)
|
if (!b->use_cnt++)
|
||||||
b->renum_num=++renum_num;
|
b->renum_num=++renum_num;
|
||||||
doc_e->bin_num=b->renum_num;
|
doc_e->bin_num=b->renum_num;
|
||||||
@@ -98,7 +98,7 @@ I64 DocBinPtrRst(CDoc *doc,CDocEntry *doc_e)
|
|||||||
{
|
{
|
||||||
U8 *st,*st2;
|
U8 *st,*st2;
|
||||||
CDoc *doc2;
|
CDoc *doc2;
|
||||||
CDocBin *tempb,*tempb2;
|
CDocBin *tmpb,*tmpb2;
|
||||||
I64 i,bin_num=0;
|
I64 i,bin_num=0;
|
||||||
if (doc_e->de_flags&DOCEF_HAS_BIN &&
|
if (doc_e->de_flags&DOCEF_HAS_BIN &&
|
||||||
doc_e->bin_ptr_link && StrLen(doc_e->bin_ptr_link)) {
|
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);
|
i=Str2I64(st2);
|
||||||
if (i>0||*st2) {
|
if (i>0||*st2) {
|
||||||
doc2=DocRead(st);
|
doc2=DocRead(st);
|
||||||
if (i>0 && (tempb2=DocBinFindNum(doc2,i)) ||
|
if (i>0 && (tmpb2=DocBinFindNum(doc2,i)) ||
|
||||||
i==0 && (tempb2=DocBinFindTag(doc2,st2))) {
|
i==0 && (tmpb2=DocBinFindTag(doc2,st2))) {
|
||||||
i=1;
|
i=1;
|
||||||
if (bin_num>0) {
|
if (bin_num>0) {
|
||||||
if (tempb=DocBinFindNum(doc,bin_num)) {
|
if (tmpb=DocBinFindNum(doc,bin_num)) {
|
||||||
i=tempb->use_cnt;
|
i=tmpb->use_cnt;
|
||||||
DocBinDel(doc,tempb);
|
DocBinDel(doc,tmpb);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
bin_num=doc->cur_bin_num++;
|
bin_num=doc->cur_bin_num++;
|
||||||
tempb=MAllocIdent(tempb2,doc->mem_task);
|
tmpb=MAllocIdent(tmpb2,doc->mem_task);
|
||||||
tempb->use_cnt=i;
|
tmpb->use_cnt=i;
|
||||||
tempb->data=MAllocIdent(tempb2->data,doc->mem_task);
|
tmpb->data=MAllocIdent(tmpb2->data,doc->mem_task);
|
||||||
tempb->num=bin_num;
|
tmpb->num=bin_num;
|
||||||
doc_e->bin_data=tempb;
|
doc_e->bin_data=tmpb;
|
||||||
if (doc_e->de_flags&DOCEF_TAG && doc_e->tag && *doc_e->tag)
|
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
|
else
|
||||||
tempb->tag=NULL;
|
tmpb->tag=NULL;
|
||||||
QueIns(tempb,doc->bin_head.last);
|
QueIns(tmpb,doc->bin_head.last);
|
||||||
} else
|
} else
|
||||||
bin_num=0;
|
bin_num=0;
|
||||||
DocDel(doc2);
|
DocDel(doc2);
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ public U0 EdLineDown(CDoc *doc,I64 sc=MIN_I64)
|
|||||||
if ((doc_ce2->y<y || doc_ce2->x<x ||
|
if ((doc_ce2->y<y || doc_ce2->x<x ||
|
||||||
doc_ce2->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP) ||
|
doc_ce2->de_flags & (DOCEF_SKIP|DOCEF_FILTER_SKIP) ||
|
||||||
doc_ce2->x==x && !doc_ce2->max_col &&
|
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);
|
BEqu(&doc_ce2->type,DOCEt_SEL,sc&SCF_SHIFT);
|
||||||
if (doc_ce2==doc_ce) break;
|
if (doc_ce2==doc_ce) break;
|
||||||
doc_ce2=doc_ce2->next;
|
doc_ce2=doc_ce2->next;
|
||||||
@@ -455,7 +455,7 @@ U0 EdCharIns(I64 ch,I64 sc,CDoc *doc)
|
|||||||
} else {
|
} else {
|
||||||
doc->dollar_buf[doc->dollar_buf_ptr]=0;
|
doc->dollar_buf[doc->dollar_buf_ptr]=0;
|
||||||
doc->flags&=~DOCF_IN_DOLLAR;
|
doc->flags&=~DOCF_IN_DOLLAR;
|
||||||
DocPrint(doc,doc->dollar_buf);
|
DocPrint(doc,"%s",doc->dollar_buf);
|
||||||
doc->dollar_buf_ptr=0;
|
doc->dollar_buf_ptr=0;
|
||||||
goto ic_done;
|
goto ic_done;
|
||||||
}
|
}
|
||||||
@@ -475,8 +475,8 @@ U0 EdCharIns(I64 ch,I64 sc,CDoc *doc)
|
|||||||
!(sc & (SCF_CTRL|SCF_SHIFT)) &&
|
!(sc & (SCF_CTRL|SCF_SHIFT)) &&
|
||||||
doc_ce->de_flags &
|
doc_ce->de_flags &
|
||||||
(DOCEF_LINK|DOCEF_TREE|DOCEF_LST|DOCEF_CHECK_COLLAPSABLE|
|
(DOCEF_LINK|DOCEF_TREE|DOCEF_LST|DOCEF_CHECK_COLLAPSABLE|
|
||||||
DOCEF_LEFT_MACRO|DOCEF_LEFT_EXP|DOCEF_LEFT_CB|DOCEF_LEFT_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_AUTO)) {
|
DOCEF_RIGHT_MACRO|DOCEF_RIGHT_EXP|DOCEF_RIGHT_CB|DOCEF_RIGHT_IN_STR)) {
|
||||||
doc->cmd_U8=ch;
|
doc->cmd_U8=ch;
|
||||||
DocEntryRun(doc,doc_ce,FALSE);
|
DocEntryRun(doc,doc_ce,FALSE);
|
||||||
DocLock(doc);
|
DocLock(doc);
|
||||||
|
|||||||
+30
-30
@@ -66,7 +66,7 @@ I64 EdRILex(CRILex *rx)
|
|||||||
{
|
{
|
||||||
rx->is_not_cont=FALSE;
|
rx->is_not_cont=FALSE;
|
||||||
I64 i;
|
I64 i;
|
||||||
CLexFile *tempf;
|
CLexFile *tmpf;
|
||||||
do {
|
do {
|
||||||
Lex(rx->cc1);
|
Lex(rx->cc1);
|
||||||
Lex(rx->cc2);
|
Lex(rx->cc2);
|
||||||
@@ -77,10 +77,10 @@ I64 EdRILex(CRILex *rx)
|
|||||||
rx->is_not_cont=TRUE;
|
rx->is_not_cont=TRUE;
|
||||||
if (rx->was_new_line && (rx->cc1->token!=':' || i==KW_CASE ||
|
if (rx->was_new_line && (rx->cc1->token!=':' || i==KW_CASE ||
|
||||||
i==KW_DFT || i==KW_START || i==KW_END)) {
|
i==KW_DFT || i==KW_START || i==KW_END)) {
|
||||||
tempf=rx->cc2->lex_include_stk;
|
tmpf=rx->cc2->lex_include_stk;
|
||||||
while (tempf->next)
|
while (tmpf->next)
|
||||||
tempf=tempf->next;
|
tmpf=tmpf->next;
|
||||||
QueVectU8Put(rx->indent,tempf->cur_entry->y,rx->depth+rx->one_shot);
|
QueVectU8Put(rx->indent,tmpf->cur_entry->y,rx->depth+rx->one_shot);
|
||||||
rx->one_shot=0;
|
rx->one_shot=0;
|
||||||
}
|
}
|
||||||
if (rx->cc2->token=='\n')
|
if (rx->cc2->token=='\n')
|
||||||
@@ -346,7 +346,7 @@ I64 EdRAGetU8(CDoc *doc)
|
|||||||
U0 EdRACollect(CDoc *doc,CRenum *head)
|
U0 EdRACollect(CDoc *doc,CRenum *head)
|
||||||
{
|
{
|
||||||
I64 ch,i;
|
I64 ch,i;
|
||||||
CRenum *tempr;
|
CRenum *tmpr;
|
||||||
U8 buf[sizeof(CEdFindText.find_text)];
|
U8 buf[sizeof(CEdFindText.find_text)];
|
||||||
ch=EdRAGetU8(doc);
|
ch=EdRAGetU8(doc);
|
||||||
while (ch>=0) {
|
while (ch>=0) {
|
||||||
@@ -371,9 +371,9 @@ U0 EdRACollect(CDoc *doc,CRenum *head)
|
|||||||
ch=EdRAGetU8(doc);
|
ch=EdRAGetU8(doc);
|
||||||
if (ch==':') {
|
if (ch==':') {
|
||||||
ch=EdRAGetU8(doc);
|
ch=EdRAGetU8(doc);
|
||||||
tempr=MAlloc(sizeof(CRenum));
|
tmpr=MAlloc(sizeof(CRenum));
|
||||||
StrCpy(tempr->label,buf);
|
StrCpy(tmpr->label,buf);
|
||||||
QueIns(tempr,head->last);
|
QueIns(tmpr,head->last);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -388,7 +388,7 @@ U0 EdRenumAsm(CDoc *doc)
|
|||||||
{
|
{
|
||||||
Bool unlock=DocLock(doc);
|
Bool unlock=DocLock(doc);
|
||||||
I64 num=0;
|
I64 num=0;
|
||||||
CRenum head,*tempr,*tempr1;
|
CRenum head,*tmpr,*tmpr1;
|
||||||
U8 buf[sizeof(CEdFindText.find_text)],
|
U8 buf[sizeof(CEdFindText.find_text)],
|
||||||
buf2[sizeof(CEdFindText.find_text)];
|
buf2[sizeof(CEdFindText.find_text)];
|
||||||
|
|
||||||
@@ -396,14 +396,14 @@ U0 EdRenumAsm(CDoc *doc)
|
|||||||
EdSelFun(doc,TRUE);
|
EdSelFun(doc,TRUE);
|
||||||
EdRACollect(doc,&head);
|
EdRACollect(doc,&head);
|
||||||
|
|
||||||
tempr=head.next;
|
tmpr=head.next;
|
||||||
while (tempr!=&head) {
|
while (tmpr!=&head) {
|
||||||
tempr1=tempr->next;
|
tmpr1=tmpr->next;
|
||||||
num+=ASM_RENUM_SPACING;
|
num+=ASM_RENUM_SPACING;
|
||||||
StrPrint(buf,"@#%02d",num);
|
StrPrint(buf,"@#%02d",num);
|
||||||
EdReplace(doc,tempr->label,buf,TRUE,TRUE,TRUE);
|
EdReplace(doc,tmpr->label,buf,TRUE,TRUE,TRUE);
|
||||||
Free(tempr);
|
Free(tmpr);
|
||||||
tempr=tempr1;
|
tmpr=tmpr1;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (num) {
|
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;
|
I64 i,start_y,end_y,x,r,goto_line_num;
|
||||||
U8 *b,*st,*st2,*prj_file;
|
U8 *b,*st,*st2,*prj_file;
|
||||||
CTask *task=NULL;
|
CTask *task=NULL;
|
||||||
CSrvCmd *tempc;
|
CSrvCmd *tmpc;
|
||||||
CQueVectU8 *indent;
|
CQueVectU8 *indent;
|
||||||
|
|
||||||
DocRecalc(doc);
|
DocRecalc(doc);
|
||||||
@@ -442,12 +442,12 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
|||||||
task=Spawn(&SrvCmdLine,NULL,"Srv",,Fs);
|
task=Spawn(&SrvCmdLine,NULL,"Srv",,Fs);
|
||||||
st2=CurDir;
|
st2=CurDir;
|
||||||
st=MStrPrint("Cd(\"%s\");",st2);
|
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(st2);
|
||||||
Free(st);
|
Free(st);
|
||||||
WinHorz(Fs->win_left,Fs->win_right, task);
|
WinHorz(Fs->win_left,Fs->win_right, task);
|
||||||
WinVert(Fs->win_top, Fs->win_bottom,task);
|
WinVert(Fs->win_top, Fs->win_bottom,task);
|
||||||
if (JobResScan(tempc,&r)) {
|
if (JobResScan(tmpc,&r)) {
|
||||||
st=DirFile(doc->filename.name,,"PRJ.Z");
|
st=DirFile(doc->filename.name,,"PRJ.Z");
|
||||||
prj_file=FileNameAbs(st,FUF_Z_OR_NOT_Z);
|
prj_file=FileNameAbs(st,FUF_Z_OR_NOT_Z);
|
||||||
Free(st);
|
Free(st);
|
||||||
@@ -455,24 +455,24 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
|||||||
st2=DirFile(prj_file),
|
st2=DirFile(prj_file),
|
||||||
st=MStrPrint("Cd(\"%s\");",st2);
|
st=MStrPrint("Cd(\"%s\");",st2);
|
||||||
Free(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);
|
1<<SVCf_FOCUS_MASTER|1<<SVCf_FREE_ON_COMPLETE);
|
||||||
Free(st);
|
Free(st);
|
||||||
st=MStrPrint("\"$$WW,1$$\";Cmp(\"%s\",\"SysTemp\",\"SysTemp\");",
|
st=MStrPrint("\"$$WW,1$$\";Cmp(\"%s\",\"SysTmp\",\"SysTmp\");",
|
||||||
prj_file);
|
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);
|
Free(st);
|
||||||
if (JobResScan(tempc,&r))
|
if (JobResScan(tmpc,&r))
|
||||||
if (!r) {
|
if (!r) {
|
||||||
tempc=TaskExe(task,Fs,
|
tmpc=TaskExe(task,Fs,
|
||||||
"Load(\"SysTemp\",LDF_JUST_LOAD);",
|
"Load(\"SysTmp\",LDF_JUST_LOAD);",
|
||||||
1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||||
if (JobResScan(tempc,&r))
|
if (JobResScan(tmpc,&r))
|
||||||
okay=TRUE;
|
okay=TRUE;
|
||||||
}
|
}
|
||||||
tempc=TaskExe(task,Fs,"Del(\"SysTemp.*\");",
|
tmpc=TaskExe(task,Fs,"Del(\"SysTmp.*\");",
|
||||||
1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||||
JobResScan(tempc,&r);
|
JobResScan(tmpc,&r);
|
||||||
} else {
|
} else {
|
||||||
Free(prj_file);
|
Free(prj_file);
|
||||||
st=DirFile(doc->filename.name,"Load","HC.Z");
|
st=DirFile(doc->filename.name,"Load","HC.Z");
|
||||||
@@ -483,9 +483,9 @@ U0 EdCodeTools2(CDoc *doc,I64 tool_action,Bool beep=TRUE)
|
|||||||
else
|
else
|
||||||
st=MStrPrint("\"$$WW,1$$\";ExeFile(\"%s\",CCF_JUST_LOAD);",
|
st=MStrPrint("\"$$WW,1$$\";ExeFile(\"%s\",CCF_JUST_LOAD);",
|
||||||
doc->filename.name);
|
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);
|
Free(st);
|
||||||
if (JobResScan(tempc,&r) && r)
|
if (JobResScan(tmpc,&r) && r)
|
||||||
okay=TRUE;
|
okay=TRUE;
|
||||||
}
|
}
|
||||||
Free(prj_file);
|
Free(prj_file);
|
||||||
|
|||||||
@@ -151,9 +151,9 @@ public Bool DocEd(CDoc *doc,I64 dof_flags=0)
|
|||||||
|
|
||||||
DocUnlock(doc);
|
DocUnlock(doc);
|
||||||
if (!(dof_flags&DOF_DONT_WINMGR_SYNC)) {
|
if (!(dof_flags&DOF_DONT_WINMGR_SYNC)) {
|
||||||
WinMgrSync(2,TRUE);
|
Refresh(2,TRUE);
|
||||||
if (doc->flags&DOCF_MIN_SIZE)
|
if (doc->flags&DOCF_MIN_SIZE)
|
||||||
WinMgrSync(2,TRUE);
|
Refresh(2,TRUE);
|
||||||
}
|
}
|
||||||
res=View;
|
res=View;
|
||||||
|
|
||||||
|
|||||||
+17
-17
@@ -5,24 +5,24 @@ public U0 DocLoad(CDoc *doc,U8 *src2,I64 size)
|
|||||||
I64 i;
|
I64 i;
|
||||||
U8 *src;
|
U8 *src;
|
||||||
Bool unlock=DocLock(doc);
|
Bool unlock=DocLock(doc);
|
||||||
CDocBin *tempb;
|
CDocBin *tmpb;
|
||||||
doc->find_replace->filter_lines=0;
|
doc->find_replace->filter_lines=0;
|
||||||
if (src2) {
|
if (src2) {
|
||||||
DocPutS(doc,src2); //Too big $LK,"DocPrint",A="MN:DocPrint"$() is wasteful.
|
DocPutS(doc,src2); //Too big $LK,"DocPrint",A="MN:DocPrint"$() is wasteful.
|
||||||
src=src2+StrLen(src2)+1;
|
src=src2+StrLen(src2)+1;
|
||||||
i=size-(offset(CDocBin.end)-offset(CDocBin.start));
|
i=size-(offset(CDocBin.end)-offset(CDocBin.start));
|
||||||
while (src<=src2+i) {
|
while (src<=src2+i) {
|
||||||
tempb=CAlloc(sizeof(CDocBin),doc->mem_task);
|
tmpb=CAlloc(sizeof(CDocBin),doc->mem_task);
|
||||||
MemCpy(&tempb->start,src,offset(CDocBin.end)-offset(CDocBin.start));
|
MemCpy(&tmpb->start,src,offset(CDocBin.end)-offset(CDocBin.start));
|
||||||
src+=offset(CDocBin.end)-offset(CDocBin.start);
|
src+=offset(CDocBin.end)-offset(CDocBin.start);
|
||||||
tempb->data=MAlloc(tempb->size,doc->mem_task);
|
tmpb->data=MAlloc(tmpb->size,doc->mem_task);
|
||||||
if (tempb->size) {
|
if (tmpb->size) {
|
||||||
MemCpy(tempb->data,src,tempb->size);
|
MemCpy(tmpb->data,src,tmpb->size);
|
||||||
src+=tempb->size;
|
src+=tmpb->size;
|
||||||
}
|
}
|
||||||
QueIns(tempb,doc->bin_head.last);
|
QueIns(tmpb,doc->bin_head.last);
|
||||||
if (tempb->num>=doc->cur_bin_num)
|
if (tmpb->num>=doc->cur_bin_num)
|
||||||
doc->cur_bin_num=tempb->num+1;
|
doc->cur_bin_num=tmpb->num+1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!(doc->flags & (DOCF_PLAIN_TEXT|DOCF_PLAIN_TEXT_TABS)))
|
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;
|
U8 *src,*name2;
|
||||||
I64 size=0;
|
I64 size=0;
|
||||||
CDirContext *dirc;
|
CDirContext *dirc;
|
||||||
if (!name) name=blkdev.temp_filename;
|
if (!name) name=blkdev.tmp_filename;
|
||||||
doc->flags|=flags;
|
doc->flags|=flags;
|
||||||
name2=FileNameAbs(name);
|
name2=FileNameAbs(name);
|
||||||
StrCpy(doc->filename.name,name2);
|
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)
|
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;
|
cnt+=offset(CDocBin.end)-offset(CDocBin.start)+b->size;
|
||||||
res=MAlloc(cnt);
|
res=MAlloc(cnt);
|
||||||
dst=res;
|
dst=res;
|
||||||
@@ -157,7 +157,7 @@ public U8 *DocSave(CDoc *doc,I64 *_size=NULL)
|
|||||||
b=doc->bin_head.next;
|
b=doc->bin_head.next;
|
||||||
if (b!=&doc->bin_head) {
|
if (b!=&doc->bin_head) {
|
||||||
do {
|
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));
|
MemCpy(dst,&b->start,offset(CDocBin.end)-offset(CDocBin.start));
|
||||||
dst+=offset(CDocBin.end)-offset(CDocBin.start);
|
dst+=offset(CDocBin.end)-offset(CDocBin.start);
|
||||||
MemCpy(dst,b->data,b->size);
|
MemCpy(dst,b->data,b->size);
|
||||||
@@ -297,7 +297,7 @@ U0 DocUndoRestore(CDoc *doc)
|
|||||||
DocUnlock(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"
|
"DolDoc/Output;StdOut/DolDoc"
|
||||||
public Bool DocType(CDoc *doc=NULL,U8 *filename,I64 trailing_new_lines=1)
|
public Bool DocType(CDoc *doc=NULL,U8 *filename,I64 trailing_new_lines=1)
|
||||||
{//Output txt or graphic file to document.
|
{//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")) {
|
} else if (FilesFindMatch(filename,"*.BMP;*.bmp")) {
|
||||||
DocBMP(doc,filename,,TRUE);
|
DocBMP(doc,filename,,TRUE);
|
||||||
res=TRUE;
|
res=TRUE;
|
||||||
} else if (FilesFindMatch(filename,"*.GRA*")) {
|
} else if (FilesFindMatch(filename,"*.GR*")) {
|
||||||
DocGRA(doc,filename);
|
DocGR(doc,filename);
|
||||||
res=TRUE;
|
res=TRUE;
|
||||||
}
|
}
|
||||||
if (res)
|
if (res)
|
||||||
@@ -327,7 +327,7 @@ public Bool DocType(CDoc *doc=NULL,U8 *filename,I64 trailing_new_lines=1)
|
|||||||
return res;
|
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);"\
|
"File/Cmd Line (Typically);DolDoc/Cmd Line (Typically);"\
|
||||||
"StdOut;Cmd Line (Typically)"
|
"StdOut;Cmd Line (Typically)"
|
||||||
public Bool Type(U8 *filename,I64 trailing_new_lines=1)
|
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;
|
I64 i;
|
||||||
U8 *ptr,*ptr2;
|
U8 *ptr,*ptr2;
|
||||||
CHashDefineStr *temph;
|
CHashDefineStr *tmph;
|
||||||
if (doc_e->type_u8==DOCT_DATA && doc_e->de_flags&DOCEF_AUX_STR ||
|
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) {
|
doc_e->type_u8==DOCT_CHECK_BOX || doc_e->de_flags & DOCEF_LST) {
|
||||||
if (d==DOCM_CANCEL) {
|
if (d==DOCM_CANCEL) {
|
||||||
@@ -109,9 +109,9 @@ U0 DocDataFmt(CDoc *doc,CDocEntry *doc_e,I64 d=DOCM_CANCEL)
|
|||||||
}
|
}
|
||||||
doc_e->max_col=i;
|
doc_e->max_col=i;
|
||||||
} else if (doc_e->de_flags & DOCEF_LST) {
|
} else if (doc_e->de_flags & DOCEF_LST) {
|
||||||
if (doc_e->de_flags & DOCEF_DEFINE && (temph=HashFind(doc_e->define_str,
|
if (doc_e->de_flags & DOCEF_DEFINE && (tmph=HashFind(doc_e->define_str,
|
||||||
doc->win_task->hash_table,HTT_DEFINE_STR)) && 0<=d<temph->cnt) {
|
doc->win_task->hash_table,HTT_DEFINE_STR)) && 0<=d<tmph->cnt) {
|
||||||
ptr=MStrPrint("[%s]",temph->sub_idx[d]);
|
ptr=MStrPrint("[%s]",tmph->sub_idx[d]);
|
||||||
Free(doc_e->tag);
|
Free(doc_e->tag);
|
||||||
doc_e->tag=StrNew(ptr,doc->mem_task);
|
doc_e->tag=StrNew(ptr,doc->mem_task);
|
||||||
Free(ptr);
|
Free(ptr);
|
||||||
@@ -132,7 +132,7 @@ U0 DocDataScan(CDoc *doc,CDocEntry *doc_e)
|
|||||||
{
|
{
|
||||||
I64 i,d;
|
I64 i,d;
|
||||||
U8 *ptr,*ptr1,*ptr2;
|
U8 *ptr,*ptr1,*ptr2;
|
||||||
CHashDefineStr *temph;
|
CHashDefineStr *tmph;
|
||||||
if (doc_e->type_u8==DOCT_DATA && doc_e->de_flags&DOCEF_AUX_STR ||
|
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) {
|
doc_e->type_u8==DOCT_CHECK_BOX || doc_e->de_flags & DOCEF_LST) {
|
||||||
if (doc_e->de_flags&DOCEF_DEREF_DATA &&
|
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) {
|
} else if (doc_e->de_flags & DOCEF_LST) {
|
||||||
d=0;
|
d=0;
|
||||||
if (doc_e->tag && doc_e->de_flags & DOCEF_DEFINE &&
|
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))) {
|
doc->win_task->hash_table,HTT_DEFINE_STR))) {
|
||||||
ptr1=ptr2=StrNew(doc_e->tag);
|
ptr1=ptr2=StrNew(doc_e->tag);
|
||||||
if (*ptr2=='[') {
|
if (*ptr2=='[') {
|
||||||
@@ -175,7 +175,7 @@ U0 DocDataScan(CDoc *doc,CDocEntry *doc_e)
|
|||||||
if (ptr2[i-1]==']')
|
if (ptr2[i-1]==']')
|
||||||
ptr2[i-1]=0;
|
ptr2[i-1]=0;
|
||||||
}
|
}
|
||||||
d=LstMatch(ptr2,temph->data);
|
d=LstMatch(ptr2,tmph->data);
|
||||||
Free(ptr1);
|
Free(ptr1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -213,11 +213,11 @@ public Bool DocForm(U8 *_d,U8 *class_name=lastclass,
|
|||||||
CMemberLst *ml;
|
CMemberLst *ml;
|
||||||
CDocEntry *doc_e;
|
CDocEntry *doc_e;
|
||||||
U8 *fmtstr;
|
U8 *fmtstr;
|
||||||
CHashClass *tempc,*tempc2;
|
CHashClass *tmpc,*tmpc2;
|
||||||
CDoc *doc;
|
CDoc *doc;
|
||||||
Bool res=FALSE;
|
Bool res=FALSE;
|
||||||
I64 old_border_src=Fs->border_src,has_action;
|
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;
|
return FALSE;
|
||||||
doc=DocNew;
|
doc=DocNew;
|
||||||
doc->desc='Form';
|
doc->desc='Form';
|
||||||
@@ -225,18 +225,18 @@ public Bool DocForm(U8 *_d,U8 *class_name=lastclass,
|
|||||||
doc->flags|=DOCF_OVERSTRIKE|DOCF_FORM;
|
doc->flags|=DOCF_OVERSTRIKE|DOCF_FORM;
|
||||||
if (dof_flags&DOF_MIN_SIZE)
|
if (dof_flags&DOF_MIN_SIZE)
|
||||||
doc->flags|=DOCF_MIN_SIZE;
|
doc->flags|=DOCF_MIN_SIZE;
|
||||||
ml=tempc->member_lst_and_root;
|
ml=tmpc->member_lst_and_root;
|
||||||
while (ml) {
|
while (ml) {
|
||||||
if ((fmtstr=MemberMetaData("fmtstr",ml)) &&
|
if ((fmtstr=MemberMetaData("fmtstr",ml)) &&
|
||||||
(doc_e=DocPrint(doc,"%s",fmtstr))) {
|
(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 ||
|
if ((doc_e->type_u8==DOCT_DATA || doc_e->type_u8==DOCT_LST ||
|
||||||
doc_e->type_u8==DOCT_CHECK_BOX) && !tempc2->ptr_stars_cnt) {
|
doc_e->type_u8==DOCT_CHECK_BOX) && !tmpc2->ptr_stars_cnt) {
|
||||||
tempc2=OptClassFwd(tempc2);
|
tmpc2=OptClassFwd(tmpc2);
|
||||||
tempc2-=tempc2->ptr_stars_cnt;
|
tmpc2-=tmpc2->ptr_stars_cnt;
|
||||||
if (tempc2->type & HTT_INTERNAL_TYPE) {
|
if (tmpc2->type & HTT_INTERNAL_TYPE) {
|
||||||
if (ml->dim.next) { //Array
|
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)) {
|
LBtr(&doc_e->de_flags,&DOCEf_DFT_LEN)) {
|
||||||
doc_e->len=ml->dim.total_cnt;
|
doc_e->len=ml->dim.total_cnt;
|
||||||
if (doc_e->de_flags&DOCEF_HAS_TERMINATOR)
|
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"
|
doc->mem_task); //+2 because "_\0"
|
||||||
}
|
}
|
||||||
} else if (LBtr(&doc_e->de_flags,DOCEf_DFT_RAW_TYPE))
|
} 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) {
|
if (doc_e->de_flags&DOCEF_REMALLOC_DATA) {
|
||||||
|
|||||||
+33
-33
@@ -1,33 +1,33 @@
|
|||||||
#help_index "DolDoc/Misc"
|
#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"$.
|
{//Be aware of $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.HC"$.
|
||||||
U32 *res=MAlloc((len+1)*sizeof(U32)),*dst=res;
|
U32 *res=MAlloc((len+1)*sizeof(U32)),*dst=res;
|
||||||
U8 *ptr;
|
U8 *ptr;
|
||||||
CDocSettings *s=&doc_e->settings;
|
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;
|
comment_depth,brace_depth=s->brace_depth,paren_depth=s->paren_depth;
|
||||||
CHash *temph;
|
CHash *tmph;
|
||||||
switch [s->state] {
|
switch [s->state] {
|
||||||
case DOCSS_NORMAL:
|
case DOCSS_NORMAL:
|
||||||
hl_normal:
|
hl_normal:
|
||||||
while (len) {
|
while (len) {
|
||||||
while (len && !Bt(chars_bmp_alpha_numeric,*src)) {
|
while (len && !Bt(chars_bmp_alpha_numeric,*src)) {
|
||||||
temp_u32_attr=_temp_u32_attr;
|
tmp_u32_attr=_tmp_u32_attr;
|
||||||
ch1=*src++;
|
ch1=*src++;
|
||||||
switch (ch1) {
|
switch (ch1) {
|
||||||
case '/':
|
case '/':
|
||||||
if (len>=2) {
|
if (len>=2) {
|
||||||
if (*src=='/') {
|
if (*src=='/') {
|
||||||
temp_u32_attr=DOC_COLOR_COMMENT<<8|mask_temp_u32_attr;
|
tmp_u32_attr=DOC_COLOR_COMMENT<<8|mask_tmp_u32_attr;
|
||||||
*dst++=ch1+temp_u32_attr;
|
*dst++=ch1+tmp_u32_attr;
|
||||||
*dst++=*src++ +temp_u32_attr;
|
*dst++=*src++ +tmp_u32_attr;
|
||||||
len-=2;
|
len-=2;
|
||||||
goto hl_cpp_comment;
|
goto hl_cpp_comment;
|
||||||
} else if (*src=='*') {
|
} else if (*src=='*') {
|
||||||
temp_u32_attr=DOC_COLOR_COMMENT<<8|mask_temp_u32_attr;
|
tmp_u32_attr=DOC_COLOR_COMMENT<<8|mask_tmp_u32_attr;
|
||||||
*dst++=ch1+temp_u32_attr;
|
*dst++=ch1+tmp_u32_attr;
|
||||||
*dst++=*src++ +temp_u32_attr;
|
*dst++=*src++ +tmp_u32_attr;
|
||||||
len-=2;
|
len-=2;
|
||||||
comment_depth=1;
|
comment_depth=1;
|
||||||
goto hl_comment;
|
goto hl_comment;
|
||||||
@@ -35,33 +35,33 @@ hl_normal:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '\'':
|
case '\'':
|
||||||
temp_u32_attr=DOC_COLOR_QUOTE<<8|mask_temp_u32_attr;
|
tmp_u32_attr=DOC_COLOR_QUOTE<<8|mask_tmp_u32_attr;
|
||||||
*dst++=ch1+temp_u32_attr;
|
*dst++=ch1+tmp_u32_attr;
|
||||||
len--;
|
len--;
|
||||||
goto hl_single_quote;
|
goto hl_single_quote;
|
||||||
case '\"':
|
case '\"':
|
||||||
temp_u32_attr=DOC_COLOR_QUOTE<<8|mask_temp_u32_attr;
|
tmp_u32_attr=DOC_COLOR_QUOTE<<8|mask_tmp_u32_attr;
|
||||||
*dst++=ch1+temp_u32_attr;
|
*dst++=ch1+tmp_u32_attr;
|
||||||
len--;
|
len--;
|
||||||
goto hl_dbl_quote;
|
goto hl_dbl_quote;
|
||||||
case '(':
|
case '(':
|
||||||
if (paren_depth++&1)
|
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;
|
break;
|
||||||
case ')':
|
case ')':
|
||||||
if (--paren_depth&1)
|
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;
|
break;
|
||||||
case '{':
|
case '{':
|
||||||
if (brace_depth++&1)
|
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;
|
break;
|
||||||
case '}':
|
case '}':
|
||||||
if (--brace_depth&1)
|
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;
|
break;
|
||||||
}
|
}
|
||||||
*dst++=ch1+temp_u32_attr;
|
*dst++=ch1+tmp_u32_attr;
|
||||||
if (!--len) goto hl_normal_done;
|
if (!--len) goto hl_normal_done;
|
||||||
}
|
}
|
||||||
ptr=src;
|
ptr=src;
|
||||||
@@ -71,16 +71,16 @@ hl_normal:
|
|||||||
}
|
}
|
||||||
ch=*src;
|
ch=*src;
|
||||||
*src=0;
|
*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)) {
|
HTT_KEYWORD|HTT_ASM_KEYWORD|HTT_OPCODE|HTT_REG)) {
|
||||||
if (temph->type&(HTT_KEYWORD|HTT_ASM_KEYWORD|HTT_OPCODE))
|
if (tmph->type&(HTT_KEYWORD|HTT_ASM_KEYWORD|HTT_OPCODE))
|
||||||
temp_u32_attr=DOC_COLOR_KEYWORD<<8|mask_temp_u32_attr;
|
tmp_u32_attr=DOC_COLOR_KEYWORD<<8|mask_tmp_u32_attr;
|
||||||
else
|
else
|
||||||
temp_u32_attr=DOC_COLOR_KEYWORD2<<8|mask_temp_u32_attr;
|
tmp_u32_attr=DOC_COLOR_KEYWORD2<<8|mask_tmp_u32_attr;
|
||||||
} else
|
} else
|
||||||
temp_u32_attr=_temp_u32_attr;
|
tmp_u32_attr=_tmp_u32_attr;
|
||||||
while (ch1=*ptr++)
|
while (ch1=*ptr++)
|
||||||
*dst++=ch1+temp_u32_attr;
|
*dst++=ch1+tmp_u32_attr;
|
||||||
*src=ch;
|
*src=ch;
|
||||||
}
|
}
|
||||||
hl_normal_done:
|
hl_normal_done:
|
||||||
@@ -88,12 +88,12 @@ hl_normal_done:
|
|||||||
s->comment_depth=0;
|
s->comment_depth=0;
|
||||||
break;
|
break;
|
||||||
case DOCSS_SINGLE_QUOTE:
|
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:
|
hl_single_quote:
|
||||||
last_ch=0;
|
last_ch=0;
|
||||||
while (len--) {
|
while (len--) {
|
||||||
ch1=*src++;
|
ch1=*src++;
|
||||||
*dst++=ch1+temp_u32_attr;
|
*dst++=ch1+tmp_u32_attr;
|
||||||
if (last_ch!='\\' && ch1=='\'')
|
if (last_ch!='\\' && ch1=='\'')
|
||||||
goto hl_normal;
|
goto hl_normal;
|
||||||
if (last_ch=='\\' && ch1=='\\')
|
if (last_ch=='\\' && ch1=='\\')
|
||||||
@@ -105,12 +105,12 @@ hl_single_quote:
|
|||||||
s->comment_depth=0;
|
s->comment_depth=0;
|
||||||
break;
|
break;
|
||||||
case DOCSS_DBL_QUOTE:
|
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:
|
hl_dbl_quote:
|
||||||
last_ch=0;
|
last_ch=0;
|
||||||
while (len--) {
|
while (len--) {
|
||||||
ch1=*src++;
|
ch1=*src++;
|
||||||
*dst++=ch1+temp_u32_attr;
|
*dst++=ch1+tmp_u32_attr;
|
||||||
if (last_ch!='\\' && ch1=='\"')
|
if (last_ch!='\\' && ch1=='\"')
|
||||||
goto hl_normal;
|
goto hl_normal;
|
||||||
if (last_ch=='\\' && ch1=='\\')
|
if (last_ch=='\\' && ch1=='\\')
|
||||||
@@ -122,13 +122,13 @@ hl_dbl_quote:
|
|||||||
s->comment_depth=0;
|
s->comment_depth=0;
|
||||||
break;
|
break;
|
||||||
case DOCSS_COMMENT:
|
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;
|
comment_depth=s->comment_depth;
|
||||||
hl_comment:
|
hl_comment:
|
||||||
last_ch=0;
|
last_ch=0;
|
||||||
while (len--) {
|
while (len--) {
|
||||||
ch1=*src++;
|
ch1=*src++;
|
||||||
*dst++=ch1+temp_u32_attr;
|
*dst++=ch1+tmp_u32_attr;
|
||||||
if (last_ch=='*' && ch1=='/') {
|
if (last_ch=='*' && ch1=='/') {
|
||||||
if (!--comment_depth)
|
if (!--comment_depth)
|
||||||
goto hl_normal;
|
goto hl_normal;
|
||||||
@@ -140,10 +140,10 @@ hl_comment:
|
|||||||
s->comment_depth=comment_depth;
|
s->comment_depth=comment_depth;
|
||||||
break;
|
break;
|
||||||
case DOCSS_CPP_Z_COMMENT:
|
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:
|
hl_cpp_comment:
|
||||||
while (len--)
|
while (len--)
|
||||||
*dst++=*src++ +temp_u32_attr;
|
*dst++=*src++ +tmp_u32_attr;
|
||||||
s->state=DOCSS_CPP_Z_COMMENT;
|
s->state=DOCSS_CPP_Z_COMMENT;
|
||||||
s->comment_depth=0;
|
s->comment_depth=0;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ U0 DocInit()
|
|||||||
{//$LK-UL,"CMD Defines",A="MN:DOCT_TEXT"$
|
{//$LK-UL,"CMD Defines",A="MN:DOCT_TEXT"$
|
||||||
CCmpCtrl *cc;
|
CCmpCtrl *cc;
|
||||||
I64 i;
|
I64 i;
|
||||||
CHashGeneric *temph;
|
CHashGeneric *tmph;
|
||||||
|
|
||||||
DefineLstLoad("ST_DOC_CMDS",
|
DefineLstLoad("ST_DOC_CMDS",
|
||||||
"TX\0CR\0SR\0TB\0PB\0CU\0MK\0PT\0CL\0PL\0LM\0RM\0HD\0FO\0ID\0FG\0"
|
"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");
|
"DA\0CB\0LS\0MA\0MU\0HX\0TR\0SP\0IB\0IS\0SO\0HC\0ER\0");
|
||||||
DefineLstLoad("ST_DOC_FLAGS",
|
DefineLstLoad("ST_DOC_FLAGS",
|
||||||
"T\0LEN\0A\0D\0HTML\0LE\0LM\0RE\0RM\0BI\0BP\0RT\0SX\0SY\0SCX\0U\0"
|
"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"
|
"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"
|
"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");
|
"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;
|
cc->htc.hash_table_lst=NULL;
|
||||||
Lex(cc);
|
Lex(cc);
|
||||||
while (cc->token==TK_IDENT) {
|
while (cc->token==TK_IDENT) {
|
||||||
if (temph=HashFind(cc->cur_str,doldoc.hash,DHT_DOC_CMD)) {
|
if (tmph=HashFind(cc->cur_str,doldoc.hash,DHT_DOC_CMD)) {
|
||||||
i=temph->user_data0;
|
i=tmph->user_data0;
|
||||||
Lex(cc);
|
Lex(cc);
|
||||||
PrsDocFlags(cc,&doldoc.dft_de_flags[i],&doldoc.dft_type_flags[i]);
|
PrsDocFlags(cc,&doldoc.dft_de_flags[i],&doldoc.dft_type_flags[i]);
|
||||||
}
|
}
|
||||||
@@ -51,7 +51,7 @@ U0 DocInit()
|
|||||||
Bts(doldoc.type_flags_form,i);
|
Bts(doldoc.type_flags_form,i);
|
||||||
|
|
||||||
//Don't forget $LK,"cmp_type_flags_src_code",A="MN:cmp_type_flags_src_code"$.
|
//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_PMT|
|
||||||
1<<DOCT_PAGE_LEN|
|
1<<DOCT_PAGE_LEN|
|
||||||
1<<DOCT_LEFT_MARGIN|
|
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"$()
|
doc=Str2I64(filename);//See $LK,"SpriteEdText",A="MN:SpriteEdText"$()
|
||||||
res=TRUE;
|
res=TRUE;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
st1=StrNew(filename);
|
st1=StrNew(filename);
|
||||||
st2=StrNew(filename);
|
st2=StrNew(filename);
|
||||||
StrLastRem(st1,"/",st2); //st2 is name without dir
|
StrLastRem(st1,"/",st2); //st2 is name without dir
|
||||||
|
|
||||||
if (!FileNameChk(st2))
|
if (!FileNameChk(st2))
|
||||||
doc=NULL;
|
doc=NULL;
|
||||||
else {
|
else {
|
||||||
@@ -107,8 +105,7 @@ Bool DocFileEd(I64 _type,U8 *filename,
|
|||||||
if (Bt(&edf_dof_flags,EDf_BAIL)) //if bail, scan parents
|
if (Bt(&edf_dof_flags,EDf_BAIL)) //if bail, scan parents
|
||||||
res=FileFind(filename,,
|
res=FileFind(filename,,
|
||||||
FUF_JUST_FILES|FUF_Z_OR_NOT_Z|FUF_SCAN_PARENTS);
|
FUF_JUST_FILES|FUF_Z_OR_NOT_Z|FUF_SCAN_PARENTS);
|
||||||
else if (!(res=FileFind(filename,,
|
else if (!(res=FileFind(filename,,FUF_JUST_FILES)))
|
||||||
FUF_JUST_FILES)))
|
|
||||||
other_found=FileFind(filename,,
|
other_found=FileFind(filename,,
|
||||||
FUF_JUST_FILES|FUF_Z_OR_NOT_Z|FUF_SCAN_PARENTS);
|
FUF_JUST_FILES|FUF_Z_OR_NOT_Z|FUF_SCAN_PARENTS);
|
||||||
doc=DocRead(filename,flags);
|
doc=DocRead(filename,flags);
|
||||||
@@ -116,7 +113,6 @@ Bool DocFileEd(I64 _type,U8 *filename,
|
|||||||
Silent(old_silent);
|
Silent(old_silent);
|
||||||
Fs->border_src=BDS_ED_FILENAME_DRV;
|
Fs->border_src=BDS_ED_FILENAME_DRV;
|
||||||
}
|
}
|
||||||
|
|
||||||
Free(st1);
|
Free(st1);
|
||||||
Free(st2);
|
Free(st2);
|
||||||
}
|
}
|
||||||
@@ -149,7 +145,12 @@ Bool DocFileEd(I64 _type,U8 *filename,
|
|||||||
|
|
||||||
if (edf_dof_flags&EDF_WAS_WRITE)
|
if (edf_dof_flags&EDF_WAS_WRITE)
|
||||||
res=FALSE;
|
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);
|
DocLock(doc);
|
||||||
doc_e=doc->cur_entry;
|
doc_e=doc->cur_entry;
|
||||||
if (doc_e!=doc)
|
if (doc_e!=doc)
|
||||||
@@ -161,6 +162,8 @@ Bool DocFileEd(I64 _type,U8 *filename,
|
|||||||
res=TRUE;
|
res=TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
DirContextDel(doc->filename.dirc);
|
||||||
|
}
|
||||||
if (!(LK_DOC<=_type<=LK_DOC_LINE))
|
if (!(LK_DOC<=_type<=LK_DOC_LINE))
|
||||||
DocDel(doc);
|
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.
|
{//$LK,"Editor Link",A="MN:LK_FILE"$--> filename, needle_str and line number.
|
||||||
U8 *st,*ptr,*src,*filename=NULL,*needle_str=NULL,*filename2;
|
U8 *st,*ptr,*src,*filename=NULL,*needle_str=NULL,*filename2;
|
||||||
I64 res,i,num=1;
|
I64 res,i,num=1;
|
||||||
CHashSrcSym *temph;
|
CHashSrcSym *tmph;
|
||||||
if (!link_st||!*link_st) {
|
if (!link_st||!*link_st) {
|
||||||
if (edf_dof_flags&EDF_BAIL)
|
if (edf_dof_flags&EDF_BAIL)
|
||||||
return -1;
|
return -1;
|
||||||
link_st=blkdev.temp_filename;
|
link_st=blkdev.tmp_filename;
|
||||||
}
|
}
|
||||||
st=StrNew(link_st);
|
st=StrNew(link_st);
|
||||||
res=LK_FILE;
|
res=LK_FILE;
|
||||||
@@ -192,8 +195,8 @@ public I64 EdLinkCvt(U8 *link_st,U8 **_filename=NULL,U8 **_needle_str=NULL,
|
|||||||
filename2=st+3;
|
filename2=st+3;
|
||||||
switch (res=DefineMatch(st,"ST_LINK_TYPES",LMF_IGNORE_CASE)) {
|
switch (res=DefineMatch(st,"ST_LINK_TYPES",LMF_IGNORE_CASE)) {
|
||||||
case LK_MAN_PAGE:
|
case LK_MAN_PAGE:
|
||||||
if (temph=HashFind(filename2,Fs->hash_table,HTG_SRC_SYM))
|
if (tmph=HashFind(filename2,Fs->hash_table,HTG_SRC_SYM))
|
||||||
res=EdLinkCvt(temph->src_link,&filename,
|
res=EdLinkCvt(tmph->src_link,&filename,
|
||||||
&needle_str,&num,edf_dof_flags);
|
&needle_str,&num,edf_dof_flags);
|
||||||
else
|
else
|
||||||
res=-1;
|
res=-1;
|
||||||
@@ -292,11 +295,15 @@ lc_done:
|
|||||||
return res;
|
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"$.
|
{//Check for bad $LK,"Editor Link",A="MN:LK_FILE"$.
|
||||||
U8 *filename,*st;
|
U8 *filename,*st;
|
||||||
Bool res=FALSE;
|
Bool res=FALSE;
|
||||||
|
CDirContext *dirc;
|
||||||
if (link_st) {
|
if (link_st) {
|
||||||
|
st=FileNameAbs(doc->filename.name);
|
||||||
|
dirc=DirContextNew(st);
|
||||||
|
Free(st);
|
||||||
switch (EdLinkCvt(link_st,&filename)) {
|
switch (EdLinkCvt(link_st,&filename)) {
|
||||||
case -1:
|
case -1:
|
||||||
break;
|
break;
|
||||||
@@ -320,6 +327,7 @@ public Bool DocLinkChk(U8 *link_st)
|
|||||||
res=TRUE;
|
res=TRUE;
|
||||||
}
|
}
|
||||||
Free(filename);
|
Free(filename);
|
||||||
|
DirContextDel(dirc);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
+51
-51
@@ -7,18 +7,18 @@ I64 sys_macro_repeat_n=1;
|
|||||||
|
|
||||||
U0 SysMacroStripKey(CSrvCmd *macro_head,I64 a1,I64 a2)
|
U0 SysMacroStripKey(CSrvCmd *macro_head,I64 a1,I64 a2)
|
||||||
{
|
{
|
||||||
CSrvCmd *tempc,*tempc1;
|
CSrvCmd *tmpc,*tmpc1;
|
||||||
tempc=macro_head->next;
|
tmpc=macro_head->next;
|
||||||
while (tempc!=macro_head) {
|
while (tmpc!=macro_head) {
|
||||||
tempc1=tempc->next;
|
tmpc1=tmpc->next;
|
||||||
if (tempc->cmd_code==SVCT_MSG &&
|
if (tmpc->cmd_code==SVCT_MSG &&
|
||||||
(tempc->msg_code==MSG_KEY_DOWN || tempc->msg_code==MSG_KEY_UP ||
|
(tmpc->msg_code==MSG_KEY_DOWN || tmpc->msg_code==MSG_KEY_UP ||
|
||||||
tempc->msg_code==MSG_KEY_DOWN_UP) &&
|
tmpc->msg_code==MSG_KEY_DOWN_UP) &&
|
||||||
a1 && tempc->aux1==a1 || !a1 && tempc->aux2==a2) {
|
a1 && tmpc->aux1==a1 || !a1 && tmpc->aux2==a2) {
|
||||||
QueRem(tempc);
|
QueRem(tmpc);
|
||||||
SrvCmdDel(tempc);
|
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_MSG 1
|
||||||
#define MT_CHAR 2
|
#define MT_CHAR 2
|
||||||
|
|
||||||
class CMacroTemp
|
class CMacroTmp
|
||||||
{
|
{
|
||||||
CMacroTemp *next,*last;
|
CMacroTmp *next,*last;
|
||||||
I64 type;
|
I64 type;
|
||||||
U8 buf[STR_LEN];
|
U8 buf[STR_LEN];
|
||||||
};
|
};
|
||||||
|
|
||||||
CMacroTemp *Cmd2MT(CSrvCmd *tempc)
|
CMacroTmp *Cmd2MT(CSrvCmd *tmpc)
|
||||||
{
|
{
|
||||||
U8 buf[8];
|
U8 buf[8];
|
||||||
CMacroTemp *tempmt=CAlloc(sizeof(CMacroTemp));
|
CMacroTmp *tmpmt=CAlloc(sizeof(CMacroTmp));
|
||||||
if (Bt(chars_bmp_macro,tempc->aux1) && tempc->msg_code==MSG_KEY_DOWN) {
|
if (Bt(chars_bmp_macro,tmpc->aux1) && tmpc->msg_code==MSG_KEY_DOWN) {
|
||||||
tempmt->type=MT_CHAR;
|
tmpmt->type=MT_CHAR;
|
||||||
buf[0]=tempc->aux1;
|
buf[0]=tmpc->aux1;
|
||||||
buf[1]=0;
|
buf[1]=0;
|
||||||
StrPrint(tempmt->buf,"%Q",buf);
|
StrPrint(tmpmt->buf,"%Q",buf);
|
||||||
} else {
|
} else {
|
||||||
tempmt->type=MT_MSG;
|
tmpmt->type=MT_MSG;
|
||||||
StrPrint(tempmt->buf,"Msg(0x%X,0x%X,0x%X);",
|
StrPrint(tmpmt->buf,"Msg(0x%X,0x%X,0x%X);",
|
||||||
tempc->msg_code,tempc->aux1,tempc->aux2);
|
tmpc->msg_code,tmpc->aux1,tmpc->aux2);
|
||||||
}
|
}
|
||||||
return tempmt;
|
return tmpmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
U8 *SysMacro2Str(CSrvCmd *macro_head)
|
U8 *SysMacro2Str(CSrvCmd *macro_head)
|
||||||
{
|
{
|
||||||
CSrvCmd *tempc;
|
CSrvCmd *tmpc;
|
||||||
I64 cnt=1; //terminating zero
|
I64 cnt=1; //terminating zero
|
||||||
U8 *ptr,*m;
|
U8 *ptr,*m;
|
||||||
CMacroTemp *tempmt,*tempmt1,head;
|
CMacroTmp *tmpmt,*tmpmt1,head;
|
||||||
LBtr(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
|
LBtr(&sys_semas[SYS_SEMA_RECORD_MACRO],0);
|
||||||
|
|
||||||
QueInit(&head);
|
QueInit(&head);
|
||||||
head.type=MT_NULL;
|
head.type=MT_NULL;
|
||||||
tempc=macro_head->next;
|
tmpc=macro_head->next;
|
||||||
while (tempc!=macro_head) {
|
while (tmpc!=macro_head) {
|
||||||
tempmt=Cmd2MT(tempc);
|
tmpmt=Cmd2MT(tmpc);
|
||||||
QueIns(tempmt,head.last);
|
QueIns(tmpmt,head.last);
|
||||||
cnt+=StrLen(tempmt->buf);
|
cnt+=StrLen(tmpmt->buf);
|
||||||
if (tempmt->type==MT_CHAR) {
|
if (tmpmt->type==MT_CHAR) {
|
||||||
if (tempmt->last->type!=MT_CHAR)
|
if (tmpmt->last->type!=MT_CHAR)
|
||||||
cnt+=StrLen("\"");
|
cnt+=StrLen("\"");
|
||||||
if (tempmt->next->type!=MT_CHAR)
|
if (tmpmt->next->type!=MT_CHAR)
|
||||||
cnt+=StrLen("\";");
|
cnt+=StrLen("\";");
|
||||||
}
|
}
|
||||||
tempc=tempc->next;
|
tmpc=tmpc->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
m=MAlloc(cnt);
|
m=MAlloc(cnt);
|
||||||
ptr=m;
|
ptr=m;
|
||||||
|
|
||||||
tempmt=head.next;
|
tmpmt=head.next;
|
||||||
while (tempmt!=&head) {
|
while (tmpmt!=&head) {
|
||||||
tempmt1=tempmt->next;
|
tmpmt1=tmpmt->next;
|
||||||
if (tempmt->type==MT_MSG) {
|
if (tmpmt->type==MT_MSG) {
|
||||||
StrCpy(ptr, tempmt->buf);
|
StrCpy(ptr, tmpmt->buf);
|
||||||
ptr+=StrLen(tempmt->buf);
|
ptr+=StrLen(tmpmt->buf);
|
||||||
} else {
|
} else {
|
||||||
if (tempmt->last->type!=MT_CHAR) {
|
if (tmpmt->last->type!=MT_CHAR) {
|
||||||
StrCpy(ptr, "\"");
|
StrCpy(ptr, "\"");
|
||||||
ptr+=StrLen("\"");
|
ptr+=StrLen("\"");
|
||||||
}
|
}
|
||||||
StrCpy(ptr,tempmt->buf);
|
StrCpy(ptr,tmpmt->buf);
|
||||||
ptr+=StrLen(tempmt->buf);
|
ptr+=StrLen(tmpmt->buf);
|
||||||
if (tempmt->next->type!=MT_CHAR) {
|
if (tmpmt->next->type!=MT_CHAR) {
|
||||||
StrCpy(ptr, "\";");
|
StrCpy(ptr, "\";");
|
||||||
ptr+=StrLen("\";");
|
ptr+=StrLen("\";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Free(tempmt);
|
Free(tmpmt);
|
||||||
tempmt=tempmt1;
|
tmpmt=tmpmt1;
|
||||||
}
|
}
|
||||||
*ptr=0;
|
*ptr=0;
|
||||||
return m;
|
return m;
|
||||||
@@ -111,7 +111,7 @@ U0 PlaySysMacro(I64 n=1)
|
|||||||
m=SysMacro2Str(&sys_macro_head);
|
m=SysMacro2Str(&sys_macro_head);
|
||||||
while (n-- && TaskValidate(task)) {
|
while (n-- && TaskValidate(task)) {
|
||||||
if (task==Fs)
|
if (task==Fs)
|
||||||
AutoStr("%s",m);
|
InStr("%s",m);
|
||||||
else
|
else
|
||||||
XTalkStrWait(task,"%s",m);
|
XTalkStrWait(task,"%s",m);
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ U0 EdInsCapturedMacro()
|
|||||||
{
|
{
|
||||||
U8 *st=SysMacro2Str(&sys_macro_head);
|
U8 *st=SysMacro2Str(&sys_macro_head);
|
||||||
if (sys_focus_task) {
|
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);
|
captured_macro_name,st);
|
||||||
Free(st);
|
Free(st);
|
||||||
}
|
}
|
||||||
@@ -139,7 +139,7 @@ I64 PopUpMacroMenu()
|
|||||||
{
|
{
|
||||||
I64 res=0;
|
I64 res=0;
|
||||||
U8 buf[STR_LEN];
|
U8 buf[STR_LEN];
|
||||||
CSrvCmd *tempc;
|
CSrvCmd *tmpc;
|
||||||
CDoc *doc=DocNew;
|
CDoc *doc=DocNew;
|
||||||
CDocEntry *doc_e=DocPrint(doc,"$$DA-P,LEN=STR_LEN-1,A=\"Name:%%s\"$$");
|
CDocEntry *doc_e=DocPrint(doc,"$$DA-P,LEN=STR_LEN-1,A=\"Name:%%s\"$$");
|
||||||
doc_e->data=captured_macro_name;
|
doc_e->data=captured_macro_name;
|
||||||
@@ -162,9 +162,9 @@ I64 PopUpMacroMenu()
|
|||||||
sys_macro_task=Spawn(&SrvCmdLine,NULL,"Macro Popup",,Fs);
|
sys_macro_task=Spawn(&SrvCmdLine,NULL,"Macro Popup",,Fs);
|
||||||
Fs->popup_task=sys_macro_task;
|
Fs->popup_task=sys_macro_task;
|
||||||
LBts(&sys_macro_task->display_flags,DISPLAYf_WIN_ON_TOP);
|
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);
|
1<<SVCf_WAKE_MASTER|1<<SVCf_FOCUS_MASTER);
|
||||||
JobResScan(tempc,&res);
|
JobResScan(tmpc,&res);
|
||||||
Fs->popup_task=NULL;
|
Fs->popup_task=NULL;
|
||||||
Kill(sys_macro_task);
|
Kill(sys_macro_task);
|
||||||
sys_macro_task=NULL;
|
sys_macro_task=NULL;
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ U0 DocUndoCntSet(CDoc *doc)
|
|||||||
public CDocEntry *DocEntryCopy(CDoc *doc,CDocEntry *doc_e)
|
public CDocEntry *DocEntryCopy(CDoc *doc,CDocEntry *doc_e)
|
||||||
{//Make copy of entry and all parts of entry.
|
{//Make copy of entry and all parts of entry.
|
||||||
CDocEntry *doc_ne;
|
CDocEntry *doc_ne;
|
||||||
CDocBin *tempb;
|
CDocBin *tmpb;
|
||||||
CTask *task=doc->mem_task;
|
CTask *task=doc->mem_task;
|
||||||
doc_ne=MAllocIdent(doc_e,task);
|
doc_ne=MAllocIdent(doc_e,task);
|
||||||
doc_ne->next=doc_ne;
|
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)
|
if (doc_e->de_flags & DOCEF_BIN_PTR_LINK)
|
||||||
doc_ne->bin_ptr_link=MAllocIdent(doc_e->bin_ptr_link,task);
|
doc_ne->bin_ptr_link=MAllocIdent(doc_e->bin_ptr_link,task);
|
||||||
if (doc_e->de_flags & DOCEF_HAS_BIN) {
|
if (doc_e->de_flags & DOCEF_HAS_BIN) {
|
||||||
tempb=MAllocIdent(doc_e->bin_data,task);
|
tmpb=MAllocIdent(doc_e->bin_data,task);
|
||||||
tempb->data=MAllocIdent(doc_e->bin_data->data,task);
|
tmpb->data=MAllocIdent(doc_e->bin_data->data,task);
|
||||||
doc_ne->bin_num=doc->cur_bin_num;
|
doc_ne->bin_num=doc->cur_bin_num;
|
||||||
tempb->num=doc->cur_bin_num++;
|
tmpb->num=doc->cur_bin_num++;
|
||||||
doc_ne->bin_data=tempb;
|
doc_ne->bin_data=tmpb;
|
||||||
if (doc_e->de_flags&DOCEF_TAG && doc_e->tag && *doc_e->tag)
|
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
|
else
|
||||||
tempb->tag=NULL;
|
tmpb->tag=NULL;
|
||||||
QueIns(tempb,doc->bin_head.last);
|
QueIns(tmpb,doc->bin_head.last);
|
||||||
}
|
}
|
||||||
if (doc_e->de_flags & DOCEF_REMALLOC_DATA)
|
if (doc_e->de_flags & DOCEF_REMALLOC_DATA)
|
||||||
doc_ne->data=MAllocIdent(doc_e->data,task);
|
doc_ne->data=MAllocIdent(doc_e->data,task);
|
||||||
@@ -368,7 +368,7 @@ public CDoc *DocNew(U8 *filename=NULL,CTask *task=NULL)
|
|||||||
if (filename)
|
if (filename)
|
||||||
StrCpy(doc->filename.name,filename);
|
StrCpy(doc->filename.name,filename);
|
||||||
else
|
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=CAlloc(sizeof(CEdFindText),task);
|
||||||
doc->find_replace->scan_fwd=TRUE;
|
doc->find_replace->scan_fwd=TRUE;
|
||||||
doc->find_replace->match_case=TRUE;
|
doc->find_replace->match_case=TRUE;
|
||||||
|
|||||||
+12
-12
@@ -88,21 +88,21 @@ I64 DocOptFile(U8 *filename,I64 fuf_flags)
|
|||||||
DocDel(doc);
|
DocDel(doc);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
I64 DocOptLst(CDirEntry *tempde,I64 fuf_flags)
|
I64 DocOptLst(CDirEntry *tmpde,I64 fuf_flags)
|
||||||
{
|
{
|
||||||
I64 res=0;
|
I64 res=0;
|
||||||
CDirEntry *tempde1;
|
CDirEntry *tmpde1;
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
tempde1=tempde->next;
|
tmpde1=tmpde->next;
|
||||||
if (tempde->attr & RS_ATTR_DIR) {
|
if (tmpde->attr & RS_ATTR_DIR) {
|
||||||
if (tempde->sub) {
|
if (tmpde->sub) {
|
||||||
"Scanning Directory: %s\n",tempde->full_name;
|
"Scanning Directory: %s\n",tmpde->full_name;
|
||||||
res+=DocOptLst(tempde->sub,fuf_flags);
|
res+=DocOptLst(tmpde->sub,fuf_flags);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
res+=DocOptFile(tempde->full_name,fuf_flags);
|
res+=DocOptFile(tmpde->full_name,fuf_flags);
|
||||||
DirEntryDel(tempde);
|
DirEntryDel(tmpde);
|
||||||
tempde=tempde1;
|
tmpde=tmpde1;
|
||||||
}
|
}
|
||||||
return res;
|
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.
|
{//Optimize $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ Files, eliminating aux_str's and .Z's.
|
||||||
//+R flag for aggressively risky.
|
//+R flag for aggressively risky.
|
||||||
I64 fuf_flags=0;
|
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);
|
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||||
return DocOptLst(FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND),
|
return DocOptLst(FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND),
|
||||||
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 PrsDocFlagSingle(CCmpCtrl *cc,I64 *_de_flags,U32 *_type,Bool turn_on)
|
||||||
{
|
{
|
||||||
I64 res=-1;
|
I64 res=-1;
|
||||||
CHashGeneric *temph;
|
CHashGeneric *tmph;
|
||||||
if (cc->token==TK_IDENT &&
|
if (cc->token==TK_IDENT &&
|
||||||
(temph=HashFind(cc->cur_str,doldoc.hash,DHT_DOC_FLAG))) {
|
(tmph=HashFind(cc->cur_str,doldoc.hash,DHT_DOC_FLAG))) {
|
||||||
res=temph->user_data0;
|
res=tmph->user_data0;
|
||||||
if (res<64) {
|
if (res<64) {
|
||||||
BEqu(_de_flags,res,turn_on);
|
BEqu(_de_flags,res,turn_on);
|
||||||
switch (res) {
|
switch (res) {
|
||||||
@@ -219,18 +219,18 @@ CDocEntry *PrsDollarCmd(CDoc *doc,U8 *st)
|
|||||||
I64 i,j,de_flags,processed_flags,attr=DOC_DFT;
|
I64 i,j,de_flags,processed_flags,attr=DOC_DFT;
|
||||||
U8 *ptr,*st2;
|
U8 *ptr,*st2;
|
||||||
CDocEntry *doc_e=NULL;
|
CDocEntry *doc_e=NULL;
|
||||||
CHashGeneric *temph;
|
CHashGeneric *tmph;
|
||||||
CCmpCtrl *cc=CmpCtrlNew(st,CCF_DONT_FREE_BUF);
|
CCmpCtrl *cc=CmpCtrlNew(st,CCF_DONT_FREE_BUF);
|
||||||
CHashTable *old_hash_table_lst=cc->htc.hash_table_lst;
|
CHashTable *old_hash_table_lst=cc->htc.hash_table_lst;
|
||||||
try {
|
try {
|
||||||
cc->htc.hash_table_lst=NULL;
|
cc->htc.hash_table_lst=NULL;
|
||||||
if (Lex(cc)==TK_IDENT) {
|
if (Lex(cc)==TK_IDENT) {
|
||||||
if (temph=HashFind(cc->cur_str,doldoc.hash,DHT_DOC_CMD|DHT_COLOR)) {
|
if (tmph=HashFind(cc->cur_str,doldoc.hash,DHT_DOC_CMD|DHT_COLOR)) {
|
||||||
if (temph->type&DHT_DOC_CMD)
|
if (tmph->type&DHT_DOC_CMD)
|
||||||
i=temph->user_data0;
|
i=tmph->user_data0;
|
||||||
else {//DHT_COLOR
|
else {//DHT_COLOR
|
||||||
i=DOCT_FOREGROUND;
|
i=DOCT_FOREGROUND;
|
||||||
attr=temph->user_data0;
|
attr=tmph->user_data0;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
goto pd_err;
|
goto pd_err;
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ public I64 PopUpFile(U8 *filename,Bool warn_ext=TRUE,
|
|||||||
okay=FALSE;
|
okay=FALSE;
|
||||||
if (okay) {
|
if (okay) {
|
||||||
st=MStrPrint(
|
st=MStrPrint(
|
||||||
"\"$$$$WW+H,1$$$$\";Auto(\"ExeFile2(\\\"%s\\\",CCF_CMD_LINE);\\n\");"
|
"\"$$$$WW+H,1$$$$\";In(\"ExeFile2(\\\"%s\\\",CCF_CMD_LINE);\\n\");"
|
||||||
"UserTaskCont;",
|
"UserTaskCont;",
|
||||||
name2);
|
name2);
|
||||||
res=PopUp(st,parent,_pu_task);
|
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_SHIFT)) {
|
||||||
if (sc&SCF_KEY_DESC)
|
if (sc&SCF_KEY_DESC)
|
||||||
KeyDescSet("Edit/Save As");
|
KeyDescSet("Edit/Save As");
|
||||||
else
|
else if (DocWrite(doc,TRUE)&&(st=FileNameAbs(doc->filename.name))) {
|
||||||
DocWrite(doc,TRUE);
|
DirContextDel(doc->filename.dirc);
|
||||||
|
doc->filename.dirc=DirContextNew(st);
|
||||||
|
Free(st);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CH_CTRLB:
|
case CH_CTRLB:
|
||||||
|
|||||||
+72
-72
@@ -201,67 +201,67 @@ CDocEntry *DocWordWrapAdd(CDoc *doc,CDocEntry *doc_e,
|
|||||||
return NULL;
|
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=doc->flags& (DOCG_BL_IV_UL|DOCEF_WORD_WRAP|DOCEF_HIGHLIGHT) |
|
||||||
doc_e->de_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->flags&DOCG_BL_IV_UL|(doc_e->settings.shifted_x&0x1F)<<16|
|
||||||
(doc_e->settings.shifted_y&0x1F)<<21;
|
(doc_e->settings.shifted_y&0x1F)<<21;
|
||||||
if (doc_e->de_flags & DOCEF_HAS_BIN && *doc_e->tag=='<')
|
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
|
else
|
||||||
switch (doc_e->type_u8) {
|
switch (doc_e->type_u8) {
|
||||||
case DOCT_SPRITE:
|
case DOCT_SPRITE:
|
||||||
if (doc_e->de_flags & DOCEF_LEFT_EXP)
|
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)
|
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)
|
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))
|
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
|
else
|
||||||
temp_u32_attr.u8[1]|=DOC_COLOR_BIN;
|
tmp_u32_attr.u8[1]|=DOC_COLOR_BIN;
|
||||||
break;
|
break;
|
||||||
case DOCT_HTML_CODE:
|
case DOCT_HTML_CODE:
|
||||||
temp_u32_attr.u8[1]|=DOC_COLOR_BIN;
|
tmp_u32_attr.u8[1]|=DOC_COLOR_BIN;
|
||||||
break;
|
break;
|
||||||
case DOCT_LINK:
|
case DOCT_LINK:
|
||||||
temp_u32_attr.u8[1]|=DOC_COLOR_LINK;
|
tmp_u32_attr.u8[1]|=DOC_COLOR_LINK;
|
||||||
break;
|
break;
|
||||||
case DOCT_MACRO:
|
case DOCT_MACRO:
|
||||||
temp_u32_attr.u8[1]|=DOC_COLOR_MACRO;
|
tmp_u32_attr.u8[1]|=DOC_COLOR_MACRO;
|
||||||
break;
|
break;
|
||||||
case DOCT_ANCHOR:
|
case DOCT_ANCHOR:
|
||||||
temp_u32_attr.u8[1]|=DOC_COLOR_ANCHOR;
|
tmp_u32_attr.u8[1]|=DOC_COLOR_ANCHOR;
|
||||||
break;
|
break;
|
||||||
case DOCT_TREE:
|
case DOCT_TREE:
|
||||||
case DOCT_LST:
|
case DOCT_LST:
|
||||||
temp_u32_attr.u8[1]|=DOC_COLOR_TREE;
|
tmp_u32_attr.u8[1]|=DOC_COLOR_TREE;
|
||||||
break;
|
break;
|
||||||
default:
|
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];
|
doc_e->type.u8[1]=tmp_u32_attr.u8[1];
|
||||||
temp_u32_attr|=doc_e->type&0xFFFF0000;
|
tmp_u32_attr|=doc_e->type&0xFFFF0000;
|
||||||
if (doc_e==doc->cur_entry && !(doc->flags&DOCF_DONT_HIGHLIGHT_CURSOR) &&
|
if (doc_e==doc->cur_entry && !(doc->flags&DOCF_DONT_HIGHLIGHT_CURSOR) &&
|
||||||
doc_e->type_u8!=DOCT_TEXT)
|
doc_e->type_u8!=DOCT_TEXT)
|
||||||
temp_u32_attr^=0xFF00;
|
tmp_u32_attr^=0xFF00;
|
||||||
doc_e->settings.final_u32_attr=temp_u32_attr;
|
doc_e->settings.final_u32_attr=tmp_u32_attr;
|
||||||
return temp_u32_attr;
|
return tmp_u32_attr;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
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,
|
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,
|
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;
|
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,
|
CDocEntry reg *doc_e,reg *doc_e2,*best_doc_e,*next_clear_found=NULL,
|
||||||
*added_cursor=NULL;
|
*added_cursor=NULL;
|
||||||
CDocBin *tempb;
|
CDocBin *tmpb;
|
||||||
CDocSettings *s;
|
CDocSettings *s;
|
||||||
Bool del_doc_e,skipped_update,tree_collapsed,same_win,more=FALSE,
|
Bool del_doc_e,skipped_update,tree_collapsed,same_win,more=FALSE,
|
||||||
find_cursor=FALSE,blink_flag,full_refresh=TRUE,unlock,clear_holds;
|
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;
|
I32 *depth_buf=NULL;
|
||||||
F64 cur_time=tS;
|
F64 cur_time=tS;
|
||||||
CWinScroll *vss,*hss;
|
CWinScroll *vss,*hss;
|
||||||
CHashDefineStr *temph;
|
CHashDefineStr *tmph;
|
||||||
|
|
||||||
if (!doc || doc->doc_signature!=DOC_SIGNATURE_VAL) return FALSE;
|
if (!doc || doc->doc_signature!=DOC_SIGNATURE_VAL) return FALSE;
|
||||||
|
|
||||||
//WinMgr updates all wins $TX,"30",D="WINMGR_FPS"$, 33.33333mS
|
//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
|
i_jif=cnts.jiffies+JIFFY_FREQ/250; //4 ms
|
||||||
while (Bt(&doc->locked_flags,DOClf_LOCKED)) {
|
while (Bt(&doc->locked_flags,DOClf_LOCKED)) {
|
||||||
if (cnts.jiffies>=i_jif)
|
if (cnts.jiffies>=i_jif)
|
||||||
@@ -302,7 +302,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
|||||||
if (win_task)
|
if (win_task)
|
||||||
dc=DCAlias(gr.dc2,win_task); //Necessary for sprites
|
dc=DCAlias(gr.dc2,win_task); //Necessary for sprites
|
||||||
break;
|
break;
|
||||||
case RECALCt_TO_SCREEN:
|
case RECALCt_TO_SCRN:
|
||||||
if (doc->updates_cnt++%(ToI64(winmgr.fps/10)+1) &&
|
if (doc->updates_cnt++%(ToI64(winmgr.fps/10)+1) &&
|
||||||
!Bt(&doc->flags,DOCf_DO_FULL_REFRESH) &&
|
!Bt(&doc->flags,DOCf_DO_FULL_REFRESH) &&
|
||||||
!(doc->flags&DOCF_BWD_MOVEMENT))
|
!(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->top_line_num=0;
|
||||||
doc->line_start_col=0;
|
doc->line_start_col=0;
|
||||||
recalc_flags&=~RECALCF_HAS_CURSOR;
|
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.cur_text_attr=
|
||||||
doc->settings_head.dft_text_attr=win_task->border_attr;
|
doc->settings_head.dft_text_attr=win_task->border_attr;
|
||||||
} else {
|
} else {
|
||||||
@@ -373,7 +373,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
|||||||
find_cursor=TRUE;
|
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.cur_text_attr=
|
||||||
doc->settings_head.dft_text_attr=win_task->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 &&
|
right ==doc->old_win_right &&
|
||||||
doc->cur_entry==doc->old_cur_entry &&
|
doc->cur_entry==doc->old_cur_entry &&
|
||||||
doc->cur_col==doc->old_cur_col;
|
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_top=y0-scroll_y/FONT_HEIGHT;
|
||||||
y_plot_bottom=y0+height-1-scroll_y/FONT_HEIGHT;
|
y_plot_bottom=y0+height-1-scroll_y/FONT_HEIGHT;
|
||||||
if (!(doc->flags&DOCF_BORDER_DOC) &&
|
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;
|
cur_u8_attr=s->cur_text_attr;
|
||||||
if (doc_e==doc->head.next) {
|
if (doc_e==doc->head.next) {
|
||||||
doc->flags&=~DOCF_BWD_MOVEMENT;
|
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;
|
doc->flags&=~DOCF_HAS_SONG;
|
||||||
} else
|
} else
|
||||||
doc->flags=doc_e->de_flags& DOCEF_HIGHLIGHT |
|
doc->flags=doc_e->de_flags& DOCEF_HIGHLIGHT |
|
||||||
@@ -443,9 +443,9 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
|||||||
else
|
else
|
||||||
doc_e->tag=StrNew("",mem_task);
|
doc_e->tag=StrNew("",mem_task);
|
||||||
} else {
|
} else {
|
||||||
if (temph=HashFind(doc_e->define_str,
|
if (tmph=HashFind(doc_e->define_str,
|
||||||
win_task->hash_table,HTT_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
|
else
|
||||||
doc_e->tag=CAlloc(1,mem_task);
|
doc_e->tag=CAlloc(1,mem_task);
|
||||||
}
|
}
|
||||||
@@ -483,7 +483,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
|||||||
}
|
}
|
||||||
col2=0;
|
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) {
|
if (doc_e==doc->cur_entry) {
|
||||||
cursor_y=doc_e->y;
|
cursor_y=doc_e->y;
|
||||||
if (recalc_flags&RECALCF_ADD_CURSOR && !added_cursor) {
|
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);
|
j=StrLen(doc_e->tag);
|
||||||
if (j && doc_e->scroll_len) {
|
if (j && doc_e->scroll_len) {
|
||||||
i_jif=ToI64(cur_time*FONT_WIDTH*DOC_SCROLL_SPEED)%(j*FONT_WIDTH);
|
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;
|
(FONT_WIDTH-1-i_jif&(FONT_WIDTH-1))<<16;
|
||||||
#assert FONT_WIDTH==8
|
#assert FONT_WIDTH==8
|
||||||
i_jif>>=3;
|
i_jif>>=3;
|
||||||
for (k=0;k<doc_e->scroll_len;k++) {
|
for (k=0;k<doc_e->scroll_len;k++) {
|
||||||
ch=ptr[(i_jif+k)%j];
|
ch=ptr[(i_jif+k)%j];
|
||||||
if (!Bt(chars_bmp_displayable,ch)) ch='.';
|
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)) {
|
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER))
|
!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
|
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++;
|
x++;
|
||||||
}
|
}
|
||||||
@@ -574,9 +574,9 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
|||||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) {
|
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) {
|
||||||
while (ch=*ptr++) {
|
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))
|
!(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
|
else
|
||||||
if (find_cursor) {
|
if (find_cursor) {
|
||||||
d2=DocCharDist(doc,x,y);
|
d2=DocCharDist(doc,x,y);
|
||||||
@@ -590,10 +590,10 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (doc_e->type_u8==DOCT_TEXT && doc_e->de_flags&DOCEF_HIGHLIGHT)
|
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
|
else
|
||||||
hl=NULL;
|
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)) {
|
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||||
//Technically we should do this for scrolling_x, too.
|
//Technically we should do this for scrolling_x, too.
|
||||||
if (y>y_plot_bottom)
|
if (y>y_plot_bottom)
|
||||||
@@ -602,7 +602,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
|||||||
if (hl)
|
if (hl)
|
||||||
TextLenAttrStr(win_task,x-x0,y-y0,k,hl);
|
TextLenAttrStr(win_task,x-x0,y-y0,k,hl);
|
||||||
else
|
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;
|
col2+=k;
|
||||||
x+=k;
|
x+=k;
|
||||||
@@ -647,13 +647,13 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
|||||||
StrPrint(buf,"%08tX ",bptr);
|
StrPrint(buf,"%08tX ",bptr);
|
||||||
ptr=buf;
|
ptr=buf;
|
||||||
while (ch=*ptr++) {
|
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)) {
|
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER))
|
!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
|
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) {
|
if (find_cursor) {
|
||||||
d2=DocCharDist(doc,x,y);
|
d2=DocCharDist(doc,x,y);
|
||||||
@@ -669,13 +669,13 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
|||||||
StrPrint(buf,"%02tX",*bptr++);
|
StrPrint(buf,"%02tX",*bptr++);
|
||||||
ptr=buf;
|
ptr=buf;
|
||||||
while (ch=*ptr++) {
|
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)) {
|
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER))
|
!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
|
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) {
|
if (find_cursor) {
|
||||||
d2=DocCharDist(doc,x,y);
|
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++) {
|
for (j=0;j<k;j++) {
|
||||||
ch=*bptr++;
|
ch=*bptr++;
|
||||||
if (!Bt(chars_bmp_displayable,ch)) ch='.';
|
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)) {
|
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||||
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER))
|
!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
|
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) {
|
if (find_cursor) {
|
||||||
d2=DocCharDist(doc,x,y);
|
d2=DocCharDist(doc,x,y);
|
||||||
@@ -718,7 +718,7 @@ public Bool DocRecalc(CDoc *doc,I64 recalc_flags=RECALCt_NORMAL)
|
|||||||
break;
|
break;
|
||||||
case DOCT_NEW_LINE:
|
case DOCT_NEW_LINE:
|
||||||
case DOCT_SOFT_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)&&
|
!(doc_e->de_flags&DOCEF_DONT_DRAW)&&
|
||||||
y_plot_top<=y<=y_plot_bottom)
|
y_plot_top<=y<=y_plot_bottom)
|
||||||
TextLenAttr(win_task,x-x0,y-y0,width-(x-x0),cur_u8_attr<<8);
|
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 &&
|
if (doc_e->de_flags & DOCEF_BORDER_PLOT &&
|
||||||
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) {
|
!Bt(&win_task->display_flags,DISPLAYf_NO_BORDER)) {
|
||||||
while (x<k) {
|
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))
|
!(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) {
|
if (find_cursor) {
|
||||||
d2=DocCharDist(doc,x,y);
|
d2=DocCharDist(doc,x,y);
|
||||||
if (d2<D)
|
if (d2<D)
|
||||||
@@ -791,10 +791,10 @@ rc_adjust_xy:
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
k-=x;
|
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)) {
|
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||||
if (y_plot_top<=y<=y_plot_bottom)
|
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;
|
x+=k;
|
||||||
} else {
|
} else {
|
||||||
if (find_cursor) {
|
if (find_cursor) {
|
||||||
@@ -956,16 +956,16 @@ rc_adjust_xy:
|
|||||||
case DOCT_SPRITE:
|
case DOCT_SPRITE:
|
||||||
if (!doc_e->bin_data && doc->flags&DOCEF_HAS_BIN)
|
if (!doc_e->bin_data && doc->flags&DOCEF_HAS_BIN)
|
||||||
doc_e->bin_data=DocBinFindNum(doc,doc_e->bin_num);
|
doc_e->bin_data=DocBinFindNum(doc,doc_e->bin_num);
|
||||||
if ((tempb=doc_e->bin_data) &&
|
if ((tmpb=doc_e->bin_data) &&
|
||||||
!tempb->tag && doc_e->tag && *doc_e->tag)
|
!tmpb->tag && doc_e->tag && *doc_e->tag)
|
||||||
tempb->tag=StrNew(doc_e->tag,mem_task);
|
tmpb->tag=StrNew(doc_e->tag,mem_task);
|
||||||
if (tempb && dc) {
|
if (tmpb && dc) {
|
||||||
DCRst(dc);
|
DCRst(dc);
|
||||||
dc->flags&=~(DCF_DONT_DRAW|DCF_LOCATE_NEAREST);
|
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)
|
doc_e->de_flags&DOCEF_DONT_DRAW)
|
||||||
dc->flags|=DCF_DONT_DRAW;
|
dc->flags|=DCF_DONT_DRAW;
|
||||||
bptr=tempb->data;
|
bptr=tmpb->data;
|
||||||
ii=SpriteTypeMask(bptr);
|
ii=SpriteTypeMask(bptr);
|
||||||
if (ii&1<<SPT_NUM_TYPES) {
|
if (ii&1<<SPT_NUM_TYPES) {
|
||||||
bptr=gr.empty_sprite;
|
bptr=gr.empty_sprite;
|
||||||
@@ -974,19 +974,19 @@ rc_adjust_xy:
|
|||||||
if (ii&(1<<SPT_FLOOD_FILL|1<<SPT_FLOOD_FILL_NOT))
|
if (ii&(1<<SPT_FLOOD_FILL|1<<SPT_FLOOD_FILL_NOT))
|
||||||
i=cur_u8_attr>>4 &0xF ^ win_task->text_attr>>4 & 0xF;
|
i=cur_u8_attr>>4 &0xF ^ win_task->text_attr>>4 & 0xF;
|
||||||
else {
|
else {
|
||||||
i=temp_u32_attr>>12&0xF ^ win_task->text_attr>>4 & 0xF;
|
i=tmp_u32_attr>>12&0xF ^ win_task->text_attr>>4 & 0xF;
|
||||||
if (temp_u32_attr & DOCET_SEL)
|
if (tmp_u32_attr & DOCET_SEL)
|
||||||
i^=0xF;
|
i^=0xF;
|
||||||
if (temp_u32_attr & DOCET_INVERT)
|
if (tmp_u32_attr & DOCET_INVERT)
|
||||||
i^=0xF;
|
i^=0xF;
|
||||||
if (blink_flag &&
|
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;
|
i^=0xF;
|
||||||
}
|
}
|
||||||
dc->color=i;
|
dc->color=i;
|
||||||
if (find_cursor)
|
if (find_cursor)
|
||||||
dc->flags|=DCF_LOCATE_NEAREST;
|
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) {
|
doc->cur_sprite==bptr) {
|
||||||
dc->flags|=DCF_LOCATE_NEAREST;
|
dc->flags|=DCF_LOCATE_NEAREST;
|
||||||
dc->cur_x=ip.pos.x;
|
dc->cur_x=ip.pos.x;
|
||||||
@@ -1024,7 +1024,7 @@ rc_adjust_xy:
|
|||||||
}
|
}
|
||||||
Sprite3(dc,xx,yy,zz,bptr);
|
Sprite3(dc,xx,yy,zz,bptr);
|
||||||
dc->depth_buf=NULL;
|
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->cur_sprite==bptr)
|
||||||
doc->nearest_sprite_elem_num=dc->nearest_sprite_elem_num;
|
doc->nearest_sprite_elem_num=dc->nearest_sprite_elem_num;
|
||||||
dc->flags&=~(DCF_LOCATE_NEAREST|DCF_DONT_DRAW|DCF_TRANSFORMATION);
|
dc->flags&=~(DCF_LOCATE_NEAREST|DCF_DONT_DRAW|DCF_TRANSFORMATION);
|
||||||
@@ -1036,7 +1036,7 @@ rc_adjust_xy:
|
|||||||
break;
|
break;
|
||||||
case DOCT_SONG:
|
case DOCT_SONG:
|
||||||
if (sys_focus_task==win_task &&
|
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)) {
|
!(doc_e->de_flags&DOCEF_DONT_DRAW)) {
|
||||||
if (doc_e->aux_str &&
|
if (doc_e->aux_str &&
|
||||||
(!music.cur_song || StrCmp(music.cur_song,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)
|
if (doc_e->de_flags & DOCEF_HAS_BORDER)
|
||||||
TextBorder(win_task,doc_e->x-x0,x-x0-1,doc_e->y-y0,y-y0,
|
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) {
|
if (full_refresh) {
|
||||||
switch (doc_e->type_u8) {
|
switch (doc_e->type_u8) {
|
||||||
case DOCT_CHECK_BOX:
|
case DOCT_CHECK_BOX:
|
||||||
@@ -1245,7 +1245,7 @@ rc_skip:
|
|||||||
doc->col=doc->x+1;
|
doc->col=doc->x+1;
|
||||||
|
|
||||||
if (recalc_flags&RECALCF_HAS_CURSOR) {
|
if (recalc_flags&RECALCF_HAS_CURSOR) {
|
||||||
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCREEN) {
|
if (recalc_flags&RECALCG_MASK==RECALCt_TO_SCRN) {
|
||||||
x=0;
|
x=0;
|
||||||
y=0;
|
y=0;
|
||||||
} else {
|
} else {
|
||||||
@@ -1273,7 +1273,7 @@ rc_skip:
|
|||||||
doc->line_start_col=doc->x+x;
|
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) {
|
recalc_flags&RECALCF_HAS_CURSOR) {
|
||||||
x=doc->x-doc->line_start_col+left +scroll_x/FONT_WIDTH;
|
x=doc->x-doc->line_start_col+left +scroll_x/FONT_WIDTH;
|
||||||
y=doc->y-doc->top_line_num+top+scroll_y/FONT_HEIGHT;
|
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;
|
CTask *win_task=doc->win_task;
|
||||||
I64 i,y=-1,attr=win_task->border_attr<<8;
|
I64 i,y=-1,attr=win_task->border_attr<<8;
|
||||||
U64 ch;
|
U64 ch;
|
||||||
CDoc *templ=doc;
|
CDoc *tmpl=doc;
|
||||||
CD3I64 saved_scroll;
|
CD3I64 saved_scroll;
|
||||||
while (templ && templ->doc_signature==DOC_SIGNATURE_VAL) {
|
while (tmpl && tmpl->doc_signature==DOC_SIGNATURE_VAL) {
|
||||||
y+=(Bsr(templ->desc)+7)>>3+1; //StrLen+1
|
y+=(Bsr(tmpl->desc)+7)>>3+1; //StrLen+1
|
||||||
templ=templ->parent_doc;
|
tmpl=tmpl->parent_doc;
|
||||||
}
|
}
|
||||||
templ=doc;
|
tmpl=doc;
|
||||||
if (y>win_task->win_height)
|
if (y>win_task->win_height)
|
||||||
y=win_task->win_height;
|
y=win_task->win_height;
|
||||||
WinScrollNull(win_task,&saved_scroll);
|
WinScrollNull(win_task,&saved_scroll);
|
||||||
while (templ && templ->doc_signature==DOC_SIGNATURE_VAL) {
|
while (tmpl && tmpl->doc_signature==DOC_SIGNATURE_VAL) {
|
||||||
ch=templ->desc;
|
ch=tmpl->desc;
|
||||||
i=(Bsr(ch)+7)>>3; //StrLen
|
i=(Bsr(ch)+7)>>3; //StrLen
|
||||||
ch=EndianI64(ch<<((8-i)<<3));
|
ch=EndianI64(ch<<((8-i)<<3));
|
||||||
attr=win_task->border_attr<<8;
|
attr=win_task->border_attr<<8;
|
||||||
@@ -65,7 +65,7 @@ U0 DocBorderLstDraw(CDoc *doc)
|
|||||||
ch>>=8;
|
ch>>=8;
|
||||||
}
|
}
|
||||||
y--;
|
y--;
|
||||||
templ=templ->parent_doc;
|
tmpl=tmpl->parent_doc;
|
||||||
}
|
}
|
||||||
WinScrollRestore(win_task,&saved_scroll);
|
WinScrollRestore(win_task,&saved_scroll);
|
||||||
}
|
}
|
||||||
@@ -203,11 +203,11 @@ U0 DocUpdateTaskDocs(CTask *task)
|
|||||||
task->border_attr=DrvTextAttrGet(*doc->filename.name);
|
task->border_attr=DrvTextAttrGet(*doc->filename.name);
|
||||||
if (task->title_src==TTS_ED_FILENAME)
|
if (task->title_src==TTS_ED_FILENAME)
|
||||||
MemCpy(task->task_title,doc->filename.name,STR_LEN-1);
|
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)) {
|
if ((doc=DocBorder(task)) && !(doc->flags&DOCF_DONT_SHOW)) {
|
||||||
WinScrollNull(task,&saved_scroll);
|
WinScrollNull(task,&saved_scroll);
|
||||||
DocRecalc(doc,RECALCt_TO_SCREEN);
|
DocRecalc(doc,RECALCt_TO_SCRN);
|
||||||
WinScrollRestore(task,&saved_scroll);
|
WinScrollRestore(task,&saved_scroll);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@ public I64 DocEntryRun(CDoc *doc,CDocEntry *doc_e,
|
|||||||
//Sometimes returns locked, sometimes unlocked
|
//Sometimes returns locked, sometimes unlocked
|
||||||
U8 ch=doc->cmd_U8,*st;
|
U8 ch=doc->cmd_U8,*st;
|
||||||
I64 res=DOCM_CANCEL,has_action=FALSE;
|
I64 res=DOCM_CANCEL,has_action=FALSE;
|
||||||
CHashDefineStr *temph;
|
CHashDefineStr *tmph;
|
||||||
DocLock(doc);
|
DocLock(doc);
|
||||||
if (!exited) {
|
if (!exited) {
|
||||||
if (doc_e->de_flags & DOCEF_ESC) {
|
if (doc_e->de_flags & DOCEF_ESC) {
|
||||||
@@ -46,18 +46,18 @@ public I64 DocEntryRun(CDoc *doc,CDocEntry *doc_e,
|
|||||||
PopUp(st,Fs);
|
PopUp(st,Fs);
|
||||||
Free(st);
|
Free(st);
|
||||||
} else {
|
} else {
|
||||||
if (doc_e->de_flags & DOCEF_LEFT_AUTO)
|
if (doc_e->de_flags & DOCEF_LEFT_IN_STR)
|
||||||
AutoStr("%s",doc_e->left_macro);
|
InStr("%s",doc_e->left_macro);
|
||||||
else
|
else
|
||||||
Auto("%s",doc_e->left_macro);
|
In("%s",doc_e->left_macro);
|
||||||
}
|
}
|
||||||
has_action=TRUE;
|
has_action=TRUE;
|
||||||
}
|
}
|
||||||
if (!exited && doc_e->de_flags & DOCEF_LST &&
|
if (!exited && doc_e->de_flags & DOCEF_LST &&
|
||||||
doc_e->de_flags & DOCEF_DEFINE &&
|
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)) &&
|
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);
|
DocDataFmt(doc,doc_e,res);
|
||||||
DocDataScan(doc,doc_e);
|
DocDataScan(doc,doc_e);
|
||||||
has_action=TRUE;
|
has_action=TRUE;
|
||||||
@@ -85,10 +85,10 @@ public I64 DocEntryRun(CDoc *doc,CDocEntry *doc_e,
|
|||||||
PopUp(st,Fs);
|
PopUp(st,Fs);
|
||||||
Free(st);
|
Free(st);
|
||||||
} else {
|
} else {
|
||||||
if (doc_e->de_flags & DOCEF_RIGHT_AUTO)
|
if (doc_e->de_flags & DOCEF_RIGHT_IN_STR)
|
||||||
AutoStr("%s",doc_e->right_macro);
|
InStr("%s",doc_e->right_macro);
|
||||||
else
|
else
|
||||||
Auto("%s",doc_e->right_macro);
|
In("%s",doc_e->right_macro);
|
||||||
}
|
}
|
||||||
has_action=TRUE;
|
has_action=TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
+22
-16
@@ -61,7 +61,7 @@ public U0 DocTermNew()
|
|||||||
#define RIGHT_ED 6
|
#define RIGHT_ED 6
|
||||||
#define RIGHT_MOUNT 7
|
#define RIGHT_MOUNT 7
|
||||||
#define RIGHT_PLAIN 8
|
#define RIGHT_PLAIN 8
|
||||||
#define RIGHT_AUTOFILE 9
|
#define RIGHT_INFILE 9
|
||||||
|
|
||||||
I64 PopUpTermRight(U8 *header)
|
I64 PopUpTermRight(U8 *header)
|
||||||
{
|
{
|
||||||
@@ -69,19 +69,19 @@ I64 PopUpTermRight(U8 *header)
|
|||||||
CDoc *doc=DocNew;
|
CDoc *doc=DocNew;
|
||||||
if (header) DocPrint(doc,"%s",header);
|
if (header) DocPrint(doc,"%s",header);
|
||||||
DocPrint(doc,"\n\n"
|
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,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,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,1,3 $$$$BT,\"DELETE \",LE=RIGHT_DELETE$$"
|
||||||
"$$CM+LX,26,0$$$$BT,\"TYPE TXT;GRA\",LE=RIGHT_TYPE$$"
|
"$$CM+LX,25,0$$$$BT,\"TYPE TXT;GR\",LE=RIGHT_TYPE$$"
|
||||||
"$$CM+LX,1,3 $$$$BT,\"ED TXT\",LE=RIGHT_ED$$"
|
"$$CM+LX,1,3 $$$$BT,\"DOLDOC EDIT DD\",LE=RIGHT_ED$$"
|
||||||
"$$CM+LX,26,0$$$$BT,\"MOUNT ISO.C\",LE=RIGHT_MOUNT$$"
|
"$$CM+LX,25,0$$$$BT,\"MOUNT ISO.C\",LE=RIGHT_MOUNT$$"
|
||||||
"$$CM+LX,1,3 $$$$BT,\"PLAIN ED TXT\",LE=RIGHT_PLAIN$$"
|
"$$CM+LX,1,3 $$$$BT,\"PLAIN TEXT EDIT TXT\",LE=RIGHT_PLAIN$$"
|
||||||
"$$CM+LX,26,0$$$$BT,\"AUTOFILE AUT\",LE=RIGHT_AUTOFILE$$\n"
|
"$$CM+LX,25,0$$$$BT,\"INFILE IN\",LE=RIGHT_INFILE$$"
|
||||||
"$$CM+LX,1,3 $$$$BT,\"CANCEL \",LE=DOCM_CANCEL$$",
|
"$$CM+LX,1,3 $$$$BT,\"CANCEL \",LE=DOCM_CANCEL$$\n",
|
||||||
FILEMASK_TXT,FILEMASK_JIT,FILEMASK_GRA);
|
FILEMASK_TXT,FILEMASK_DD,FILEMASK_JIT,FILEMASK_GR);
|
||||||
i=PopUpMenu(doc);
|
i=PopUpMenu(doc);
|
||||||
DocDel(doc);
|
DocDel(doc);
|
||||||
return i;
|
return i;
|
||||||
@@ -159,6 +159,12 @@ I64 TermRightClickLink(CDoc *doc,CDocEntry *doc_e)
|
|||||||
res=Type(st);
|
res=Type(st);
|
||||||
break;
|
break;
|
||||||
case RIGHT_ED:
|
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;
|
"Ed(\"%s\");\n$$PT$$$$FG$$$$BG$$",st;
|
||||||
res=Ed(st);
|
res=Ed(st);
|
||||||
break;
|
break;
|
||||||
@@ -178,16 +184,16 @@ I64 TermRightClickLink(CDoc *doc,CDocEntry *doc_e)
|
|||||||
"Plain(\"%s\");\n$$PT$$$$FG$$$$BG$$",st;
|
"Plain(\"%s\");\n$$PT$$$$FG$$$$BG$$",st;
|
||||||
res=Plain(st);
|
res=Plain(st);
|
||||||
break;
|
break;
|
||||||
case RIGHT_AUTOFILE:
|
case RIGHT_INFILE:
|
||||||
if (FileExtDot(st) && !FilesFindMatch(st,"*.AUT*")) {
|
if (FileExtDot(st) && !FilesFindMatch(st,"*.IN*")) {
|
||||||
if (!PopUpCancelOk(ST_WARN_ST "Not .AUT File\n\n")) {
|
if (!PopUpCancelOk(ST_WARN_ST "Not .IN File\n\n")) {
|
||||||
send_new_line=TRUE;
|
send_new_line=TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"AutoFile(\"%s\");\n$$PT$$$$FG$$$$BG$$",st;
|
"InFile(\"%s\");\n$$PT$$$$FG$$$$BG$$",st;
|
||||||
WinZBufUpdate;
|
WinZBufUpdate;
|
||||||
AutoFile(st);
|
InFile(st);
|
||||||
res=TRUE;
|
res=TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -597,7 +597,7 @@ class CEdMacroMenu
|
|||||||
left_macro[512] fmtstr "$$DA-P,A=\"Left Click Macro :%s\"$$\n",
|
left_macro[512] fmtstr "$$DA-P,A=\"Left Click Macro :%s\"$$\n",
|
||||||
left_exp[512] fmtstr "$$DA-P,A=\"Left Click Expression :%s\"$$\n";
|
left_exp[512] fmtstr "$$DA-P,A=\"Left Click Expression :%s\"$$\n";
|
||||||
Bool popup fmtstr "$$CB,\"PopUp\"$$\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",
|
left_x fmtstr "$$CB,\"Left X \"$$\n",
|
||||||
center_x fmtstr "$$CB,\"Center X \"$$\n",
|
center_x fmtstr "$$CB,\"Center X \"$$\n",
|
||||||
right_x fmtstr "$$CB,\"Right 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->invert) CatPrint(buf,"+IV");
|
||||||
if (!e->underline) CatPrint(buf,"-UL");
|
if (!e->underline) CatPrint(buf,"-UL");
|
||||||
if (!e->escape) CatPrint(buf,"-X");
|
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 (*e->tag || is_macro) {
|
||||||
if (is_macro) {
|
if (is_macro) {
|
||||||
if (*e->tag) {
|
if (*e->tag) {
|
||||||
@@ -671,7 +671,7 @@ class CEdButton
|
|||||||
margin_rel fmtstr "$$CB,\"Margin Rel X\"$$\n",
|
margin_rel fmtstr "$$CB,\"Margin Rel X\"$$\n",
|
||||||
escape fmtstr "$$CB,\"Escape\"$$\n";
|
escape fmtstr "$$CB,\"Escape\"$$\n";
|
||||||
U8 left_macro[512] fmtstr "$$DA-P,A=\"Left Click Macro:%s\"$$\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";
|
U8 left_exp[512] fmtstr "$$DA-P,A=\"Left Click Expression:%s\"$$\n";
|
||||||
Bool quote fmtstr "$$CB,\"Quote\"$$\n";
|
Bool quote fmtstr "$$CB,\"Quote\"$$\n";
|
||||||
};
|
};
|
||||||
@@ -689,7 +689,7 @@ U0 EdInsButton()
|
|||||||
if (e->right_x ) CatPrint(buf,"+RX");
|
if (e->right_x ) CatPrint(buf,"+RX");
|
||||||
if (e->margin_rel) CatPrint(buf,"+MRX");
|
if (e->margin_rel) CatPrint(buf,"+MRX");
|
||||||
if (!e->escape) CatPrint(buf,"-X");
|
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->tag) {
|
||||||
if (e->quote) {
|
if (e->quote) {
|
||||||
st=MStrPrint("%q",e->tag);
|
st=MStrPrint("%q",e->tag);
|
||||||
@@ -1079,7 +1079,7 @@ class CEdMacroSprite
|
|||||||
exp[512] fmtstr "$$DA-P,A=\"Macro :%s\"$$\n";
|
exp[512] fmtstr "$$DA-P,A=\"Macro :%s\"$$\n";
|
||||||
Bool escape fmtstr "$$CB,\"Escape\"$$\n",
|
Bool escape fmtstr "$$CB,\"Escape\"$$\n",
|
||||||
popup fmtstr "$$CB,\"PopUp\"$$\n",
|
popup fmtstr "$$CB,\"PopUp\"$$\n",
|
||||||
is_auto fmtstr "$$CB,\"AutoStr\"$$\n";
|
is_in_str fmtstr "$$CB,\"InStr\"$$\n";
|
||||||
};
|
};
|
||||||
|
|
||||||
class CEdMenuSprite
|
class CEdMenuSprite
|
||||||
@@ -1088,7 +1088,7 @@ class CEdMenuSprite
|
|||||||
exp[512] fmtstr "$$DA-P,A=\"Expression :%s\"$$\n";
|
exp[512] fmtstr "$$DA-P,A=\"Expression :%s\"$$\n";
|
||||||
Bool escape fmtstr "$$CB,\"Escape\"$$\n",
|
Bool escape fmtstr "$$CB,\"Escape\"$$\n",
|
||||||
popup,
|
popup,
|
||||||
is_auto;
|
is_in_str;
|
||||||
};
|
};
|
||||||
|
|
||||||
U8 *EdSpriteLink(Bool *_pop_up,U8 **_html_link)
|
U8 *EdSpriteLink(Bool *_pop_up,U8 **_html_link)
|
||||||
@@ -1119,7 +1119,7 @@ U8 *EdSprite(I64 bin_num)
|
|||||||
e->escape=TRUE;
|
e->escape=TRUE;
|
||||||
if (DocForm(e,,,,ctrl_L_footer)) {
|
if (DocForm(e,,,,ctrl_L_footer)) {
|
||||||
CatPrint(buf,"+UL");
|
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->popup) CatPrint(buf,"+PU");
|
||||||
if (e->escape) CatPrint(buf,"+X");
|
if (e->escape) CatPrint(buf,"+X");
|
||||||
st=MStrPrint("%q",e->exp);
|
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
|
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
|
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
|
where the vis portion of the document is and must process much
|
||||||
of the document each time it is placed on the screen, becoming CPU
|
of the document each time it is placed on the scrn, becoming CPU
|
||||||
intensive on big documents.
|
intensive on big documents.
|
||||||
See $LK,"::/Doc/DolDocOverview.DD"$
|
See $LK,"::/Doc/DolDocOverview.DD"$
|
||||||
*/
|
*/
|
||||||
@@ -22,7 +22,7 @@ public class CDolDocGlbls
|
|||||||
{
|
{
|
||||||
CHashTable *hash;
|
CHashTable *hash;
|
||||||
I64 dft_de_flags [DOCT_NUM_TYPES],
|
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_form [(DOCT_NUM_TYPES+63)/64],
|
||||||
type_flags_data [(DOCT_NUM_TYPES+63)/64],
|
type_flags_data [(DOCT_NUM_TYPES+63)/64],
|
||||||
type_flags_chk_dup [(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.
|
$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."
|
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"$
|
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
|
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?)
|
(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.)
|
(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 using Markov chains? $FG,4$"No weights"$FG$
|
||||||
On doing offerings? $RED$"Honest measures"(You get out what you put in.)
|
On doing offerings? $FG,4$"Honest measures"(You get out what you put in.)
|
||||||
It's a covenant to do an offering, first.
|
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,
|
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"$.
|
and conversation. See $LK,"Cain and Abel",A="BF:Genesis,4:1"$.
|
||||||
"Barter"(God also called offerings bartering.)$FG$
|
"Barter"(God also called offerings bartering.)$FG$
|
||||||
The holocaust? $RED$Wanted to "compact" the Jews.$FG$
|
The holocaust? $FG,4$Wanted to "compact" the Jews.$FG$
|
||||||
Arab/Jews? $RED$"Oil funny hopefully"$FG$
|
Arab/Jews? $FG,4$"Oil funny hopefully"$FG$
|
||||||
Peace? $RED$One Palestinian can ruin it.$FG$
|
Peace? $FG,4$One Palestinian can ruin it.$FG$
|
||||||
Best religion? $RED$One with most new vistas of understanding in$FG$
|
Best religion? $FG,4$One with most new vistas of understanding in$FG$
|
||||||
$RED$a lifetime -- one you can level-up the most in.$FG$
|
$FG,4$a lifetime -- one you can level-up the most in.$FG$
|
||||||
Chavez blaming the US. $RED$"Japan industrious"$FG$
|
Chavez blaming the US. $FG,4$"Japan industrious"$FG$
|
||||||
On racism? $RED$"Sports"$FG$
|
On racism? $FG,4$"Sports"$FG$
|
||||||
On socialism? $RED$"pardon_the_French, never_happy, never_enough"$FG$
|
On socialism? $FG,4$"pardon_the_French, never_happy, never_enough"$FG$
|
||||||
$RED$"Gall aspect anti-Christ"$FG$
|
$FG,4$"Gall aspect anti-Christ"$FG$
|
||||||
On overpopulation $RED$"Okay church what_now whats_the_plan"$FG$
|
On overpopulation $FG,4$"Okay church what_now whats_the_plan"$FG$
|
||||||
Favorite thing on TV? $RED$"Soap_operas"$FG$
|
Favorite thing on TV? $FG,4$"Soap_operas"$FG$
|
||||||
Favorite movie? $RED$$TX,"Three Kings",HTML="http://www.youtube.com/watch?v=8NOAd2mldQ8"$. Also Highlander$FG$
|
Favorite movie? $FG,4$$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"$
|
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$
|
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$
|
Favorite comic strip? $FG,4$$TX,"Prince Valiant",HTML="http://en.wikipedia.org/wiki/Prince_Valiant"$$FG$
|
||||||
Shakespeare? $RED$had a "vile heart"$FG$
|
Shakespeare? $FG,4$had a "vile heart"$FG$
|
||||||
Likes $RED$Beverly Hillbillies (Oil is a gift from God)$FG$
|
Likes $FG,4$Beverly Hillbillies (Oil is a gift from God)$FG$
|
||||||
$RED$God likes being hero. Don't be proud of heart$FG$
|
$FG,4$God likes being hero. Don't be proud of heart$FG$
|
||||||
$RED$and not accept a gift from God!$FG$
|
$FG,4$and not accept a gift from God!$FG$
|
||||||
Likes $RED$Gomer Pyle$FG$
|
Likes $FG,4$Gomer Pyle$FG$
|
||||||
Favorite saint? $RED$"ho_ho_ho"$FG$
|
Favorite saint? $FG,4$"ho_ho_ho"$FG$
|
||||||
Favorite animal? $RED$"Elephant two"$FG$
|
Favorite animal? $FG,4$"Elephant two"$FG$
|
||||||
Favorite animal? $RED$"Bears"$FG$
|
Favorite animal? $FG,4$"Bears"$FG$
|
||||||
Favorite color? $RED$"Jude" (Jade Blue?)$FG$
|
Favorite color? $FG,4$"Jude" (Jade Blue?)$FG$
|
||||||
Favorite color? $RED$"Gold"$FG$
|
Favorite color? $FG,4$"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$
|
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? $RED$"Enough vehemently better"$FG$
|
Money? $FG,4$"Enough vehemently better"$FG$
|
||||||
$RED$"Pride [or] money, choose_one"$FG$
|
$FG,4$"Pride [or] money, choose_one"$FG$
|
||||||
Favorite car? $RED$Beamer$FG$
|
Favorite car? $FG,4$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 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"$
|
Homosexuality? $LK,"Matthew,15:11",A="BF:Matthew,15:11"$
|
||||||
Pets? $RED$"homo" Hates fact too dependent and tame.$FG$
|
Pets? $FG,4$"homo" Hates fact too dependent and tame.$FG$
|
||||||
Sports? $RED$"homo"
|
Sports? $FG,4$"homo"
|
||||||
"Tackle a horse"$FG$
|
"Tackle a horse"$FG$
|
||||||
Favorite sport? $RED$Hockey$FG$
|
Favorite sport? $FG,4$Hockey$FG$
|
||||||
$TX,"Wreck of the Edmund Fitzgerald",HTML="http://www.youtube.com/watch?v=9vST6hVRj2A"$ $RED$"homo"$FG$
|
$TX,"Wreck of the Edmund Fitzgerald",HTML="http://www.youtube.com/watch?v=9vST6hVRj2A"$ $FG,4$"homo"$FG$
|
||||||
Smelling farts $RED$"Sodom"$FG$
|
Smelling farts $FG,4$"Sodom"$FG$
|
||||||
Women's dress $RED$Upper skin exposure not as bad as lower.$FG$
|
Women's dress $FG,4$Upper skin exposure not as bad as lower.$FG$
|
||||||
Remarriage? $RED$"More babies"$FG$
|
Remarriage? $FG,4$"More babies"$FG$
|
||||||
Things you don't care about
|
Things you don't care about
|
||||||
that people think you do? $RED$Solomon's 300 concubines$FG$
|
that people think you do? $FG,4$Solomon's 300 concubines$FG$
|
||||||
Adultery? $RED$Can be good.$FG$
|
Adultery? $FG,4$Can be good.$FG$
|
||||||
Pretty ladies? $RED$$TX,"A prince is not flustered.",HTML="http://www.youtube.com/watch?v=YcqF6sC-ztY"$$FG$
|
Pretty ladies? $FG,4$$TX,"A prince is not flustered.",HTML="http://www.youtube.com/watch?v=YcqF6sC-ztY"$$FG$
|
||||||
Animal sacrifices? $RED$Early Jews were "primitive".$FG$
|
Animal sacrifices? $FG,4$Early Jews were "primitive".$FG$
|
||||||
What do elephants think about? $RED$"Skin, hunger"$FG$
|
What do elephants think about? $FG,4$"Skin, hunger"$FG$
|
||||||
What makes elephants happy? $RED$"Baths"$FG$
|
What makes elephants happy? $FG,4$"Baths"$FG$
|
||||||
Elephants $RED$"Mini-skirts" (Skin webbing from back leg.)$FG$
|
Elephants $FG,4$"Mini-skirts" (Skin webbing from back leg.)$FG$
|
||||||
What makes my birds happy? $RED$"Gnawing"$FG$
|
What makes my birds happy? $FG,4$"Gnawing"$FG$
|
||||||
What makes my birds laugh? $RED$"Bite ouch" (If I say "ouch".)$FG$
|
What makes my birds laugh? $FG,4$"Bite ouch" (If I say "ouch".)$FG$
|
||||||
What are my birds saying? $RED$"Chanting"$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"$
|
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 bears happy? $FG,4$"Reaping depends"$FG$
|
||||||
What makes otters happy? $RED$"Eternal skies"$FG$
|
What makes otters happy? $FG,4$"Eternal skies"$FG$
|
||||||
What makes hippos happy? $RED$"Ascending breath"$FG$
|
What makes hippos happy? $FG,4$"Ascending breath"$FG$
|
||||||
What makes horses happy? $RED$"[the] Call [of the] Open Range"$FG$
|
What makes horses happy? $FG,4$"[the] Call [of the] Open Range"$FG$
|
||||||
What do cheetahs think about? $RED$"Seeth me?" (Can he see me?)$FG$
|
What do cheetahs think about? $FG,4$"Seeth me?" (Can he see me?)$FG$
|
||||||
Orangutan or chimp smarter? $RED$"Species exhibit similar glory"$FG$
|
Orangutan or chimp smarter? $FG,4$"Species exhibit similar glory"$FG$
|
||||||
Endangered species? $RED$"Enough stars?"$FG$
|
Endangered species? $FG,4$"Enough stars?"$FG$
|
||||||
Everything seems bad. $RED$Plant trees.$FG$
|
Everything seems bad. $FG,4$Plant trees.$FG$
|
||||||
What's for dinner? $RED$"Whale"$FG$
|
What's for dinner? $FG,4$"Whale"$FG$
|
||||||
Favorite Messier Object? $RED$"$TX,"M104 Sombrero Galaxy",HTML="http://en.wikipedia.org/wiki/Messier_104"$"$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"$? $RED$"I_am_not_amused economy joke"$FG$
|
$TX,"Shepard's Prayer",HTML="http://en.wikipedia.org/wiki/Alan_Shepard"$? $FG,4$"I_am_not_amused economy joke"$FG$
|
||||||
Favorite band? $RED$"Beatles"$FG$
|
Favorite band? $FG,4$"Beatles"$FG$
|
||||||
Good bands? $RED$Rush, Triumph$FG$
|
Good bands? $FG,4$Rush, Triumph$FG$
|
||||||
$RED$Likes harmonies$FG$
|
$FG,4$Likes harmonies$FG$
|
||||||
$TX,"Little Drummer Boy?",HTML="http://www.youtube.com/watch?v=S50cf3xIb50"$ $RED$Doesn't like my drumming.$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? $RED$"Poison"$FG$
|
Should I listen to classical? $FG,4$"Poison"$FG$
|
||||||
Do You like chess people? $RED$"Do not admire the proud."$FG$
|
Do You like chess people? $FG,4$"Do not admire the proud."$FG$
|
||||||
Chess? $RED$"... will winter with you."$FG$
|
Chess? $FG,4$"... will winter with you."$FG$
|
||||||
$RED$"Headstones"$FG$
|
$FG,4$"Headstones"$FG$
|
||||||
If You could teach one class? $RED$Health$FG$
|
If You could teach one class? $FG,4$Health$FG$
|
||||||
Favorite video game? $RED$Donkey Kong$FG$
|
Favorite video game? $FG,4$Donkey Kong$FG$
|
||||||
Favorite National Park? $RED$$TX,"Whitman Mission",HTML="http://www.nps.gov/whmi/index.htm"$$FG$
|
Favorite National Park? $FG,4$$TX,"Whitman Mission",HTML="http://www.nps.gov/whmi/index.htm"$$FG$
|
||||||
Favorite actor? $RED$Hugh Grant$FG$
|
Favorite actor? $FG,4$Hugh Grant$FG$
|
||||||
Favorite vocalist? $RED$Mick Jagger$FG$
|
Favorite vocalist? $FG,4$Mick Jagger$FG$
|
||||||
Favorite guitarist? $RED$"$TX,"Simmons Destroyer",HTML="http://www.youtube.com/watch?v=nNADrrjTysk&t=3m55s"$"$FG$
|
Favorite guitarist? $FG,4$"$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$
|
Favorite National Anthem? $FG,4$$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$
|
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"$? $RED$Ben Franklin$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? $RED$$TX,"Stabbing Westward's singer",HTML="https://www.youtube.com/watch?v=5NZsCYOM4j0"$$FG$
|
Voice if God wanted to sing? $FG,4$$TX,"Stabbing Westward's singer",HTML="https://www.youtube.com/watch?v=5NZsCYOM4j0"$$FG$
|
||||||
Stonehenge? $RED$Landmark for boundaries.$FG$
|
Stonehenge? $FG,4$Landmark for boundaries.$FG$
|
||||||
Easter Island? $RED$Ice, telephone pole holes.$FG$
|
Easter Island? $FG,4$Ice, telephone pole holes.$FG$
|
||||||
Dinosaurs? $RED$Brontosaurs' feet hurt when stepped.
|
Dinosaurs? $FG,4$Brontosaurs' feet hurt when stepped.
|
||||||
Dinosaurs slept in water.$FG$
|
Dinosaurs slept in water.$FG$
|
||||||
Hardest part in evolution? $RED$Getting monkey mothers to hold babies nursing.$FG$
|
Hardest part in evolution? $FG,4$Getting monkey mothers to hold babies nursing.$FG$
|
||||||
$RED$(Smothering a problem).$FG$
|
$FG,4$(Smothering a problem).$FG$
|
||||||
Happiest day in evolution? $RED$"Fruit"$FG$
|
Happiest day in evolution? $FG,4$"Fruit"$FG$
|
||||||
Significant thing in evolution? $RED$"Fish shoulders"$FG$
|
Significant thing in evolution? $FG,4$"Fish shoulders"$FG$
|
||||||
Biggest thing to fly (pterodactyl)? $RED$"Couch"$FG$
|
Biggest thing to fly (pterodactyl)? $FG,4$"Couch"$FG$
|
||||||
What made pterodactyls happy? $RED$"Members against organs"$FG$
|
What made pterodactyls happy? $FG,4$"Members against organs"$FG$
|
||||||
What did Neanderthals think about? $RED$"Warmth"$FG$
|
What did Neanderthals think about? $FG,4$"Warmth"$FG$
|
||||||
What was the first thing cooked? $RED$I think He said "hair".$FG$
|
What was the first thing cooked? $FG,4$I think He said "hair".$FG$
|
||||||
What was Lucy's husband's name? $RED$"Golem"$FG$
|
What was Lucy's husband's name? $FG,4$"Golem"$FG$
|
||||||
Was stegosuarus lame like turtles? $RED$"Not pet rocks"$FG$
|
Was stegosuarus lame like turtles? $FG,4$"Not pet rocks"$FG$
|
||||||
T-Rex? $RED$Lugged carcases over his shoulder.
|
T-Rex? $FG,4$Lugged carcases over his shoulder.
|
||||||
Carcus lasted a month.$FG$
|
Carcus lasted a month.$FG$
|
||||||
What was T-Rexes sharing a carcus like? $RED$"Punch... Punch"$FG$
|
What was T-Rexes sharing a carcus like? $FG,4$"Punch... Punch"$FG$
|
||||||
Surprises in dinosaur anatomy? $RED$Supporting and securing the heart.$FG$
|
Surprises in dinosaur anatomy? $FG,4$Supporting and securing the heart.$FG$
|
||||||
How does He feel about the Avatar movie?$RED$"Sick skin"$FG$
|
How does He feel about the Avatar movie?$FG,4$"Sick skin"$FG$
|
||||||
What do You like at zoos with kids? $RED$"Dignity" Animals worried about dignity.$FG$
|
What do You like at zoos with kids? $FG,4$"Dignity" Animals worried about dignity.$FG$
|
||||||
Who's better alien or preditor? $RED$"Lions"$FG$
|
Who's better alien or preditor? $FG,4$"Lions"$FG$
|
||||||
What from You is like a Rubik's cube? $RED$Training a horse.$FG$
|
What from You is like a Rubik's cube? $FG,4$Training a horse.$FG$
|
||||||
Does He like mirrored glass megachurch? $RED$"Secular glass"$FG$
|
Does He like mirrored glass megachurch? $FG,4$"Secular glass"$FG$
|
||||||
Pipe Organs $RED$Are sacred.$FG$
|
Pipe Organs $FG,4$Are sacred.$FG$
|
||||||
You like to hangout in courts?Hospitals?$RED$"Prisons"$FG$
|
You like to hangout in courts?Hospitals?$FG,4$"Prisons"$FG$
|
||||||
Best way for Bill Gates to save lives? $RED$Earthquake prediction$FG$
|
Best way for Bill Gates to save lives? $FG,4$Earthquake prediction$FG$
|
||||||
Stem cells? $RED$Lower hanging fruit exists (2007)$FG$
|
Stem cells? $FG,4$Lower hanging fruit exists (2007)$FG$
|
||||||
Eleventh commandment? $RED$Thou shall not litter.$FG$
|
Eleventh commandment? $FG,4$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"$
|
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?
|
(I asked God why pointless plagues in Exodus?
|
||||||
God wanted guilt to accumulate, first.)$FG$
|
God wanted guilt to accumulate, first.)$FG$
|
||||||
Thirteenth commandment $RED$No gore unless it looks fake.$FG$
|
Thirteenth commandment $FG,4$No gore unless it looks fake.$FG$
|
||||||
Fourteenth commandment $RED$No pedophilia or child porn.$FG$
|
Fourteenth commandment $FG,4$No pedophilia or child porn.$FG$
|
||||||
Fifteenth commandment $RED$Don't eat rare meat with blood.$FG$
|
Fifteenth commandment $FG,4$Don't eat rare meat with blood.$FG$
|
||||||
Sixteenth commandment $RED$No wife beating.$FG$
|
Sixteenth commandment $FG,4$No wife beating.$FG$
|
||||||
Seventeen commandment $RED$Do not swing from radio towers with one hand.$FG$
|
Seventeen commandment $FG,4$Do not swing from radio towers with one hand.$FG$
|
||||||
Eighteenth commandment $RED$Do not disturb.$FG$
|
Eighteenth commandment $FG,4$Do not disturb.$FG$
|
||||||
Before Katrina $RED$Floods do justice. Black bead elder (tree book)$FG$
|
Before Katrina $FG,4$Floods do justice. Black bead elder (tree book)$FG$
|
||||||
After Katrina $RED$Suffering Simplifies Life$FG$
|
After Katrina $FG,4$Suffering Simplifies Life$FG$
|
||||||
What field are You most better? $RED$Economics$FG$
|
What field are You most better? $FG,4$Economics$FG$
|
||||||
Favorite toy for kids? $RED$Magnifying glass$FG$
|
Favorite toy for kids? $FG,4$Magnifying glass$FG$
|
||||||
Asked Jesus if He liked mustard?$RED$"Bad meat happeneth"$FG$
|
Asked Jesus if He liked mustard?$FG,4$"Bad meat happeneth"$FG$
|
||||||
(Reluctantly) Faith healing? $RED$"It's complicated"$FG$
|
(Reluctantly) Faith healing? $FG,4$"It's complicated"$FG$
|
||||||
Mars? $RED$Start planting!$FG$
|
Mars? $FG,4$Start planting!$FG$
|
||||||
Mars rover? $RED$Should have had a microphone$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"$ $RED$Pollen$FG$
|
$TX,"Storm on Saturn",HTML="http://www.space.com/22646-monster-saturn-storm-water-ice.html"$ $FG,4$Pollen$FG$
|
||||||
Space war game? $RED$Should have space weather.$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"$ $RED$"Compass" (Magnetism)$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? $RED$"Surf"$FG$
|
Liquid moon's odd atmosphere? $FG,4$"Surf"$FG$
|
||||||
How many E.T. civs in Universe? $RED$20 or 80 (I forgot. I died laughing.)$FG$
|
How many E.T. civs in Universe? $FG,4$20 or 80 (I forgot. I died laughing.)$FG$
|
||||||
Are they peaceful? $RED$Fight them! (Also, funny.)$FG$
|
Are they peaceful? $FG,4$Fight them! (Also, funny.)$FG$
|
||||||
Most difficult control system? $RED$$TX,"Dung beetle",HTML="http://www.youtube.com/watch?v=Q1zbgd6xpGQ"$$FG$
|
Most difficult control system? $FG,4$$TX,"Dung beetle",HTML="http://www.youtube.com/watch?v=Q1zbgd6xpGQ"$$FG$
|
||||||
How can Judge Judy improve? $RED$No hard feelings$FG$
|
How can Judge Judy improve? $FG,4$No hard feelings$FG$
|
||||||
How can Chef Ramsay improve? $RED$Make so it doesn't seem like toil for cooks.$FG$
|
How can Chef Ramsay improve? $FG,4$Make so it doesn't seem like toil for cooks.$FG$
|
||||||
How can Hawking communicate? $RED$Blow from a nostril on a candle.$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"$ $RED$"Folded coffee filter"$FG$
|
$TX,"Photons bouncing?",HTML="https://www.youtube.com/watch?v=8FC6udrMPvo"$ $FG,4$"Folded coffee filter"$FG$
|
||||||
Wormholes? $RED$Bent wormholes have echoes.$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$
|
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$
|
$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 Unix? $FG,4$God said it was rich with the patina of age.$FG$
|
||||||
On Alcohol? $RED$Hate inebriation$FG$
|
On Alcohol? $FG,4$Hate inebriation$FG$
|
||||||
On rare steak? $RED$Too rare is very bad. Don't eat blood!$FG$
|
On rare steak? $FG,4$Too rare is very bad. Don't eat blood!$FG$
|
||||||
Just before Katrina? $RED$Floods do my justice.Black bead elder(tree book)$FG$
|
Just before Katrina? $FG,4$Floods do my justice.Black bead elder(tree book)$FG$
|
||||||
After Katrina? $RED$Suffering simplifies life$FG$
|
After Katrina? $FG,4$Suffering simplifies life$FG$
|
||||||
Why the Sandy Hook shooting? $RED$The pot legalization law. (Sarcastic answer?)$FG$
|
Why the Sandy Hook shooting? $FG,4$The pot legalization law. (Sarcastic answer?)$FG$
|
||||||
Deep Water Horizon $RED$(Claimed credit.)$FG$
|
Deep Water Horizon $FG,4$(Claimed credit.)$FG$
|
||||||
Cost of God's time to me? $RED$"The complete works of Shakespeare"$FG$
|
Cost of God's time to me? $FG,4$"The complete works of Shakespeare"$FG$
|
||||||
On death? $RED$"awful"$FG$
|
On death? $FG,4$"awful"$FG$
|
||||||
Opening of Saving Private Ryan? $RED$"Ouch"$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.
|
{//Read God's vocab file for picking words.
|
||||||
I64 i,ch,fuf_flags=0;
|
I64 i,ch,fuf_flags=0;
|
||||||
U8 *buf,*ptr,*ptr2;
|
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"),"+r+f+F+T+O");
|
||||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||||
if (fuf_flags&~FUG_FILES_FIND)
|
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_file_mask=StrNew(files_find_mask);
|
||||||
god.word_fuf_flags=fuf_flags;
|
god.word_fuf_flags=fuf_flags;
|
||||||
|
|
||||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||||
i=0;
|
i=0;
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
if (buf=ptr=FileRead(tempde->full_name)) {
|
if (buf=ptr=FileRead(tmpde->full_name)) {
|
||||||
while (*ptr) {
|
while (*ptr) {
|
||||||
while (*ptr && !Bt(chars_bmp_word,*ptr))
|
while (*ptr && !Bt(chars_bmp_word,*ptr))
|
||||||
ptr++;
|
ptr++;
|
||||||
@@ -103,17 +103,17 @@ public I64 GodInit(U8 *files_find_mask="/Adam/God/Vocab.DD*",U8 *fu_flags=NULL)
|
|||||||
}
|
}
|
||||||
Free(buf);
|
Free(buf);
|
||||||
}
|
}
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
Free(god.words);
|
Free(god.words);
|
||||||
god.num_words=i;
|
god.num_words=i;
|
||||||
god.words=MAlloc(i*sizeof(U8 *));
|
god.words=MAlloc(i*sizeof(U8 *));
|
||||||
|
|
||||||
tempde=tempde1;
|
tmpde=tmpde1;
|
||||||
i=0;
|
i=0;
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
if (buf=ptr=FileRead(tempde->full_name)) {
|
if (buf=ptr=FileRead(tmpde->full_name)) {
|
||||||
while (*ptr) {
|
while (*ptr) {
|
||||||
while (*ptr && !Bt(chars_bmp_word,*ptr))
|
while (*ptr && !Bt(chars_bmp_word,*ptr))
|
||||||
ptr++;
|
ptr++;
|
||||||
@@ -129,9 +129,9 @@ public I64 GodInit(U8 *files_find_mask="/Adam/God/Vocab.DD*",U8 *fu_flags=NULL)
|
|||||||
}
|
}
|
||||||
Free(buf);
|
Free(buf);
|
||||||
}
|
}
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
DirTreeDel(tempde1);
|
DirTreeDel(tmpde1);
|
||||||
return god.num_words;
|
return god.num_words;
|
||||||
} GodInit;
|
} 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;
|
CColorROPU32 color,c,old_color;
|
||||||
CTask *win_task;
|
CTask *win_task;
|
||||||
|
|
||||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||||
win_task=dc->win_task;
|
win_task=dc->win_task;
|
||||||
x+=win_task->scroll_x;
|
x+=win_task->scroll_x;
|
||||||
y+=win_task->scroll_y;
|
y+=win_task->scroll_y;
|
||||||
@@ -98,7 +98,7 @@ public I64 GrBlot(CDC *dc=gr.dc,I64 x,I64 y,CDC *img)
|
|||||||
h1=0;
|
h1=0;
|
||||||
w2=img->width;
|
w2=img->width;
|
||||||
h2=img->height;
|
h2=img->height;
|
||||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||||
x+=win_task->pix_left;
|
x+=win_task->pix_left;
|
||||||
y+=win_task->pix_top;
|
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;
|
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+w1<0) w1=-x;
|
||||||
if (x+w2>win_task->pix_right+1)
|
if (x+w2>win_task->pix_right+1)
|
||||||
w2=win_task->pix_right+1-x;
|
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:
|
case ROPB_MONO:
|
||||||
color_mask=gr.to_8_colors[color.c0.color];
|
color_mask=gr.to_8_colors[color.c0.color];
|
||||||
if (img->flags&DCF_NO_TRANSPARENTS) {
|
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;
|
win_z_buf_ptr=NULL;
|
||||||
else {
|
else {
|
||||||
win_z_num=win_task->win_z_num;
|
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 {
|
} else {
|
||||||
k=h1*img->width_internal;
|
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 (j=h1;j<h2;j++) {
|
||||||
for (i=w1;i<w2;i++)
|
for (i=w1;i<w2;i++)
|
||||||
if (img->body[k+i])
|
if (img->body[k+i])
|
||||||
@@ -318,7 +318,7 @@ public I64 GrBlot(CDC *dc=gr.dc,I64 x,I64 y,CDC *img)
|
|||||||
break;
|
break;
|
||||||
case ROPB_EQU:
|
case ROPB_EQU:
|
||||||
if (img->flags&DCF_NO_TRANSPARENTS) {
|
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;
|
win_z_buf_ptr=NULL;
|
||||||
else {
|
else {
|
||||||
win_z_num=win_task->win_z_num;
|
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 {
|
} else {
|
||||||
here1a:
|
here1a:
|
||||||
k=h1*img->width_internal;
|
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 (j=h1;j<h2;j++) {
|
||||||
for (i=w1;i<w2;i++) {
|
for (i=w1;i<w2;i++) {
|
||||||
c=img->body[k+i];
|
c=img->body[k+i];
|
||||||
@@ -477,7 +477,7 @@ here1a:
|
|||||||
break;
|
break;
|
||||||
case ROPB_XOR:
|
case ROPB_XOR:
|
||||||
if (img->flags&DCF_NO_TRANSPARENTS) {
|
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;
|
win_z_buf_ptr=NULL;
|
||||||
else {
|
else {
|
||||||
win_z_num=win_task->win_z_num;
|
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;
|
CTask *win_task;
|
||||||
if (x1>x2) SwapI64(&x1,&x2);
|
if (x1>x2) SwapI64(&x1,&x2);
|
||||||
if (y1>y2) SwapI64(&y1,&y2);
|
if (y1>y2) SwapI64(&y1,&y2);
|
||||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||||
win_task=dc->win_task;
|
win_task=dc->win_task;
|
||||||
x1+=win_task->pix_left+win_task->scroll_x;
|
x1+=win_task->pix_left+win_task->scroll_x;
|
||||||
y1+=win_task->pix_top +win_task->scroll_y;
|
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;
|
CColorROPU32 color,c;
|
||||||
CTask *win_task;
|
CTask *win_task;
|
||||||
|
|
||||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||||
win_task=dc->win_task;
|
win_task=dc->win_task;
|
||||||
x+=win_task->scroll_x;
|
x+=win_task->scroll_x;
|
||||||
y+=win_task->scroll_y;
|
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;
|
w2=FONT_WIDTH;
|
||||||
h2=FONT_HEIGHT;
|
h2=FONT_HEIGHT;
|
||||||
|
|
||||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||||
x+=win_task->pix_left;
|
x+=win_task->pix_left;
|
||||||
y+=win_task->pix_top;
|
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;
|
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+w1<0) w1=-x;
|
||||||
if (x+w2>win_task->pix_right+1)
|
if (x+w2>win_task->pix_right+1)
|
||||||
w2=win_task->pix_right+1-x;
|
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];
|
color_mask=gr.to_8_colors[color.c0.color];
|
||||||
k1=x+w1;
|
k1=x+w1;
|
||||||
kk1=(h1+y)*dc->width_internal+k1;
|
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) {
|
if (leading_pixels) {
|
||||||
dst=dc->body+kk1&~7;
|
dst=dc->body+kk1&~7;
|
||||||
src=font_ptr;
|
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;
|
Bool dither,probability_dither;
|
||||||
CTask *win_task;
|
CTask *win_task;
|
||||||
|
|
||||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||||
win_task=dc->win_task;
|
win_task=dc->win_task;
|
||||||
x+=win_task->scroll_x;
|
x+=win_task->scroll_x;
|
||||||
y+=win_task->scroll_y;
|
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;
|
w2=w;
|
||||||
h2=h;
|
h2=h;
|
||||||
|
|
||||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||||
x+=win_task->pix_left;
|
x+=win_task->pix_left;
|
||||||
y+=win_task->pix_top;
|
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;
|
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+w1<0) w1=-x;
|
||||||
if (x+w2>win_task->pix_right+1)
|
if (x+w2>win_task->pix_right+1)
|
||||||
w2=win_task->pix_right+1-x;
|
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;
|
res+=dc->collision_cnt;
|
||||||
} else {
|
} 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;
|
win_z_buf_ptr=NULL;
|
||||||
else {
|
else {
|
||||||
win_z_num=win_task->win_z_num;
|
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);
|
Bool not_color=ToBool(dc->flags&DCF_FILL_NOT_COLOR);
|
||||||
CTask *win_task;
|
CTask *win_task;
|
||||||
|
|
||||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||||
win_task=dc->win_task;
|
win_task=dc->win_task;
|
||||||
x+=win_task->scroll_x;
|
x+=win_task->scroll_x;
|
||||||
y+=win_task->scroll_y;
|
y+=win_task->scroll_y;
|
||||||
@@ -1389,7 +1389,7 @@ I64 GrRayLenMinus(CDC *dc,I64 x,I64 y)
|
|||||||
y3=y;
|
y3=y;
|
||||||
if (x3<0 || y3<0)
|
if (x3<0 || y3<0)
|
||||||
goto gr_done;
|
goto gr_done;
|
||||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||||
x3+=win_task->pix_left;
|
x3+=win_task->pix_left;
|
||||||
y3+=win_task->pix_top;
|
y3+=win_task->pix_top;
|
||||||
if (!(0<=x3<=win_task->pix_right) || !(0<=y3<=win_task->pix_bottom) ||
|
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) {
|
while (TRUE) {
|
||||||
x3=x;
|
x3=x;
|
||||||
if (x3&(FONT_WIDTH-1)==FONT_WIDTH-1) {
|
if (x3&(FONT_WIDTH-1)==FONT_WIDTH-1) {
|
||||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||||
if (x3<0) break;
|
if (x3<0) break;
|
||||||
x3+=win_task->pix_left;
|
x3+=win_task->pix_left;
|
||||||
if (!(0<=x3<=win_task->pix_right) || x3>=dc->width ||
|
if (!(0<=x3<=win_task->pix_right) || x3>=dc->width ||
|
||||||
@@ -1413,7 +1413,7 @@ I64 GrRayLenMinus(CDC *dc,I64 x,I64 y)
|
|||||||
} else
|
} else
|
||||||
if (!(0<=x3<dc->width))
|
if (!(0<=x3<dc->width))
|
||||||
break;
|
break;
|
||||||
} else if (dc->flags & DCF_SCREEN_BITMAP)
|
} else if (dc->flags & DCF_SCRN_BITMAP)
|
||||||
x3+=win_task->pix_left;
|
x3+=win_task->pix_left;
|
||||||
dst=dst2+x3;
|
dst=dst2+x3;
|
||||||
c=*dst;
|
c=*dst;
|
||||||
@@ -1447,7 +1447,7 @@ I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
|
|||||||
I32 *db2;
|
I32 *db2;
|
||||||
CTask *win_task;
|
CTask *win_task;
|
||||||
|
|
||||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||||
win_task=dc->win_task;
|
win_task=dc->win_task;
|
||||||
x+=win_task->scroll_x;
|
x+=win_task->scroll_x;
|
||||||
y+=win_task->scroll_y;
|
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;
|
y3=y;
|
||||||
if (x3<0 || y3<0)
|
if (x3<0 || y3<0)
|
||||||
goto gr_done;
|
goto gr_done;
|
||||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||||
x3+=win_task->pix_left;
|
x3+=win_task->pix_left;
|
||||||
y3+=win_task->pix_top;
|
y3+=win_task->pix_top;
|
||||||
if (!(0<=x3<=win_task->pix_right) || !(0<=y3<=win_task->pix_bottom) ||
|
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) {
|
while (TRUE) {
|
||||||
x3=x;
|
x3=x;
|
||||||
if (!(x3&(FONT_WIDTH-1))) {
|
if (!(x3&(FONT_WIDTH-1))) {
|
||||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||||
if (x3<0) break;
|
if (x3<0) break;
|
||||||
x3+=win_task->pix_left;
|
x3+=win_task->pix_left;
|
||||||
if (!(0<=x3<=win_task->pix_right) || x3>=dc->width ||
|
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))
|
if (!(0<=x3<dc->width))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (dc->flags & DCF_SCREEN_BITMAP)
|
} else if (dc->flags & DCF_SCRN_BITMAP)
|
||||||
x3+=win_task->pix_left;
|
x3+=win_task->pix_left;
|
||||||
|
|
||||||
dst=dst2+x3;
|
dst=dst2+x3;
|
||||||
@@ -1558,7 +1558,7 @@ I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
|
|||||||
} else
|
} else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (dc->flags & DCF_SCREEN_BITMAP)
|
if (dc->flags & DCF_SCRN_BITMAP)
|
||||||
*x1=x-1-win_task->scroll_x;
|
*x1=x-1-win_task->scroll_x;
|
||||||
else
|
else
|
||||||
*x1=x-1;
|
*x1=x-1;
|
||||||
@@ -1566,7 +1566,7 @@ I64 GrRayLen(CDC *dc,I64 *x1,I64 y,I64 z=0,I32 *db=NULL)
|
|||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
x3=x;
|
x3=x;
|
||||||
if (x3&(FONT_WIDTH-1)==FONT_WIDTH-1) {
|
if (x3&(FONT_WIDTH-1)==FONT_WIDTH-1) {
|
||||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||||
if (x3<0) break;
|
if (x3<0) break;
|
||||||
x3+=win_task->pix_left;
|
x3+=win_task->pix_left;
|
||||||
if (!(0<=x3<=win_task->pix_right) || x3>=dc->width ||
|
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
|
} else
|
||||||
if (!(0<=x3<dc->width))
|
if (!(0<=x3<dc->width))
|
||||||
break;
|
break;
|
||||||
} else if (dc->flags & DCF_SCREEN_BITMAP)
|
} else if (dc->flags & DCF_SCRN_BITMAP)
|
||||||
x3+=win_task->pix_left;
|
x3+=win_task->pix_left;
|
||||||
|
|
||||||
dst=dst2+x3;
|
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);
|
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;
|
win_task=dc->win_task;
|
||||||
x1+=win_task->scroll_x;
|
x1+=win_task->scroll_x;
|
||||||
x2+=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
|
} else
|
||||||
i=0;
|
i=0;
|
||||||
j=0;
|
j=0;
|
||||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||||
x1+=win_task->pix_left;
|
x1+=win_task->pix_left;
|
||||||
x2+=win_task->pix_left;
|
x2+=win_task->pix_left;
|
||||||
if (x1>win_task->pix_right)
|
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)
|
if (dc->flags & DCF_DONT_DRAW)
|
||||||
goto gr_done;
|
goto gr_done;
|
||||||
|
|
||||||
if (!(dc->flags & DCF_SCREEN_BITMAP) ||
|
if (!(dc->flags & DCF_SCRN_BITMAP) ||
|
||||||
win_task->next_task==sys_winmgr_task ||
|
win_task->next_task==sys_winmgr_task ||
|
||||||
dc->flags&DCF_ON_TOP || !IsPixCovered0(win_task,x1,y))
|
dc->flags&DCF_ON_TOP || !IsPixCovered0(win_task,x1,y))
|
||||||
char_clear=TRUE;
|
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++;
|
db++;
|
||||||
z+=dz;
|
z+=dz;
|
||||||
if (!(x1&(FONT_WIDTH-1)) && x1<=x2) {
|
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 ||
|
win_task->next_task==sys_winmgr_task ||
|
||||||
dc->flags&DCF_ON_TOP || !IsPixCovered0(win_task,x1,y))
|
dc->flags&DCF_ON_TOP || !IsPixCovered0(win_task,x1,y))
|
||||||
char_clear=TRUE;
|
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);
|
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;
|
win_task=dc->win_task;
|
||||||
x +=win_task->scroll_x;
|
x +=win_task->scroll_x;
|
||||||
y1+=win_task->scroll_y;
|
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
|
} else
|
||||||
i=0;
|
i=0;
|
||||||
j=0;
|
j=0;
|
||||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||||
y1+=win_task->pix_top;
|
y1+=win_task->pix_top;
|
||||||
y2+=win_task->pix_top;
|
y2+=win_task->pix_top;
|
||||||
if (y1>win_task->pix_bottom)
|
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)
|
if (dc->flags & DCF_DONT_DRAW)
|
||||||
goto gr_done;
|
goto gr_done;
|
||||||
|
|
||||||
if (!(dc->flags & DCF_SCREEN_BITMAP) ||
|
if (!(dc->flags & DCF_SCRN_BITMAP) ||
|
||||||
win_task->next_task==sys_winmgr_task ||
|
win_task->next_task==sys_winmgr_task ||
|
||||||
dc->flags&DCF_ON_TOP || !IsPixCovered0(win_task,x,y1))
|
dc->flags&DCF_ON_TOP || !IsPixCovered0(win_task,x,y1))
|
||||||
char_clear=TRUE;
|
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;
|
db+=dc->width_internal;
|
||||||
z+=dz;
|
z+=dz;
|
||||||
if (!(y1&(FONT_HEIGHT-1)) && y1<=y2) {
|
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 ||
|
win_task->next_task==sys_winmgr_task ||
|
||||||
dc->flags&DCF_ON_TOP || !IsPixCovered0(win_task,x,y1))
|
dc->flags&DCF_ON_TOP || !IsPixCovered0(win_task,x,y1))
|
||||||
char_clear=TRUE;
|
char_clear=TRUE;
|
||||||
|
|||||||
+24
-24
@@ -373,13 +373,13 @@ public CDC *DCLoad(U8 *src,I64 *_size=NULL,CTask *task=NULL)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
#help_index "Graphics/GRA Files"
|
#help_index "Graphics/GR Files"
|
||||||
#help_file "::/Doc/GRAFiles"
|
#help_file "::/Doc/GRFiles"
|
||||||
#help_index "Graphics/Device Contexts;Graphics/GRA Files"
|
#help_index "Graphics/Device Contexts;Graphics/GR Files"
|
||||||
public I64 GRAWrite(U8 *filename,CDC *dc,I64 dcsf_flags=DCSF_COMPRESSED)
|
public I64 GRWrite(U8 *filename,CDC *dc,I64 dcsf_flags=DCSF_COMPRESSED)
|
||||||
{//TempleOS GRA File.
|
{//TempleOS GR File.
|
||||||
I64 size;
|
I64 size;
|
||||||
U8 *st=DftExt(filename,"GRA.Z"),
|
U8 *st=DftExt(filename,"GR.Z"),
|
||||||
*src=DCSave(dc,&size,dcsf_flags);
|
*src=DCSave(dc,&size,dcsf_flags);
|
||||||
FileWrite(st,src,size);
|
FileWrite(st,src,size);
|
||||||
Free(st);
|
Free(st);
|
||||||
@@ -387,10 +387,10 @@ public I64 GRAWrite(U8 *filename,CDC *dc,I64 dcsf_flags=DCSF_COMPRESSED)
|
|||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CDC *GRARead(U8 *filename,CTask *task=NULL)
|
public CDC *GRRead(U8 *filename,CTask *task=NULL)
|
||||||
{//TempleOS GRA File.
|
{//TempleOS GR File.
|
||||||
CDC *dc=NULL;
|
CDC *dc=NULL;
|
||||||
U8 *st=DftExt(filename,"GRA.Z"),
|
U8 *st=DftExt(filename,"GR.Z"),
|
||||||
*src=FileRead(st);
|
*src=FileRead(st);
|
||||||
if (src)
|
if (src)
|
||||||
dc=DCLoad(src,,task);
|
dc=DCLoad(src,,task);
|
||||||
@@ -399,27 +399,27 @@ public CDC *GRARead(U8 *filename,CTask *task=NULL)
|
|||||||
return dc;
|
return dc;
|
||||||
}
|
}
|
||||||
|
|
||||||
#help_index "Graphics/Sprite;Graphics/GRA Files;DolDoc/Output;StdOut/DolDoc"
|
#help_index "Graphics/Sprite;Graphics/GR Files;DolDoc/Output;StdOut/DolDoc"
|
||||||
public U0 DocGRA(CDoc *doc=NULL,U8 *filename)
|
public U0 DocGR(CDoc *doc=NULL,U8 *filename)
|
||||||
{//Put a GRA file into a document as asprite.
|
{//Put a GR file into a document as asprite.
|
||||||
CDC *dc=GRARead(filename);
|
CDC *dc=GRRead(filename);
|
||||||
CSprite *elems=DC2Sprite(dc);
|
CSprite *elems=DC2Sprite(dc);
|
||||||
DocSprite(doc,elems);
|
DocSprite(doc,elems);
|
||||||
Free(elems);
|
Free(elems);
|
||||||
DCDel(dc);
|
DCDel(dc);
|
||||||
}
|
}
|
||||||
|
|
||||||
#help_index "Graphics/Device Contexts;Graphics/Screen"
|
#help_index "Graphics/Device Contexts;Graphics/Scrn"
|
||||||
public CDC *DCScreenCapture(Bool include_zoom=TRUE,CTask *task=NULL)
|
public CDC *DCScrnCapture(Bool include_zoom=TRUE,CTask *task=NULL)
|
||||||
{//Capture screen to a device context.
|
{//Capture scrn to a device context.
|
||||||
CDC *dc;
|
CDC *dc;
|
||||||
U8 *dst;
|
U8 *dst;
|
||||||
WinMgrSync(2,TRUE);
|
Refresh(2,TRUE);
|
||||||
if (include_zoom)
|
if (include_zoom)
|
||||||
dc=DCCopy(gr.screen_image,task);
|
dc=DCCopy(gr.scrn_image,task);
|
||||||
else
|
else
|
||||||
dc=DCCopy(gr.dc1,task);
|
dc=DCCopy(gr.dc1,task);
|
||||||
dc->flags&=~DCF_SCREEN_BITMAP;
|
dc->flags&=~DCF_SCRN_BITMAP;
|
||||||
dst=MAlloc(dc->width_internal*dc->height,task);
|
dst=MAlloc(dc->width_internal*dc->height,task);
|
||||||
//Pick background color that never occurs. COLOR_INVALID
|
//Pick background color that never occurs. COLOR_INVALID
|
||||||
GrBitMap4ToBitMap8(dst,dc->body,
|
GrBitMap4ToBitMap8(dst,dc->body,
|
||||||
@@ -429,12 +429,12 @@ public CDC *DCScreenCapture(Bool include_zoom=TRUE,CTask *task=NULL)
|
|||||||
return dc;
|
return dc;
|
||||||
}
|
}
|
||||||
|
|
||||||
#help_index "Graphics/GRA Files;Graphics/Screen"
|
#help_index "Graphics/GR Files;Graphics/Scrn"
|
||||||
public I64 GRAScreenCapture(U8 *filename,Bool include_zoom=TRUE)
|
public I64 GRScrnCapture(U8 *filename,Bool include_zoom=TRUE)
|
||||||
{//Capture screen to a TempleOS GRA File.
|
{//Capture scrn to a TempleOS GR File.
|
||||||
I64 size;
|
I64 size;
|
||||||
CDC *dc=DCScreenCapture(include_zoom);
|
CDC *dc=DCScrnCapture(include_zoom);
|
||||||
size=GRAWrite(filename,dc,DCSF_COMPRESSED|DCSF_PALETTE_GET);
|
size=GRWrite(filename,dc,DCSF_COMPRESSED|DCSF_PALETTE_GET);
|
||||||
DCDel(dc);
|
DCDel(dc);
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
+5
-5
@@ -1,4 +1,4 @@
|
|||||||
#help_index "Graphics/Screen"
|
#help_index "Graphics/Scrn"
|
||||||
|
|
||||||
U0 CtrlAltZ(I64 sc)
|
U0 CtrlAltZ(I64 sc)
|
||||||
{
|
{
|
||||||
@@ -10,9 +10,9 @@ U0 CtrlAltZ(I64 sc)
|
|||||||
CtrlAltCBSet('Z',&CtrlAltZ,"Cmd /Zoom In",
|
CtrlAltCBSet('Z',&CtrlAltZ,"Cmd /Zoom In",
|
||||||
"Cmd /Zoom Out");
|
"Cmd /Zoom Out");
|
||||||
|
|
||||||
U0 Screen2Clipboard(I64)
|
U0 Scrn2Clipboard(I64)
|
||||||
{
|
{
|
||||||
CDC *dc=DCScreenCapture;
|
CDC *dc=DCScrnCapture;
|
||||||
U8 *elems=DC2Sprite(dc);
|
U8 *elems=DC2Sprite(dc);
|
||||||
Bool unlock_doc=DocLock(sys_clipboard_doc);
|
Bool unlock_doc=DocLock(sys_clipboard_doc);
|
||||||
ClipboardDel;
|
ClipboardDel;
|
||||||
@@ -24,6 +24,6 @@ U0 Screen2Clipboard(I64)
|
|||||||
}
|
}
|
||||||
U0 CtrlAltS(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
|
public class CGrGlbls
|
||||||
{
|
{
|
||||||
I64 *to_8_bits,*to_8_colors;
|
I64 *to_8_bits,*to_8_colors;
|
||||||
CDC *screen_image, //Read only.
|
CDC *scrn_image, //Read only.
|
||||||
*dc, //Persistent
|
*dc, //Persistent
|
||||||
*dc1,
|
*dc1,
|
||||||
*dc2, //Updated every refresh
|
*dc2, //Updated every refresh
|
||||||
@@ -19,7 +19,7 @@ public class CGrGlbls
|
|||||||
I64 highest_uncovered;
|
I64 highest_uncovered;
|
||||||
U16 *vga_text_cache;
|
U16 *vga_text_cache;
|
||||||
I64 pan_text_x,pan_text_y; //[-7,7]
|
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_wall_paper)(CTask *task);
|
||||||
U0 (*fp_draw_input_ptr)(CDC *dc,I64 x,I64 y);
|
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);
|
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],
|
I8 circle_lo[GR_NUM_PEN_BRUSHES][GR_NUM_PEN_BRUSHES],
|
||||||
circle_hi[GR_NUM_PEN_BRUSHES][GR_NUM_PEN_BRUSHES];
|
circle_hi[GR_NUM_PEN_BRUSHES][GR_NUM_PEN_BRUSHES];
|
||||||
|
|
||||||
#define GR_MAX_SCREEN_ZOOM 8
|
#define GR_MAX_SCRN_ZOOM 8
|
||||||
U8 *screen_zoom_tables[GR_MAX_SCREEN_ZOOM+1];
|
U8 *scrn_zoom_tables[GR_MAX_SCRN_ZOOM+1];
|
||||||
I64 screen_zoom,sx,sy;
|
I64 scrn_zoom,sx,sy;
|
||||||
|
|
||||||
//When zoomed, this keeps the mouse centered.
|
//When zoomed, this keeps the mouse centered.
|
||||||
Bool continuous_scroll,
|
Bool continuous_scroll,
|
||||||
|
|||||||
+11
-11
@@ -1,4 +1,4 @@
|
|||||||
#help_index "Graphics/Screen"
|
#help_index "Graphics/Scrn"
|
||||||
|
|
||||||
U0 GrSetUpTables()
|
U0 GrSetUpTables()
|
||||||
{
|
{
|
||||||
@@ -75,10 +75,10 @@ U0 GrSetUpTables()
|
|||||||
OutU8(VGAP_DATA,0x0F);
|
OutU8(VGAP_DATA,0x0F);
|
||||||
//Virtual Box crashes on the following for some reason.
|
//Virtual Box crashes on the following for some reason.
|
||||||
// MemSet(text.vga_alias,0,GR_HEIGHT*GR_WIDTH>>3);
|
// 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++) {
|
for (i=1;i<=GR_MAX_SCRN_ZOOM;i++) {
|
||||||
dst=gr.screen_zoom_tables[i]=MAlloc(256*i);
|
dst=gr.scrn_zoom_tables[i]=MAlloc(256*i);
|
||||||
for (j=0;j<256;j++) {
|
for (j=0;j<256;j++) {
|
||||||
m=0;
|
m=0;
|
||||||
for (k=0;k<8;k++) {
|
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)
|
U0 WinZBufFill(CTask *task)
|
||||||
{//Not public
|
{//Not public
|
||||||
@@ -175,7 +175,7 @@ U0 GrInit2()
|
|||||||
MemSet(&gr,0,sizeof(CGrGlbls));
|
MemSet(&gr,0,sizeof(CGrGlbls));
|
||||||
gr.sprite_hash=HashTableNew(512);
|
gr.sprite_hash=HashTableNew(512);
|
||||||
HashDefineLstAdd("ST_SPRITE_ELEM_CODES",SPHT_ELEM_CODE,gr.sprite_hash);
|
HashDefineLstAdd("ST_SPRITE_ELEM_CODES",SPHT_ELEM_CODE,gr.sprite_hash);
|
||||||
gr.screen_zoom=1;
|
gr.scrn_zoom=1;
|
||||||
|
|
||||||
PaletteSetStd;
|
PaletteSetStd;
|
||||||
fp_set_std_palette=&PaletteSetStd;
|
fp_set_std_palette=&PaletteSetStd;
|
||||||
@@ -191,19 +191,19 @@ U0 GrInit2()
|
|||||||
gr.win_z_buf=MAlloc(TEXT_ROWS*TEXT_COLS*sizeof(U16));
|
gr.win_z_buf=MAlloc(TEXT_ROWS*TEXT_COLS*sizeof(U16));
|
||||||
|
|
||||||
gr.dc2=DCNew(GR_WIDTH,GR_HEIGHT);
|
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_cache=DCNew(GR_WIDTH,GR_HEIGHT);
|
||||||
|
|
||||||
gr.dc=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;
|
DCFill;
|
||||||
|
|
||||||
gr.dc1=DCNew(GR_WIDTH,GR_HEIGHT);
|
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 =DCNew(GR_WIDTH,GR_HEIGHT); //4-bit
|
||||||
gr.zoomed_dc->flags|=DCF_SCREEN_BITMAP;
|
gr.zoomed_dc->flags|=DCF_SCRN_BITMAP;
|
||||||
}
|
}
|
||||||
|
|
||||||
GrInit2;
|
GrInit2;
|
||||||
+42
-42
@@ -277,8 +277,8 @@ public U0 DCReflect(CDC *dc,I64 *_x,I64 *_y,I64 *_z)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#help_index "Graphics/Math"
|
#help_index "Graphics/Math"
|
||||||
#define SCALE1 24
|
#define GR_SCALE1_BITS 24
|
||||||
#define SCALE2 8
|
#define GR_SCALE2_BITS 8
|
||||||
public Bool Circle(U8 *aux_data,I64 cx,I64 cy,I64 cz,I64 radius,
|
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),
|
Bool (*fp_plot)(U8 *aux,I64 x,I64 y,I64 z),
|
||||||
I64 step=1,F64 start_radians=0,F64 len_radians=2*ã)
|
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;
|
F64 t;
|
||||||
if (radius<=0||!step) return TRUE;
|
if (radius<=0||!step) return TRUE;
|
||||||
t=1.0/radius;
|
t=1.0/radius;
|
||||||
c=1<<SCALE1*Cos(t);
|
c=1<<GR_SCALE1_BITS*Cos(t);
|
||||||
if (step<0) {
|
if (step<0) {
|
||||||
step=-step;
|
step=-step;
|
||||||
s2=1<<SCALE1*Sin(t);
|
s2=1<<GR_SCALE1_BITS*Sin(t);
|
||||||
s1=-s2;
|
s1=-s2;
|
||||||
} else {
|
} else {
|
||||||
s1=1<<SCALE1*Sin(t);
|
s1=1<<GR_SCALE1_BITS*Sin(t);
|
||||||
s2=-s1;
|
s2=-s1;
|
||||||
}
|
}
|
||||||
if (start_radians) {
|
if (start_radians) {
|
||||||
@@ -304,14 +304,14 @@ public Bool Circle(U8 *aux_data,I64 cx,I64 cy,I64 cz,I64 radius,
|
|||||||
x=radius;
|
x=radius;
|
||||||
y=0;
|
y=0;
|
||||||
}
|
}
|
||||||
x<<=SCALE2;
|
x<<=GR_SCALE2_BITS;
|
||||||
y<<=SCALE2;
|
y<<=GR_SCALE2_BITS;
|
||||||
for (i=0;i<=len;i+=step) {
|
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;
|
return FALSE;
|
||||||
for (j=0;j<step;j++) {
|
for (j=0;j<step;j++) {
|
||||||
x1=(c*x+s1*y)>>SCALE1;
|
x1=(c*x+s1*y)>>GR_SCALE1_BITS;
|
||||||
y1=(s2*x+c*y)>>SCALE1;
|
y1=(s2*x+c*y)>>GR_SCALE1_BITS;
|
||||||
x=x1; y=y1;
|
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);
|
len=Ceil(len_radians*y_radius);
|
||||||
}
|
}
|
||||||
|
|
||||||
c=1<<SCALE1*Cos(t);
|
c=1<<GR_SCALE1_BITS*Cos(t);
|
||||||
if (step<0) {
|
if (step<0) {
|
||||||
step=-step;
|
step=-step;
|
||||||
s2=1<<SCALE1*Sin(t);
|
s2=1<<GR_SCALE1_BITS*Sin(t);
|
||||||
s1=-s2;
|
s1=-s2;
|
||||||
} else {
|
} else {
|
||||||
s1=1<<SCALE1*Sin(t);
|
s1=1<<GR_SCALE1_BITS*Sin(t);
|
||||||
s2=-s1;
|
s2=-s1;
|
||||||
}
|
}
|
||||||
|
|
||||||
c2=1<<SCALE1*Cos(rot_angle);
|
c2=1<<GR_SCALE1_BITS*Cos(rot_angle);
|
||||||
s12=1<<SCALE1*Sin(rot_angle);
|
s12=1<<GR_SCALE1_BITS*Sin(rot_angle);
|
||||||
s22=-s12;
|
s22=-s12;
|
||||||
|
|
||||||
if (start_radians) {
|
if (start_radians) {
|
||||||
@@ -357,29 +357,29 @@ public Bool Ellipse(U8 *aux_data,I64 cx,I64 cy,I64 cz,
|
|||||||
x=x_radius;
|
x=x_radius;
|
||||||
y=0;
|
y=0;
|
||||||
}
|
}
|
||||||
x<<=SCALE2;
|
x<<=GR_SCALE2_BITS;
|
||||||
y<<=SCALE2;
|
y<<=GR_SCALE2_BITS;
|
||||||
x2=x;
|
x2=x;
|
||||||
y2=y;
|
y2=y;
|
||||||
|
|
||||||
y1=y2*y_radius/x_radius;
|
y1=y2*y_radius/x_radius;
|
||||||
x=(c2*x2+s12*y1)>>SCALE1;
|
x=(c2*x2+s12*y1)>>GR_SCALE1_BITS;
|
||||||
y=(s22*x2+c2*y1)>>SCALE1;
|
y=(s22*x2+c2*y1)>>GR_SCALE1_BITS;
|
||||||
|
|
||||||
for (i=0;i<=len;i+=step) {
|
for (i=0;i<=len;i+=step) {
|
||||||
if ((x>>SCALE2!=_x || y>>SCALE2!=_y || first) &&
|
if ((x>>GR_SCALE2_BITS!=_x || y>>GR_SCALE2_BITS!=_y || first) &&
|
||||||
!(*fp_plot)(aux_data,cx+x>>SCALE2,cy+y>>SCALE2,cz))
|
!(*fp_plot)(aux_data,cx+x>>GR_SCALE2_BITS,cy+y>>GR_SCALE2_BITS,cz))
|
||||||
return FALSE;
|
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++) {
|
for (j=0;j<step;j++) {
|
||||||
x1=(c*x2+s1*y2)>>SCALE1;
|
x1=(c*x2+s1*y2)>>GR_SCALE1_BITS;
|
||||||
y1=(s2*x2+c*y2)>>SCALE1;
|
y1=(s2*x2+c*y2)>>GR_SCALE1_BITS;
|
||||||
x2=x1;
|
x2=x1;
|
||||||
y2=y1;
|
y2=y1;
|
||||||
y1=y1*y_radius/x_radius;
|
y1=y1*y_radius/x_radius;
|
||||||
x=(c2*x1+s12*y1)>>SCALE1;
|
x=(c2*x1+s12*y1)>>GR_SCALE1_BITS;
|
||||||
y=(s22*x1+c2*y1)>>SCALE1;
|
y=(s22*x1+c2*y1)>>GR_SCALE1_BITS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -401,13 +401,13 @@ public Bool RegPoly(U8 *aux_data,I64 cx,I64 cy,I64 cz,
|
|||||||
angle_step=2*ã/sides;
|
angle_step=2*ã/sides;
|
||||||
n=len_radians*sides/(2*ã);
|
n=len_radians*sides/(2*ã);
|
||||||
|
|
||||||
s1=1<<SCALE1*Sin(angle_step);
|
s1=1<<GR_SCALE1_BITS*Sin(angle_step);
|
||||||
s2=-s1;
|
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;
|
s22=-s12;
|
||||||
c2=1<<SCALE1*Cos(rot_angle);
|
c2=1<<GR_SCALE1_BITS*Cos(rot_angle);
|
||||||
|
|
||||||
if (start_radians) {
|
if (start_radians) {
|
||||||
x=x_radius*Cos(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;
|
x=x_radius;
|
||||||
y=0;
|
y=0;
|
||||||
}
|
}
|
||||||
x<<=SCALE2;
|
x<<=GR_SCALE2_BITS;
|
||||||
y<<=SCALE2;
|
y<<=GR_SCALE2_BITS;
|
||||||
x2=x;
|
x2=x;
|
||||||
y2=y;
|
y2=y;
|
||||||
|
|
||||||
y1=y2*y_radius/x_radius;
|
y1=y2*y_radius/x_radius;
|
||||||
x=(c2*x2+s12*y1)>>SCALE1;
|
x=(c2*x2+s12*y1)>>GR_SCALE1_BITS;
|
||||||
y=(s22*x2+c2*y1)>>SCALE1;
|
y=(s22*x2+c2*y1)>>GR_SCALE1_BITS;
|
||||||
|
|
||||||
xx1=cx+x>>SCALE2;
|
xx1=cx+x>>GR_SCALE2_BITS;
|
||||||
yy1=cy+y>>SCALE2;
|
yy1=cy+y>>GR_SCALE2_BITS;
|
||||||
for (i=0;i<n;i++) {
|
for (i=0;i<n;i++) {
|
||||||
x1=(c*x2+s1*y2)>>SCALE1;
|
x1=(c*x2+s1*y2)>>GR_SCALE1_BITS;
|
||||||
y1=(s2*x2+c*y2)>>SCALE1;
|
y1=(s2*x2+c*y2)>>GR_SCALE1_BITS;
|
||||||
x2=x1;
|
x2=x1;
|
||||||
y2=y1;
|
y2=y1;
|
||||||
y1=y1*y_radius/x_radius;
|
y1=y1*y_radius/x_radius;
|
||||||
x=(c2*x1+s12*y1)>>SCALE1;
|
x=(c2*x1+s12*y1)>>GR_SCALE1_BITS;
|
||||||
y=(s22*x1+c2*y1)>>SCALE1;
|
y=(s22*x1+c2*y1)>>GR_SCALE1_BITS;
|
||||||
xx2=cx+x>>SCALE2;
|
xx2=cx+x>>GR_SCALE2_BITS;
|
||||||
yy2=cy+y>>SCALE2;
|
yy2=cy+y>>GR_SCALE2_BITS;
|
||||||
if (!Line(aux_data,xx1,yy1,cz,xx2,yy2,cz,fp_plot,step))
|
if (!Line(aux_data,xx1,yy1,cz,xx2,yy2,cz,fp_plot,step))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
xx1=xx2; yy1=yy2;
|
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,
|
public Bool GrClamp(CDC *dc=gr.dc,I64 *left,I64 *top,I64 *right,I64 *bottom,
|
||||||
I64 width=0,I64 height=0)
|
I64 width=0,I64 height=0)
|
||||||
{//Returns screen, not window coordinates.
|
{//Returns scrn, not window coordinates.
|
||||||
CTask *win_task;
|
CTask *win_task;
|
||||||
*left=0;
|
*left=0;
|
||||||
*top=0;
|
*top=0;
|
||||||
*right=dc->width-1;
|
*right=dc->width-1;
|
||||||
*bottom=dc->height-1;
|
*bottom=dc->height-1;
|
||||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||||
win_task=dc->win_task;
|
win_task=dc->win_task;
|
||||||
if (GR_WIDTH-1<*right)
|
if (GR_WIDTH-1<*right)
|
||||||
*right=GR_WIDTH-1;
|
*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,
|
Bool DCClipLine(CDC *dc=gr.dc,I64 *x1,I64 *y1,I64 *x2,I64 *y2,
|
||||||
I64 width=0,I64 height=0)
|
I64 width=0,I64 height=0)
|
||||||
{//Also converts window to screen coordinates
|
{//Also converts window to scrn coordinates
|
||||||
I64 left,top,right,bottom;
|
I64 left,top,right,bottom;
|
||||||
CTask *win_task;
|
CTask *win_task;
|
||||||
if (GrClamp(dc,&left,&top,&right,&bottom,width,height)) {
|
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;
|
win_task=dc->win_task;
|
||||||
*x1+=win_task->pix_left+win_task->scroll_x;
|
*x1+=win_task->pix_left+win_task->scroll_x;
|
||||||
*y1+=win_task->pix_top+win_task->scroll_y;
|
*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;
|
dc->color.c0.rop=ROPB_MONO;
|
||||||
GrBlot(dc,x,y,dc->brush);
|
GrBlot(dc,x,y,dc->brush);
|
||||||
dc->color=old_color;
|
dc->color=old_color;
|
||||||
} else if (dc->flags & DCF_SCREEN_BITMAP) {
|
} else if (dc->flags & DCF_SCRN_BITMAP) {
|
||||||
win_task=dc->win_task;
|
win_task=dc->win_task;
|
||||||
x+=win_task->pix_left+win_task->scroll_x;
|
x+=win_task->pix_left+win_task->scroll_x;
|
||||||
y+=win_task->pix_top+win_task->scroll_y;
|
y+=win_task->pix_top+win_task->scroll_y;
|
||||||
@@ -91,7 +91,7 @@ Bool GrPlot1(CDC *dc=gr.dc,I64 x,I64 y)
|
|||||||
else
|
else
|
||||||
GrBlot(dc,x,y,dc->brush);
|
GrBlot(dc,x,y,dc->brush);
|
||||||
dc->color=old_color;
|
dc->color=old_color;
|
||||||
} else if (dc->flags & DCF_SCREEN_BITMAP) {
|
} else if (dc->flags & DCF_SCRN_BITMAP) {
|
||||||
win_task=dc->win_task;
|
win_task=dc->win_task;
|
||||||
x+=win_task->pix_left+win_task->scroll_x;
|
x+=win_task->pix_left+win_task->scroll_x;
|
||||||
y+=win_task->pix_top+win_task->scroll_y;
|
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)
|
public I64 GrPeek(CDC *dc=gr.dc,I64 x,I64 y)
|
||||||
{//2D. Clipping but no transformation.
|
{//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;
|
CTask *win_task;
|
||||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||||
win_task=dc->win_task;
|
win_task=dc->win_task;
|
||||||
x+=win_task->pix_left+win_task->scroll_x;
|
x+=win_task->pix_left+win_task->scroll_x;
|
||||||
y+=win_task->pix_top+win_task->scroll_y;
|
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 (record) {
|
||||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||||
win_task=dc->win_task;
|
win_task=dc->win_task;
|
||||||
x+=win_task->pix_left+win_task->scroll_x;
|
x+=win_task->pix_left+win_task->scroll_x;
|
||||||
y+=win_task->pix_top+win_task->scroll_y;
|
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)
|
Bool GrLinePlot0(CDC *dc,I64 x,I64 y,I64 z)
|
||||||
{//This is a callback.
|
{//This is a callback.
|
||||||
CTask *win_task=dc->win_task;
|
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 ||
|
win_task->next_task==sys_winmgr_task ||
|
||||||
dc->flags&DCF_ON_TOP ||
|
dc->flags&DCF_ON_TOP ||
|
||||||
!IsPixCovered0(win_task,x,y)) {
|
!IsPixCovered0(win_task,x,y)) {
|
||||||
@@ -1204,7 +1204,7 @@ normal_image:
|
|||||||
x1+=dx1; y1+=dy1; z1+=dz1;
|
x1+=dx1; y1+=dy1; z1+=dz1;
|
||||||
x+=dw;
|
x+=dw;
|
||||||
}
|
}
|
||||||
res=1; //TODO: check off screen
|
res=1; //TODO: check off scrn
|
||||||
} else
|
} else
|
||||||
res=GrBlot(dc,x1,y1,img);
|
res=GrBlot(dc,x1,y1,img);
|
||||||
gr_done:
|
gr_done:
|
||||||
@@ -1415,7 +1415,7 @@ public I64 GrFillTri0(CDC *dc=gr.dc,CD3I32 *p1,CD3I32 *p2,CD3I32 *p4)
|
|||||||
|
|
||||||
min=0;
|
min=0;
|
||||||
max=dc->height;
|
max=dc->height;
|
||||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||||
win_task=dc->win_task;
|
win_task=dc->win_task;
|
||||||
min-=win_task->scroll_y+win_task->pix_top;
|
min-=win_task->scroll_y+win_task->pix_top;
|
||||||
max-=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;
|
min=0;
|
||||||
max=dc->width;
|
max=dc->width;
|
||||||
if (dc->flags & DCF_SCREEN_BITMAP) {
|
if (dc->flags & DCF_SCRN_BITMAP) {
|
||||||
win_task=dc->win_task;
|
win_task=dc->win_task;
|
||||||
min-=win_task->scroll_x+win_task->pix_left;
|
min-=win_task->scroll_x+win_task->pix_left;
|
||||||
max-=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)
|
U0 GrUpdateTaskODEs(CTask *task)
|
||||||
{
|
{
|
||||||
sys_task_being_screen_updated=task;
|
sys_task_being_scrn_updated=task;
|
||||||
try
|
try
|
||||||
ODEsUpdate(task);
|
ODEsUpdate(task);
|
||||||
catch {
|
catch {
|
||||||
@@ -12,14 +12,14 @@ U0 GrUpdateTaskODEs(CTask *task)
|
|||||||
Sleep(3000);
|
Sleep(3000);
|
||||||
VGAFlush;
|
VGAFlush;
|
||||||
}
|
}
|
||||||
sys_task_being_screen_updated=NULL;
|
sys_task_being_scrn_updated=NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 GrUpdateTaskWin(CTask *task)
|
U0 GrUpdateTaskWin(CTask *task)
|
||||||
{ //Draw a win. Only core0 tasks have a win.
|
{ //Draw a win. Only Core0 tasks have a win.
|
||||||
CDC *dc;
|
CDC *dc;
|
||||||
CD3I64 saved_scroll;
|
CD3I64 saved_scroll;
|
||||||
sys_task_being_screen_updated=task;
|
sys_task_being_scrn_updated=task;
|
||||||
try {
|
try {
|
||||||
if (!Bt(&task->display_flags,DISPLAYf_NO_BORDER))
|
if (!Bt(&task->display_flags,DISPLAYf_NO_BORDER))
|
||||||
TextBorder(Fs,task->win_left,task->win_right,task->win_top,
|
TextBorder(Fs,task->win_left,task->win_right,task->win_top,
|
||||||
@@ -52,7 +52,7 @@ U0 GrUpdateTaskWin(CTask *task)
|
|||||||
VGAFlush;
|
VGAFlush;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sys_task_being_screen_updated=NULL;
|
sys_task_being_scrn_updated=NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 GrUpdateTasks()
|
U0 GrUpdateTasks()
|
||||||
@@ -64,7 +64,7 @@ U0 GrUpdateTasks()
|
|||||||
if (Bt(&sys_semas[SYS_SEMA_UPDATE_WIN_Z_BUF],0))
|
if (Bt(&sys_semas[SYS_SEMA_UPDATE_WIN_Z_BUF],0))
|
||||||
WinZBufUpdate;
|
WinZBufUpdate;
|
||||||
task1=task=sys_winmgr_task;
|
task1=task=sys_winmgr_task;
|
||||||
do { //Loop through core0 tasks.
|
do { //Loop through Core0 tasks.
|
||||||
if (!TaskValidate(task)) break;
|
if (!TaskValidate(task)) break;
|
||||||
if (Bt(&task->display_flags,DISPLAYf_SHOW) &&
|
if (Bt(&task->display_flags,DISPLAYf_SHOW) &&
|
||||||
Bt(gr.win_uncovered_bitmap,task->win_z_num))
|
Bt(gr.win_uncovered_bitmap,task->win_z_num))
|
||||||
@@ -89,62 +89,62 @@ U0 GrUpdateTasks()
|
|||||||
winmgr.last_ode_time=winmgr.ode_time;
|
winmgr.last_ode_time=winmgr.ode_time;
|
||||||
ode_alloced_factor=LowPass1(0.1,ode_alloced_factor,
|
ode_alloced_factor=LowPass1(0.1,ode_alloced_factor,
|
||||||
Clamp(Gs->idle_factor-0.1,0.2,0.8),1/winmgr.fps);
|
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()
|
U0 GrFixZoomScale()
|
||||||
{
|
{
|
||||||
gr.screen_zoom=ClampI64(gr.screen_zoom,1,GR_MAX_SCREEN_ZOOM);
|
gr.scrn_zoom=ClampI64(gr.scrn_zoom,1,GR_MAX_SCRN_ZOOM);
|
||||||
if (gr.screen_zoom==1) {
|
if (gr.scrn_zoom==1) {
|
||||||
gr.sx=0;
|
gr.sx=0;
|
||||||
gr.sy=0;
|
gr.sy=0;
|
||||||
} else {
|
} else {
|
||||||
gr.sx=ClampI64(gr.sx,0,GR_WIDTH-GR_WIDTH/gr.screen_zoom)&~7;
|
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.screen_zoom);
|
gr.sy=ClampI64(gr.sy,0,GR_HEIGHT-GR_HEIGHT/gr.scrn_zoom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public U0 GrScaleZoom(F64 scale)
|
public U0 GrScaleZoom(F64 scale)
|
||||||
{//Multiply zoom factor larger or smaller.
|
{//Multiply zoom factor larger or smaller.
|
||||||
F64 s=gr.screen_zoom;
|
F64 s=gr.scrn_zoom;
|
||||||
gr.screen_zoom=gr.screen_zoom*scale;
|
gr.scrn_zoom=gr.scrn_zoom*scale;
|
||||||
GrFixZoomScale;
|
GrFixZoomScale;
|
||||||
s/=gr.screen_zoom;
|
s/=gr.scrn_zoom;
|
||||||
ip.scale.x*=s;
|
ip.scale.x*=s;
|
||||||
ip.scale.y*=s;
|
ip.scale.y*=s;
|
||||||
ip.scale.z*=s;
|
ip.scale.z*=s;
|
||||||
ip.offset.x=ip.pos.x-(ip.pos.x-ip.offset.x)*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.y=ip.pos.y-(ip.pos.y-ip.offset.y)*s;
|
||||||
ip.offset.z=ip.pos.z-(ip.pos.z-ip.offset.z)*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.sx=ip.pos.x-gr.zoomed_dc->width >>1/gr.scrn_zoom;
|
||||||
gr.sy=ip.pos.y-gr.zoomed_dc->height>>1/gr.screen_zoom;
|
gr.sy=ip.pos.y-gr.zoomed_dc->height>>1/gr.scrn_zoom;
|
||||||
GrFixZoomScale;
|
GrFixZoomScale;
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 GrZoomInScreen()
|
U0 GrZoomInScrn()
|
||||||
{
|
{
|
||||||
GrFixZoomScale;
|
GrFixZoomScale;
|
||||||
I64 plane,row,col,k,l,
|
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,
|
d4=gr.zoomed_dc->width_internal>>3,
|
||||||
d5=d4-d2*gr.screen_zoom,
|
d5=d4-d2*gr.scrn_zoom,
|
||||||
d3=gr.zoomed_dc->height/gr.screen_zoom,
|
d3=gr.zoomed_dc->height/gr.scrn_zoom,
|
||||||
d6=(gr.zoomed_dc->height-d3)*gr.dc1->width_internal>>3,
|
d6=(gr.zoomed_dc->height-d3)*gr.dc1->width_internal>>3,
|
||||||
d7=gr.zoomed_dc->height%gr.screen_zoom*d4;
|
d7=gr.zoomed_dc->height%gr.scrn_zoom*d4;
|
||||||
U8 *src,*src2,*dst,*src3,*map=gr.screen_zoom_tables[gr.screen_zoom];
|
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;
|
src=gr.dc1->body+gr.sx>>3+gr.sy*gr.dc1->width_internal>>3;
|
||||||
dst=gr.zoomed_dc->body;
|
dst=gr.zoomed_dc->body;
|
||||||
for (plane=1;plane<0x10;plane<<=1) {
|
for (plane=1;plane<0x10;plane<<=1) {
|
||||||
row=d3;
|
row=d3;
|
||||||
while (row--) {
|
while (row--) {
|
||||||
k=gr.screen_zoom;
|
k=gr.scrn_zoom;
|
||||||
while (k--) {
|
while (k--) {
|
||||||
src2=src;
|
src2=src;
|
||||||
col=d2;
|
col=d2;
|
||||||
while (col--) {
|
while (col--) {
|
||||||
src3=&map[*src2++];
|
src3=&map[*src2++];
|
||||||
l=gr.screen_zoom;
|
l=gr.scrn_zoom;
|
||||||
while (l--) {
|
while (l--) {
|
||||||
*dst++=*src3;
|
*dst++=*src3;
|
||||||
src3+=256;
|
src3+=256;
|
||||||
@@ -367,13 +367,13 @@ U0 GrUpdateVGAGraphics()
|
|||||||
{//Update Graphic Card
|
{//Update Graphic Card
|
||||||
I64 row,plane,d=gr.zoomed_dc->width_internal>>6;
|
I64 row,plane,d=gr.zoomed_dc->width_internal>>6;
|
||||||
U32 *src,*vga,*dst;
|
U32 *src,*vga,*dst;
|
||||||
if (gr.screen_zoom==1)
|
if (gr.scrn_zoom==1)
|
||||||
src=gr.dc1->body;
|
src=gr.dc1->body;
|
||||||
else {
|
else {
|
||||||
GrZoomInScreen;
|
GrZoomInScrn;
|
||||||
src=gr.zoomed_dc->body;
|
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)) {
|
if (LBtr(&sys_semas[SYS_SEMA_FLUSH_VGA_IMAGE],0)) {
|
||||||
for (plane=1;plane<0x10;plane<<=1) {
|
for (plane=1;plane<0x10;plane<<=1) {
|
||||||
OutU8(VGAP_IDX,VGAR_MAP_MASK);
|
OutU8(VGAP_IDX,VGAR_MAP_MASK);
|
||||||
@@ -395,8 +395,8 @@ U0 GrUpdateVGAGraphics()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 GrUpdateScreen()
|
U0 GrUpdateScrn()
|
||||||
{//Called by the Window Manager $LK,"HERE",A="FF:::/Adam/WinB.HC,GrUpdateScreen"$, 30 times a second.
|
{//Called by the Window Manager $LK,"HERE",A="FF:::/Adam/WinMgr.HC,GrUpdateScrn"$, 30 times a second.
|
||||||
CDC *dc;
|
CDC *dc;
|
||||||
if (!Bt(&sys_run_level,RLf_VGA)) //if text mode
|
if (!Bt(&sys_run_level,RLf_VGA)) //if text mode
|
||||||
GrUpdateTasks;
|
GrUpdateTasks;
|
||||||
@@ -409,8 +409,8 @@ U0 GrUpdateScreen()
|
|||||||
|
|
||||||
dc=DCAlias(gr.dc2,Fs);
|
dc=DCAlias(gr.dc2,Fs);
|
||||||
dc->flags|=DCF_ON_TOP;
|
dc->flags|=DCF_ON_TOP;
|
||||||
if (gr.fp_final_screen_update)
|
if (gr.fp_final_scrn_update)
|
||||||
(*gr.fp_final_screen_update)(dc);
|
(*gr.fp_final_scrn_update)(dc);
|
||||||
DCDel(dc);
|
DCDel(dc);
|
||||||
|
|
||||||
if (!Bt(&sys_run_level,RLf_VGA)) //if text mode
|
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,
|
public U0 Sprite3(CDC *dc=gr.dc,I64 x,I64 y,I64 z,U8 *elems,
|
||||||
Bool just_one_elem=FALSE)
|
Bool just_one_elem=FALSE)
|
||||||
{//Plot a sprite into a CDC.
|
{//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,
|
I64 i,j,k,x1,y1,z1,x2,y2,
|
||||||
cur_sprite_elem_num=0,*old_r,*r2,
|
cur_sprite_elem_num=0,*old_r,*r2,
|
||||||
old_flags=dc->flags,
|
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_sprite_elem_num=0;
|
||||||
dc->nearest_dist=MAX_I64;
|
dc->nearest_dist=MAX_I64;
|
||||||
}
|
}
|
||||||
while (tempg->type) {
|
while (tmpg->type) {
|
||||||
dc->cur_sprite_elem_num=cur_sprite_elem_num;
|
dc->cur_sprite_elem_num=cur_sprite_elem_num;
|
||||||
switch (tempg->type) {
|
switch (tmpg->type) {
|
||||||
case SPT_COLOR:
|
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;
|
break;
|
||||||
case SPT_DITHER_COLOR:
|
case SPT_DITHER_COLOR:
|
||||||
dc->color=dc->color&~COLORROP_COLORS_MASK|
|
dc->color=dc->color&~COLORROP_COLORS_MASK|
|
||||||
tempg->d.dither_color.u8[0]|
|
tmpg->d.dither_color.u8[0]|
|
||||||
tempg->d.dither_color.u8[1]<<COLORROP_BITS|ROPF_DITHER;
|
tmpg->d.dither_color.u8[1]<<COLORROP_BITS|ROPF_DITHER;
|
||||||
break;
|
break;
|
||||||
case SPT_WIDTH:
|
case SPT_WIDTH:
|
||||||
dc->pen_width=tempg->w.width;
|
dc->pen_width=tmpg->w.width;
|
||||||
DCPenWidthScale(dc);
|
DCPenWidthScale(dc);
|
||||||
break;
|
break;
|
||||||
case SPT_TRANSFORM_ON:
|
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;
|
dc->flags&=~DCF_TRANSFORMATION;
|
||||||
break;
|
break;
|
||||||
case SPT_PT:
|
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;
|
break;
|
||||||
case SPT_TEXT:
|
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;
|
break;
|
||||||
case SPT_TEXT_BOX:
|
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;
|
break;
|
||||||
case SPT_TEXT_DIAMOND:
|
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;
|
break;
|
||||||
case SPT_FLOOD_FILL:
|
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;
|
break;
|
||||||
case SPT_FLOOD_FILL_NOT:
|
case SPT_FLOOD_FILL_NOT:
|
||||||
i=dc->color;
|
i=dc->color;
|
||||||
dc->color=dc->color.c0;
|
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;
|
dc->color=i;
|
||||||
break;
|
break;
|
||||||
case SPT_SHIFT:
|
case SPT_SHIFT:
|
||||||
x+=tempg->p.x1;
|
x+=tmpg->p.x1;
|
||||||
y+=tempg->p.y1;
|
y+=tmpg->p.y1;
|
||||||
break;
|
break;
|
||||||
case SPT_LINE:
|
case SPT_LINE:
|
||||||
GrLine3(dc,tempg->pp.x1+x,tempg->pp.y1+y,z,
|
GrLine3(dc,tmpg->pp.x1+x,tmpg->pp.y1+y,z,
|
||||||
tempg->pp.x2+x,tempg->pp.y2+y,z);
|
tmpg->pp.x2+x,tmpg->pp.y2+y,z);
|
||||||
break;
|
break;
|
||||||
case SPT_ARROW:
|
case SPT_ARROW:
|
||||||
GrArrow3(dc,tempg->pp.x1+x,tempg->pp.y1+y,z,
|
GrArrow3(dc,tmpg->pp.x1+x,tmpg->pp.y1+y,z,
|
||||||
tempg->pp.x2+x,tempg->pp.y2+y,z);
|
tmpg->pp.x2+x,tmpg->pp.y2+y,z);
|
||||||
break;
|
break;
|
||||||
case SPT_PLANAR_SYMMETRY:
|
case SPT_PLANAR_SYMMETRY:
|
||||||
if (DCSymmetry3Set(dc,tempg->pp.x1+x,tempg->pp.y1+y,z,
|
if (DCSymmetry3Set(dc,tmpg->pp.x1+x,tmpg->pp.y1+y,z,
|
||||||
tempg->pp.x2+x,tempg->pp.y2+y,z,
|
tmpg->pp.x2+x,tmpg->pp.y2+y,z,
|
||||||
tempg->pp.x2+x,tempg->pp.y2+y,z+1))
|
tmpg->pp.x2+x,tmpg->pp.y2+y,z+1))
|
||||||
dc->flags|=DCF_SYMMETRY;
|
dc->flags|=DCF_SYMMETRY;
|
||||||
else
|
else
|
||||||
dc->flags&=~DCF_SYMMETRY;
|
dc->flags&=~DCF_SYMMETRY;
|
||||||
break;
|
break;
|
||||||
case SPT_BITMAP:
|
case SPT_BITMAP:
|
||||||
img=CAlloc(sizeof(CDC));
|
img=CAlloc(sizeof(CDC));
|
||||||
img->width=tempg->pwhu.width;
|
img->width=tmpg->pwhu.width;
|
||||||
img->width_internal=(tempg->pwhu.width+7)&~7;
|
img->width_internal=(tmpg->pwhu.width+7)&~7;
|
||||||
img->height=tempg->pwhu.height;
|
img->height=tmpg->pwhu.height;
|
||||||
img->body=&tempg->pwhu.u;
|
img->body=&tmpg->pwhu.u;
|
||||||
img->dc_signature=DCS_SIGNATURE_VAL;
|
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);
|
Free(img);
|
||||||
break;
|
break;
|
||||||
case SPT_RECT:
|
case SPT_RECT:
|
||||||
GrRect3(dc,tempg->pp.x1+x,tempg->pp.y1+y,z,
|
GrRect3(dc,tmpg->pp.x1+x,tmpg->pp.y1+y,z,
|
||||||
tempg->pp.x2-tempg->pp.x1,tempg->pp.y2-tempg->pp.y1);
|
tmpg->pp.x2-tmpg->pp.x1,tmpg->pp.y2-tmpg->pp.y1);
|
||||||
break;
|
break;
|
||||||
case SPT_ROTATED_RECT:
|
case SPT_ROTATED_RECT:
|
||||||
x1=tempg->ppa.x1+x;
|
x1=tmpg->ppa.x1+x;
|
||||||
y1=tempg->ppa.y1+y;
|
y1=tmpg->ppa.y1+y;
|
||||||
z1=z;
|
z1=z;
|
||||||
Mat4x4MulXYZ(dc->r,&x1,&y1,&z1);
|
Mat4x4MulXYZ(dc->r,&x1,&y1,&z1);
|
||||||
old_r=dc->r;
|
old_r=dc->r;
|
||||||
dc->flags|=DCF_TRANSFORMATION;
|
dc->flags|=DCF_TRANSFORMATION;
|
||||||
r2=Mat4x4IdentNew;
|
r2=Mat4x4IdentNew;
|
||||||
Mat4x4RotZ(r2,-tempg->ppa.angle);
|
Mat4x4RotZ(r2,-tmpg->ppa.angle);
|
||||||
Mat4x4TranslationEqu(r2,x1,y1,z1);
|
Mat4x4TranslationEqu(r2,x1,y1,z1);
|
||||||
DCMat4x4Set(dc,Mat4x4MulMat4x4New(old_r,r2));
|
DCMat4x4Set(dc,Mat4x4MulMat4x4New(old_r,r2));
|
||||||
GrRect3(dc,0,0,0,
|
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(dc->r);
|
||||||
Free(r2);
|
Free(r2);
|
||||||
DCMat4x4Set(dc,old_r);
|
DCMat4x4Set(dc,old_r);
|
||||||
dc->flags=dc->flags&~DCF_TRANSFORMATION|old_flags;
|
dc->flags=dc->flags&~DCF_TRANSFORMATION|old_flags;
|
||||||
break;
|
break;
|
||||||
case SPT_CIRCLE:
|
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;
|
break;
|
||||||
case SPT_ELLIPSE:
|
case SPT_ELLIPSE:
|
||||||
GrEllipse3(dc,tempg->pwha.x1+x,tempg->pwha.y1+y,z,tempg->pwha.width,
|
GrEllipse3(dc,tmpg->pwha.x1+x,tmpg->pwha.y1+y,z,tmpg->pwha.width,
|
||||||
tempg->pwha.height,tempg->pwha.angle);
|
tmpg->pwha.height,tmpg->pwha.angle);
|
||||||
break;
|
break;
|
||||||
case SPT_POLYGON:
|
case SPT_POLYGON:
|
||||||
GrRegPoly3(dc,tempg->pwhas.x1+x,tempg->pwhas.y1+y,z,tempg->pwhas.width,
|
GrRegPoly3(dc,tmpg->pwhas.x1+x,tmpg->pwhas.y1+y,z,tmpg->pwhas.width,
|
||||||
tempg->pwhas.height,tempg->pwhas.sides,tempg->pwhas.angle);
|
tmpg->pwhas.height,tmpg->pwhas.sides,tmpg->pwhas.angle);
|
||||||
break;
|
break;
|
||||||
case SPT_POLYLINE:
|
case SPT_POLYLINE:
|
||||||
ptr=&tempg->nu.u;
|
ptr=&tmpg->nu.u;
|
||||||
x1=ptr[0];
|
x1=ptr[0];
|
||||||
y1=ptr[1];
|
y1=ptr[1];
|
||||||
for (i=1;i<tempg->nu.num;i++) {
|
for (i=1;i<tmpg->nu.num;i++) {
|
||||||
x2=ptr[i<<1];
|
x2=ptr[i<<1];
|
||||||
y2=ptr[i<<1+1];
|
y2=ptr[i<<1+1];
|
||||||
GrLine3(dc,x1+x,y1+y,z,x2+x,y2+y,z);
|
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;
|
break;
|
||||||
case SPT_POLYPT:
|
case SPT_POLYPT:
|
||||||
x1=tempg->npu.x;
|
x1=tmpg->npu.x;
|
||||||
y1=tempg->npu.y;
|
y1=tmpg->npu.y;
|
||||||
ptr=&tempg->npu.u;
|
ptr=&tmpg->npu.u;
|
||||||
k=tempg->npu.num*3;
|
k=tmpg->npu.num*3;
|
||||||
GrPlot3(dc,x1+x,y1+y,z);
|
GrPlot3(dc,x1+x,y1+y,z);
|
||||||
for (i=0;i<k;i+=3) {
|
for (i=0;i<k;i+=3) {
|
||||||
j=BFieldExtU32(ptr,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;
|
break;
|
||||||
start:
|
start:
|
||||||
p2=p=MAlloc(tempg->nu.num*sizeof(CD3I32));
|
p2=p=MAlloc(tmpg->nu.num*sizeof(CD3I32));
|
||||||
MemCpy(p,&tempg->nu.u,tempg->nu.num*sizeof(CD3I32));
|
MemCpy(p,&tmpg->nu.u,tmpg->nu.num*sizeof(CD3I32));
|
||||||
for (i=0;i<tempg->nu.num;i++,p2++) {
|
for (i=0;i<tmpg->nu.num;i++,p2++) {
|
||||||
p2->x+=x;
|
p2->x+=x;
|
||||||
p2->y+=y;
|
p2->y+=y;
|
||||||
p2->z+=z;
|
p2->z+=z;
|
||||||
}
|
}
|
||||||
case SPT_BSPLINE2:
|
case SPT_BSPLINE2:
|
||||||
Gr2BSpline3(dc,p,tempg->nu.num,FALSE);
|
Gr2BSpline3(dc,p,tmpg->nu.num,FALSE);
|
||||||
break;
|
break;
|
||||||
case SPT_BSPLINE3:
|
case SPT_BSPLINE3:
|
||||||
Gr3BSpline3(dc,p,tempg->nu.num,FALSE);
|
Gr3BSpline3(dc,p,tmpg->nu.num,FALSE);
|
||||||
break;
|
break;
|
||||||
case SPT_BSPLINE2_CLOSED:
|
case SPT_BSPLINE2_CLOSED:
|
||||||
Gr2BSpline3(dc,p,tempg->nu.num,TRUE);
|
Gr2BSpline3(dc,p,tmpg->nu.num,TRUE);
|
||||||
break;
|
break;
|
||||||
case SPT_BSPLINE3_CLOSED:
|
case SPT_BSPLINE3_CLOSED:
|
||||||
Gr3BSpline3(dc,p,tempg->nu.num,TRUE);
|
Gr3BSpline3(dc,p,tmpg->nu.num,TRUE);
|
||||||
break;
|
break;
|
||||||
end:
|
end:
|
||||||
Free(p);
|
Free(p);
|
||||||
break;
|
break;
|
||||||
case SPT_MESH:
|
case SPT_MESH:
|
||||||
p2=p=MAlloc(tempg->mu.vertex_cnt*sizeof(CD3I32));
|
p2=p=MAlloc(tmpg->mu.vertex_cnt*sizeof(CD3I32));
|
||||||
MemCpy(p,&tempg->mu.u,tempg->mu.vertex_cnt*sizeof(CD3I32));
|
MemCpy(p,&tmpg->mu.u,tmpg->mu.vertex_cnt*sizeof(CD3I32));
|
||||||
for (i=0;i<tempg->mu.vertex_cnt;i++,p2++) {
|
for (i=0;i<tmpg->mu.vertex_cnt;i++,p2++) {
|
||||||
p2->x+=x;
|
p2->x+=x;
|
||||||
p2->y+=y;
|
p2->y+=y;
|
||||||
p2->z+=z;
|
p2->z+=z;
|
||||||
}
|
}
|
||||||
Gr3Mesh(dc,tempg->mu.vertex_cnt,p,tempg->mu.tri_cnt,
|
Gr3Mesh(dc,tmpg->mu.vertex_cnt,p,tmpg->mu.tri_cnt,
|
||||||
(&tempg->mu.u)(U8 *)+sizeof(CD3I32)*tempg->mu.vertex_cnt);
|
(&tmpg->mu.u)(U8 *)+sizeof(CD3I32)*tmpg->mu.vertex_cnt);
|
||||||
Free(p);
|
Free(p);
|
||||||
break;
|
break;
|
||||||
case SPT_SHIFTABLE_MESH:
|
case SPT_SHIFTABLE_MESH:
|
||||||
if (dc->flags&DCF_TRANSFORMATION) {
|
if (dc->flags&DCF_TRANSFORMATION) {
|
||||||
dc->x+=tempg->pmu.x;
|
dc->x+=tmpg->pmu.x;
|
||||||
dc->y+=tempg->pmu.y;
|
dc->y+=tmpg->pmu.y;
|
||||||
dc->z+=tempg->pmu.z;
|
dc->z+=tmpg->pmu.z;
|
||||||
x1=x;
|
x1=x;
|
||||||
y1=y;
|
y1=y;
|
||||||
z1=z;
|
z1=z;
|
||||||
} else {
|
} else {
|
||||||
x1=tempg->pmu.x+x;
|
x1=tmpg->pmu.x+x;
|
||||||
y1=tempg->pmu.y+y;
|
y1=tmpg->pmu.y+y;
|
||||||
z1=tempg->pmu.z+z;
|
z1=tmpg->pmu.z+z;
|
||||||
}
|
}
|
||||||
p2=p=MAlloc(tempg->pmu.vertex_cnt*sizeof(CD3I32));
|
p2=p=MAlloc(tmpg->pmu.vertex_cnt*sizeof(CD3I32));
|
||||||
MemCpy(p,&tempg->pmu.u,tempg->pmu.vertex_cnt*sizeof(CD3I32));
|
MemCpy(p,&tmpg->pmu.u,tmpg->pmu.vertex_cnt*sizeof(CD3I32));
|
||||||
for (i=0;i<tempg->pmu.vertex_cnt;i++,p2++) {
|
for (i=0;i<tmpg->pmu.vertex_cnt;i++,p2++) {
|
||||||
p2->x+=x1;
|
p2->x+=x1;
|
||||||
p2->y+=y1;
|
p2->y+=y1;
|
||||||
p2->z+=z1;
|
p2->z+=z1;
|
||||||
}
|
}
|
||||||
Gr3Mesh(dc,tempg->pmu.vertex_cnt,p,tempg->pmu.tri_cnt,
|
Gr3Mesh(dc,tmpg->pmu.vertex_cnt,p,tmpg->pmu.tri_cnt,
|
||||||
(&tempg->pmu.u)(U8 *)+sizeof(CD3I32)*tempg->pmu.vertex_cnt);
|
(&tmpg->pmu.u)(U8 *)+sizeof(CD3I32)*tmpg->pmu.vertex_cnt);
|
||||||
Free(p);
|
Free(p);
|
||||||
if (dc->flags&DCF_TRANSFORMATION) {
|
if (dc->flags&DCF_TRANSFORMATION) {
|
||||||
dc->x-=tempg->pmu.x;
|
dc->x-=tmpg->pmu.x;
|
||||||
dc->y-=tempg->pmu.y;
|
dc->y-=tmpg->pmu.y;
|
||||||
dc->z-=tempg->pmu.z;
|
dc->z-=tmpg->pmu.z;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
cur_sprite_elem_num++;
|
cur_sprite_elem_num++;
|
||||||
if (just_one_elem) break;
|
if (just_one_elem) break;
|
||||||
tempg(U8 *)+=SpriteElemSize(tempg);
|
tmpg(U8 *)+=SpriteElemSize(tmpg);
|
||||||
}
|
}
|
||||||
MemCpy(&dc->sym,&old_sym,sizeof(CGrSym));
|
MemCpy(&dc->sym,&old_sym,sizeof(CGrSym));
|
||||||
dc->color=old_color;
|
dc->color=old_color;
|
||||||
@@ -334,8 +334,8 @@ public U8 *SpriteInterpolate(F64 t,U8 *elems0,U8 *elems1)
|
|||||||
I32 *ptr0,*ptr1,*ptrr;
|
I32 *ptr0,*ptr1,*ptrr;
|
||||||
CD3I32 *p0,*p1,*pr;
|
CD3I32 *p0,*p1,*pr;
|
||||||
U8 *res;
|
U8 *res;
|
||||||
CSprite *tempg0=elems0-offset(CSprite.start),
|
CSprite *tmpg0=elems0-offset(CSprite.start),
|
||||||
*tempg1=elems1-offset(CSprite.start),*tempgr;
|
*tmpg1=elems1-offset(CSprite.start),*tmpgr;
|
||||||
if (t<0.5) {
|
if (t<0.5) {
|
||||||
i=SpriteSize(elems0),
|
i=SpriteSize(elems0),
|
||||||
res=MAlloc(i);
|
res=MAlloc(i);
|
||||||
@@ -345,19 +345,19 @@ public U8 *SpriteInterpolate(F64 t,U8 *elems0,U8 *elems1)
|
|||||||
res=MAlloc(i);
|
res=MAlloc(i);
|
||||||
MemCpy(res,elems1,i);
|
MemCpy(res,elems1,i);
|
||||||
}
|
}
|
||||||
tempgr=res-offset(CSprite.start);
|
tmpgr=res-offset(CSprite.start);
|
||||||
while (tempg0->type) {
|
while (tmpg0->type) {
|
||||||
if (tempg0->type!=tempg1->type)
|
if (tmpg0->type!=tmpg1->type)
|
||||||
throw('Graphics');
|
throw('Graphics');
|
||||||
switch (tempg0->type) {
|
switch (tmpg0->type) {
|
||||||
case SPT_ROTATED_RECT:
|
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_RECT:
|
||||||
case SPT_LINE:
|
case SPT_LINE:
|
||||||
case SPT_ARROW:
|
case SPT_ARROW:
|
||||||
case SPT_PLANAR_SYMMETRY:
|
case SPT_PLANAR_SYMMETRY:
|
||||||
tempgr->pp.x2=(tempg0->pp.x2*t0+tempg1->pp.x2*t1)>>32;
|
tmpgr->pp.x2=(tmpg0->pp.x2*t0+tmpg1->pp.x2*t1)>>32;
|
||||||
tempgr->pp.y2=(tempg0->pp.y2*t0+tempg1->pp.y2*t1)>>32;
|
tmpgr->pp.y2=(tmpg0->pp.y2*t0+tmpg1->pp.y2*t1)>>32;
|
||||||
case SPT_TEXT:
|
case SPT_TEXT:
|
||||||
case SPT_TEXT_BOX:
|
case SPT_TEXT_BOX:
|
||||||
case SPT_TEXT_DIAMOND:
|
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:
|
||||||
case SPT_FLOOD_FILL_NOT:
|
case SPT_FLOOD_FILL_NOT:
|
||||||
case SPT_SHIFT:
|
case SPT_SHIFT:
|
||||||
tempgr->p.x1=(tempg0->p.x1*t0+tempg1->p.x1*t1)>>32;
|
tmpgr->p.x1=(tmpg0->p.x1*t0+tmpg1->p.x1*t1)>>32;
|
||||||
tempgr->p.y1=(tempg0->p.y1*t0+tempg1->p.y1*t1)>>32;
|
tmpgr->p.y1=(tmpg0->p.y1*t0+tmpg1->p.y1*t1)>>32;
|
||||||
break;
|
break;
|
||||||
case SPT_CIRCLE:
|
case SPT_CIRCLE:
|
||||||
tempgr->pr.radius=(tempg0->pr.radius*t0+tempg1->pr.radius*t1)>>32;
|
tmpgr->pr.radius=(tmpg0->pr.radius*t0+tmpg1->pr.radius*t1)>>32;
|
||||||
tempgr->pr.x1=(tempg0->pr.x1*t0+tempg1->pr.x1*t1)>>32;
|
tmpgr->pr.x1=(tmpg0->pr.x1*t0+tmpg1->pr.x1*t1)>>32;
|
||||||
tempgr->pr.y1=(tempg0->pr.y1*t0+tempg1->pr.y1*t1)>>32;
|
tmpgr->pr.y1=(tmpg0->pr.y1*t0+tmpg1->pr.y1*t1)>>32;
|
||||||
break;
|
break;
|
||||||
case SPT_ELLIPSE:
|
case SPT_ELLIPSE:
|
||||||
case SPT_POLYGON:
|
case SPT_POLYGON:
|
||||||
tempgr->pwha.x1=(tempg0->pwha.x1*t0+tempg1->pwha.x1*t1)>>32;
|
tmpgr->pwha.x1=(tmpg0->pwha.x1*t0+tmpg1->pwha.x1*t1)>>32;
|
||||||
tempgr->pwha.y1=(tempg0->pwha.y1*t0+tempg1->pwha.y1*t1)>>32;
|
tmpgr->pwha.y1=(tmpg0->pwha.y1*t0+tmpg1->pwha.y1*t1)>>32;
|
||||||
tempgr->pwha.width =(tempg0->pwha.width *t0+tempg1->pwha.width*t1)>>32;
|
tmpgr->pwha.width =(tmpg0->pwha.width *t0+tmpg1->pwha.width*t1)>>32;
|
||||||
tempgr->pwha.height=(tempg0->pwha.height*t0+tempg1->pwha.height*t1)>>32;
|
tmpgr->pwha.height=(tmpg0->pwha.height*t0+tmpg1->pwha.height*t1)>>32;
|
||||||
break;
|
break;
|
||||||
case SPT_BITMAP:
|
case SPT_BITMAP:
|
||||||
tempgr->pwhu.x1=(tempg0->pwhu.x1*t0+tempg1->pwhu.x1*t1)>>32;
|
tmpgr->pwhu.x1=(tmpg0->pwhu.x1*t0+tmpg1->pwhu.x1*t1)>>32;
|
||||||
tempgr->pwhu.y1=(tempg0->pwhu.y1*t0+tempg1->pwhu.y1*t1)>>32;
|
tmpgr->pwhu.y1=(tmpg0->pwhu.y1*t0+tmpg1->pwhu.y1*t1)>>32;
|
||||||
break;
|
break;
|
||||||
case SPT_POLYLINE:
|
case SPT_POLYLINE:
|
||||||
ptr0=&tempg0->nu.u;
|
ptr0=&tmpg0->nu.u;
|
||||||
ptr1=&tempg1->nu.u;
|
ptr1=&tmpg1->nu.u;
|
||||||
ptrr=&tempgr->nu.u;
|
ptrr=&tmpgr->nu.u;
|
||||||
for (i=0;i<tempg0->nu.num;i++) {
|
for (i=0;i<tmpg0->nu.num;i++) {
|
||||||
ptrr[i<<1]=(ptr0[i<<1]*t0+ptr1[i<<1]*t1)>>32;
|
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;
|
ptrr[i<<1+1]=(ptr0[i<<1+1]*t0+ptr1[i<<1+1]*t1)>>32;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SPT_POLYPT:
|
case SPT_POLYPT:
|
||||||
tempgr->npu.x=(tempg0->npu.x*t0+tempg1->npu.x*t1)>>32;
|
tmpgr->npu.x=(tmpg0->npu.x*t0+tmpg1->npu.x*t1)>>32;
|
||||||
tempgr->npu.y=(tempg0->npu.y*t0+tempg1->npu.y*t1)>>32;
|
tmpgr->npu.y=(tmpg0->npu.y*t0+tmpg1->npu.y*t1)>>32;
|
||||||
break;
|
break;
|
||||||
case SPT_BSPLINE2:
|
case SPT_BSPLINE2:
|
||||||
case SPT_BSPLINE3:
|
case SPT_BSPLINE3:
|
||||||
case SPT_BSPLINE2_CLOSED:
|
case SPT_BSPLINE2_CLOSED:
|
||||||
case SPT_BSPLINE3_CLOSED:
|
case SPT_BSPLINE3_CLOSED:
|
||||||
p0=&tempg0->nu.u;
|
p0=&tmpg0->nu.u;
|
||||||
p1=&tempg1->nu.u;
|
p1=&tmpg1->nu.u;
|
||||||
pr=&tempgr->nu.u;
|
pr=&tmpgr->nu.u;
|
||||||
for (i=0;i<tempg0->nu.num;i++) {
|
for (i=0;i<tmpg0->nu.num;i++) {
|
||||||
pr[i].x=(p0[i].x*t0+p1[i].x*t1)>>32;
|
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].y=(p0[i].y*t0+p1[i].y*t1)>>32;
|
||||||
pr[i].z=(p0[i].z*t0+p1[i].z*t1)>>32;
|
pr[i].z=(p0[i].z*t0+p1[i].z*t1)>>32;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SPT_MESH:
|
case SPT_MESH:
|
||||||
p0=&tempg0->mu.u;
|
p0=&tmpg0->mu.u;
|
||||||
p1=&tempg1->mu.u;
|
p1=&tmpg1->mu.u;
|
||||||
pr=&tempgr->mu.u;
|
pr=&tmpgr->mu.u;
|
||||||
for (i=0;i<tempg0->mu.vertex_cnt;i++) {
|
for (i=0;i<tmpg0->mu.vertex_cnt;i++) {
|
||||||
pr[i].x=(p0[i].x*t0+p1[i].x*t1)>>32;
|
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].y=(p0[i].y*t0+p1[i].y*t1)>>32;
|
||||||
pr[i].z=(p0[i].z*t0+p1[i].z*t1)>>32;
|
pr[i].z=(p0[i].z*t0+p1[i].z*t1)>>32;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SPT_SHIFTABLE_MESH:
|
case SPT_SHIFTABLE_MESH:
|
||||||
p0=&tempg0->pmu.u;
|
p0=&tmpg0->pmu.u;
|
||||||
p1=&tempg1->pmu.u;
|
p1=&tmpg1->pmu.u;
|
||||||
pr=&tempgr->pmu.u;
|
pr=&tmpgr->pmu.u;
|
||||||
for (i=0;i<tempg0->pmu.vertex_cnt;i++) {
|
for (i=0;i<tmpg0->pmu.vertex_cnt;i++) {
|
||||||
pr[i].x=(p0[i].x*t0+p1[i].x*t1)>>32;
|
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].y=(p0[i].y*t0+p1[i].y*t1)>>32;
|
||||||
pr[i].z=(p0[i].z*t0+p1[i].z*t1)>>32;
|
pr[i].z=(p0[i].z*t0+p1[i].z*t1)>>32;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
tempg0(U8 *)+=SpriteElemSize(tempg0);
|
tmpg0(U8 *)+=SpriteElemSize(tmpg0);
|
||||||
tempg1(U8 *)+=SpriteElemSize(tempg1);
|
tmpg1(U8 *)+=SpriteElemSize(tmpg1);
|
||||||
tempgr(U8 *)+=SpriteElemSize(tempgr);
|
tmpgr(U8 *)+=SpriteElemSize(tmpgr);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -446,26 +446,26 @@ public CDocEntry *DocSprite(CDoc *doc=NULL,U8 *elems,U8 *fmt=NULL)
|
|||||||
U8 *st;
|
U8 *st;
|
||||||
Bool unlock;
|
Bool unlock;
|
||||||
CDocEntry *doc_e;
|
CDocEntry *doc_e;
|
||||||
CDocBin *tempb;
|
CDocBin *tmpb;
|
||||||
if (!doc && !(doc=DocPut)) return NULL;
|
if (!doc && !(doc=DocPut)) return NULL;
|
||||||
unlock=DocLock(doc);
|
unlock=DocLock(doc);
|
||||||
size=SpriteSize(elems);
|
size=SpriteSize(elems);
|
||||||
tempb=CAlloc(sizeof(CDocBin),doc->mem_task);
|
tmpb=CAlloc(sizeof(CDocBin),doc->mem_task);
|
||||||
tempb->size=size;
|
tmpb->size=size;
|
||||||
tempb->data=MAlloc(size,doc->mem_task);
|
tmpb->data=MAlloc(size,doc->mem_task);
|
||||||
MemCpy(tempb->data,elems,size);
|
MemCpy(tmpb->data,elems,size);
|
||||||
tempb->num=doc->cur_bin_num;
|
tmpb->num=doc->cur_bin_num;
|
||||||
tempb->use_cnt=1;
|
tmpb->use_cnt=1;
|
||||||
QueIns(tempb,doc->bin_head.last);
|
QueIns(tmpb,doc->bin_head.last);
|
||||||
if (fmt)
|
if (fmt)
|
||||||
st=MStrPrint(fmt,doc->cur_bin_num++);
|
st=MStrPrint(fmt,doc->cur_bin_num++);
|
||||||
else
|
else
|
||||||
st=MStrPrint("$$SP,\"\",BI=%d$$",doc->cur_bin_num++);
|
st=MStrPrint("$$SP,\"\",BI=%d$$",doc->cur_bin_num++);
|
||||||
doc_e=DocPrint(doc,"%s",st);
|
doc_e=DocPrint(doc,"%s",st);
|
||||||
Free(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)
|
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)
|
if (unlock)
|
||||||
DocUnlock(doc);
|
DocUnlock(doc);
|
||||||
return doc_e;
|
return doc_e;
|
||||||
|
|||||||
+4
-4
@@ -10,14 +10,14 @@ Cd(__DIR__);;
|
|||||||
#include "GrDC"
|
#include "GrDC"
|
||||||
#include "GrInitB"
|
#include "GrInitB"
|
||||||
#include "GrMath"
|
#include "GrMath"
|
||||||
#include "GrScreen"
|
#include "GrScrn"
|
||||||
#include "GrBitMap"
|
#include "GrBitMap"
|
||||||
#include "GrPrimatives"
|
#include "GrPrimatives"
|
||||||
#include "GrComposites"
|
#include "GrComposites"
|
||||||
|
|
||||||
#define GE_ABORT (-1)
|
#define SPE_ABORT (-1)
|
||||||
#define GE_EXIT 0
|
#define SPE_EXIT 0
|
||||||
#define GE_CONT 1
|
#define SPE_CONT 1
|
||||||
#include "SpriteNew"
|
#include "SpriteNew"
|
||||||
#include "GrSpritePlot"
|
#include "GrSpritePlot"
|
||||||
#include "SpriteMesh"
|
#include "SpriteMesh"
|
||||||
|
|||||||
+144
-144
@@ -1,33 +1,33 @@
|
|||||||
#help_index "Graphics/Sprite;Sprites"
|
#help_index "Graphics/Sprite;Sprites"
|
||||||
|
|
||||||
#define GBM_EXIT 0
|
#define SPBM_EXIT 0
|
||||||
#define GBM_MAIN_MENU 1
|
#define SPBM_MAIN_MENU 1
|
||||||
#define GBM_COLOR 2
|
#define SPBM_COLOR 2
|
||||||
#define GBM_DITHER_COLOR 3
|
#define SPBM_DITHER_COLOR 3
|
||||||
#define GBM_WIDTH 4
|
#define SPBM_WIDTH 4
|
||||||
#define GBM_PT 5
|
#define SPBM_PT 5
|
||||||
#define GBM_LINE 6
|
#define SPBM_LINE 6
|
||||||
#define GBM_ARROW 7
|
#define SPBM_ARROW 7
|
||||||
#define GBM_RECT 8
|
#define SPBM_RECT 8
|
||||||
#define GBM_CIRCLE 9
|
#define SPBM_CIRCLE 9
|
||||||
#define GBM_TEXT 10
|
#define SPBM_TEXT 10
|
||||||
#define GBM_TEXT_BOX 11
|
#define SPBM_TEXT_BOX 11
|
||||||
#define GBM_TEXT_DIAMOND 12
|
#define SPBM_TEXT_DIAMOND 12
|
||||||
#define GBM_FLOOD_FILL 13
|
#define SPBM_FLOOD_FILL 13
|
||||||
#define GBM_FLOOD_FILL_NOT 14
|
#define SPBM_FLOOD_FILL_NOT 14
|
||||||
#define GBM_POLYLINE 15
|
#define SPBM_POLYLINE 15
|
||||||
#define GBM_POLYPT 16
|
#define SPBM_POLYPT 16
|
||||||
#define GBM_COPY 17
|
#define SPBM_COPY 17
|
||||||
#define GBM_DELETE 18
|
#define SPBM_DELETE 18
|
||||||
#define GBM_PASTE 19
|
#define SPBM_PASTE 19
|
||||||
#define GBM_PASTE_TRANSPARENT 20
|
#define SPBM_PASTE_TRANSPARENT 20
|
||||||
#define GBM_FIND_AND_REPLACE 21
|
#define SPBM_FIND_AND_REPLACE 21
|
||||||
#define GBM_TRIM_TO_EXTENTS 22
|
#define SPBM_TRIM_TO_EXTENTS 22
|
||||||
#define GBM_ADD_OUTLINE 23
|
#define SPBM_ADD_OUTLINE 23
|
||||||
#define GBM_ETCH 24
|
#define SPBM_ETCH 24
|
||||||
#define GBM_UNDO 25
|
#define SPBM_UNDO 25
|
||||||
#define GBM_SAVE_BMP 26
|
#define SPBM_SAVE_BMP 26
|
||||||
#define GBM_SAVE_GRA 27
|
#define SPBM_SAVE_GRA 27
|
||||||
|
|
||||||
U0 GrInit4()
|
U0 GrInit4()
|
||||||
{
|
{
|
||||||
@@ -36,7 +36,7 @@ U0 GrInit4()
|
|||||||
"Rect\0Circle\0Text\0Text Box\0Text Diamond\0Flood Fill\0"
|
"Rect\0Circle\0Text\0Text Box\0Text Diamond\0Flood Fill\0"
|
||||||
"Flood Fill Not Color\0PolyLine\0PolyPoint\0Copy\0Delete\0Paste\0"
|
"Flood Fill Not Color\0PolyLine\0PolyPoint\0Copy\0Delete\0Paste\0"
|
||||||
"Paste Transparent\0Find and Replace\0Trim to Extents\0Add Outline\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;
|
GrInit4;
|
||||||
|
|
||||||
@@ -56,34 +56,34 @@ I64 PopUpSpriteBitMap(CColorROPU32 color,I64 width)
|
|||||||
}
|
}
|
||||||
DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Sprite BitMap Menu\"$$\n"
|
DocPrint(doc,"$$PURPLE$$$$TX+CX,\"Sprite BitMap Menu\"$$\n"
|
||||||
"$$LK+PU+CX,\"Click for Help\",A=\"FI:::/Doc/SpriteBitMap.DD.Z\"$$\n"
|
"$$LK+PU+CX,\"Click for Help\",A=\"FI:::/Doc/SpriteBitMap.DD.Z\"$$\n"
|
||||||
"\n$$LTBLUE$$$$MU-UL,\"Color %s\",LE=GBM_COLOR$$\n"
|
"\n$$LTBLUE$$$$MU-UL,\"Color %s\",LE=SPBM_COLOR$$\n"
|
||||||
"$$MU-UL,\"Dither Color %s\",LE=GBM_DITHER_COLOR$$\n"
|
"$$MU-UL,\"Dither Color %s\",LE=SPBM_DITHER_COLOR$$\n"
|
||||||
"$$MU-UL,\"Width %d\",LE=GBM_WIDTH$$\n"
|
"$$MU-UL,\"Width %d\",LE=SPBM_WIDTH$$\n"
|
||||||
"$$MU-UL,\"Find & Replace Color\",LE=GBM_FIND_AND_REPLACE$$\n"
|
"$$MU-UL,\"Find & Replace Color\",LE=SPBM_FIND_AND_REPLACE$$\n"
|
||||||
"$$MU-UL,\"Trim to Extents\",LE=GBM_TRIM_TO_EXTENTS$$\n"
|
"$$MU-UL,\"Trim to Extents\",LE=SPBM_TRIM_TO_EXTENTS$$\n"
|
||||||
"$$MU-UL,\"Add Outline\",LE=GBM_ADD_OUTLINE$$\n"
|
"$$MU-UL,\"Add Outline\",LE=SPBM_ADD_OUTLINE$$\n"
|
||||||
"$$MU-UL,\"Etch\",LE=GBM_ETCH$$\n"
|
"$$MU-UL,\"Etch\",LE=SPBM_ETCH$$\n"
|
||||||
"\n$$MU-UL,\"Point\",LE=GBM_PT$$\n"
|
"\n$$MU-UL,\"Point\",LE=SPBM_PT$$\n"
|
||||||
"$$MU-UL,\"Line\",LE=GBM_LINE$$\n"
|
"$$MU-UL,\"Line\",LE=SPBM_LINE$$\n"
|
||||||
"$$MU-UL,\"Arrow\",LE=GBM_ARROW$$\n"
|
"$$MU-UL,\"Arrow\",LE=SPBM_ARROW$$\n"
|
||||||
"$$MU-UL,\"Rect\",LE=GBM_RECT$$\n"
|
"$$MU-UL,\"Rect\",LE=SPBM_RECT$$\n"
|
||||||
"$$MU-UL,\"Circle\",LE=GBM_CIRCLE$$\n"
|
"$$MU-UL,\"Circle\",LE=SPBM_CIRCLE$$\n"
|
||||||
"$$MU-UL,\"Text\",LE=GBM_TEXT$$\n"
|
"$$MU-UL,\"Text\",LE=SPBM_TEXT$$\n"
|
||||||
"$$MU-UL,\"Text Box\",LE=GBM_TEXT_BOX$$\n"
|
"$$MU-UL,\"Text Box\",LE=SPBM_TEXT_BOX$$\n"
|
||||||
"$$MU-UL,\"Text Diamond\",LE=GBM_TEXT_DIAMOND$$\n"
|
"$$MU-UL,\"Text Diamond\",LE=SPBM_TEXT_DIAMOND$$\n"
|
||||||
"$$MU-UL,\"Flood Fill\",LE=GBM_FLOOD_FILL$$\n"
|
"$$MU-UL,\"Flood Fill\",LE=SPBM_FLOOD_FILL$$\n"
|
||||||
"$$MU-UL,\"Flood Fill Not Color\",LE=GBM_FLOOD_FILL_NOT$$\n"
|
"$$MU-UL,\"Flood Fill Not Color\",LE=SPBM_FLOOD_FILL_NOT$$\n"
|
||||||
"$$MU-UL,\"PolyLine\",LE=GBM_POLYLINE$$\n"
|
"$$MU-UL,\"PolyLine\",LE=SPBM_POLYLINE$$\n"
|
||||||
"$$MU-UL,\"PolyPoint\",LE=GBM_POLYPT$$\n"
|
"$$MU-UL,\"PolyPoint\",LE=SPBM_POLYPT$$\n"
|
||||||
"\n$$MU-UL,\"Copy to Clipboard\",LE=GBM_COPY$$\n"
|
"\n$$MU-UL,\"Copy to Clipboard\",LE=SPBM_COPY$$\n"
|
||||||
"$$MU-UL,\"Delete to Clipboard\",LE=GBM_DELETE$$\n"
|
"$$MU-UL,\"Delete to Clipboard\",LE=SPBM_DELETE$$\n"
|
||||||
"$$MU-UL,\"Paste Clipboard\",LE=GBM_PASTE$$\n"
|
"$$MU-UL,\"Paste Clipboard\",LE=SPBM_PASTE$$\n"
|
||||||
"$$MU-UL,\"Paste Transparent Clipboard\",LE=GBM_PASTE_TRANSPARENT$$\n"
|
"$$MU-UL,\"Paste Transparent Clipboard\",LE=SPBM_PASTE_TRANSPARENT$$\n"
|
||||||
"\n$$MU-UL,\"Save BMP File\",LE=GBM_SAVE_BMP$$\n"
|
"\n$$MU-UL,\"Save BMP File\",LE=SPBM_SAVE_BMP$$\n"
|
||||||
"$$MU-UL,\"Save GRA File\",LE=GBM_SAVE_GRA$$\n"
|
"$$MU-UL,\"Save GR File\",LE=SPBM_SAVE_GRA$$\n"
|
||||||
"\n$$MU-UL,\"Undo\",LE=GBM_UNDO$$\n"
|
"\n$$MU-UL,\"Undo\",LE=SPBM_UNDO$$\n"
|
||||||
"\n$$PURPLE$$$$MU-UL,\"+] Sprite Main Menu\",LE=GBM_MAIN_MENU$$$$LTBLUE$$\n"
|
"\n$$PURPLE$$$$MU-UL,\"+] Sprite Main Menu\",LE=SPBM_MAIN_MENU$$$$LTBLUE$$\n"
|
||||||
"$$MU-UL,\"Exit Sprite\",LE=GBM_EXIT$$\n"
|
"$$MU-UL,\"Exit Sprite\",LE=SPBM_EXIT$$\n"
|
||||||
"$$MU-UL,\"Abort Sprite\",LE=DOCM_CANCEL$$\n"
|
"$$MU-UL,\"Abort Sprite\",LE=DOCM_CANCEL$$\n"
|
||||||
"\nRight-Click to get back to this menu.",st1,st2,width);
|
"\nRight-Click to get back to this menu.",st1,st2,width);
|
||||||
i=PopUpMenu(doc);
|
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 SpriteBitMapEd(CDoc *,CDocEntry *doc_e,CDC *dc,I64 *_xx1,I64 *_yy1,
|
||||||
I64 *_xx2,I64 *_yy2,CDC **_img,CColorROPU32 bkcolor)
|
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,
|
x22,y22,res,xx1=*_xx1,yy1=*_yy1,xx2=*_xx2,yy2=*_yy2,
|
||||||
old_de_flags=doc_e->de_flags;
|
old_de_flags=doc_e->de_flags;
|
||||||
Bool down=FALSE;
|
Bool down=FALSE;
|
||||||
@@ -228,13 +228,13 @@ I64 SpriteBitMapEd(CDoc *,CDocEntry *doc_e,CDC *dc,I64 *_xx1,I64 *_yy1,
|
|||||||
case MSG_KEY_DOWN:
|
case MSG_KEY_DOWN:
|
||||||
switch (a1) {
|
switch (a1) {
|
||||||
case CH_SHIFT_ESC:
|
case CH_SHIFT_ESC:
|
||||||
res=GE_ABORT;
|
res=SPE_ABORT;
|
||||||
goto bm_key_up_done;
|
goto bm_key_up_done;
|
||||||
case CH_ESC:
|
case CH_ESC:
|
||||||
res=GE_CONT;
|
res=SPE_CONT;
|
||||||
goto bm_key_up_done;
|
goto bm_key_up_done;
|
||||||
case 'c': //eye-dropper
|
case 'c': //eye-dropper
|
||||||
dc2=DCScreenCapture(FALSE);
|
dc2=DCScrnCapture(FALSE);
|
||||||
color=GrPeek(dc2,ip.pos.x,ip.pos.y)^15;//Mouse cursor is XORed.
|
color=GrPeek(dc2,ip.pos.x,ip.pos.y)^15;//Mouse cursor is XORed.
|
||||||
DCDel(dc2);
|
DCDel(dc2);
|
||||||
break;
|
break;
|
||||||
@@ -253,19 +253,19 @@ bm_menu:
|
|||||||
StrCpy(Fs->task_title,DefineSub(i,"ST_SPRITE_BITMAP_MENU"));
|
StrCpy(Fs->task_title,DefineSub(i,"ST_SPRITE_BITMAP_MENU"));
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case DOCM_CANCEL:
|
case DOCM_CANCEL:
|
||||||
res=GE_ABORT;
|
res=SPE_ABORT;
|
||||||
goto bm_done;
|
goto bm_done;
|
||||||
case GBM_EXIT:
|
case SPBM_EXIT:
|
||||||
res=GE_EXIT;
|
res=SPE_EXIT;
|
||||||
goto bm_done;
|
goto bm_done;
|
||||||
case GBM_MAIN_MENU:
|
case SPBM_MAIN_MENU:
|
||||||
res=GE_CONT;
|
res=SPE_CONT;
|
||||||
goto bm_done;
|
goto bm_done;
|
||||||
case GBM_COLOR:
|
case SPBM_COLOR:
|
||||||
i=PopUpColor(,,FALSE);
|
i=PopUpColor(,,FALSE);
|
||||||
if (i>=0) color=i;
|
if (i>=0) color=i;
|
||||||
goto bm_menu;
|
goto bm_menu;
|
||||||
case GBM_FIND_AND_REPLACE:
|
case SPBM_FIND_AND_REPLACE:
|
||||||
i=PopUpColor("Find Color\n",,FALSE);
|
i=PopUpColor("Find Color\n",,FALSE);
|
||||||
if (i>=0) {
|
if (i>=0) {
|
||||||
j=PopUpColor("Replace Color\n",,FALSE);
|
j=PopUpColor("Replace Color\n",,FALSE);
|
||||||
@@ -275,43 +275,43 @@ bm_menu:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
goto bm_menu;
|
goto bm_menu;
|
||||||
case GBM_TRIM_TO_EXTENTS:
|
case SPBM_TRIM_TO_EXTENTS:
|
||||||
GrBitMapEdTrimToExtents(&img,&xx1,&yy1,&xx2,&yy2,bkcolor);
|
GrBitMapEdTrimToExtents(&img,&xx1,&yy1,&xx2,&yy2,bkcolor);
|
||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
goto bm_menu;
|
goto bm_menu;
|
||||||
case GBM_ADD_OUTLINE:
|
case SPBM_ADD_OUTLINE:
|
||||||
i=PopUpRangeI64(1,16,1,"Outline Width\n");
|
i=PopUpRangeI64(1,16,1,"Outline Width\n");
|
||||||
if (i>=0) {
|
if (i>=0) {
|
||||||
GrBitMapEdAddOutline(img,i,color,bkcolor);
|
GrBitMapEdAddOutline(img,i,color,bkcolor);
|
||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
}
|
}
|
||||||
goto bm_menu;
|
goto bm_menu;
|
||||||
case GBM_ETCH:
|
case SPBM_ETCH:
|
||||||
i=PopUpRangeI64(1,16,1,"Etch Width\n");
|
i=PopUpRangeI64(1,16,1,"Etch Width\n");
|
||||||
if (i>=0) {
|
if (i>=0) {
|
||||||
GrBitMapEdEtch(img,i,bkcolor);
|
GrBitMapEdEtch(img,i,bkcolor);
|
||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
}
|
}
|
||||||
goto bm_menu;
|
goto bm_menu;
|
||||||
case GBM_SAVE_BMP:
|
case SPBM_SAVE_BMP:
|
||||||
*filename.name=0;
|
*filename.name=0;
|
||||||
if (DocForm(&filename) && *filename.name)
|
if (DocForm(&filename) && *filename.name)
|
||||||
BMPWrite(filename.name,img);
|
BMPWrite(filename.name,img);
|
||||||
goto bm_menu;
|
goto bm_menu;
|
||||||
case GBM_SAVE_GRA:
|
case SPBM_SAVE_GRA:
|
||||||
*filename.name=0;
|
*filename.name=0;
|
||||||
if (DocForm(&filename) && *filename.name)
|
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;
|
goto bm_menu;
|
||||||
case GBM_DITHER_COLOR:
|
case SPBM_DITHER_COLOR:
|
||||||
i=PopUpColorDither;
|
i=PopUpColorDither;
|
||||||
if (i>=0) color=i;
|
if (i>=0) color=i;
|
||||||
goto bm_menu;
|
goto bm_menu;
|
||||||
case GBM_WIDTH:
|
case SPBM_WIDTH:
|
||||||
i=PopUpRangeI64(1,16,1,"Pen Width\n");
|
i=PopUpRangeI64(1,16,1,"Pen Width\n");
|
||||||
if (i>=0) width=i;
|
if (i>=0) width=i;
|
||||||
goto bm_menu;
|
goto bm_menu;
|
||||||
case GBM_UNDO:
|
case SPBM_UNDO:
|
||||||
if (undo) {
|
if (undo) {
|
||||||
DCFill(img,bkcolor);
|
DCFill(img,bkcolor);
|
||||||
img->color=ROP_EQU;
|
img->color=ROP_EQU;
|
||||||
@@ -320,24 +320,24 @@ bm_menu:
|
|||||||
undo=NULL;
|
undo=NULL;
|
||||||
}
|
}
|
||||||
goto bm_menu;
|
goto bm_menu;
|
||||||
case GBM_PT:
|
case SPBM_PT:
|
||||||
case GBM_LINE:
|
case SPBM_LINE:
|
||||||
case GBM_ARROW:
|
case SPBM_ARROW:
|
||||||
case GBM_RECT:
|
case SPBM_RECT:
|
||||||
case GBM_CIRCLE:
|
case SPBM_CIRCLE:
|
||||||
case GBM_FLOOD_FILL:
|
case SPBM_FLOOD_FILL:
|
||||||
case GBM_FLOOD_FILL_NOT:
|
case SPBM_FLOOD_FILL_NOT:
|
||||||
case GBM_POLYPT:
|
case SPBM_POLYPT:
|
||||||
case GBM_POLYLINE:
|
case SPBM_POLYLINE:
|
||||||
case GBM_COPY:
|
case SPBM_COPY:
|
||||||
case GBM_DELETE:
|
case SPBM_DELETE:
|
||||||
case GBM_PASTE:
|
case SPBM_PASTE:
|
||||||
case GBM_PASTE_TRANSPARENT:
|
case SPBM_PASTE_TRANSPARENT:
|
||||||
mode=i;
|
mode=i;
|
||||||
break;
|
break;
|
||||||
case GBM_TEXT:
|
case SPBM_TEXT:
|
||||||
case GBM_TEXT_BOX:
|
case SPBM_TEXT_BOX:
|
||||||
case GBM_TEXT_DIAMOND:
|
case SPBM_TEXT_DIAMOND:
|
||||||
Free(st);
|
Free(st);
|
||||||
st=PopUpGetStr("Enter text and press <ESC>.\n");
|
st=PopUpGetStr("Enter text and press <ESC>.\n");
|
||||||
if (st && *st)
|
if (st && *st)
|
||||||
@@ -349,13 +349,13 @@ bm_menu:
|
|||||||
DCDel(undo);
|
DCDel(undo);
|
||||||
undo=DCExt(img,0,0,img->width-1,img->height-1);
|
undo=DCExt(img,0,0,img->width-1,img->height-1);
|
||||||
undo->bkcolor=bkcolor;
|
undo->bkcolor=bkcolor;
|
||||||
WinMgrSync(2,TRUE); //Let popup close
|
Refresh(2,TRUE); //Let popup close
|
||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
down=FALSE;
|
down=FALSE;
|
||||||
break;
|
break;
|
||||||
case MSG_IP_L_DOWN:
|
case MSG_IP_L_DOWN:
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case GBM_PT:
|
case SPBM_PT:
|
||||||
img->color=color;
|
img->color=color;
|
||||||
img->pen_width=width;
|
img->pen_width=width;
|
||||||
GrPlot3(img,a1-xx1,a2-yy1,0);
|
GrPlot3(img,a1-xx1,a2-yy1,0);
|
||||||
@@ -368,31 +368,31 @@ bm_menu:
|
|||||||
down=TRUE;
|
down=TRUE;
|
||||||
dc->color=color;
|
dc->color=color;
|
||||||
dc->pen_width=width;
|
dc->pen_width=width;
|
||||||
case GBM_LINE:
|
case SPBM_LINE:
|
||||||
GrLine3(dc,x1,y1,0,a1,a2,0);
|
GrLine3(dc,x1,y1,0,a1,a2,0);
|
||||||
break;
|
break;
|
||||||
case GBM_ARROW:
|
case SPBM_ARROW:
|
||||||
GrArrow3(dc,x1,y1,0,a1,a2,0);
|
GrArrow3(dc,x1,y1,0,a1,a2,0);
|
||||||
break;
|
break;
|
||||||
case GBM_RECT:
|
case SPBM_RECT:
|
||||||
GrRect(dc,x1,y1,1,1);
|
GrRect(dc,x1,y1,1,1);
|
||||||
break;
|
break;
|
||||||
case GBM_CIRCLE:
|
case SPBM_CIRCLE:
|
||||||
GrCircle3(dc,x1,y1,0,1);
|
GrCircle3(dc,x1,y1,0,1);
|
||||||
break;
|
break;
|
||||||
case GBM_COPY:
|
case SPBM_COPY:
|
||||||
case GBM_DELETE:
|
case SPBM_DELETE:
|
||||||
dc->color=ROPF_DITHER+WHITE<<16+BLACK;
|
dc->color=ROPF_DITHER+WHITE<<16+BLACK;
|
||||||
dc->pen_width=1;
|
dc->pen_width=1;
|
||||||
GrBorder(dc,x1,y1,x1,y1);
|
GrBorder(dc,x1,y1,x1,y1);
|
||||||
break;
|
break;
|
||||||
end:
|
end:
|
||||||
break;
|
break;
|
||||||
case GBM_PASTE:
|
case SPBM_PASTE:
|
||||||
case GBM_PASTE_TRANSPARENT:
|
case SPBM_PASTE_TRANSPARENT:
|
||||||
if (clipboard) {
|
if (clipboard) {
|
||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
if (mode==GBM_PASTE) {
|
if (mode==SPBM_PASTE) {
|
||||||
clipboard->flags|=DCF_NO_TRANSPARENTS;
|
clipboard->flags|=DCF_NO_TRANSPARENTS;
|
||||||
GrBlot(dc,a1,a2,clipboard);
|
GrBlot(dc,a1,a2,clipboard);
|
||||||
clipboard->flags&=~DCF_NO_TRANSPARENTS;
|
clipboard->flags&=~DCF_NO_TRANSPARENTS;
|
||||||
@@ -404,32 +404,32 @@ bm_menu:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GBM_TEXT:
|
case SPBM_TEXT:
|
||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
dc->color=color;
|
dc->color=color;
|
||||||
GrPrint(dc,a1,a2,"%s",st);
|
GrPrint(dc,a1,a2,"%s",st);
|
||||||
break;
|
break;
|
||||||
case GBM_TEXT_BOX:
|
case SPBM_TEXT_BOX:
|
||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
dc->color=color;
|
dc->color=color;
|
||||||
GrTextBox3(dc,a1,a2,0,st);
|
GrTextBox3(dc,a1,a2,0,st);
|
||||||
break;
|
break;
|
||||||
case GBM_TEXT_DIAMOND:
|
case SPBM_TEXT_DIAMOND:
|
||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
dc->color=color;
|
dc->color=color;
|
||||||
GrTextDiamond3(dc,a1,a2,0,st);
|
GrTextDiamond3(dc,a1,a2,0,st);
|
||||||
break;
|
break;
|
||||||
case GBM_FLOOD_FILL:
|
case SPBM_FLOOD_FILL:
|
||||||
img->color=color;
|
img->color=color;
|
||||||
GrFloodFill(img,a1-xx1,a2-yy1);
|
GrFloodFill(img,a1-xx1,a2-yy1);
|
||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
break;
|
break;
|
||||||
case GBM_FLOOD_FILL_NOT:
|
case SPBM_FLOOD_FILL_NOT:
|
||||||
img->color=color;
|
img->color=color;
|
||||||
GrFloodFill(img,a1-xx1,a2-yy1,TRUE);
|
GrFloodFill(img,a1-xx1,a2-yy1,TRUE);
|
||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
break;
|
break;
|
||||||
case GBM_POLYLINE:
|
case SPBM_POLYLINE:
|
||||||
if (!down) {
|
if (!down) {
|
||||||
x1=a1; y1=a2;
|
x1=a1; y1=a2;
|
||||||
down=TRUE;
|
down=TRUE;
|
||||||
@@ -438,7 +438,7 @@ bm_menu:
|
|||||||
GrLine3(dc,x1,y1,0,a1,a2,0);
|
GrLine3(dc,x1,y1,0,a1,a2,0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GBM_POLYPT:
|
case SPBM_POLYPT:
|
||||||
x1=a1; y1=a2;
|
x1=a1; y1=a2;
|
||||||
down=TRUE;
|
down=TRUE;
|
||||||
img->color=color;
|
img->color=color;
|
||||||
@@ -450,20 +450,20 @@ bm_menu:
|
|||||||
break;
|
break;
|
||||||
case MSG_IP_MOVE:
|
case MSG_IP_MOVE:
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case GBM_LINE:
|
case SPBM_LINE:
|
||||||
case GBM_ARROW:
|
case SPBM_ARROW:
|
||||||
case GBM_POLYLINE:
|
case SPBM_POLYLINE:
|
||||||
if (down) {
|
if (down) {
|
||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
dc->color=color;
|
dc->color=color;
|
||||||
dc->pen_width=width;
|
dc->pen_width=width;
|
||||||
if (mode==GBM_ARROW)
|
if (mode==SPBM_ARROW)
|
||||||
GrArrow3(dc,x1,y1,0,a1,a2,0);
|
GrArrow3(dc,x1,y1,0,a1,a2,0);
|
||||||
else
|
else
|
||||||
GrLine3(dc,x1,y1,0,a1,a2,0);
|
GrLine3(dc,x1,y1,0,a1,a2,0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GBM_RECT:
|
case SPBM_RECT:
|
||||||
if (down) {
|
if (down) {
|
||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
if (x1<a1) {
|
if (x1<a1) {
|
||||||
@@ -484,8 +484,8 @@ bm_menu:
|
|||||||
GrRect(dc,x11,y11,x22-x11+1,y22-y11+1);
|
GrRect(dc,x11,y11,x22-x11+1,y22-y11+1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GBM_COPY:
|
case SPBM_COPY:
|
||||||
case GBM_DELETE:
|
case SPBM_DELETE:
|
||||||
if (down) {
|
if (down) {
|
||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
if (x1<a1) {
|
if (x1<a1) {
|
||||||
@@ -507,7 +507,7 @@ bm_menu:
|
|||||||
GrBorder(dc,x11,y11,x22,y22);
|
GrBorder(dc,x11,y11,x22,y22);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GBM_CIRCLE:
|
case SPBM_CIRCLE:
|
||||||
if (down) {
|
if (down) {
|
||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
dc->color=color;
|
dc->color=color;
|
||||||
@@ -515,11 +515,11 @@ bm_menu:
|
|||||||
GrCircle3(dc,x1,y1,0,Sqrt(SqrI64(a1-x1)+SqrI64(a2-y1)));
|
GrCircle3(dc,x1,y1,0,Sqrt(SqrI64(a1-x1)+SqrI64(a2-y1)));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GBM_PASTE:
|
case SPBM_PASTE:
|
||||||
case GBM_PASTE_TRANSPARENT:
|
case SPBM_PASTE_TRANSPARENT:
|
||||||
if (clipboard) {
|
if (clipboard) {
|
||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
if (mode==GBM_PASTE) {
|
if (mode==SPBM_PASTE) {
|
||||||
clipboard->flags|=DCF_NO_TRANSPARENTS;
|
clipboard->flags|=DCF_NO_TRANSPARENTS;
|
||||||
GrBlot(dc,a1,a2,clipboard);
|
GrBlot(dc,a1,a2,clipboard);
|
||||||
clipboard->flags&=~DCF_NO_TRANSPARENTS;
|
clipboard->flags&=~DCF_NO_TRANSPARENTS;
|
||||||
@@ -531,22 +531,22 @@ bm_menu:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GBM_TEXT:
|
case SPBM_TEXT:
|
||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
dc->color=color;
|
dc->color=color;
|
||||||
GrPrint(dc,a1,a2,"%s",st);
|
GrPrint(dc,a1,a2,"%s",st);
|
||||||
break;
|
break;
|
||||||
case GBM_TEXT_BOX:
|
case SPBM_TEXT_BOX:
|
||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
dc->color=color;
|
dc->color=color;
|
||||||
GrTextBox3(dc,a1,a2,0,st);
|
GrTextBox3(dc,a1,a2,0,st);
|
||||||
break;
|
break;
|
||||||
case GBM_TEXT_DIAMOND:
|
case SPBM_TEXT_DIAMOND:
|
||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
dc->color=color;
|
dc->color=color;
|
||||||
GrTextDiamond3(dc,a1,a2,0,st);
|
GrTextDiamond3(dc,a1,a2,0,st);
|
||||||
break;
|
break;
|
||||||
case GBM_POLYPT:
|
case SPBM_POLYPT:
|
||||||
if (down) {
|
if (down) {
|
||||||
img->color=color;
|
img->color=color;
|
||||||
img->pen_width=width;
|
img->pen_width=width;
|
||||||
@@ -559,23 +559,23 @@ bm_menu:
|
|||||||
break;
|
break;
|
||||||
case MSG_IP_L_UP:
|
case MSG_IP_L_UP:
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case GBM_LINE:
|
case SPBM_LINE:
|
||||||
case GBM_ARROW:
|
case SPBM_ARROW:
|
||||||
case GBM_POLYPT:
|
case SPBM_POLYPT:
|
||||||
case GBM_POLYLINE:
|
case SPBM_POLYLINE:
|
||||||
img->color=color;
|
img->color=color;
|
||||||
img->pen_width=width;
|
img->pen_width=width;
|
||||||
if (mode==GBM_ARROW)
|
if (mode==SPBM_ARROW)
|
||||||
GrArrow3(img,x1-xx1,y1-yy1,0,a1-xx1,a2-yy1,0);
|
GrArrow3(img,x1-xx1,y1-yy1,0,a1-xx1,a2-yy1,0);
|
||||||
else
|
else
|
||||||
GrLine3(img,x1-xx1,y1-yy1,0,a1-xx1,a2-yy1,0);
|
GrLine3(img,x1-xx1,y1-yy1,0,a1-xx1,a2-yy1,0);
|
||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
if (mode==GBM_POLYLINE) {
|
if (mode==SPBM_POLYLINE) {
|
||||||
x1=a1; y1=a2;
|
x1=a1; y1=a2;
|
||||||
} else
|
} else
|
||||||
down=FALSE;
|
down=FALSE;
|
||||||
break;
|
break;
|
||||||
case GBM_RECT:
|
case SPBM_RECT:
|
||||||
img->color=color;
|
img->color=color;
|
||||||
if (x1<a1) {
|
if (x1<a1) {
|
||||||
x11=x1;
|
x11=x1;
|
||||||
@@ -595,8 +595,8 @@ bm_menu:
|
|||||||
down=FALSE;
|
down=FALSE;
|
||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
break;
|
break;
|
||||||
case GBM_COPY:
|
case SPBM_COPY:
|
||||||
case GBM_DELETE:
|
case SPBM_DELETE:
|
||||||
if (x1<a1) {
|
if (x1<a1) {
|
||||||
x11=x1;
|
x11=x1;
|
||||||
x22=a1;
|
x22=a1;
|
||||||
@@ -614,23 +614,23 @@ bm_menu:
|
|||||||
DCDel(clipboard);
|
DCDel(clipboard);
|
||||||
clipboard=DCExt(img,x11-xx1,y11-yy1,x22-xx1,y22-yy1);
|
clipboard=DCExt(img,x11-xx1,y11-yy1,x22-xx1,y22-yy1);
|
||||||
clipboard->bkcolor=bkcolor;
|
clipboard->bkcolor=bkcolor;
|
||||||
if (mode==GBM_DELETE) {
|
if (mode==SPBM_DELETE) {
|
||||||
img->color=bkcolor;
|
img->color=bkcolor;
|
||||||
GrRect(img,x11-xx1,y11-yy1,x22-x11+1,y22-y11+1);
|
GrRect(img,x11-xx1,y11-yy1,x22-x11+1,y22-y11+1);
|
||||||
}
|
}
|
||||||
goto bm_menu;
|
goto bm_menu;
|
||||||
case GBM_CIRCLE:
|
case SPBM_CIRCLE:
|
||||||
img->color=color;
|
img->color=color;
|
||||||
img->pen_width=width;
|
img->pen_width=width;
|
||||||
GrCircle3(img,x1-xx1,y1-yy1,0,Sqrt(SqrI64(a1-x1)+SqrI64(a2-y1)));
|
GrCircle3(img,x1-xx1,y1-yy1,0,Sqrt(SqrI64(a1-x1)+SqrI64(a2-y1)));
|
||||||
down=FALSE;
|
down=FALSE;
|
||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
break;
|
break;
|
||||||
case GBM_PASTE:
|
case SPBM_PASTE:
|
||||||
case GBM_PASTE_TRANSPARENT:
|
case SPBM_PASTE_TRANSPARENT:
|
||||||
if (clipboard) {
|
if (clipboard) {
|
||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
if (mode==GBM_PASTE) {
|
if (mode==SPBM_PASTE) {
|
||||||
clipboard->flags|=DCF_NO_TRANSPARENTS;
|
clipboard->flags|=DCF_NO_TRANSPARENTS;
|
||||||
GrBlot(img,a1-xx1,a2-yy1,clipboard);
|
GrBlot(img,a1-xx1,a2-yy1,clipboard);
|
||||||
clipboard->flags&=~DCF_NO_TRANSPARENTS;
|
clipboard->flags&=~DCF_NO_TRANSPARENTS;
|
||||||
@@ -643,15 +643,15 @@ bm_menu:
|
|||||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GBM_TEXT:
|
case SPBM_TEXT:
|
||||||
img->color=color;
|
img->color=color;
|
||||||
GrPrint(img,a1-xx1,a2-yy1,"%s",st);
|
GrPrint(img,a1-xx1,a2-yy1,"%s",st);
|
||||||
goto bm_menu;
|
goto bm_menu;
|
||||||
case GBM_TEXT_BOX:
|
case SPBM_TEXT_BOX:
|
||||||
img->color=color;
|
img->color=color;
|
||||||
GrTextBox3(img,a1-xx1,a2-yy1,0,st);
|
GrTextBox3(img,a1-xx1,a2-yy1,0,st);
|
||||||
goto bm_menu;
|
goto bm_menu;
|
||||||
case GBM_TEXT_DIAMOND:
|
case SPBM_TEXT_DIAMOND:
|
||||||
img->color=color;
|
img->color=color;
|
||||||
GrTextDiamond3(img,a1-xx1,a2-yy1,0,st);
|
GrTextDiamond3(img,a1-xx1,a2-yy1,0,st);
|
||||||
goto bm_menu;
|
goto bm_menu;
|
||||||
@@ -659,7 +659,7 @@ bm_menu:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WinMgrSync;
|
Refresh;
|
||||||
}
|
}
|
||||||
bm_key_up_done:
|
bm_key_up_done:
|
||||||
GetMsg(,,1<<MSG_KEY_UP);
|
GetMsg(,,1<<MSG_KEY_UP);
|
||||||
|
|||||||
+117
-117
@@ -1,6 +1,6 @@
|
|||||||
#help_index "Graphics/Sprite;Sprites"
|
#help_index "Graphics/Sprite;Sprites"
|
||||||
|
|
||||||
U0 SpriteElem2Code(CDoc *doc,CSprite *tempg)
|
U0 SpriteElem2Code(CDoc *doc,CSprite *tmpg)
|
||||||
{
|
{
|
||||||
U8 buf1[STR_LEN],buf2[STR_LEN];
|
U8 buf1[STR_LEN],buf2[STR_LEN];
|
||||||
I32 *ptr;
|
I32 *ptr;
|
||||||
@@ -8,16 +8,16 @@ U0 SpriteElem2Code(CDoc *doc,CSprite *tempg)
|
|||||||
CD3I32 *p;
|
CD3I32 *p;
|
||||||
CMeshTri *tri;
|
CMeshTri *tri;
|
||||||
if (!doc) doc=DocPut;
|
if (!doc) doc=DocPut;
|
||||||
DocPrint(doc,"%Z",tempg->type,"ST_SPRITE_ELEM_CODES");
|
DocPrint(doc,"%Z",tmpg->type,"ST_SPRITE_ELEM_CODES");
|
||||||
switch (tempg->type) {
|
switch (tmpg->type) {
|
||||||
case SPT_COLOR:
|
case SPT_COLOR:
|
||||||
DocPrint(doc,"{%s}",
|
DocPrint(doc,"{%s}",
|
||||||
Color2Str(buf1,tempg->c.color));
|
Color2Str(buf1,tmpg->c.color));
|
||||||
break;
|
break;
|
||||||
case SPT_DITHER_COLOR:
|
case SPT_DITHER_COLOR:
|
||||||
DocPrint(doc,"{%s}",
|
DocPrint(doc,"{%s}",
|
||||||
Color2Str(buf2,ROPF_DITHER|tempg->d.dither_color.u8[0]|
|
Color2Str(buf2,ROPF_DITHER|tmpg->d.dither_color.u8[0]|
|
||||||
tempg->d.dither_color.u8[1]<<COLORROP_BITS));
|
tmpg->d.dither_color.u8[1]<<COLORROP_BITS));
|
||||||
break;
|
break;
|
||||||
case SPT_TRANSFORM_ON:
|
case SPT_TRANSFORM_ON:
|
||||||
DocPrint(doc,"{ON}");
|
DocPrint(doc,"{ON}");
|
||||||
@@ -28,54 +28,54 @@ U0 SpriteElem2Code(CDoc *doc,CSprite *tempg)
|
|||||||
case SPT_LINE:
|
case SPT_LINE:
|
||||||
case SPT_ARROW:
|
case SPT_ARROW:
|
||||||
case SPT_PLANAR_SYMMETRY:
|
case SPT_PLANAR_SYMMETRY:
|
||||||
DocPrint(doc,"{(%d,%d),(%d,%d)}",tempg->pp.x1,tempg->pp.y1,
|
DocPrint(doc,"{(%d,%d),(%d,%d)}",tmpg->pp.x1,tmpg->pp.y1,
|
||||||
tempg->pp.x2,tempg->pp.y2);
|
tmpg->pp.x2,tmpg->pp.y2);
|
||||||
break;
|
break;
|
||||||
case SPT_RECT:
|
case SPT_RECT:
|
||||||
DocPrint(doc,"{(%d,%d):(%d,%d)}",tempg->pp.x1,tempg->pp.y1,
|
DocPrint(doc,"{(%d,%d):(%d,%d)}",tmpg->pp.x1,tmpg->pp.y1,
|
||||||
tempg->pp.x2-tempg->pp.x1,tempg->pp.y2-tempg->pp.y1);
|
tmpg->pp.x2-tmpg->pp.x1,tmpg->pp.y2-tmpg->pp.y1);
|
||||||
break;
|
break;
|
||||||
case SPT_ROTATED_RECT:
|
case SPT_ROTATED_RECT:
|
||||||
DocPrint(doc,"{(%d,%d):(%d,%d),%0.4f}",tempg->ppa.x1,tempg->ppa.y1,
|
DocPrint(doc,"{(%d,%d):(%d,%d),%0.4f}",tmpg->ppa.x1,tmpg->ppa.y1,
|
||||||
tempg->ppa.x2-tempg->ppa.x1,tempg->ppa.y2-tempg->ppa.y1,
|
tmpg->ppa.x2-tmpg->ppa.x1,tmpg->ppa.y2-tmpg->ppa.y1,
|
||||||
180/ã*Wrap(tempg->ppa.angle));
|
180/ã*Wrap(tmpg->ppa.angle));
|
||||||
break;
|
break;
|
||||||
case SPT_PT:
|
case SPT_PT:
|
||||||
case SPT_FLOOD_FILL:
|
case SPT_FLOOD_FILL:
|
||||||
case SPT_SHIFT:
|
case SPT_SHIFT:
|
||||||
DocPrint(doc,"{(%d,%d)}",tempg->p.x1,tempg->p.y1);
|
DocPrint(doc,"{(%d,%d)}",tmpg->p.x1,tmpg->p.y1);
|
||||||
break;
|
break;
|
||||||
case SPT_FLOOD_FILL_NOT:
|
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;
|
break;
|
||||||
case SPT_CIRCLE:
|
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;
|
break;
|
||||||
case SPT_WIDTH:
|
case SPT_WIDTH:
|
||||||
DocPrint(doc,"{%d}",tempg->w.width);
|
DocPrint(doc,"{%d}",tmpg->w.width);
|
||||||
break;
|
break;
|
||||||
case SPT_ELLIPSE:
|
case SPT_ELLIPSE:
|
||||||
DocPrint(doc,"{(%d,%d):(%d,%d),%0.4f}",tempg->pwha.x1,tempg->pwha.y1,
|
DocPrint(doc,"{(%d,%d):(%d,%d),%0.4f}",tmpg->pwha.x1,tmpg->pwha.y1,
|
||||||
tempg->pwha.width,tempg->pwha.height,180/ã*Wrap(tempg->pwha.angle));
|
tmpg->pwha.width,tmpg->pwha.height,180/ã*Wrap(tmpg->pwha.angle));
|
||||||
break;
|
break;
|
||||||
case SPT_POLYGON:
|
case SPT_POLYGON:
|
||||||
DocPrint(doc,"{%d,(%d,%d):(%d,%d),%0.4f}",tempg->pwhas.sides,
|
DocPrint(doc,"{%d,(%d,%d):(%d,%d),%0.4f}",tmpg->pwhas.sides,
|
||||||
tempg->pwhas.x1,tempg->pwhas.y1,
|
tmpg->pwhas.x1,tmpg->pwhas.y1,
|
||||||
tempg->pwhas.width,tempg->pwhas.height,
|
tmpg->pwhas.width,tmpg->pwhas.height,
|
||||||
180/ã*Wrap(tempg->pwhas.angle));
|
180/ã*Wrap(tmpg->pwhas.angle));
|
||||||
break;
|
break;
|
||||||
case SPT_TEXT:
|
case SPT_TEXT:
|
||||||
case SPT_TEXT_BOX:
|
case SPT_TEXT_BOX:
|
||||||
case SPT_TEXT_DIAMOND:
|
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;
|
break;
|
||||||
case SPT_POLYLINE:
|
case SPT_POLYLINE:
|
||||||
ptr=&tempg->nu.u;
|
ptr=&tmpg->nu.u;
|
||||||
DocPrint(doc,"{");
|
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]);
|
DocPrint(doc,"(%d,%d)",ptr[0],ptr[1]);
|
||||||
if (i+1<tempg->nu.num) DocPrint(doc,",");
|
if (i+1<tmpg->nu.num) DocPrint(doc,",");
|
||||||
if (i&3==3 && i+1<tempg->nu.num)
|
if (i&3==3 && i+1<tmpg->nu.num)
|
||||||
DocPrint(doc,"\n");
|
DocPrint(doc,"\n");
|
||||||
}
|
}
|
||||||
DocPrint(doc,"}");
|
DocPrint(doc,"}");
|
||||||
@@ -84,26 +84,26 @@ U0 SpriteElem2Code(CDoc *doc,CSprite *tempg)
|
|||||||
case SPT_BSPLINE3:
|
case SPT_BSPLINE3:
|
||||||
case SPT_BSPLINE2_CLOSED:
|
case SPT_BSPLINE2_CLOSED:
|
||||||
case SPT_BSPLINE3_CLOSED:
|
case SPT_BSPLINE3_CLOSED:
|
||||||
ptr=&tempg->nu.u;
|
ptr=&tmpg->nu.u;
|
||||||
DocPrint(doc,"{");
|
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]);
|
DocPrint(doc,"(%d,%d,%d)",ptr[0],ptr[1],ptr[2]);
|
||||||
if (i+1<tempg->nu.num) DocPrint(doc,",");
|
if (i+1<tmpg->nu.num) DocPrint(doc,",");
|
||||||
if (i&3==3 && i+1<tempg->nu.num)
|
if (i&3==3 && i+1<tmpg->nu.num)
|
||||||
DocPrint(doc,"\n");
|
DocPrint(doc,"\n");
|
||||||
}
|
}
|
||||||
if (tempg->type==SPT_BSPLINE2||tempg->type==SPT_BSPLINE3)
|
if (tmpg->type==SPT_BSPLINE2||tmpg->type==SPT_BSPLINE3)
|
||||||
DocPrint(doc,",FALSE}");
|
DocPrint(doc,",FALSE}");
|
||||||
else
|
else
|
||||||
DocPrint(doc,",TRUE}");
|
DocPrint(doc,",TRUE}");
|
||||||
break;
|
break;
|
||||||
case SPT_POLYPT:
|
case SPT_POLYPT:
|
||||||
DocPrint(doc,"{(%d,%d),",tempg->npu.x,tempg->npu.y);
|
DocPrint(doc,"{(%d,%d),",tmpg->npu.x,tmpg->npu.y);
|
||||||
ptr=&tempg->npu.u;
|
ptr=&tmpg->npu.u;
|
||||||
col=16;
|
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));
|
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");
|
DocPrint(doc,"\n");
|
||||||
col=0;
|
col=0;
|
||||||
}
|
}
|
||||||
@@ -111,24 +111,24 @@ U0 SpriteElem2Code(CDoc *doc,CSprite *tempg)
|
|||||||
DocPrint(doc,"}");
|
DocPrint(doc,"}");
|
||||||
break;
|
break;
|
||||||
case SPT_BITMAP:
|
case SPT_BITMAP:
|
||||||
DocPrint(doc,"{(%d,%d):(%d,%d),\n",tempg->pwhu.x1,tempg->pwhu.y1,
|
DocPrint(doc,"{(%d,%d):(%d,%d),\n",tmpg->pwhu.x1,tmpg->pwhu.y1,
|
||||||
tempg->pwhu.width,tempg->pwhu.height);
|
tmpg->pwhu.width,tmpg->pwhu.height);
|
||||||
width_internal=(tempg->pwhu.width+7)&~7;
|
width_internal=(tmpg->pwhu.width+7)&~7;
|
||||||
if (width_internal<80)
|
if (width_internal<80)
|
||||||
k=width_internal;
|
k=width_internal;
|
||||||
else
|
else
|
||||||
k=64;
|
k=64;
|
||||||
ptr=&tempg->pwhu.u;
|
ptr=&tmpg->pwhu.u;
|
||||||
col=0;
|
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 *)++) {
|
for (i=0;i<width_internal;i++,ptr(U8 *)++) {
|
||||||
if (i>=tempg->pwhu.width)
|
if (i>=tmpg->pwhu.width)
|
||||||
DocPrint(doc,"_");
|
DocPrint(doc,"_");
|
||||||
else if (*ptr(U8 *)<16)
|
else if (*ptr(U8 *)<16)
|
||||||
DocPrint(doc,"%X",*ptr(U8 *));
|
DocPrint(doc,"%X",*ptr(U8 *));
|
||||||
else
|
else
|
||||||
DocPrint(doc,"%c",CH_SHIFT_SPACE);
|
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");
|
DocPrint(doc,"\n");
|
||||||
col=0;
|
col=0;
|
||||||
}
|
}
|
||||||
@@ -137,11 +137,11 @@ U0 SpriteElem2Code(CDoc *doc,CSprite *tempg)
|
|||||||
break;
|
break;
|
||||||
case SPT_MESH:
|
case SPT_MESH:
|
||||||
DocPrint(doc,"{FALSE,");
|
DocPrint(doc,"{FALSE,");
|
||||||
p=&tempg->mu.u;
|
p=&tmpg->mu.u;
|
||||||
col=0;
|
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);
|
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) {
|
if (++col==4) {
|
||||||
DocPrint(doc,"\t//%d\n",i);
|
DocPrint(doc,"\t//%d\n",i);
|
||||||
col=0;
|
col=0;
|
||||||
@@ -149,11 +149,11 @@ U0 SpriteElem2Code(CDoc *doc,CSprite *tempg)
|
|||||||
}
|
}
|
||||||
DocPrint(doc,":");
|
DocPrint(doc,":");
|
||||||
tri=p;
|
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),
|
DocPrint(doc,"(%s,%d,%d,%d)",Color2Str(buf1,tri->color),
|
||||||
tri->nums[0],tri->nums[1],tri->nums[2]);
|
tri->nums[0],tri->nums[1],tri->nums[2]);
|
||||||
if (i+1<tempg->mu.tri_cnt) DocPrint(doc,",");
|
if (i+1<tmpg->mu.tri_cnt) DocPrint(doc,",");
|
||||||
if (++col>=3 && i+1<tempg->mu.tri_cnt) {
|
if (++col>=3 && i+1<tmpg->mu.tri_cnt) {
|
||||||
DocPrint(doc,"\n");
|
DocPrint(doc,"\n");
|
||||||
col=0;
|
col=0;
|
||||||
}
|
}
|
||||||
@@ -161,12 +161,12 @@ U0 SpriteElem2Code(CDoc *doc,CSprite *tempg)
|
|||||||
DocPrint(doc,"}");
|
DocPrint(doc,"}");
|
||||||
break;
|
break;
|
||||||
case SPT_SHIFTABLE_MESH:
|
case SPT_SHIFTABLE_MESH:
|
||||||
DocPrint(doc,"{TRUE,(%d,%d,%d):",tempg->pmu.x,tempg->pmu.y,tempg->pmu.z);
|
DocPrint(doc,"{TRUE,(%d,%d,%d):",tmpg->pmu.x,tmpg->pmu.y,tmpg->pmu.z);
|
||||||
p=&tempg->pmu.u;
|
p=&tmpg->pmu.u;
|
||||||
col=1;
|
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);
|
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) {
|
if (++col==4) {
|
||||||
DocPrint(doc,"\t//%d\n",i);
|
DocPrint(doc,"\t//%d\n",i);
|
||||||
col=0;
|
col=0;
|
||||||
@@ -174,11 +174,11 @@ U0 SpriteElem2Code(CDoc *doc,CSprite *tempg)
|
|||||||
}
|
}
|
||||||
DocPrint(doc,":");
|
DocPrint(doc,":");
|
||||||
tri=p;
|
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),
|
DocPrint(doc,"(%s,%d,%d,%d)",Color2Str(buf1,tri->color),
|
||||||
tri->nums[0],tri->nums[1],tri->nums[2]);
|
tri->nums[0],tri->nums[1],tri->nums[2]);
|
||||||
if (i+1<tempg->pmu.tri_cnt) DocPrint(doc,",");
|
if (i+1<tmpg->pmu.tri_cnt) DocPrint(doc,",");
|
||||||
if (++col>=3 && i+1<tempg->pmu.tri_cnt) {
|
if (++col>=3 && i+1<tmpg->pmu.tri_cnt) {
|
||||||
DocPrint(doc,"\n");
|
DocPrint(doc,"\n");
|
||||||
col=0;
|
col=0;
|
||||||
}
|
}
|
||||||
@@ -191,10 +191,10 @@ U0 SpriteElem2Code(CDoc *doc,CSprite *tempg)
|
|||||||
|
|
||||||
public U0 Sprite2Code(CDoc *doc=NULL,U8 *elems)
|
public U0 Sprite2Code(CDoc *doc=NULL,U8 *elems)
|
||||||
{//Sprite to text.
|
{//Sprite to text.
|
||||||
CSprite *tempg=elems-offset(CSprite.start);
|
CSprite *tmpg=elems-offset(CSprite.start);
|
||||||
while (tempg->type) {
|
while (tmpg->type) {
|
||||||
SpriteElem2Code(doc,tempg);
|
SpriteElem2Code(doc,tmpg);
|
||||||
tempg(U8 *)+=SpriteElemSize(tempg);
|
tmpg(U8 *)+=SpriteElemSize(tmpg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,9 +204,9 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
|||||||
CSprite *res,g;
|
CSprite *res,g;
|
||||||
CColorROPU32 color;
|
CColorROPU32 color;
|
||||||
U8 *st,*ptr;
|
U8 *st,*ptr;
|
||||||
CQueD3I32 headp,*tempp,*tempa1;
|
CQueD3I32 headp,*tmpp,*tmpa1;
|
||||||
CQueMeshTri headt,*tempt,*tempt1;
|
CQueMeshTri headt,*tmpt,*tmpt1;
|
||||||
CQueVectU8 *tempv;
|
CQueVectU8 *tmpv;
|
||||||
MemSet(&g,0,sizeof(CSprite));
|
MemSet(&g,0,sizeof(CSprite));
|
||||||
switch (type) {
|
switch (type) {
|
||||||
start:
|
start:
|
||||||
@@ -340,9 +340,9 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
|||||||
g.type=SPT_POLYLINE;
|
g.type=SPT_POLYLINE;
|
||||||
QueInit(&headp);
|
QueInit(&headp);
|
||||||
while (cc->token=='(') {
|
while (cc->token=='(') {
|
||||||
tempp=CAlloc(sizeof(CQueD3I32));
|
tmpp=CAlloc(sizeof(CQueD3I32));
|
||||||
LexD2I32(cc,&tempp->p);
|
LexD2I32(cc,&tmpp->p);
|
||||||
QueIns(tempp,headp.last);
|
QueIns(tmpp,headp.last);
|
||||||
g.nu.num++;
|
g.nu.num++;
|
||||||
if (cc->token==',')
|
if (cc->token==',')
|
||||||
Lex(cc); //Skip ,
|
Lex(cc); //Skip ,
|
||||||
@@ -353,13 +353,13 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
|||||||
res=MAlloc(size+g.nu.num*sizeof(CD2I32));
|
res=MAlloc(size+g.nu.num*sizeof(CD2I32));
|
||||||
MemCpy(res,&g,size);
|
MemCpy(res,&g,size);
|
||||||
ptr=&res->nu.u;
|
ptr=&res->nu.u;
|
||||||
tempp=headp.next;
|
tmpp=headp.next;
|
||||||
while (tempp!=&headp) {
|
while (tmpp!=&headp) {
|
||||||
tempa1=tempp->next;
|
tmpa1=tmpp->next;
|
||||||
MemCpy(ptr,&tempp->p,sizeof(CD2I32));
|
MemCpy(ptr,&tmpp->p,sizeof(CD2I32));
|
||||||
ptr+=sizeof(CD2I32);
|
ptr+=sizeof(CD2I32);
|
||||||
Free(tempp);
|
Free(tmpp);
|
||||||
tempp=tempa1;
|
tmpp=tmpa1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SPT_BSPLINE2:
|
case SPT_BSPLINE2:
|
||||||
@@ -369,9 +369,9 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
|||||||
Lex(cc); //Skip {
|
Lex(cc); //Skip {
|
||||||
QueInit(&headp);
|
QueInit(&headp);
|
||||||
while (cc->token=='(') {
|
while (cc->token=='(') {
|
||||||
tempp=CAlloc(sizeof(CQueD3I32));
|
tmpp=CAlloc(sizeof(CQueD3I32));
|
||||||
LexD3I32(cc,&tempp->p);
|
LexD3I32(cc,&tmpp->p);
|
||||||
QueIns(tempp,headp.last);
|
QueIns(tmpp,headp.last);
|
||||||
g.nu.num++;
|
g.nu.num++;
|
||||||
if (cc->token==',')
|
if (cc->token==',')
|
||||||
Lex(cc); //Skip ,
|
Lex(cc); //Skip ,
|
||||||
@@ -393,13 +393,13 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
|||||||
}
|
}
|
||||||
MemCpy(res,&g,size);
|
MemCpy(res,&g,size);
|
||||||
ptr=&res->nu.u;
|
ptr=&res->nu.u;
|
||||||
tempp=headp.next;
|
tmpp=headp.next;
|
||||||
while (tempp!=&headp) {
|
while (tmpp!=&headp) {
|
||||||
tempa1=tempp->next;
|
tmpa1=tmpp->next;
|
||||||
MemCpy(ptr,&tempp->p,sizeof(CD3I32));
|
MemCpy(ptr,&tmpp->p,sizeof(CD3I32));
|
||||||
ptr+=sizeof(CD3I32);
|
ptr+=sizeof(CD3I32);
|
||||||
Free(tempp);
|
Free(tmpp);
|
||||||
tempp=tempa1;
|
tmpp=tmpa1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SPT_POLYPT:
|
case SPT_POLYPT:
|
||||||
@@ -407,14 +407,14 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
|||||||
LexD2I32(cc,&g.npu.x);
|
LexD2I32(cc,&g.npu.x);
|
||||||
if (cc->token!=',')
|
if (cc->token!=',')
|
||||||
LexExcept(cc,"Expecting ',' at ");
|
LexExcept(cc,"Expecting ',' at ");
|
||||||
tempv=QueVectU8New;
|
tmpv=QueVectU8New;
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
if (!(i=LexGetChar(cc)))
|
if (!(i=LexGetChar(cc)))
|
||||||
LexExcept(cc,"Expecting '}' at ");
|
LexExcept(cc,"Expecting '}' at ");
|
||||||
if (i=='}')
|
if (i=='}')
|
||||||
break;
|
break;
|
||||||
if ('0'<=i<='7')
|
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);
|
Bts(&cc->flags,CCf_USE_LAST_U16);
|
||||||
Lex(cc); //Load '}'
|
Lex(cc); //Load '}'
|
||||||
@@ -424,8 +424,8 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
|||||||
MemCpy(res,&g,size);
|
MemCpy(res,&g,size);
|
||||||
ptr=&res->npu.u;
|
ptr=&res->npu.u;
|
||||||
for (i=0;i<g.npu.num;i++)
|
for (i=0;i<g.npu.num;i++)
|
||||||
BFieldOrU32(ptr,i*3,QueVectU8Get(tempv,i));
|
BFieldOrU32(ptr,i*3,QueVectU8Get(tmpv,i));
|
||||||
QueVectU8Del(tempv);
|
QueVectU8Del(tmpv);
|
||||||
break;
|
break;
|
||||||
case SPT_BITMAP:
|
case SPT_BITMAP:
|
||||||
Lex(cc); //Skip {
|
Lex(cc); //Skip {
|
||||||
@@ -436,7 +436,7 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
|||||||
LexD2I32(cc,&g.pwhu.width);
|
LexD2I32(cc,&g.pwhu.width);
|
||||||
if (cc->token!=',')
|
if (cc->token!=',')
|
||||||
LexExcept(cc,"Expecting ',' at ");
|
LexExcept(cc,"Expecting ',' at ");
|
||||||
tempv=QueVectU8New;
|
tmpv=QueVectU8New;
|
||||||
num1=0;
|
num1=0;
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
if (!(i=ToUpper(LexGetChar(cc))))
|
if (!(i=ToUpper(LexGetChar(cc))))
|
||||||
@@ -444,13 +444,13 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
|||||||
if (i=='}')
|
if (i=='}')
|
||||||
break;
|
break;
|
||||||
if ('0'<=i<='9')
|
if ('0'<=i<='9')
|
||||||
QueVectU8Put(tempv,num1++,i-'0');
|
QueVectU8Put(tmpv,num1++,i-'0');
|
||||||
else if ('A'<=i<='F')
|
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)
|
else if (i==CH_SPACE||i==CH_SHIFT_SPACE)
|
||||||
QueVectU8Put(tempv,num1++,TRANSPARENT);
|
QueVectU8Put(tmpv,num1++,TRANSPARENT);
|
||||||
else if (i=='_')
|
else if (i=='_')
|
||||||
QueVectU8Put(tempv,num1++,0);
|
QueVectU8Put(tmpv,num1++,0);
|
||||||
}
|
}
|
||||||
Bts(&cc->flags,CCf_USE_LAST_U16);
|
Bts(&cc->flags,CCf_USE_LAST_U16);
|
||||||
Lex(cc); //Load '}'
|
Lex(cc); //Load '}'
|
||||||
@@ -460,8 +460,8 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
|||||||
MemCpy(res,&g,size);
|
MemCpy(res,&g,size);
|
||||||
ptr=&res->pwhu.u;
|
ptr=&res->pwhu.u;
|
||||||
for (i=0;i<num1;i++)
|
for (i=0;i<num1;i++)
|
||||||
*ptr++=QueVectU8Get(tempv,i);
|
*ptr++=QueVectU8Get(tmpv,i);
|
||||||
QueVectU8Del(tempv);
|
QueVectU8Del(tmpv);
|
||||||
break;
|
break;
|
||||||
case SPT_MESH:
|
case SPT_MESH:
|
||||||
case SPT_SHIFTABLE_MESH:
|
case SPT_SHIFTABLE_MESH:
|
||||||
@@ -484,9 +484,9 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
|||||||
num1=0;
|
num1=0;
|
||||||
QueInit(&headp);
|
QueInit(&headp);
|
||||||
while (cc->token=='(') {
|
while (cc->token=='(') {
|
||||||
tempp=CAlloc(sizeof(CQueD3I32));
|
tmpp=CAlloc(sizeof(CQueD3I32));
|
||||||
LexD3I32(cc,&tempp->p);
|
LexD3I32(cc,&tmpp->p);
|
||||||
QueIns(tempp,headp.last);
|
QueIns(tmpp,headp.last);
|
||||||
num1++;
|
num1++;
|
||||||
if (cc->token==',')
|
if (cc->token==',')
|
||||||
Lex(cc); //Skip ,
|
Lex(cc); //Skip ,
|
||||||
@@ -497,27 +497,27 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
|||||||
num2=0;
|
num2=0;
|
||||||
QueInit(&headt);
|
QueInit(&headt);
|
||||||
while (cc->token=='(') {
|
while (cc->token=='(') {
|
||||||
tempt=CAlloc(sizeof(CQueMeshTri));
|
tmpt=CAlloc(sizeof(CQueMeshTri));
|
||||||
st=LexFirstRem(cc,",");
|
st=LexFirstRem(cc,",");
|
||||||
tempt->color=Str2ColorU32(st);
|
tmpt->color=Str2ColorU32(st);
|
||||||
Free(st);
|
Free(st);
|
||||||
Lex(cc); //Skip color
|
Lex(cc); //Skip color
|
||||||
if (cc->token!=',')
|
if (cc->token!=',')
|
||||||
LexExcept(cc,"Expecting ',' at ");
|
LexExcept(cc,"Expecting ',' at ");
|
||||||
Lex(cc); //Skip ,
|
Lex(cc); //Skip ,
|
||||||
tempt->nums[0]=LexExpressionI64(cc);
|
tmpt->nums[0]=LexExpressionI64(cc);
|
||||||
if (cc->token!=',')
|
if (cc->token!=',')
|
||||||
LexExcept(cc,"Expecting ',' at ");
|
LexExcept(cc,"Expecting ',' at ");
|
||||||
Lex(cc); //Skip ,
|
Lex(cc); //Skip ,
|
||||||
tempt->nums[1]=LexExpressionI64(cc);
|
tmpt->nums[1]=LexExpressionI64(cc);
|
||||||
if (cc->token!=',')
|
if (cc->token!=',')
|
||||||
LexExcept(cc,"Expecting ',' at ");
|
LexExcept(cc,"Expecting ',' at ");
|
||||||
Lex(cc); //Skip ,
|
Lex(cc); //Skip ,
|
||||||
tempt->nums[2]=LexExpressionI64(cc);
|
tmpt->nums[2]=LexExpressionI64(cc);
|
||||||
if (cc->token!=')')
|
if (cc->token!=')')
|
||||||
LexExcept(cc,"Expecting ')' at ");
|
LexExcept(cc,"Expecting ')' at ");
|
||||||
Lex(cc); //Skip )
|
Lex(cc); //Skip )
|
||||||
QueIns(tempt,headt.last);
|
QueIns(tmpt,headt.last);
|
||||||
num2++;
|
num2++;
|
||||||
if (cc->token==',')
|
if (cc->token==',')
|
||||||
Lex(cc); //Skip ,
|
Lex(cc); //Skip ,
|
||||||
@@ -534,21 +534,21 @@ CSprite *Code2SpriteElem(CCmpCtrl *cc,I64 type)
|
|||||||
res=MAlloc(size+num1*sizeof(CD3I32)+num2*sizeof(CMeshTri));
|
res=MAlloc(size+num1*sizeof(CD3I32)+num2*sizeof(CMeshTri));
|
||||||
MemCpy(res,&g,size);
|
MemCpy(res,&g,size);
|
||||||
ptr=res(U8 *)+size;
|
ptr=res(U8 *)+size;
|
||||||
tempp=headp.next;
|
tmpp=headp.next;
|
||||||
while (tempp!=&headp) {
|
while (tmpp!=&headp) {
|
||||||
tempa1=tempp->next;
|
tmpa1=tmpp->next;
|
||||||
MemCpy(ptr,&tempp->p,sizeof(CD3I32));
|
MemCpy(ptr,&tmpp->p,sizeof(CD3I32));
|
||||||
ptr+=sizeof(CD3I32);
|
ptr+=sizeof(CD3I32);
|
||||||
Free(tempp);
|
Free(tmpp);
|
||||||
tempp=tempa1;
|
tmpp=tmpa1;
|
||||||
}
|
}
|
||||||
tempt=headt.next;
|
tmpt=headt.next;
|
||||||
while (tempt!=&headt) {
|
while (tmpt!=&headt) {
|
||||||
tempt1=tempt->next;
|
tmpt1=tmpt->next;
|
||||||
MemCpy(ptr,&tempt->start,sizeof(CMeshTri));
|
MemCpy(ptr,&tmpt->start,sizeof(CMeshTri));
|
||||||
ptr+=sizeof(CMeshTri);
|
ptr+=sizeof(CMeshTri);
|
||||||
Free(tempt);
|
Free(tmpt);
|
||||||
tempt=tempt1;
|
tmpt=tmpt1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -566,7 +566,7 @@ public U8 *Code2Sprite(CDoc *doc,I64 *_size=NULL)
|
|||||||
Bool okay=TRUE,unlock_doc=DocLock(doc);
|
Bool okay=TRUE,unlock_doc=DocLock(doc);
|
||||||
CCmpCtrl *cc=CmpCtrlNew(,CCF_DONT_FREE_BUF);
|
CCmpCtrl *cc=CmpCtrlNew(,CCF_DONT_FREE_BUF);
|
||||||
CHashTable *old_hash_table_lst=cc->htc.hash_table_lst;
|
CHashTable *old_hash_table_lst=cc->htc.hash_table_lst;
|
||||||
CHashGeneric *temph;
|
CHashGeneric *tmph;
|
||||||
I64 i,size=0;
|
I64 i,size=0;
|
||||||
QueInit(&head);
|
QueInit(&head);
|
||||||
LexAttachDoc(cc,,doc);
|
LexAttachDoc(cc,,doc);
|
||||||
@@ -574,8 +574,8 @@ public U8 *Code2Sprite(CDoc *doc,I64 *_size=NULL)
|
|||||||
do {
|
do {
|
||||||
cc->htc.hash_table_lst=NULL;
|
cc->htc.hash_table_lst=NULL;
|
||||||
if (Lex(cc)==TK_IDENT && //Skip ;
|
if (Lex(cc)==TK_IDENT && //Skip ;
|
||||||
(temph=HashFind(cc->cur_str,gr.sprite_hash,SPHT_ELEM_CODE))) {
|
(tmph=HashFind(cc->cur_str,gr.sprite_hash,SPHT_ELEM_CODE))) {
|
||||||
i=temph->user_data0;
|
i=tmph->user_data0;
|
||||||
cc->htc.hash_table_lst=old_hash_table_lst;
|
cc->htc.hash_table_lst=old_hash_table_lst;
|
||||||
if (Lex(cc)=='{') //Skip ident
|
if (Lex(cc)=='{') //Skip ident
|
||||||
QueIns(Code2SpriteElem(cc,i),head.last);
|
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"
|
#help_index "Graphics/Sprite;Sprites"
|
||||||
|
|
||||||
#define SPT_MENU -2
|
#define SPT_MENU -2
|
||||||
#define SPT_INS_SCREEN_BITMAP -3
|
#define SPT_INS_SCRN_BITMAP -3
|
||||||
#define SPT_INS_TRANSPARENT_SCREEN_BITMAP -4
|
#define SPT_INS_TRANSPARENT_SCRN_BITMAP -4
|
||||||
#define SPT_ED_MENU -5
|
#define SPT_ED_MENU -5
|
||||||
#define SPT_EXIT -6
|
#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,\"BSpline3\",LE=SPT_BSPLINE3$$\n"
|
||||||
"$$MU-UL,\"BSpline2 Closed\",LE=SPT_BSPLINE2_CLOSED$$\n"
|
"$$MU-UL,\"BSpline2 Closed\",LE=SPT_BSPLINE2_CLOSED$$\n"
|
||||||
"$$MU-UL,\"BSpline3 Closed\",LE=SPT_BSPLINE3_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 Scrn-Captured BitMap\",LE=SPT_INS_SCRN_BITMAP$$\n"
|
||||||
"$$MU-UL,\"Insert Transparent Screen-Captured BitMap\","
|
"$$MU-UL,\"Insert Transparent Scrn-Captured BitMap\","
|
||||||
"LE=SPT_INS_TRANSPARENT_SCREEN_BITMAP$$\n"
|
"LE=SPT_INS_TRANSPARENT_SCRN_BITMAP$$\n"
|
||||||
"$$PURPLE$$$$MU-UL,\"+] Create or Edit 3D Mesh\",LE=SPT_MESH$$\n"
|
"$$PURPLE$$$$MU-UL,\"+] Create or Edit 3D Mesh\",LE=SPT_MESH$$\n"
|
||||||
"$$MU-UL,\"+] Create or Edit Shiftable 3D Mesh\","
|
"$$MU-UL,\"+] Create or Edit Shiftable 3D Mesh\","
|
||||||
"LE=SPT_SHIFTABLE_MESH$$\n"
|
"LE=SPT_SHIFTABLE_MESH$$\n"
|
||||||
@@ -101,12 +101,12 @@ Bool PopUpExtents(I64 *_x1,I64 *_x2,I64 *_y1,I64 *_y2)
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 SpriteScreenInit(CDC *dc,I64,I64)
|
U0 SpriteScrnInit(CDC *dc,I64,I64)
|
||||||
{
|
{
|
||||||
//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.HC"$.
|
//Uses $LK,"fixed-point",A="FI:::/Demo/Lectures/FixedPoint.HC"$.
|
||||||
I64 xx,yy,old_pen_width=dc->pen_width;
|
I64 xx,yy,old_pen_width=dc->pen_width;
|
||||||
CColorROPU32 old_color=dc->color;
|
CColorROPU32 old_color=dc->color;
|
||||||
WinMgrSync;
|
Refresh;
|
||||||
DCFill(dc);
|
DCFill(dc);
|
||||||
if (dc->flags&DCF_SYMMETRY) {
|
if (dc->flags&DCF_SYMMETRY) {
|
||||||
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;
|
dc->color=color&COLORROP_NO_ROP0_MASK;
|
||||||
GrLine3(dc,x1,y1,0,x2,y2,0);
|
GrLine3(dc,x1,y1,0,x2,y2,0);
|
||||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
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;
|
x2=a1; y2=a2;
|
||||||
} while (msg_code!=MSG_IP_L_UP);
|
} while (msg_code!=MSG_IP_L_UP);
|
||||||
dc->color=color&COLORROP_NO_ROP0_MASK;
|
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;
|
dc->color=color&COLORROP_NO_ROP0_MASK;
|
||||||
GrArrow3(dc,x1,y1,0,x2,y2,0);
|
GrArrow3(dc,x1,y1,0,x2,y2,0);
|
||||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
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;
|
x2=a1; y2=a2;
|
||||||
} while (msg_code!=MSG_IP_L_UP);
|
} while (msg_code!=MSG_IP_L_UP);
|
||||||
dc->color=color&COLORROP_NO_ROP0_MASK;
|
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;
|
dc->color=ROPF_DITHER+WHITE<<16+BLACK;
|
||||||
GrLine3(dc,x1,y1,0,x2,y2,0);
|
GrLine3(dc,x1,y1,0,x2,y2,0);
|
||||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
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;
|
x2=a1; y2=a2;
|
||||||
} while (msg_code!=MSG_IP_L_UP);
|
} while (msg_code!=MSG_IP_L_UP);
|
||||||
dc->flags=old_flags&DCF_SYMMETRY|dc->flags&~DCF_SYMMETRY;
|
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;
|
dc->color=color&COLORROP_NO_ROP0_MASK;
|
||||||
GrRect3(dc,xx1,yy1,0,xx2-xx1,yy2-yy1);
|
GrRect3(dc,xx1,yy1,0,xx2-xx1,yy2-yy1);
|
||||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
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;
|
x2=a1; y2=a2;
|
||||||
if (x2<x1) {
|
if (x2<x1) {
|
||||||
xx1=x2; xx2=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;
|
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)
|
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;
|
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,
|
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);
|
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);
|
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;
|
x2=a1; y2=a2;
|
||||||
if (x2<x1) {
|
if (x2<x1) {
|
||||||
xx1=x2; xx2=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.height=yy2-yy1;
|
||||||
res->pwhu.x1=0;
|
res->pwhu.x1=0;
|
||||||
res->pwhu.y1=0;
|
res->pwhu.y1=0;
|
||||||
SpriteScreenInit(dc,x,y);
|
SpriteScrnInit(dc,x,y);
|
||||||
i=gr.screen_zoom;
|
i=gr.scrn_zoom;
|
||||||
GrScaleZoom(1.0/i);
|
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,
|
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);
|
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);
|
DCColorChg(img,bm_bkcolor);
|
||||||
GrScaleZoom(i);
|
GrScaleZoom(i);
|
||||||
MemCpy(&res->pwhu.u,img->body,((xx2-xx1+7)&~7)*(yy2-yy1));
|
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;
|
dc->color=color&COLORROP_NO_ROP0_MASK;
|
||||||
GrCircle3(dc,x1,y1,0,Sqrt(SqrI64(x1-x2)+SqrI64(y1-y2)));
|
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);
|
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;
|
x2=a1; y2=a2;
|
||||||
} while (msg_code!=MSG_IP_L_UP);
|
} while (msg_code!=MSG_IP_L_UP);
|
||||||
dc->color=color&COLORROP_NO_ROP0_MASK;
|
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;
|
dc->color=color&COLORROP_NO_ROP0_MASK;
|
||||||
GrEllipse3(dc,(x1+x2)>>1,(y1+y2)>>1,0,AbsI64(x1-x2)>>1,AbsI64(y1-y2)>>1);
|
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);
|
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;
|
x2=a1; y2=a2;
|
||||||
} while (msg_code!=MSG_IP_L_UP);
|
} while (msg_code!=MSG_IP_L_UP);
|
||||||
res=CAlloc(SpriteElemQuedBaseSize(SPT_ELLIPSE));
|
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,
|
GrEllipse3(dc,res->pwha.x1+x,res->pwha.y1+y,0,
|
||||||
res->pwha.width,res->pwha.height,res->pwha.angle);
|
res->pwha.width,res->pwha.height,res->pwha.angle);
|
||||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
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;
|
x2=a1; y2=a2;
|
||||||
} while (msg_code!=MSG_IP_L_UP);
|
} while (msg_code!=MSG_IP_L_UP);
|
||||||
angle1=Arg(x2-(res->pwha.x1+x),y2-(res->pwha.y1+y));
|
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,
|
GrRegPoly3(dc,(x1+x2)>>1,(y1+y2)>>1,0,
|
||||||
AbsI64(x1-x2)>>1,AbsI64(y1-y2)>>1,sides);
|
AbsI64(x1-x2)>>1,AbsI64(y1-y2)>>1,sides);
|
||||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
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;
|
x2=a1; y2=a2;
|
||||||
} while (msg_code!=MSG_IP_L_UP);
|
} while (msg_code!=MSG_IP_L_UP);
|
||||||
res=CAlloc(SpriteElemQuedBaseSize(SPT_POLYGON));
|
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.width,res->pwhas.height,
|
||||||
res->pwhas.sides,res->pwhas.angle);
|
res->pwhas.sides,res->pwhas.angle);
|
||||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
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;
|
x2=a1; y2=a2;
|
||||||
} while (msg_code!=MSG_IP_L_UP);
|
} while (msg_code!=MSG_IP_L_UP);
|
||||||
angle1=Arg(x2-(res->pwhas.x1+x),y2-(res->pwhas.y1+y));
|
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;
|
I64 i,num=0,msg_code,x1=a1,y1=a2,x2=a1,y2=a2;
|
||||||
I32 *ptr;
|
I32 *ptr;
|
||||||
CD3I32 *p;
|
CD3I32 *p;
|
||||||
CSprite *res,*tempg,*tempg1,head2;
|
CSprite *res,*tmpg,*tmpg1,head2;
|
||||||
|
|
||||||
QueInit(&head2);
|
QueInit(&head2);
|
||||||
do {
|
do {
|
||||||
@@ -438,22 +438,22 @@ CSprite *SMPolyLineFamily(I64 eletype,CDC *dc,I64 x,I64 y,I64 a1,I64 a2,
|
|||||||
if (num>1) {
|
if (num>1) {
|
||||||
res=CAlloc(SpriteElemQuedBaseSize(SPT_POLYLINE)+num*sizeof(CD2I32));
|
res=CAlloc(SpriteElemQuedBaseSize(SPT_POLYLINE)+num*sizeof(CD2I32));
|
||||||
ptr=&res->nu.u;
|
ptr=&res->nu.u;
|
||||||
tempg1=head2.next;
|
tmpg1=head2.next;
|
||||||
for (i=0;i<num;i++) {
|
for (i=0;i<num;i++) {
|
||||||
tempg=tempg1->next;
|
tmpg=tmpg1->next;
|
||||||
ptr[i<<1]=tempg1->p.x1;
|
ptr[i<<1]=tmpg1->p.x1;
|
||||||
ptr[i<<1+1]=tempg1->p.y1;
|
ptr[i<<1+1]=tmpg1->p.y1;
|
||||||
Free(tempg1);
|
Free(tmpg1);
|
||||||
tempg1=tempg;
|
tmpg1=tmpg;
|
||||||
}
|
}
|
||||||
res->type=SPT_POLYLINE;
|
res->type=SPT_POLYLINE;
|
||||||
res->nu.num=num;
|
res->nu.num=num;
|
||||||
} else {
|
} else {
|
||||||
tempg1=head2.next;
|
tmpg1=head2.next;
|
||||||
for (i=0;i<num;i++) {
|
for (i=0;i<num;i++) {
|
||||||
tempg=tempg1->next;
|
tmpg=tmpg1->next;
|
||||||
Free(tempg1);
|
Free(tmpg1);
|
||||||
tempg1=tempg;
|
tmpg1=tmpg;
|
||||||
}
|
}
|
||||||
res=NULL;
|
res=NULL;
|
||||||
}
|
}
|
||||||
@@ -465,22 +465,22 @@ CSprite *SMPolyLineFamily(I64 eletype,CDC *dc,I64 x,I64 y,I64 a1,I64 a2,
|
|||||||
if (num>2) {
|
if (num>2) {
|
||||||
res=CAlloc(SpriteElemQuedBaseSize(eletype)+num*sizeof(CD3I32));
|
res=CAlloc(SpriteElemQuedBaseSize(eletype)+num*sizeof(CD3I32));
|
||||||
p=&res->nu.u;
|
p=&res->nu.u;
|
||||||
tempg1=head2.next;
|
tmpg1=head2.next;
|
||||||
for (i=0;i<num;i++) {
|
for (i=0;i<num;i++) {
|
||||||
tempg=tempg1->next;
|
tmpg=tmpg1->next;
|
||||||
p[i].x=tempg1->p.x1;
|
p[i].x=tmpg1->p.x1;
|
||||||
p[i].y=tempg1->p.y1;
|
p[i].y=tmpg1->p.y1;
|
||||||
Free(tempg1);
|
Free(tmpg1);
|
||||||
tempg1=tempg;
|
tmpg1=tmpg;
|
||||||
}
|
}
|
||||||
res->type=eletype;
|
res->type=eletype;
|
||||||
res->nu.num=num;
|
res->nu.num=num;
|
||||||
} else {
|
} else {
|
||||||
tempg1=head2.next;
|
tmpg1=head2.next;
|
||||||
for (i=0;i<num;i++) {
|
for (i=0;i<num;i++) {
|
||||||
tempg=tempg1->next;
|
tmpg=tmpg1->next;
|
||||||
Free(tempg1);
|
Free(tmpg1);
|
||||||
tempg1=tempg;
|
tmpg1=tmpg;
|
||||||
}
|
}
|
||||||
res=NULL;
|
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;
|
I64 i,num=0,msg_code,x1=a1,y1=a2,x2=a1,y2=a2,x3,y3;
|
||||||
I32 *ptr;
|
I32 *ptr;
|
||||||
CSprite *res,*tempg,*tempg1,head2;
|
CSprite *res,*tmpg,*tmpg1,head2;
|
||||||
|
|
||||||
QueInit(&head2);
|
QueInit(&head2);
|
||||||
x3=a1-x; y3=a2-y;
|
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;
|
res=head2.next;
|
||||||
x1=x3; y1=y3;
|
x1=x3; y1=y3;
|
||||||
while (res!=&head2) {
|
while (res!=&head2) {
|
||||||
tempg=res->next;
|
tmpg=res->next;
|
||||||
if (res->p.x1==x1 && res->p.y1==y1) {
|
if (res->p.x1==x1 && res->p.y1==y1) {
|
||||||
QueRem(res);
|
QueRem(res);
|
||||||
Free(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;
|
x1=res->p.x1;
|
||||||
y1=res->p.y1;
|
y1=res->p.y1;
|
||||||
}
|
}
|
||||||
res=tempg;
|
res=tmpg;
|
||||||
}
|
}
|
||||||
|
|
||||||
res=CAlloc(SpriteElemQuedBaseSize(SPT_POLYPT)+(num*3+7)>>3);
|
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;
|
ptr=&res->npu.u;
|
||||||
x1=x3; y1=y3;
|
x1=x3; y1=y3;
|
||||||
i=0;
|
i=0;
|
||||||
tempg1=head2.next;
|
tmpg1=head2.next;
|
||||||
while (tempg1!=&head2) {
|
while (tmpg1!=&head2) {
|
||||||
tempg=tempg1->next;
|
tmpg=tmpg1->next;
|
||||||
BFieldOrU32(ptr,i,polypt_map[SignI64(tempg1->p.x1-x1)+1+
|
BFieldOrU32(ptr,i,polypt_map[SignI64(tmpg1->p.x1-x1)+1+
|
||||||
3*(SignI64(tempg1->p.y1-y1)+1)]);
|
3*(SignI64(tmpg1->p.y1-y1)+1)]);
|
||||||
i+=3;
|
i+=3;
|
||||||
x1=tempg1->p.x1;y1=tempg1->p.y1;
|
x1=tmpg1->p.x1;y1=tmpg1->p.y1;
|
||||||
QueRem(tempg1);
|
QueRem(tmpg1);
|
||||||
Free(tempg1);
|
Free(tmpg1);
|
||||||
tempg1=tempg;
|
tmpg1=tmpg;
|
||||||
}
|
}
|
||||||
res->type=SPT_POLYPT;
|
res->type=SPT_POLYPT;
|
||||||
res->npu.num=num;
|
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 x,I64 y,I64 a1,I64 a2,CColorROPU32 color,I64 *_cur_elem_num,
|
||||||
I64 old_de_flags)
|
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;
|
I64 msg_code,x1,y1;
|
||||||
U8 *st;
|
U8 *st;
|
||||||
doc_ce->de_flags|=DOCEF_DONT_DRAW;
|
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;
|
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);
|
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;
|
x1=a1; y1=a2;
|
||||||
} while (msg_code!=MSG_IP_L_UP);
|
} while (msg_code!=MSG_IP_L_UP);
|
||||||
tempg=CAlloc(SpriteElemQuedBaseSize(eletype)+StrLen(st)+1);
|
tmpg=CAlloc(SpriteElemQuedBaseSize(eletype)+StrLen(st)+1);
|
||||||
tempg->type=eletype;
|
tmpg->type=eletype;
|
||||||
tempg->ps.x1=x1-x;
|
tmpg->ps.x1=x1-x;
|
||||||
tempg->ps.y1=y1-y;
|
tmpg->ps.y1=y1-y;
|
||||||
StrCpy(tempg->ps.st,st);
|
StrCpy(tmpg->ps.st,st);
|
||||||
QueIns(tempg,insert_pt->last);
|
QueIns(tmpg,insert_pt->last);
|
||||||
SpriteEdUpdate(doc,doc_ce,head);
|
SpriteEdUpdate(doc,doc_ce,head);
|
||||||
*_cur_elem_num+=1;
|
*_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)
|
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;
|
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;
|
CDC *img;
|
||||||
|
|
||||||
insert_pt=SpriteSetSettings(,head,*_cur_elem_num,xx,yy,,,&x,&y);
|
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;
|
dc->color=ROPF_DITHER+WHITE<<16+BLACK;
|
||||||
GrBorder(dc,xx1,yy1,xx2,yy2);
|
GrBorder(dc,xx1,yy1,xx2,yy2);
|
||||||
msg_code=GetMsg(&a1,&a2,1<<MSG_IP_L_UP+1<<MSG_IP_MOVE);
|
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;
|
x2=a1; y2=a2;
|
||||||
if (x2<x1) {
|
if (x2<x1) {
|
||||||
xx1=x2; xx2=x1;
|
xx1=x2; xx2=x1;
|
||||||
@@ -616,18 +616,18 @@ I64 SMBitMap(I64 eletype,CDoc *doc,CDocEntry *doc_ce,CSprite *head,
|
|||||||
}
|
}
|
||||||
|
|
||||||
xx2++; yy2++;
|
xx2++; yy2++;
|
||||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_BITMAP)+
|
tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_BITMAP)+
|
||||||
((xx2-xx1+7)&~7)*(yy2-yy1));
|
((xx2-xx1+7)&~7)*(yy2-yy1));
|
||||||
tempg->type=SPT_BITMAP;
|
tmpg->type=SPT_BITMAP;
|
||||||
tempg->pwhu.width=xx2-xx1;
|
tmpg->pwhu.width=xx2-xx1;
|
||||||
tempg->pwhu.height=yy2-yy1;
|
tmpg->pwhu.height=yy2-yy1;
|
||||||
tempg->pwhu.x1=xx1-x;
|
tmpg->pwhu.x1=xx1-x;
|
||||||
tempg->pwhu.y1=yy1-y;
|
tmpg->pwhu.y1=yy1-y;
|
||||||
img=DCNew(tempg->pwhu.width,tempg->pwhu.height,Fs);
|
img=DCNew(tmpg->pwhu.width,tmpg->pwhu.height,Fs);
|
||||||
img->color=bm_bkcolor;
|
img->color=bm_bkcolor;
|
||||||
GrRect(img,0,0,tempg->pwhu.width,tempg->pwhu.height);
|
GrRect(img,0,0,tmpg->pwhu.width,tmpg->pwhu.height);
|
||||||
tempg1=insert_pt;
|
tmpg1=insert_pt;
|
||||||
if (tempg1==head || tempg1->type!=SPT_BITMAP) {
|
if (tmpg1==head || tmpg1->type!=SPT_BITMAP) {
|
||||||
SpriteSetSettings(img,head,0,-(xx1-x),-(yy1-y));
|
SpriteSetSettings(img,head,0,-(xx1-x),-(yy1-y));
|
||||||
x=xx; y=yy;
|
x=xx; y=yy;
|
||||||
Sprite3(img,-(xx1-x),-(yy1-y),0,doc_ce->bin_data->data);
|
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;
|
*_cur_elem_num=1;
|
||||||
} else {
|
} else {
|
||||||
SpriteSetSettings(img,head,*_cur_elem_num,-(xx1-x),-(yy1-y));
|
SpriteSetSettings(img,head,*_cur_elem_num,-(xx1-x),-(yy1-y));
|
||||||
Sprite3(img,-(xx1-x),-(yy1-y),0,&tempg1->start,TRUE);
|
Sprite3(img,-(xx1-x),-(yy1-y),0,&tmpg1->start,TRUE);
|
||||||
insert_pt=tempg1->next;
|
insert_pt=tmpg1->next;
|
||||||
QueRem(tempg1);
|
QueRem(tmpg1);
|
||||||
Free(tempg1);
|
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,
|
switch (i=SpriteBitMapEd(doc,doc_ce,dc,&xx1,&yy1,
|
||||||
&xx2,&yy2,&img,bm_bkcolor)) {
|
&xx2,&yy2,&img,bm_bkcolor)) {
|
||||||
case GE_EXIT:
|
case SPE_EXIT:
|
||||||
case GE_CONT:
|
case SPE_CONT:
|
||||||
Free(tempg);
|
Free(tmpg);
|
||||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_BITMAP)+
|
tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_BITMAP)+
|
||||||
((xx2-xx1+7)&~7)*(yy2-yy1));
|
((xx2-xx1+7)&~7)*(yy2-yy1));
|
||||||
tempg->type=eletype;
|
tmpg->type=eletype;
|
||||||
tempg->pwhu.width=xx2-xx1;
|
tmpg->pwhu.width=xx2-xx1;
|
||||||
tempg->pwhu.height=yy2-yy1;
|
tmpg->pwhu.height=yy2-yy1;
|
||||||
tempg->pwhu.x1=xx1-x;
|
tmpg->pwhu.x1=xx1-x;
|
||||||
tempg->pwhu.y1=yy1-y;
|
tmpg->pwhu.y1=yy1-y;
|
||||||
MemCpy(&tempg->pwhu.u,img->body,((xx2-xx1+7)&~7)*(yy2-yy1));
|
MemCpy(&tmpg->pwhu.u,img->body,((xx2-xx1+7)&~7)*(yy2-yy1));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
QueIns(tempg,insert_pt->last);
|
QueIns(tmpg,insert_pt->last);
|
||||||
DCDel(img);
|
DCDel(img);
|
||||||
SpriteEdUpdate(doc,doc_ce,head);
|
SpriteEdUpdate(doc,doc_ce,head);
|
||||||
return i;
|
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)
|
U0 SMMesh(CDoc *doc,CDocEntry *doc_ce,CSprite *head,I64 *_cur_elem_num)
|
||||||
{
|
{
|
||||||
CSprite *tempg,*insert_pt=SpriteSetSettings(,head,*_cur_elem_num),
|
CSprite *tmpg,*insert_pt=SpriteSetSettings(,head,*_cur_elem_num),
|
||||||
*tempg1=insert_pt;
|
*tmpg1=insert_pt;
|
||||||
CD3I32 *p;
|
CD3I32 *p;
|
||||||
I64 i,size,x1,y1,z1;
|
I64 i,size,x1,y1,z1;
|
||||||
I32 *mesh,*old_mesh;
|
I32 *mesh,*old_mesh;
|
||||||
if (tempg1!=head && tempg1->type==SPT_MESH)
|
if (tmpg1!=head && tmpg1->type==SPT_MESH)
|
||||||
old_mesh=&tempg1->mu.vertex_cnt;
|
old_mesh=&tmpg1->mu.vertex_cnt;
|
||||||
else if (tempg1!=head && tempg1->type==SPT_SHIFTABLE_MESH) {
|
else if (tmpg1!=head && tmpg1->type==SPT_SHIFTABLE_MESH) {
|
||||||
x1=tempg1->pmu.x;
|
x1=tmpg1->pmu.x;
|
||||||
y1=tempg1->pmu.y;
|
y1=tmpg1->pmu.y;
|
||||||
z1=tempg1->pmu.z;
|
z1=tmpg1->pmu.z;
|
||||||
p=&tempg1->pmu.u;
|
p=&tmpg1->pmu.u;
|
||||||
for (i=0;i<tempg1->pmu.vertex_cnt;i++,p++) {
|
for (i=0;i<tmpg1->pmu.vertex_cnt;i++,p++) {
|
||||||
p->x+=x1;
|
p->x+=x1;
|
||||||
p->y+=y1;
|
p->y+=y1;
|
||||||
p->z+=z1;
|
p->z+=z1;
|
||||||
}
|
}
|
||||||
old_mesh=&tempg1->pmu.vertex_cnt;
|
old_mesh=&tmpg1->pmu.vertex_cnt;
|
||||||
} else
|
} else
|
||||||
old_mesh=NULL;
|
old_mesh=NULL;
|
||||||
if (mesh=SpriteMeshEd(old_mesh,&size,TRUE)) {
|
if (mesh=SpriteMeshEd(old_mesh,&size,TRUE)) {
|
||||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_MESH)-sizeof(I32)*2+size);
|
tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_MESH)-sizeof(I32)*2+size);
|
||||||
tempg->type=SPT_MESH;
|
tmpg->type=SPT_MESH;
|
||||||
MemCpy(&tempg->mu.vertex_cnt,mesh,size);
|
MemCpy(&tmpg->mu.vertex_cnt,mesh,size);
|
||||||
Free(mesh);
|
Free(mesh);
|
||||||
QueIns(tempg,insert_pt->last);
|
QueIns(tmpg,insert_pt->last);
|
||||||
SpriteEdUpdate(doc,doc_ce,head);
|
SpriteEdUpdate(doc,doc_ce,head);
|
||||||
if (old_mesh) {
|
if (old_mesh) {
|
||||||
insert_pt=tempg;
|
insert_pt=tmpg;
|
||||||
QueRem(tempg1);
|
QueRem(tmpg1);
|
||||||
Free(tempg1);
|
Free(tmpg1);
|
||||||
SpriteEdUpdate(doc,doc_ce,head);
|
SpriteEdUpdate(doc,doc_ce,head);
|
||||||
} else
|
} else
|
||||||
*_cur_elem_num+=1;
|
*_cur_elem_num+=1;
|
||||||
} else if (old_mesh && tempg1->type==SPT_SHIFTABLE_MESH) {
|
} else if (old_mesh && tmpg1->type==SPT_SHIFTABLE_MESH) {
|
||||||
x1=tempg1->pmu.x;
|
x1=tmpg1->pmu.x;
|
||||||
y1=tempg1->pmu.y;
|
y1=tmpg1->pmu.y;
|
||||||
z1=tempg1->pmu.z;
|
z1=tmpg1->pmu.z;
|
||||||
p=&tempg1->pmu.u;
|
p=&tmpg1->pmu.u;
|
||||||
for (i=0;i<tempg1->pmu.vertex_cnt;i++,p++) {
|
for (i=0;i<tmpg1->pmu.vertex_cnt;i++,p++) {
|
||||||
p->x-=x1;
|
p->x-=x1;
|
||||||
p->y-=y1;
|
p->y-=y1;
|
||||||
p->z-=z1;
|
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,
|
U0 SMShiftableMesh(CDoc *doc,CDocEntry *doc_ce,CSprite *head,
|
||||||
I64 x,I64 y,I64 a1,I64 a2,I64 *_cur_elem_num)
|
I64 x,I64 y,I64 a1,I64 a2,I64 *_cur_elem_num)
|
||||||
{
|
{
|
||||||
CSprite *tempg,*insert_pt=SpriteSetSettings(,head,*_cur_elem_num),
|
CSprite *tmpg,*insert_pt=SpriteSetSettings(,head,*_cur_elem_num),
|
||||||
*tempg1=insert_pt;
|
*tmpg1=insert_pt;
|
||||||
CD3I32 *p;
|
CD3I32 *p;
|
||||||
I64 i,size,z,x1,y1,z1;
|
I64 i,size,z,x1,y1,z1;
|
||||||
I32 *mesh,*old_mesh;
|
I32 *mesh,*old_mesh;
|
||||||
if (tempg1!=head && tempg1->type==SPT_MESH) {
|
if (tmpg1!=head && tmpg1->type==SPT_MESH) {
|
||||||
z=0;
|
z=0;
|
||||||
x1=-(a1-x);
|
x1=-(a1-x);
|
||||||
y1=-(a2-y);
|
y1=-(a2-y);
|
||||||
z1=z;
|
z1=z;
|
||||||
p=&tempg1->mu.u;
|
p=&tmpg1->mu.u;
|
||||||
for (i=0;i<tempg1->mu.vertex_cnt;i++,p++) {
|
for (i=0;i<tmpg1->mu.vertex_cnt;i++,p++) {
|
||||||
p->x+=x1;
|
p->x+=x1;
|
||||||
p->y+=y1;
|
p->y+=y1;
|
||||||
p->z+=z1;
|
p->z+=z1;
|
||||||
}
|
}
|
||||||
old_mesh=&tempg1->mu.vertex_cnt;
|
old_mesh=&tmpg1->mu.vertex_cnt;
|
||||||
} else if (tempg1!=head && tempg1->type==SPT_SHIFTABLE_MESH) {
|
} else if (tmpg1!=head && tmpg1->type==SPT_SHIFTABLE_MESH) {
|
||||||
z=-tempg1->pmu.z;
|
z=-tmpg1->pmu.z;
|
||||||
x1=tempg1->pmu.x-(a1-x);
|
x1=tmpg1->pmu.x-(a1-x);
|
||||||
y1=tempg1->pmu.y-(a2-y);
|
y1=tmpg1->pmu.y-(a2-y);
|
||||||
z1=tempg1->pmu.z+z;
|
z1=tmpg1->pmu.z+z;
|
||||||
p=&tempg1->pmu.u;
|
p=&tmpg1->pmu.u;
|
||||||
for (i=0;i<tempg1->pmu.vertex_cnt;i++,p++) {
|
for (i=0;i<tmpg1->pmu.vertex_cnt;i++,p++) {
|
||||||
p->x+=x1;
|
p->x+=x1;
|
||||||
p->y+=y1;
|
p->y+=y1;
|
||||||
p->z+=z1;
|
p->z+=z1;
|
||||||
}
|
}
|
||||||
old_mesh=&tempg1->pmu.vertex_cnt;
|
old_mesh=&tmpg1->pmu.vertex_cnt;
|
||||||
} else {
|
} else {
|
||||||
z=0;
|
z=0;
|
||||||
old_mesh=NULL;
|
old_mesh=NULL;
|
||||||
}
|
}
|
||||||
if (mesh=SpriteMeshEd(old_mesh,&size,TRUE)) {
|
if (mesh=SpriteMeshEd(old_mesh,&size,TRUE)) {
|
||||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_SHIFTABLE_MESH)-sizeof(I32)*2+size);
|
tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_SHIFTABLE_MESH)-sizeof(I32)*2+size);
|
||||||
tempg->type=SPT_SHIFTABLE_MESH;
|
tmpg->type=SPT_SHIFTABLE_MESH;
|
||||||
MemCpy(&tempg->pmu.vertex_cnt,mesh,size);
|
MemCpy(&tmpg->pmu.vertex_cnt,mesh,size);
|
||||||
Free(mesh);
|
Free(mesh);
|
||||||
tempg->pmu.x=a1-x;
|
tmpg->pmu.x=a1-x;
|
||||||
tempg->pmu.y=a2-y;
|
tmpg->pmu.y=a2-y;
|
||||||
tempg->pmu.z=-z;
|
tmpg->pmu.z=-z;
|
||||||
QueIns(tempg,insert_pt->last);
|
QueIns(tmpg,insert_pt->last);
|
||||||
SpriteEdUpdate(doc,doc_ce,head);
|
SpriteEdUpdate(doc,doc_ce,head);
|
||||||
if (old_mesh) {
|
if (old_mesh) {
|
||||||
insert_pt=tempg;
|
insert_pt=tmpg;
|
||||||
QueRem(tempg1);
|
QueRem(tmpg1);
|
||||||
Free(tempg1);
|
Free(tmpg1);
|
||||||
SpriteEdUpdate(doc,doc_ce,head);
|
SpriteEdUpdate(doc,doc_ce,head);
|
||||||
} else
|
} else
|
||||||
*_cur_elem_num+=1;
|
*_cur_elem_num+=1;
|
||||||
} else if (old_mesh && tempg1->type==SPT_SHIFTABLE_MESH) {
|
} else if (old_mesh && tmpg1->type==SPT_SHIFTABLE_MESH) {
|
||||||
x1=tempg1->pmu.x-(a1-x);
|
x1=tmpg1->pmu.x-(a1-x);
|
||||||
y1=tempg1->pmu.y-(a2-y);
|
y1=tmpg1->pmu.y-(a2-y);
|
||||||
z1=tempg1->pmu.z+z;
|
z1=tmpg1->pmu.z+z;
|
||||||
p=&tempg1->pmu.u;
|
p=&tmpg1->pmu.u;
|
||||||
for (i=0;i<tempg1->pmu.vertex_cnt;i++,p++) {
|
for (i=0;i<tmpg1->pmu.vertex_cnt;i++,p++) {
|
||||||
p->x-=x1;
|
p->x-=x1;
|
||||||
p->y-=y1;
|
p->y-=y1;
|
||||||
p->z-=z1;
|
p->z-=z1;
|
||||||
}
|
}
|
||||||
} else if (old_mesh && tempg1->type==SPT_MESH) {
|
} else if (old_mesh && tmpg1->type==SPT_MESH) {
|
||||||
x1=-(a1-x);
|
x1=-(a1-x);
|
||||||
y1=-(a2-y);
|
y1=-(a2-y);
|
||||||
z1= z;
|
z1= z;
|
||||||
p=&tempg1->mu.u;
|
p=&tmpg1->mu.u;
|
||||||
for (i=0;i<tempg1->mu.vertex_cnt;i++,p++) {
|
for (i=0;i<tmpg1->mu.vertex_cnt;i++,p++) {
|
||||||
p->x-=x1;
|
p->x-=x1;
|
||||||
p->y-=y1;
|
p->y-=y1;
|
||||||
p->z-=z1;
|
p->z-=z1;
|
||||||
@@ -793,11 +793,11 @@ U0 SMTaskTitleSet(I64 eletype)
|
|||||||
{
|
{
|
||||||
Fs->title_src=TTS_CONST; //Violates TTS_LOCKED_CONST
|
Fs->title_src=TTS_CONST; //Violates TTS_LOCKED_CONST
|
||||||
switch (eletype) {
|
switch (eletype) {
|
||||||
case SPT_INS_SCREEN_BITMAP:
|
case SPT_INS_SCRN_BITMAP:
|
||||||
StrCpy(Fs->task_title,"Insert Screen BitMap");
|
StrCpy(Fs->task_title,"Insert Scrn BitMap");
|
||||||
break;
|
break;
|
||||||
case SPT_INS_TRANSPARENT_SCREEN_BITMAP:
|
case SPT_INS_TRANSPARENT_SCRN_BITMAP:
|
||||||
StrCpy(Fs->task_title,"Insert Transparent Screen BitMap");
|
StrCpy(Fs->task_title,"Insert Transparent Scrn BitMap");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (eletype>=0)
|
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,
|
cur_elem_num,old_border_src=Fs->border_src,old_title_src=Fs->title_src,
|
||||||
old_de_flags=doc_ce->de_flags;
|
old_de_flags=doc_ce->de_flags;
|
||||||
CColorROPU32 bm_bkcolor,color;
|
CColorROPU32 bm_bkcolor,color;
|
||||||
CSprite *head,*tempg,*insert_pt;
|
CSprite *head,*tmpg,*insert_pt;
|
||||||
CDC *dc=DCAlias(,Fs),*dc2=DCAlias(,sys_winmgr_task),*dc3;
|
CDC *dc=DCAlias(,Fs),*dc2=DCAlias(,sys_winmgr_task),*dc3;
|
||||||
U8 *old_task_title=StrNew(Fs->task_title);
|
U8 *old_task_title=StrNew(Fs->task_title);
|
||||||
|
|
||||||
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
|
||||||
AutoComplete;
|
AutoComplete;
|
||||||
WinMgrSync(2,TRUE);
|
Refresh(2,TRUE);
|
||||||
dc2->flags|=DCF_ON_TOP;
|
dc2->flags|=DCF_ON_TOP;
|
||||||
head=Sprite2SpriteQue(doc_ce->bin_data->data);
|
head=Sprite2SpriteQue(doc_ce->bin_data->data);
|
||||||
cur_elem_num=QueCnt(head);
|
cur_elem_num=QueCnt(head);
|
||||||
@@ -873,10 +873,10 @@ I64 SpriteMainEd(CDoc *doc)
|
|||||||
i=PopUpColor(,,FALSE);
|
i=PopUpColor(,,FALSE);
|
||||||
if (i>=0) {
|
if (i>=0) {
|
||||||
color=i;
|
color=i;
|
||||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_COLOR));
|
tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_COLOR));
|
||||||
tempg->type=SPT_COLOR;
|
tmpg->type=SPT_COLOR;
|
||||||
tempg->c.color=color;
|
tmpg->c.color=color;
|
||||||
QueIns(tempg,insert_pt->last);
|
QueIns(tmpg,insert_pt->last);
|
||||||
SpriteEdUpdate(doc,doc_ce,head);
|
SpriteEdUpdate(doc,doc_ce,head);
|
||||||
cur_elem_num++;
|
cur_elem_num++;
|
||||||
}
|
}
|
||||||
@@ -888,10 +888,10 @@ I64 SpriteMainEd(CDoc *doc)
|
|||||||
i=PopUpColorDither;
|
i=PopUpColorDither;
|
||||||
if (i>=0) {
|
if (i>=0) {
|
||||||
color=i;
|
color=i;
|
||||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_DITHER_COLOR));
|
tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_DITHER_COLOR));
|
||||||
tempg->type=SPT_DITHER_COLOR;
|
tmpg->type=SPT_DITHER_COLOR;
|
||||||
tempg->d.dither_color=color.c0.color|color.c1.color<<8;
|
tmpg->d.dither_color=color.c0.color|color.c1.color<<8;
|
||||||
QueIns(tempg,insert_pt->last);
|
QueIns(tmpg,insert_pt->last);
|
||||||
SpriteEdUpdate(doc,doc_ce,head);
|
SpriteEdUpdate(doc,doc_ce,head);
|
||||||
cur_elem_num++;
|
cur_elem_num++;
|
||||||
}
|
}
|
||||||
@@ -900,9 +900,9 @@ I64 SpriteMainEd(CDoc *doc)
|
|||||||
break;
|
break;
|
||||||
case SPT_ED_MENU:
|
case SPT_ED_MENU:
|
||||||
switch (SpriteEd(doc,doc_ce,x,y,&head,&cur_elem_num)) {
|
switch (SpriteEd(doc,doc_ce,x,y,&head,&cur_elem_num)) {
|
||||||
case GE_ABORT: eletype=DOCM_CANCEL; break;
|
case SPE_ABORT: eletype=DOCM_CANCEL; break;
|
||||||
case GE_EXIT: eletype=SPT_EXIT; break;
|
case SPE_EXIT: eletype=SPT_EXIT; break;
|
||||||
case GE_CONT: eletype=SPT_MENU; break;
|
case SPE_CONT: eletype=SPT_MENU; break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SPT_MESH:
|
case SPT_MESH:
|
||||||
@@ -934,7 +934,7 @@ I64 SpriteMainEd(CDoc *doc)
|
|||||||
PopUpOk("Select Origin.\n");
|
PopUpOk("Select Origin.\n");
|
||||||
doc_ce->de_flags=old_de_flags;
|
doc_ce->de_flags=old_de_flags;
|
||||||
break;
|
break;
|
||||||
case SPT_INS_SCREEN_BITMAP:
|
case SPT_INS_SCRN_BITMAP:
|
||||||
doc_ce->de_flags|=DOCEF_DONT_DRAW;
|
doc_ce->de_flags|=DOCEF_DONT_DRAW;
|
||||||
PopUpOk("Drag-out a rect for the extents of the\nbitmap.\n");
|
PopUpOk("Drag-out a rect for the extents of the\nbitmap.\n");
|
||||||
doc_ce->de_flags=old_de_flags;
|
doc_ce->de_flags=old_de_flags;
|
||||||
@@ -957,8 +957,8 @@ I64 SpriteMainEd(CDoc *doc)
|
|||||||
xx1+=xx; yy1+=yy;
|
xx1+=xx; yy1+=yy;
|
||||||
xx2+=xx; yy2+=yy;
|
xx2+=xx; yy2+=yy;
|
||||||
if (SMBitMap(eletype,doc,doc_ce,head,dc,xx,yy,a1,a2,bm_bkcolor,
|
if (SMBitMap(eletype,doc,doc_ce,head,dc,xx,yy,a1,a2,bm_bkcolor,
|
||||||
FALSE,xx1,yy1,xx2,yy2,&cur_elem_num)==GE_EXIT) {
|
FALSE,xx1,yy1,xx2,yy2,&cur_elem_num)==SPE_EXIT) {
|
||||||
res=GE_EXIT;
|
res=SPE_EXIT;
|
||||||
goto ei_done;
|
goto ei_done;
|
||||||
}
|
}
|
||||||
eletype=SPT_MENU;
|
eletype=SPT_MENU;
|
||||||
@@ -966,7 +966,7 @@ I64 SpriteMainEd(CDoc *doc)
|
|||||||
}
|
}
|
||||||
doc_ce->de_flags=old_de_flags;
|
doc_ce->de_flags=old_de_flags;
|
||||||
break;
|
break;
|
||||||
case SPT_INS_TRANSPARENT_SCREEN_BITMAP:
|
case SPT_INS_TRANSPARENT_SCRN_BITMAP:
|
||||||
doc_ce->de_flags|=DOCEF_DONT_DRAW;
|
doc_ce->de_flags|=DOCEF_DONT_DRAW;
|
||||||
i=PopUpColor("Color to Become Transparent\n\n",,FALSE);
|
i=PopUpColor("Color to Become Transparent\n\n",,FALSE);
|
||||||
if (i<0)
|
if (i<0)
|
||||||
@@ -984,10 +984,10 @@ I64 SpriteMainEd(CDoc *doc)
|
|||||||
i=PopUpRangeI64(1,16,1,"Pen Width\n");
|
i=PopUpRangeI64(1,16,1,"Pen Width\n");
|
||||||
if (i>=1) {
|
if (i>=1) {
|
||||||
width=i;
|
width=i;
|
||||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_WIDTH));
|
tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_WIDTH));
|
||||||
tempg->type=SPT_WIDTH;
|
tmpg->type=SPT_WIDTH;
|
||||||
tempg->w.width=width;
|
tmpg->w.width=width;
|
||||||
QueIns(tempg,insert_pt->last);
|
QueIns(tmpg,insert_pt->last);
|
||||||
SpriteEdUpdate(doc,doc_ce,head);
|
SpriteEdUpdate(doc,doc_ce,head);
|
||||||
cur_elem_num++;
|
cur_elem_num++;
|
||||||
}
|
}
|
||||||
@@ -996,12 +996,12 @@ I64 SpriteMainEd(CDoc *doc)
|
|||||||
break;
|
break;
|
||||||
case SPT_TRANSFORM_ON:
|
case SPT_TRANSFORM_ON:
|
||||||
case SPT_TRANSFORM_OFF:
|
case SPT_TRANSFORM_OFF:
|
||||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_TRANSFORM_ON));
|
tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_TRANSFORM_ON));
|
||||||
if (eletype==SPT_TRANSFORM_ON)
|
if (eletype==SPT_TRANSFORM_ON)
|
||||||
tempg->type=SPT_TRANSFORM_ON;
|
tmpg->type=SPT_TRANSFORM_ON;
|
||||||
else
|
else
|
||||||
tempg->type=SPT_TRANSFORM_OFF;
|
tmpg->type=SPT_TRANSFORM_OFF;
|
||||||
QueIns(tempg,insert_pt->last);
|
QueIns(tmpg,insert_pt->last);
|
||||||
SpriteEdUpdate(doc,doc_ce,head);
|
SpriteEdUpdate(doc,doc_ce,head);
|
||||||
cur_elem_num++;
|
cur_elem_num++;
|
||||||
eletype=SPT_MENU;
|
eletype=SPT_MENU;
|
||||||
@@ -1026,39 +1026,39 @@ I64 SpriteMainEd(CDoc *doc)
|
|||||||
insert_pt=SpriteSetSettings(dc,head,cur_elem_num,xx,yy,
|
insert_pt=SpriteSetSettings(dc,head,cur_elem_num,xx,yy,
|
||||||
&color,&width,&x,&y);
|
&color,&width,&x,&y);
|
||||||
x+=xx; y+=yy;
|
x+=xx; y+=yy;
|
||||||
SpriteScreenInit(dc,x,y);
|
SpriteScrnInit(dc,x,y);
|
||||||
if (eletype==SPT_EXIT) {
|
if (eletype==SPT_EXIT) {
|
||||||
res=GE_EXIT;
|
res=SPE_EXIT;
|
||||||
goto ei_done;
|
goto ei_done;
|
||||||
} else if (eletype==DOCM_CANCEL) {
|
} else if (eletype==DOCM_CANCEL) {
|
||||||
res=GE_ABORT;
|
res=SPE_ABORT;
|
||||||
goto ei_done;
|
goto ei_done;
|
||||||
}
|
}
|
||||||
switch (GetMsg(&a1,&a2,1<<MSG_KEY_DOWN|1<<MSG_IP_R_UP|1<<MSG_IP_L_DOWN)) {
|
switch (GetMsg(&a1,&a2,1<<MSG_KEY_DOWN|1<<MSG_IP_R_UP|1<<MSG_IP_L_DOWN)) {
|
||||||
case MSG_KEY_DOWN:
|
case MSG_KEY_DOWN:
|
||||||
switch (a1) {
|
switch (a1) {
|
||||||
case CH_ESC:
|
case CH_ESC:
|
||||||
res=GE_EXIT;
|
res=SPE_EXIT;
|
||||||
goto ei_done;
|
goto ei_done;
|
||||||
case CH_SHIFT_ESC:
|
case CH_SHIFT_ESC:
|
||||||
res=GE_ABORT;
|
res=SPE_ABORT;
|
||||||
goto ei_done;
|
goto ei_done;
|
||||||
case 'c': //eye-dropper
|
case 'c': //eye-dropper
|
||||||
dc3=DCScreenCapture(FALSE);
|
dc3=DCScrnCapture(FALSE);
|
||||||
color=GrPeek(dc3,ip.pos.x,ip.pos.y)^15;//Mouse cursor is XORed.
|
color=GrPeek(dc3,ip.pos.x,ip.pos.y)^15;//Mouse cursor is XORed.
|
||||||
DCDel(dc3);
|
DCDel(dc3);
|
||||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_COLOR));
|
tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_COLOR));
|
||||||
tempg->type=SPT_COLOR;
|
tmpg->type=SPT_COLOR;
|
||||||
tempg->c.color=color;
|
tmpg->c.color=color;
|
||||||
QueIns(tempg,insert_pt->last);
|
QueIns(tmpg,insert_pt->last);
|
||||||
SpriteEdUpdate(doc,doc_ce,head);
|
SpriteEdUpdate(doc,doc_ce,head);
|
||||||
cur_elem_num++;
|
cur_elem_num++;
|
||||||
break;
|
break;
|
||||||
case 't': //Set to transparent color
|
case 't': //Set to transparent color
|
||||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_COLOR));
|
tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_COLOR));
|
||||||
tempg->type=SPT_COLOR;
|
tmpg->type=SPT_COLOR;
|
||||||
tempg->c.color=TRANSPARENT;
|
tmpg->c.color=TRANSPARENT;
|
||||||
QueIns(tempg,insert_pt->last);
|
QueIns(tmpg,insert_pt->last);
|
||||||
SpriteEdUpdate(doc,doc_ce,head);
|
SpriteEdUpdate(doc,doc_ce,head);
|
||||||
cur_elem_num++;
|
cur_elem_num++;
|
||||||
break;
|
break;
|
||||||
@@ -1066,9 +1066,9 @@ I64 SpriteMainEd(CDoc *doc)
|
|||||||
break;
|
break;
|
||||||
case MSG_IP_R_UP:
|
case MSG_IP_R_UP:
|
||||||
if (eletype==SPT_PLANAR_SYMMETRY) {
|
if (eletype==SPT_PLANAR_SYMMETRY) {
|
||||||
tempg=CAlloc(SpriteElemQuedBaseSize(SPT_PLANAR_SYMMETRY));
|
tmpg=CAlloc(SpriteElemQuedBaseSize(SPT_PLANAR_SYMMETRY));
|
||||||
tempg->type=SPT_PLANAR_SYMMETRY;
|
tmpg->type=SPT_PLANAR_SYMMETRY;
|
||||||
QueIns(tempg,insert_pt->last);
|
QueIns(tmpg,insert_pt->last);
|
||||||
SpriteEdUpdate(doc,doc_ce,head);
|
SpriteEdUpdate(doc,doc_ce,head);
|
||||||
cur_elem_num++;
|
cur_elem_num++;
|
||||||
eletype=SPT_MENU;
|
eletype=SPT_MENU;
|
||||||
@@ -1079,62 +1079,62 @@ I64 SpriteMainEd(CDoc *doc)
|
|||||||
switch (eletype) {
|
switch (eletype) {
|
||||||
start:
|
start:
|
||||||
case SPT_LINE:
|
case SPT_LINE:
|
||||||
tempg=SMLine(dc,x,y,a1,a2,color);
|
tmpg=SMLine(dc,x,y,a1,a2,color);
|
||||||
break;
|
break;
|
||||||
case SPT_ARROW:
|
case SPT_ARROW:
|
||||||
tempg=SMArrow(dc,x,y,a1,a2,color);
|
tmpg=SMArrow(dc,x,y,a1,a2,color);
|
||||||
break;
|
break;
|
||||||
case SPT_PLANAR_SYMMETRY:
|
case SPT_PLANAR_SYMMETRY:
|
||||||
tempg=SMPlanarSymmetry(dc,x,y,a1,a2);
|
tmpg=SMPlanarSymmetry(dc,x,y,a1,a2);
|
||||||
eletype=SPT_MENU;
|
eletype=SPT_MENU;
|
||||||
break;
|
break;
|
||||||
case SPT_RECT:
|
case SPT_RECT:
|
||||||
tempg=SMRect(dc,x,y,a1,a2,color);
|
tmpg=SMRect(dc,x,y,a1,a2,color);
|
||||||
break;
|
break;
|
||||||
case SPT_INS_SCREEN_BITMAP:
|
case SPT_INS_SCRN_BITMAP:
|
||||||
case SPT_INS_TRANSPARENT_SCREEN_BITMAP:
|
case SPT_INS_TRANSPARENT_SCRN_BITMAP:
|
||||||
tempg=SMScreenBitMap(eletype,dc,dc2,x,y,a1,a2,bm_bkcolor);
|
tmpg=SMScrnBitMap(eletype,dc,dc2,x,y,a1,a2,bm_bkcolor);
|
||||||
eletype=SPT_MENU;
|
eletype=SPT_MENU;
|
||||||
break;
|
break;
|
||||||
case SPT_CIRCLE:
|
case SPT_CIRCLE:
|
||||||
tempg=SMCircle(dc,x,y,a1,a2,color);
|
tmpg=SMCircle(dc,x,y,a1,a2,color);
|
||||||
break;
|
break;
|
||||||
case SPT_ELLIPSE:
|
case SPT_ELLIPSE:
|
||||||
tempg=SMEllipse(dc,x,y,a1,a2,color);
|
tmpg=SMEllipse(dc,x,y,a1,a2,color);
|
||||||
break;
|
break;
|
||||||
case SPT_POLYGON:
|
case SPT_POLYGON:
|
||||||
tempg=SMPolygon(dc,x,y,a1,a2,i,color);
|
tmpg=SMPolygon(dc,x,y,a1,a2,i,color);
|
||||||
eletype=SPT_MENU;
|
eletype=SPT_MENU;
|
||||||
break;
|
break;
|
||||||
case SPT_PT:
|
case SPT_PT:
|
||||||
case SPT_FLOOD_FILL:
|
case SPT_FLOOD_FILL:
|
||||||
case SPT_FLOOD_FILL_NOT:
|
case SPT_FLOOD_FILL_NOT:
|
||||||
tempg=CAlloc(SpriteElemQuedBaseSize(eletype));
|
tmpg=CAlloc(SpriteElemQuedBaseSize(eletype));
|
||||||
tempg->type=eletype;
|
tmpg->type=eletype;
|
||||||
tempg->p.x1=a1-x;
|
tmpg->p.x1=a1-x;
|
||||||
tempg->p.y1=a2-y;
|
tmpg->p.y1=a2-y;
|
||||||
break;
|
break;
|
||||||
case SPT_POLYLINE:
|
case SPT_POLYLINE:
|
||||||
case SPT_BSPLINE2:
|
case SPT_BSPLINE2:
|
||||||
case SPT_BSPLINE3:
|
case SPT_BSPLINE3:
|
||||||
case SPT_BSPLINE2_CLOSED:
|
case SPT_BSPLINE2_CLOSED:
|
||||||
case SPT_BSPLINE3_CLOSED:
|
case SPT_BSPLINE3_CLOSED:
|
||||||
tempg=SMPolyLineFamily(eletype,dc,x,y,a1,a2,color);
|
tmpg=SMPolyLineFamily(eletype,dc,x,y,a1,a2,color);
|
||||||
break;
|
break;
|
||||||
case SPT_POLYPT:
|
case SPT_POLYPT:
|
||||||
tempg=SMPolyPoint(dc,x,y,a1,a2,color);
|
tmpg=SMPolyPoint(dc,x,y,a1,a2,color);
|
||||||
break;
|
break;
|
||||||
end:
|
end:
|
||||||
if (tempg) {
|
if (tmpg) {
|
||||||
QueIns(tempg,insert_pt->last);
|
QueIns(tmpg,insert_pt->last);
|
||||||
SpriteEdUpdate(doc,doc_ce,head);
|
SpriteEdUpdate(doc,doc_ce,head);
|
||||||
cur_elem_num++;
|
cur_elem_num++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SPT_BITMAP:
|
case SPT_BITMAP:
|
||||||
if (SMBitMap(eletype,doc,doc_ce,head,dc,xx,yy,a1,a2,bm_bkcolor,
|
if (SMBitMap(eletype,doc,doc_ce,head,dc,xx,yy,a1,a2,bm_bkcolor,
|
||||||
TRUE,,,,,&cur_elem_num)==GE_EXIT) {
|
TRUE,,,,,&cur_elem_num)==SPE_EXIT) {
|
||||||
res=GE_EXIT;
|
res=SPE_EXIT;
|
||||||
goto ei_done;
|
goto ei_done;
|
||||||
}
|
}
|
||||||
doc_ce->de_flags=old_de_flags;
|
doc_ce->de_flags=old_de_flags;
|
||||||
@@ -1172,33 +1172,33 @@ U0 EdSpriteIns(CDoc *doc)
|
|||||||
Bool unlock;
|
Bool unlock;
|
||||||
U8 *st;
|
U8 *st;
|
||||||
CDocEntry *doc_e;
|
CDocEntry *doc_e;
|
||||||
CDocBin *tempb;
|
CDocBin *tmpb;
|
||||||
if (Fs!=doc->mem_task)
|
if (Fs!=doc->mem_task)
|
||||||
throw('Graphics');
|
throw('Graphics');
|
||||||
if (st=EdSprite(doc->cur_bin_num)) {
|
if (st=EdSprite(doc->cur_bin_num)) {
|
||||||
unlock=DocLock(doc);
|
unlock=DocLock(doc);
|
||||||
tempb=CAlloc(sizeof(CDocBin),doc->mem_task);
|
tmpb=CAlloc(sizeof(CDocBin),doc->mem_task);
|
||||||
tempb->size=sprite_elem_base_sizes[SPT_END];
|
tmpb->size=sprite_elem_base_sizes[SPT_END];
|
||||||
tempb->data=CAlloc(tempb->size,doc->mem_task);
|
tmpb->data=CAlloc(tmpb->size,doc->mem_task);
|
||||||
tempb->num=doc->cur_bin_num++;
|
tmpb->num=doc->cur_bin_num++;
|
||||||
tempb->use_cnt=1;
|
tmpb->use_cnt=1;
|
||||||
QueIns(tempb,doc->bin_head.last);
|
QueIns(tmpb,doc->bin_head.last);
|
||||||
doc_e=DocPrint(doc,"%s",st);
|
doc_e=DocPrint(doc,"%s",st);
|
||||||
doc_e->bin_data=tempb;
|
doc_e->bin_data=tmpb;
|
||||||
Free(st);
|
Free(st);
|
||||||
if (doc_e) {
|
if (doc_e) {
|
||||||
if (doc_e->de_flags&DOCEF_TAG && doc_e->tag && *doc_e->tag)
|
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_entry=doc_e;
|
||||||
doc->cur_col=0;
|
doc->cur_col=0;
|
||||||
DocUnlock(doc);
|
DocUnlock(doc);
|
||||||
DocRecalc(doc);
|
DocRecalc(doc);
|
||||||
if (SpriteMainEd(doc)==GE_ABORT) {
|
if (SpriteMainEd(doc)==SPE_ABORT) {
|
||||||
DocLock(doc);
|
DocLock(doc);
|
||||||
DocEntryDel(doc,doc_e);
|
DocEntryDel(doc,doc_e);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
DocBinDel(doc,tempb);
|
DocBinDel(doc,tmpb);
|
||||||
if (unlock)
|
if (unlock)
|
||||||
DocUnlock(doc);
|
DocUnlock(doc);
|
||||||
}
|
}
|
||||||
@@ -1209,21 +1209,21 @@ U0 EdSpriteIns(CDoc *doc)
|
|||||||
U0 EdSpriteEd(CDoc *doc)
|
U0 EdSpriteEd(CDoc *doc)
|
||||||
{
|
{
|
||||||
CDocEntry *doc_ce;
|
CDocEntry *doc_ce;
|
||||||
CDocBin *tempb;
|
CDocBin *tmpb;
|
||||||
CSprite *old_csprite;
|
CSprite *old_csprite;
|
||||||
I64 old_size;
|
I64 old_size;
|
||||||
Bool unlock=DocLock(doc);
|
Bool unlock=DocLock(doc);
|
||||||
doc_ce=doc->cur_entry;
|
doc_ce=doc->cur_entry;
|
||||||
tempb=doc_ce->bin_data;
|
tmpb=doc_ce->bin_data;
|
||||||
old_size=tempb->size;
|
old_size=tmpb->size;
|
||||||
old_csprite=tempb->data;
|
old_csprite=tmpb->data;
|
||||||
tempb->data=MAllocIdent(old_csprite,doc->mem_task);
|
tmpb->data=MAllocIdent(old_csprite,doc->mem_task);
|
||||||
DocUnlock(doc);
|
DocUnlock(doc);
|
||||||
if (SpriteMainEd(doc)==GE_ABORT) {
|
if (SpriteMainEd(doc)==SPE_ABORT) {
|
||||||
DocLock(doc);
|
DocLock(doc);
|
||||||
Free(tempb->data);
|
Free(tmpb->data);
|
||||||
tempb->data=old_csprite;
|
tmpb->data=old_csprite;
|
||||||
tempb->size=old_size;
|
tmpb->size=old_size;
|
||||||
} else
|
} else
|
||||||
Free(old_csprite);
|
Free(old_csprite);
|
||||||
if (unlock)
|
if (unlock)
|
||||||
|
|||||||
+296
-296
@@ -13,7 +13,7 @@ class CMeshEdVertex
|
|||||||
CD3I32 p; //World coordinates of the point.
|
CD3I32 p; //World coordinates of the point.
|
||||||
U0 end;
|
U0 end;
|
||||||
CD3I32 p0,
|
CD3I32 p0,
|
||||||
pt; //Transformed coordinates. (Screen)
|
pt; //Transformed coordinates. (Scrn)
|
||||||
I32 num,flags;
|
I32 num,flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ class CMeshFrame
|
|||||||
F64 view_scale;
|
F64 view_scale;
|
||||||
CDC *dc;
|
CDC *dc;
|
||||||
I32 *depth_buf;
|
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
|
I64 vertex_cnt,tri_cnt; //Set by MeshSize
|
||||||
CMeshEdVertex vertex_head,*cur_vertex,*chain_pred;
|
CMeshEdVertex vertex_head,*cur_vertex,*chain_pred;
|
||||||
CMeshEdTri tri_head,*cur_tri;
|
CMeshEdTri tri_head,*cur_tri;
|
||||||
@@ -51,128 +51,128 @@ class CMeshFrame
|
|||||||
|
|
||||||
CMeshEdVertex *MeshVertexNew(CMeshFrame *e,I64 x,I64 y,I64 z)
|
CMeshEdVertex *MeshVertexNew(CMeshFrame *e,I64 x,I64 y,I64 z)
|
||||||
{
|
{
|
||||||
CMeshEdVertex *tempv=CAlloc(sizeof(CMeshEdVertex));
|
CMeshEdVertex *tmpv=CAlloc(sizeof(CMeshEdVertex));
|
||||||
tempv->p.x=x;
|
tmpv->p.x=x;
|
||||||
tempv->p.y=y;
|
tmpv->p.y=y;
|
||||||
tempv->p.z=z;
|
tmpv->p.z=z;
|
||||||
QueIns(tempv,e->vertex_head.last);
|
QueIns(tmpv,e->vertex_head.last);
|
||||||
return tempv;
|
return tmpv;
|
||||||
}
|
}
|
||||||
|
|
||||||
CMeshEdTri *MeshTriNew(CMeshFrame *e,CColorROPU32 color,
|
CMeshEdTri *MeshTriNew(CMeshFrame *e,CColorROPU32 color,
|
||||||
CMeshEdVertex *v1,CMeshEdVertex *v2,CMeshEdVertex *v3)
|
CMeshEdVertex *v1,CMeshEdVertex *v2,CMeshEdVertex *v3)
|
||||||
{
|
{
|
||||||
static I64 cpu_num=0;
|
static I64 cpu_num=0;
|
||||||
CMeshEdTri *tempt=CAlloc(sizeof(CMeshEdTri));
|
CMeshEdTri *tmpt=CAlloc(sizeof(CMeshEdTri));
|
||||||
tempt->cpu_num=cpu_num++%mp_cnt;
|
tmpt->cpu_num=cpu_num++%mp_cnt;
|
||||||
tempt->mt.color=color;
|
tmpt->mt.color=color;
|
||||||
tempt->t[0]=v1;
|
tmpt->t[0]=v1;
|
||||||
tempt->t[1]=v2;
|
tmpt->t[1]=v2;
|
||||||
tempt->t[2]=v3;
|
tmpt->t[2]=v3;
|
||||||
QueIns(tempt,e->tri_head.last);
|
QueIns(tmpt,e->tri_head.last);
|
||||||
return tempt;
|
return tmpt;
|
||||||
}
|
}
|
||||||
|
|
||||||
CMeshEdVertex *MeshVertexFindScrPt(CMeshFrame *e,I64 x,I64 y)
|
CMeshEdVertex *MeshVertexFindScrPt(CMeshFrame *e,I64 x,I64 y)
|
||||||
{//Screen coordinates
|
{//Scrn coordinates
|
||||||
CMeshEdVertex *res=NULL,*tempv=e->vertex_head.next;
|
CMeshEdVertex *res=NULL,*tmpv=e->vertex_head.next;
|
||||||
I64 dd,dz,best_dd=MAX_I64,best_dz=MAX_I64;
|
I64 dd,dz,best_dd=MAX_I64,best_dz=MAX_I64;
|
||||||
while (tempv!=&e->vertex_head) {
|
while (tmpv!=&e->vertex_head) {
|
||||||
if (!(tempv->flags&VF_IGNORE)) {
|
if (!(tmpv->flags&VF_IGNORE)) {
|
||||||
dd=SqrI64(x-tempv->pt.x)+SqrI64(y-tempv->pt.y);
|
dd=SqrI64(x-tmpv->pt.x)+SqrI64(y-tmpv->pt.y);
|
||||||
dz=AbsI64(e->ip_z-tempv->p.z);
|
dz=AbsI64(e->ip_z-tmpv->p.z);
|
||||||
if (dd<best_dd || dd==best_dd && dz<best_dz) {
|
if (dd<best_dd || dd==best_dd && dz<best_dz) {
|
||||||
res=tempv;
|
res=tmpv;
|
||||||
best_dd=dd;
|
best_dd=dd;
|
||||||
best_dz=dz;
|
best_dz=dz;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tempv=tempv->next;
|
tmpv=tmpv->next;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
CMeshEdVertex *MeshVertexFindNum(CMeshFrame *haystack_e,I64 needle_num)
|
CMeshEdVertex *MeshVertexFindNum(CMeshFrame *haystack_e,I64 needle_num)
|
||||||
{
|
{
|
||||||
CMeshEdVertex *tempv=haystack_e->vertex_head.next;
|
CMeshEdVertex *tmpv=haystack_e->vertex_head.next;
|
||||||
while (tempv!=&haystack_e->vertex_head) {
|
while (tmpv!=&haystack_e->vertex_head) {
|
||||||
if (tempv->num==needle_num)
|
if (tmpv->num==needle_num)
|
||||||
return tempv;
|
return tmpv;
|
||||||
tempv=tempv->next;
|
tmpv=tmpv->next;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 MeshTriDel(CMeshFrame *e,CMeshEdTri *tempt)
|
U0 MeshTriDel(CMeshFrame *e,CMeshEdTri *tmpt)
|
||||||
{
|
{
|
||||||
if (tempt) {
|
if (tmpt) {
|
||||||
if (tempt==e->cur_tri)
|
if (tmpt==e->cur_tri)
|
||||||
e->cur_tri=NULL;
|
e->cur_tri=NULL;
|
||||||
QueRem(tempt);
|
QueRem(tmpt);
|
||||||
Free(tempt);
|
Free(tmpt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 MeshVertexDel(CMeshFrame *e,CMeshEdVertex *tempv)
|
U0 MeshVertexDel(CMeshFrame *e,CMeshEdVertex *tmpv)
|
||||||
{
|
{
|
||||||
I64 i;
|
I64 i;
|
||||||
CMeshEdTri *tempt,*tempt1;
|
CMeshEdTri *tmpt,*tmpt1;
|
||||||
if (tempv) {
|
if (tmpv) {
|
||||||
tempt=e->tri_head.next;
|
tmpt=e->tri_head.next;
|
||||||
while (tempt!=&e->tri_head) {
|
while (tmpt!=&e->tri_head) {
|
||||||
tempt1=tempt->next;
|
tmpt1=tmpt->next;
|
||||||
for (i=0;i<3;i++)
|
for (i=0;i<3;i++)
|
||||||
if (tempt->t[i]==tempv)
|
if (tmpt->t[i]==tmpv)
|
||||||
break;
|
break;
|
||||||
if (i<3)
|
if (i<3)
|
||||||
MeshTriDel(e,tempt);
|
MeshTriDel(e,tmpt);
|
||||||
tempt=tempt1;
|
tmpt=tmpt1;
|
||||||
}
|
}
|
||||||
if (tempv==e->cur_vertex)
|
if (tmpv==e->cur_vertex)
|
||||||
e->cur_vertex=NULL;
|
e->cur_vertex=NULL;
|
||||||
if (tempv==e->chain_pred)
|
if (tmpv==e->chain_pred)
|
||||||
e->chain_pred=NULL;
|
e->chain_pred=NULL;
|
||||||
QueRem(tempv);
|
QueRem(tmpv);
|
||||||
Free(tempv);
|
Free(tmpv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 MeshFence(CMeshFrame *e)
|
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;
|
*start=e->chain_pred->next,*end=e->vertex_head.last;
|
||||||
tempv=start;
|
tmpv=start;
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
tempv1=MeshVertexNew(e,tempv->p.x,tempv->p.y,tempv->p.z+e->thickness);
|
tmpv1=MeshVertexNew(e,tmpv->p.x,tmpv->p.y,tmpv->p.z+e->thickness);
|
||||||
if (tempv_last) {
|
if (tmpv_last) {
|
||||||
MeshTriNew(e,e->cur_color,tempv_last,tempv,tempv1);
|
MeshTriNew(e,e->cur_color,tmpv_last,tmpv,tmpv1);
|
||||||
MeshTriNew(e,e->cur_color,tempv1,tempv1_last,tempv_last);
|
MeshTriNew(e,e->cur_color,tmpv1,tmpv1_last,tmpv_last);
|
||||||
}
|
}
|
||||||
tempv_last=tempv;
|
tmpv_last=tmpv;
|
||||||
tempv1_last=tempv1;
|
tmpv1_last=tmpv1;
|
||||||
if (tempv==end)
|
if (tmpv==end)
|
||||||
break;
|
break;
|
||||||
tempv=tempv->next;
|
tmpv=tmpv->next;
|
||||||
}
|
}
|
||||||
if (e->closed && tempv_last) {
|
if (e->closed && tmpv_last) {
|
||||||
MeshTriNew(e,e->cur_color,tempv_last,start,end->next);
|
MeshTriNew(e,e->cur_color,tmpv_last,start,end->next);
|
||||||
MeshTriNew(e,e->cur_color,end->next,tempv1_last,tempv_last);
|
MeshTriNew(e,e->cur_color,end->next,tmpv1_last,tmpv_last);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 MeshPolygon(CMeshFrame *e,CMeshEdVertex *start,CMeshEdVertex *end,Bool rev)
|
U0 MeshPolygon(CMeshFrame *e,CMeshEdVertex *start,CMeshEdVertex *end,Bool rev)
|
||||||
{
|
{
|
||||||
CMeshEdVertex *tempv,*tempv1;
|
CMeshEdVertex *tmpv,*tmpv1;
|
||||||
if (start!=end) {
|
if (start!=end) {
|
||||||
tempv=start;
|
tmpv=start;
|
||||||
tempv1=tempv->next;
|
tmpv1=tmpv->next;
|
||||||
while (tempv1!=end) {
|
while (tmpv1!=end) {
|
||||||
if (rev)
|
if (rev)
|
||||||
MeshTriNew(e,e->cur_color,tempv1,tempv,end);
|
MeshTriNew(e,e->cur_color,tmpv1,tmpv,end);
|
||||||
else
|
else
|
||||||
MeshTriNew(e,e->cur_color,tempv,tempv1,end);
|
MeshTriNew(e,e->cur_color,tmpv,tmpv1,end);
|
||||||
tempv=tempv->next;
|
tmpv=tmpv->next;
|
||||||
tempv1=tempv1->next;
|
tmpv1=tmpv1->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -187,58 +187,58 @@ U0 MeshPrism(CMeshFrame *e)
|
|||||||
|
|
||||||
U0 MeshVertexSelAll(CMeshFrame *e,Bool val)
|
U0 MeshVertexSelAll(CMeshFrame *e,Bool val)
|
||||||
{
|
{
|
||||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
CMeshEdVertex *tmpv=e->vertex_head.next;
|
||||||
while (tempv!=&e->vertex_head) {
|
while (tmpv!=&e->vertex_head) {
|
||||||
if (val)
|
if (val)
|
||||||
tempv->flags|=VF_SEL;
|
tmpv->flags|=VF_SEL;
|
||||||
else
|
else
|
||||||
tempv->flags&=~VF_SEL;
|
tmpv->flags&=~VF_SEL;
|
||||||
tempv=tempv->next;
|
tmpv=tmpv->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 MeshTriSelAll(CMeshFrame *e,Bool val)
|
U0 MeshTriSelAll(CMeshFrame *e,Bool val)
|
||||||
{
|
{
|
||||||
CMeshEdTri *tempt=e->tri_head.next;
|
CMeshEdTri *tmpt=e->tri_head.next;
|
||||||
while (tempt!=&e->tri_head) {
|
while (tmpt!=&e->tri_head) {
|
||||||
if (val)
|
if (val)
|
||||||
tempt->flags|=TF_SEL;
|
tmpt->flags|=TF_SEL;
|
||||||
else
|
else
|
||||||
tempt->flags&=~TF_SEL;
|
tmpt->flags&=~TF_SEL;
|
||||||
tempt=tempt->next;
|
tmpt=tmpt->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 MeshVertexIgnoreSet(CMeshFrame *e,Bool val)
|
U0 MeshVertexIgnoreSet(CMeshFrame *e,Bool val)
|
||||||
{
|
{
|
||||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
CMeshEdVertex *tmpv=e->vertex_head.next;
|
||||||
while (tempv!=&e->vertex_head) {
|
while (tmpv!=&e->vertex_head) {
|
||||||
tempv->flags&=~VF_IGNORE;
|
tmpv->flags&=~VF_IGNORE;
|
||||||
if (tempv->flags&VF_SEL && val)
|
if (tmpv->flags&VF_SEL && val)
|
||||||
tempv->flags|=VF_IGNORE;
|
tmpv->flags|=VF_IGNORE;
|
||||||
tempv=tempv->next;
|
tmpv=tmpv->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 MeshP0Capture(CMeshFrame *e)
|
U0 MeshP0Capture(CMeshFrame *e)
|
||||||
{
|
{
|
||||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
CMeshEdVertex *tmpv=e->vertex_head.next;
|
||||||
while (tempv!=&e->vertex_head) {
|
while (tmpv!=&e->vertex_head) {
|
||||||
MemCpy(&tempv->p0,&tempv->p,sizeof(CD3I32));
|
MemCpy(&tmpv->p0,&tmpv->p,sizeof(CD3I32));
|
||||||
tempv=tempv->next;
|
tmpv=tmpv->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 MeshP0Offset(CMeshFrame *e,I64 dx,I64 dy,I64 dz)
|
U0 MeshP0Offset(CMeshFrame *e,I64 dx,I64 dy,I64 dz)
|
||||||
{
|
{
|
||||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
CMeshEdVertex *tmpv=e->vertex_head.next;
|
||||||
while (tempv!=&e->vertex_head) {
|
while (tmpv!=&e->vertex_head) {
|
||||||
if (tempv->flags&VF_SEL) {
|
if (tmpv->flags&VF_SEL) {
|
||||||
tempv->p.x=tempv->p0.x+dx;
|
tmpv->p.x=tmpv->p0.x+dx;
|
||||||
tempv->p.y=tempv->p0.y+dy;
|
tmpv->p.y=tmpv->p0.y+dy;
|
||||||
tempv->p.z=tempv->p0.z+dz;
|
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)
|
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 (x1>x2) SwapI64(&x1,&x2);
|
||||||
if (y1>y2) SwapI64(&y1,&y2);
|
if (y1>y2) SwapI64(&y1,&y2);
|
||||||
while (tempv!=&e->vertex_head) {
|
while (tmpv!=&e->vertex_head) {
|
||||||
if (x1<=tempv->pt.x<=x2 &&
|
if (x1<=tmpv->pt.x<=x2 &&
|
||||||
y1<=tempv->pt.y<=y2) {
|
y1<=tmpv->pt.y<=y2) {
|
||||||
if (sel_mode==SEL_MESH_AND)
|
if (sel_mode==SEL_MESH_AND)
|
||||||
tempv->flags&=~VF_SEL;
|
tmpv->flags&=~VF_SEL;
|
||||||
else
|
else
|
||||||
tempv->flags|=VF_SEL;
|
tmpv->flags|=VF_SEL;
|
||||||
} else if (sel_mode==SEL_MESH_EQU)
|
} else if (sel_mode==SEL_MESH_EQU)
|
||||||
tempv->flags&=~VF_SEL;
|
tmpv->flags&=~VF_SEL;
|
||||||
tempv=tempv->next;
|
tmpv=tmpv->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 MeshTriSelRect(CMeshFrame *e,I64 sel_mode,I64 x1,I64 x2,I64 y1,I64 y2)
|
U0 MeshTriSelRect(CMeshFrame *e,I64 sel_mode,I64 x1,I64 x2,I64 y1,I64 y2)
|
||||||
{
|
{
|
||||||
CMeshEdTri *tempt=e->tri_head.next;
|
CMeshEdTri *tmpt=e->tri_head.next;
|
||||||
if (x1>x2) SwapI64(&x1,&x2);
|
if (x1>x2) SwapI64(&x1,&x2);
|
||||||
if (y1>y2) SwapI64(&y1,&y2);
|
if (y1>y2) SwapI64(&y1,&y2);
|
||||||
while (tempt!=&e->tri_head) {
|
while (tmpt!=&e->tri_head) {
|
||||||
if (x1<=tempt->t[0]->pt.x<=x2 &&
|
if (x1<=tmpt->t[0]->pt.x<=x2 &&
|
||||||
y1<=tempt->t[0]->pt.y<=y2 &&
|
y1<=tmpt->t[0]->pt.y<=y2 &&
|
||||||
x1<=tempt->t[1]->pt.x<=x2 &&
|
x1<=tmpt->t[1]->pt.x<=x2 &&
|
||||||
y1<=tempt->t[1]->pt.y<=y2 &&
|
y1<=tmpt->t[1]->pt.y<=y2 &&
|
||||||
x1<=tempt->t[2]->pt.x<=x2 &&
|
x1<=tmpt->t[2]->pt.x<=x2 &&
|
||||||
y1<=tempt->t[2]->pt.y<=y2) {
|
y1<=tmpt->t[2]->pt.y<=y2) {
|
||||||
if (sel_mode==SEL_MESH_AND)
|
if (sel_mode==SEL_MESH_AND)
|
||||||
tempt->flags&=~TF_SEL;
|
tmpt->flags&=~TF_SEL;
|
||||||
else
|
else
|
||||||
tempt->flags|=TF_SEL;
|
tmpt->flags|=TF_SEL;
|
||||||
} else {
|
} else {
|
||||||
if (sel_mode==SEL_MESH_EQU)
|
if (sel_mode==SEL_MESH_EQU)
|
||||||
tempt->flags&=~TF_SEL;
|
tmpt->flags&=~TF_SEL;
|
||||||
else if (sel_mode==SEL_MESH_AND) {
|
else if (sel_mode==SEL_MESH_AND) {
|
||||||
if (x1<=tempt->t[0]->pt.x<=x2 &&
|
if (x1<=tmpt->t[0]->pt.x<=x2 &&
|
||||||
y1<=tempt->t[0]->pt.y<=y2 ||
|
y1<=tmpt->t[0]->pt.y<=y2 ||
|
||||||
x1<=tempt->t[1]->pt.x<=x2 &&
|
x1<=tmpt->t[1]->pt.x<=x2 &&
|
||||||
y1<=tempt->t[1]->pt.y<=y2 ||
|
y1<=tmpt->t[1]->pt.y<=y2 ||
|
||||||
x1<=tempt->t[2]->pt.x<=x2 &&
|
x1<=tmpt->t[2]->pt.x<=x2 &&
|
||||||
y1<=tempt->t[2]->pt.y<=y2)
|
y1<=tmpt->t[2]->pt.y<=y2)
|
||||||
tempt->flags&=~TF_SEL;
|
tmpt->flags&=~TF_SEL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tempt=tempt->next;
|
tmpt=tmpt->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
I64 MeshSelCnt(CMeshFrame *e)
|
I64 MeshSelCnt(CMeshFrame *e)
|
||||||
{
|
{
|
||||||
I64 res=0;
|
I64 res=0;
|
||||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
CMeshEdVertex *tmpv=e->vertex_head.next;
|
||||||
CMeshEdTri *tempt=e->tri_head.next;
|
CMeshEdTri *tmpt=e->tri_head.next;
|
||||||
while (tempv!=&e->vertex_head) {
|
while (tmpv!=&e->vertex_head) {
|
||||||
if (tempv->flags&VF_SEL)
|
if (tmpv->flags&VF_SEL)
|
||||||
res++;
|
res++;
|
||||||
tempv=tempv->next;
|
tmpv=tmpv->next;
|
||||||
}
|
}
|
||||||
while (tempt!=&e->tri_head) {
|
while (tmpt!=&e->tri_head) {
|
||||||
if (tempt->flags&TF_SEL)
|
if (tmpt->flags&TF_SEL)
|
||||||
res++;
|
res++;
|
||||||
tempt=tempt->next;
|
tmpt=tmpt->next;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -318,16 +318,16 @@ I64 MeshSelCnt(CMeshFrame *e)
|
|||||||
U0 MeshSwapAxes(CMeshFrame *e,I64 o1,I64 o2)
|
U0 MeshSwapAxes(CMeshFrame *e,I64 o1,I64 o2)
|
||||||
{
|
{
|
||||||
Bool unsel;
|
Bool unsel;
|
||||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
CMeshEdVertex *tmpv=e->vertex_head.next;
|
||||||
if (!MeshSelCnt(e)) {
|
if (!MeshSelCnt(e)) {
|
||||||
MeshVertexSelAll(e,TRUE);
|
MeshVertexSelAll(e,TRUE);
|
||||||
unsel=TRUE;
|
unsel=TRUE;
|
||||||
} else
|
} else
|
||||||
unsel=FALSE;
|
unsel=FALSE;
|
||||||
while (tempv!=&e->vertex_head) {
|
while (tmpv!=&e->vertex_head) {
|
||||||
if (tempv->flags&VF_SEL)
|
if (tmpv->flags&VF_SEL)
|
||||||
SwapU32((&tempv->p)(U8 *)+o1,(&tempv->p)(U8 *)+o2);
|
SwapU32((&tmpv->p)(U8 *)+o1,(&tmpv->p)(U8 *)+o2);
|
||||||
tempv=tempv->next;
|
tmpv=tmpv->next;
|
||||||
}
|
}
|
||||||
if (unsel)
|
if (unsel)
|
||||||
MeshVertexSelAll(e,FALSE);
|
MeshVertexSelAll(e,FALSE);
|
||||||
@@ -336,16 +336,16 @@ U0 MeshSwapAxes(CMeshFrame *e,I64 o1,I64 o2)
|
|||||||
U0 MeshInvertAxis(CMeshFrame *e,I64 o)
|
U0 MeshInvertAxis(CMeshFrame *e,I64 o)
|
||||||
{
|
{
|
||||||
Bool unsel;
|
Bool unsel;
|
||||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
CMeshEdVertex *tmpv=e->vertex_head.next;
|
||||||
if (!MeshSelCnt(e)) {
|
if (!MeshSelCnt(e)) {
|
||||||
MeshVertexSelAll(e,TRUE);
|
MeshVertexSelAll(e,TRUE);
|
||||||
unsel=TRUE;
|
unsel=TRUE;
|
||||||
} else
|
} else
|
||||||
unsel=FALSE;
|
unsel=FALSE;
|
||||||
while (tempv!=&e->vertex_head) {
|
while (tmpv!=&e->vertex_head) {
|
||||||
if (tempv->flags&VF_SEL)
|
if (tmpv->flags&VF_SEL)
|
||||||
*((&tempv->p)(U8 *)+o)(I32 *)=-*((&tempv->p)(U8 *)+o)(I32 *);
|
*((&tmpv->p)(U8 *)+o)(I32 *)=-*((&tmpv->p)(U8 *)+o)(I32 *);
|
||||||
tempv=tempv->next;
|
tmpv=tmpv->next;
|
||||||
}
|
}
|
||||||
if (unsel)
|
if (unsel)
|
||||||
MeshVertexSelAll(e,FALSE);
|
MeshVertexSelAll(e,FALSE);
|
||||||
@@ -355,20 +355,20 @@ U0 MeshTransformSel(CMeshFrame *e)
|
|||||||
{
|
{
|
||||||
Bool unsel;
|
Bool unsel;
|
||||||
I64 r[16],x,y,z;
|
I64 r[16],x,y,z;
|
||||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
CMeshEdVertex *tmpv=e->vertex_head.next;
|
||||||
if (PopUpTransform(r)) {
|
if (PopUpTransform(r)) {
|
||||||
if (!MeshSelCnt(e)) {
|
if (!MeshSelCnt(e)) {
|
||||||
MeshVertexSelAll(e,TRUE);
|
MeshVertexSelAll(e,TRUE);
|
||||||
unsel=TRUE;
|
unsel=TRUE;
|
||||||
} else
|
} else
|
||||||
unsel=FALSE;
|
unsel=FALSE;
|
||||||
while (tempv!=&e->vertex_head) {
|
while (tmpv!=&e->vertex_head) {
|
||||||
if (tempv->flags&VF_SEL) {
|
if (tmpv->flags&VF_SEL) {
|
||||||
x=tempv->p.x; y=tempv->p.y; z=tempv->p.z;
|
x=tmpv->p.x; y=tmpv->p.y; z=tmpv->p.z;
|
||||||
Mat4x4MulXYZ(r,&x,&y,&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)
|
if (unsel)
|
||||||
MeshVertexSelAll(e,FALSE);
|
MeshVertexSelAll(e,FALSE);
|
||||||
@@ -378,16 +378,16 @@ U0 MeshTransformSel(CMeshFrame *e)
|
|||||||
U0 MeshColorTris(CMeshFrame *e)
|
U0 MeshColorTris(CMeshFrame *e)
|
||||||
{
|
{
|
||||||
Bool unsel;
|
Bool unsel;
|
||||||
CMeshEdTri *tempt=e->tri_head.next;
|
CMeshEdTri *tmpt=e->tri_head.next;
|
||||||
if (!MeshSelCnt(e)) {
|
if (!MeshSelCnt(e)) {
|
||||||
MeshTriSelAll(e,TRUE);
|
MeshTriSelAll(e,TRUE);
|
||||||
unsel=TRUE;
|
unsel=TRUE;
|
||||||
} else
|
} else
|
||||||
unsel=FALSE;
|
unsel=FALSE;
|
||||||
while (tempt!=&e->tri_head) {
|
while (tmpt!=&e->tri_head) {
|
||||||
if (tempt->flags & TF_SEL)
|
if (tmpt->flags & TF_SEL)
|
||||||
tempt->mt.color=e->cur_color;
|
tmpt->mt.color=e->cur_color;
|
||||||
tempt=tempt->next;
|
tmpt=tmpt->next;
|
||||||
}
|
}
|
||||||
if (unsel)
|
if (unsel)
|
||||||
MeshTriSelAll(e,FALSE);
|
MeshTriSelAll(e,FALSE);
|
||||||
@@ -396,16 +396,16 @@ U0 MeshColorTris(CMeshFrame *e)
|
|||||||
U0 MeshRevTris(CMeshFrame *e)
|
U0 MeshRevTris(CMeshFrame *e)
|
||||||
{
|
{
|
||||||
Bool unsel;
|
Bool unsel;
|
||||||
CMeshEdTri *tempt=e->tri_head.next;
|
CMeshEdTri *tmpt=e->tri_head.next;
|
||||||
if (!MeshSelCnt(e)) {
|
if (!MeshSelCnt(e)) {
|
||||||
MeshTriSelAll(e,TRUE);
|
MeshTriSelAll(e,TRUE);
|
||||||
unsel=TRUE;
|
unsel=TRUE;
|
||||||
} else
|
} else
|
||||||
unsel=FALSE;
|
unsel=FALSE;
|
||||||
while (tempt!=&e->tri_head) {
|
while (tmpt!=&e->tri_head) {
|
||||||
if (tempt->flags & TF_SEL)
|
if (tmpt->flags & TF_SEL)
|
||||||
SwapI64(&tempt->t[1],&tempt->t[2]);
|
SwapI64(&tmpt->t[1],&tmpt->t[2]);
|
||||||
tempt=tempt->next;
|
tmpt=tmpt->next;
|
||||||
}
|
}
|
||||||
if (unsel)
|
if (unsel)
|
||||||
MeshTriSelAll(e,FALSE);
|
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.
|
//Makes a copy of e->dc so we can change dc->color member and stuff.
|
||||||
CDC *dc=DCAlias(e->dc,e->dc->win_task);
|
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;
|
I64 i,*old_r=dc->r;
|
||||||
|
|
||||||
//$LK,"DCAlias",A="MN:DCAlias"$() allocs a new identity rotation matrix.
|
//$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);
|
GrLine3(dc,0,0,-500,0,0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (tempt!=&e->tri_head) {
|
while (tmpt!=&e->tri_head) {
|
||||||
if (tempt->cpu_num==Gs->num) {
|
if (tmpt->cpu_num==Gs->num) {
|
||||||
if (tempt->flags & TF_SEL) {
|
if (tmpt->flags & TF_SEL) {
|
||||||
if (Blink)
|
if (Blink)
|
||||||
dc->color=ROPF_DITHER+WHITE<<16+RED;
|
dc->color=ROPF_DITHER+WHITE<<16+RED;
|
||||||
else
|
else
|
||||||
dc->color=ROPF_DITHER+RED<<16+WHITE;
|
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 {
|
} else {
|
||||||
(*dc->lighting)(dc,&tempt->t[0]->pt,&tempt->t[1]->pt,
|
(*dc->lighting)(dc,&tmpt->t[0]->pt,&tmpt->t[1]->pt,
|
||||||
&tempt->t[2]->pt,tempt->mt.color);
|
&tmpt->t[2]->pt,tmpt->mt.color);
|
||||||
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tempt=tempt->next;
|
tmpt=tmpt->next;
|
||||||
}
|
}
|
||||||
dc->r=old_r;
|
dc->r=old_r;
|
||||||
|
|
||||||
@@ -519,7 +519,7 @@ U0 MPDrawIt(CMeshFrame *e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
I64 *MeshW2S(CMeshFrame *e,CTask *task)
|
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);
|
CCtrl *c=CtrlFindUnique(task,CTRLT_VIEWING_ANGLES);
|
||||||
CViewAngles *s=c->state;
|
CViewAngles *s=c->state;
|
||||||
I64 *r=Mat4x4IdentNew(task);
|
I64 *r=Mat4x4IdentNew(task);
|
||||||
@@ -534,7 +534,7 @@ I64 *MeshW2S(CMeshFrame *e,CTask *task)
|
|||||||
}
|
}
|
||||||
|
|
||||||
I64 *MeshS2W(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);
|
CCtrl *c=CtrlFindUnique(task,CTRLT_VIEWING_ANGLES);
|
||||||
CViewAngles *s=c->state;
|
CViewAngles *s=c->state;
|
||||||
I64 *r=Mat4x4IdentNew(task);
|
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,
|
yc=ip.pos.y-task->pix_top-task->scroll_y-e->cy,zc=0,
|
||||||
x=0,y=0,z=e->ip_z,
|
x=0,y=0,z=e->ip_z,
|
||||||
i,x2,y2,z2;
|
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.
|
//Converges onto a solution for zc, an unknown.
|
||||||
for (i=0;i<128;i++) {
|
for (i=0;i<128;i++) {
|
||||||
@@ -606,97 +606,97 @@ U0 MeshClipboardRst()
|
|||||||
|
|
||||||
U0 MeshClipboardCopy(CMeshFrame *e)
|
U0 MeshClipboardCopy(CMeshFrame *e)
|
||||||
{
|
{
|
||||||
CMeshEdVertex *tempv=e->vertex_head.next,*tempv2;
|
CMeshEdVertex *tmpv=e->vertex_head.next,*tmpv2;
|
||||||
CMeshEdTri *tempt=e->tri_head.next,*tempt2;
|
CMeshEdTri *tmpt=e->tri_head.next,*tmpt2;
|
||||||
|
|
||||||
MeshClipboardRst;
|
MeshClipboardRst;
|
||||||
while (tempv!=&e->vertex_head) {
|
while (tmpv!=&e->vertex_head) {
|
||||||
if (tempv->flags&VF_SEL) {
|
if (tmpv->flags&VF_SEL) {
|
||||||
tempv->copy=tempv2=ACAlloc(sizeof(CMeshEdVertex));
|
tmpv->copy=tmpv2=ACAlloc(sizeof(CMeshEdVertex));
|
||||||
MemCpy(&tempv2->p,&tempv->p,sizeof(CD3I32));
|
MemCpy(&tmpv2->p,&tmpv->p,sizeof(CD3I32));
|
||||||
QueIns(tempv2,sys_clipboard_vertex_head.last);
|
QueIns(tmpv2,sys_clipboard_vertex_head.last);
|
||||||
tempv->flags|=VF_COPIED;
|
tmpv->flags|=VF_COPIED;
|
||||||
tempv->flags&=~VF_SEL;
|
tmpv->flags&=~VF_SEL;
|
||||||
} else {
|
} else {
|
||||||
tempv->copy=NULL;
|
tmpv->copy=NULL;
|
||||||
tempv->flags&=~(VF_COPIED|VF_SEL);
|
tmpv->flags&=~(VF_COPIED|VF_SEL);
|
||||||
}
|
}
|
||||||
tempv=tempv->next;
|
tmpv=tmpv->next;
|
||||||
}
|
}
|
||||||
while (tempt!=&e->tri_head) {
|
while (tmpt!=&e->tri_head) {
|
||||||
if (tempt->flags&TF_SEL &&
|
if (tmpt->flags&TF_SEL &&
|
||||||
tempt->t[0]->copy && tempt->t[1]->copy && tempt->t[2]->copy) {
|
tmpt->t[0]->copy && tmpt->t[1]->copy && tmpt->t[2]->copy) {
|
||||||
tempt2=ACAlloc(sizeof(CMeshEdTri));
|
tmpt2=ACAlloc(sizeof(CMeshEdTri));
|
||||||
tempt2->t[0]=tempt->t[0]->copy;
|
tmpt2->t[0]=tmpt->t[0]->copy;
|
||||||
tempt2->t[1]=tempt->t[1]->copy;
|
tmpt2->t[1]=tmpt->t[1]->copy;
|
||||||
tempt2->t[2]=tempt->t[2]->copy;
|
tmpt2->t[2]=tmpt->t[2]->copy;
|
||||||
tempt2->mt.color=tempt->mt.color;
|
tmpt2->mt.color=tmpt->mt.color;
|
||||||
QueIns(tempt2,sys_clipboard_tri_head.last);
|
QueIns(tmpt2,sys_clipboard_tri_head.last);
|
||||||
tempt->flags|=TF_COPIED;
|
tmpt->flags|=TF_COPIED;
|
||||||
tempt->flags&=~TF_SEL;
|
tmpt->flags&=~TF_SEL;
|
||||||
} else
|
} else
|
||||||
tempt->flags&=~(TF_COPIED|TF_SEL);
|
tmpt->flags&=~(TF_COPIED|TF_SEL);
|
||||||
tempt=tempt->next;
|
tmpt=tmpt->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 MeshClipboardCut(CMeshFrame *e)
|
U0 MeshClipboardCut(CMeshFrame *e)
|
||||||
{
|
{
|
||||||
CMeshEdVertex *tempv=e->vertex_head.next,*tempv1;
|
CMeshEdVertex *tmpv=e->vertex_head.next,*tmpv1;
|
||||||
CMeshEdTri *tempt=e->tri_head.next,*tempt1;
|
CMeshEdTri *tmpt=e->tri_head.next,*tmpt1;
|
||||||
MeshClipboardCopy(e);
|
MeshClipboardCopy(e);
|
||||||
while (tempt!=&e->tri_head) {
|
while (tmpt!=&e->tri_head) {
|
||||||
tempt1=tempt->next;
|
tmpt1=tmpt->next;
|
||||||
if (tempt->flags&TF_COPIED)
|
if (tmpt->flags&TF_COPIED)
|
||||||
MeshTriDel(e,tempt);
|
MeshTriDel(e,tmpt);
|
||||||
tempt=tempt1;
|
tmpt=tmpt1;
|
||||||
}
|
}
|
||||||
while (tempv!=&e->vertex_head) {
|
while (tmpv!=&e->vertex_head) {
|
||||||
tempv1=tempv->next;
|
tmpv1=tmpv->next;
|
||||||
if (tempv->flags&VF_COPIED)
|
if (tmpv->flags&VF_COPIED)
|
||||||
MeshVertexDel(e,tempv);
|
MeshVertexDel(e,tmpv);
|
||||||
tempv=tempv1;
|
tmpv=tmpv1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 MeshClipboardDel(CMeshFrame *e)
|
U0 MeshClipboardDel(CMeshFrame *e)
|
||||||
{//Technically not clipboard
|
{//Technically not clipboard
|
||||||
CMeshEdVertex *tempv=e->vertex_head.next,*tempv1;
|
CMeshEdVertex *tmpv=e->vertex_head.next,*tmpv1;
|
||||||
CMeshEdTri *tempt=e->tri_head.next,*tempt1;
|
CMeshEdTri *tmpt=e->tri_head.next,*tmpt1;
|
||||||
while (tempt!=&e->tri_head) {
|
while (tmpt!=&e->tri_head) {
|
||||||
tempt1=tempt->next;
|
tmpt1=tmpt->next;
|
||||||
if (tempt->flags&TF_SEL)
|
if (tmpt->flags&TF_SEL)
|
||||||
MeshTriDel(e,tempt);
|
MeshTriDel(e,tmpt);
|
||||||
tempt=tempt1;
|
tmpt=tmpt1;
|
||||||
}
|
}
|
||||||
while (tempv!=&e->vertex_head) {
|
while (tmpv!=&e->vertex_head) {
|
||||||
tempv1=tempv->next;
|
tmpv1=tmpv->next;
|
||||||
if (tempv->flags&VF_SEL)
|
if (tmpv->flags&VF_SEL)
|
||||||
MeshVertexDel(e,tempv);
|
MeshVertexDel(e,tmpv);
|
||||||
tempv=tempv1;
|
tmpv=tmpv1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 MeshClipboardPaste(CMeshFrame *e)
|
U0 MeshClipboardPaste(CMeshFrame *e)
|
||||||
{
|
{
|
||||||
CMeshEdVertex *tempv2=sys_clipboard_vertex_head.next,*tempv;
|
CMeshEdVertex *tmpv2=sys_clipboard_vertex_head.next,*tmpv;
|
||||||
CMeshEdTri *tempt2=sys_clipboard_tri_head.next,*tempt;
|
CMeshEdTri *tmpt2=sys_clipboard_tri_head.next,*tmpt;
|
||||||
|
|
||||||
MeshVertexSelAll(e,FALSE);
|
MeshVertexSelAll(e,FALSE);
|
||||||
MeshTriSelAll(e,FALSE);
|
MeshTriSelAll(e,FALSE);
|
||||||
while (tempv2!=&sys_clipboard_vertex_head) {
|
while (tmpv2!=&sys_clipboard_vertex_head) {
|
||||||
tempv2->copy=tempv=CAlloc(sizeof(CMeshEdVertex));
|
tmpv2->copy=tmpv=CAlloc(sizeof(CMeshEdVertex));
|
||||||
MemCpy(&tempv->p,&tempv2->p,sizeof(CD3I32));
|
MemCpy(&tmpv->p,&tmpv2->p,sizeof(CD3I32));
|
||||||
QueIns(tempv,e->vertex_head.last);
|
QueIns(tmpv,e->vertex_head.last);
|
||||||
tempv->flags|=VF_SEL;
|
tmpv->flags|=VF_SEL;
|
||||||
tempv2=tempv2->next;
|
tmpv2=tmpv2->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (tempt2!=&sys_clipboard_tri_head) {
|
while (tmpt2!=&sys_clipboard_tri_head) {
|
||||||
tempt=MeshTriNew(e,tempt2->mt.color,tempt2->t[0]->copy,
|
tmpt=MeshTriNew(e,tmpt2->mt.color,tmpt2->t[0]->copy,
|
||||||
tempt2->t[1]->copy,tempt2->t[2]->copy);
|
tmpt2->t[1]->copy,tmpt2->t[2]->copy);
|
||||||
tempt->flags|=TF_SEL;
|
tmpt->flags|=TF_SEL;
|
||||||
tempt2=tempt2->next;
|
tmpt2=tmpt2->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -708,7 +708,7 @@ U0 DrawIt(CTask *task,CDC *dc)
|
|||||||
CCtrl *c=CtrlFindUnique(task,CTRLT_VIEWING_ANGLES);
|
CCtrl *c=CtrlFindUnique(task,CTRLT_VIEWING_ANGLES);
|
||||||
F64 d;
|
F64 d;
|
||||||
I64 i,x,y,z;
|
I64 i,x,y,z;
|
||||||
CMeshEdVertex *tempv;
|
CMeshEdVertex *tmpv;
|
||||||
|
|
||||||
task->horz_scroll.min=-(MESH_WORKSPACE_SIZE-task->pix_width)/2;
|
task->horz_scroll.min=-(MESH_WORKSPACE_SIZE-task->pix_width)/2;
|
||||||
task->horz_scroll.max= (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->x=e->cx;
|
||||||
dc->y=e->cy;
|
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.
|
//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.
|
//GR_Z_ALL is set to half of the Z-range which is an I32.
|
||||||
dc->z=GR_Z_ALL;
|
dc->z=GR_Z_ALL;
|
||||||
@@ -741,12 +741,12 @@ U0 DrawIt(CTask *task,CDC *dc)
|
|||||||
|
|
||||||
DCDepthBufAlloc(dc);
|
DCDepthBufAlloc(dc);
|
||||||
|
|
||||||
tempv=e->vertex_head.next;
|
tmpv=e->vertex_head.next;
|
||||||
while (tempv!=&e->vertex_head) {
|
while (tmpv!=&e->vertex_head) {
|
||||||
x=tempv->p.x; y=tempv->p.y; z=tempv->p.z;
|
x=tmpv->p.x; y=tmpv->p.y; z=tmpv->p.z;
|
||||||
(*dc->transform)(dc,&x,&y,&z);
|
(*dc->transform)(dc,&x,&y,&z);
|
||||||
tempv->pt.x=x; tempv->pt.y=y; tempv->pt.z=z;
|
tmpv->pt.x=x; tmpv->pt.y=y; tmpv->pt.z=z;
|
||||||
tempv=tempv->next;
|
tmpv=tmpv->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
e->mp_not_done_flags=1<<mp_cnt-1; //Issue jobs to all cores.
|
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++)
|
for (i=0;i<mp_cnt;i++)
|
||||||
JobQue(&MPDrawIt,e,i);
|
JobQue(&MPDrawIt,e,i);
|
||||||
|
|
||||||
tempv=e->vertex_head.next;
|
tmpv=e->vertex_head.next;
|
||||||
while (tempv!=&e->vertex_head) {
|
while (tmpv!=&e->vertex_head) {
|
||||||
x=tempv->pt.x; y=tempv->pt.y; z=tempv->pt.z;
|
x=tmpv->pt.x; y=tmpv->pt.y; z=tmpv->pt.z;
|
||||||
if (e->vertex_on) {
|
if (e->vertex_on) {
|
||||||
if (Blink(10)) //This blinks at 10 Hz.
|
if (Blink(10)) //This blinks at 10 Hz.
|
||||||
dc->color=ROPF_DITHER+BLACK<<16+WHITE;
|
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);
|
||||||
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 (e->ed_mode=='t') {
|
||||||
if (Blink(10)) //This blinks at 10 Hz.
|
if (Blink(10)) //This blinks at 10 Hz.
|
||||||
dc->color=ROPF_DITHER+e->cur_color.c0.color<<16+
|
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);
|
GrCircle(dc,x,y,3);
|
||||||
}
|
}
|
||||||
tempv=tempv->next;
|
tmpv=tmpv->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CtrlInside(c,ip.presnap.x,ip.presnap.y)||winmgr.show_menu) {
|
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;
|
I64 i,j,x,y,z;
|
||||||
CColorROPU32 color;
|
CColorROPU32 color;
|
||||||
CMeshEdVertex *tempv,*va[3];
|
CMeshEdVertex *tmpv,*va[3];
|
||||||
|
|
||||||
QueInit(&e->vertex_head);
|
QueInit(&e->vertex_head);
|
||||||
QueInit(&e->tri_head);
|
QueInit(&e->tri_head);
|
||||||
@@ -858,8 +858,8 @@ U0 MeshLoad(CMeshFrame *e,U8 *src)
|
|||||||
x=*src(I32 *)++;
|
x=*src(I32 *)++;
|
||||||
y=*src(I32 *)++;
|
y=*src(I32 *)++;
|
||||||
z=*src(I32 *)++;
|
z=*src(I32 *)++;
|
||||||
tempv=MeshVertexNew(e,x,y,z);
|
tmpv=MeshVertexNew(e,x,y,z);
|
||||||
tempv->num=i;
|
tmpv->num=i;
|
||||||
}
|
}
|
||||||
for (i=0;i<e->tri_cnt;i++) {
|
for (i=0;i<e->tri_cnt;i++) {
|
||||||
color=*src(I32 *)++;
|
color=*src(I32 *)++;
|
||||||
@@ -872,21 +872,21 @@ U0 MeshLoad(CMeshFrame *e,U8 *src)
|
|||||||
I64 MeshSize(CMeshFrame *e)
|
I64 MeshSize(CMeshFrame *e)
|
||||||
{
|
{
|
||||||
I64 i;
|
I64 i;
|
||||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
CMeshEdVertex *tmpv=e->vertex_head.next;
|
||||||
CMeshEdTri *tempt=e->tri_head.next;
|
CMeshEdTri *tmpt=e->tri_head.next;
|
||||||
|
|
||||||
e->vertex_cnt=0;
|
e->vertex_cnt=0;
|
||||||
while (tempv!=&e->vertex_head) {
|
while (tmpv!=&e->vertex_head) {
|
||||||
tempv->num=e->vertex_cnt++;
|
tmpv->num=e->vertex_cnt++;
|
||||||
tempv=tempv->next;
|
tmpv=tmpv->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
e->tri_cnt=0;
|
e->tri_cnt=0;
|
||||||
while (tempt!=&e->tri_head) {
|
while (tmpt!=&e->tri_head) {
|
||||||
e->tri_cnt++;
|
e->tri_cnt++;
|
||||||
for (i=0;i<3;i++)
|
for (i=0;i<3;i++)
|
||||||
tempt->mt.nums[i]=tempt->t[i]->num;
|
tmpt->mt.nums[i]=tmpt->t[i]->num;
|
||||||
tempt=tempt->next;
|
tmpt=tmpt->next;
|
||||||
}
|
}
|
||||||
return sizeof(I32)*2+
|
return sizeof(I32)*2+
|
||||||
(offset(CMeshEdVertex.end)-offset(CMeshEdVertex.start))*e->vertex_cnt+
|
(offset(CMeshEdVertex.end)-offset(CMeshEdVertex.start))*e->vertex_cnt+
|
||||||
@@ -897,25 +897,25 @@ I32 *MeshSave(CMeshFrame *e,I64 *_size=NULL)
|
|||||||
{
|
{
|
||||||
I64 size=MeshSize(e);
|
I64 size=MeshSize(e);
|
||||||
U8 *res=MAlloc(size),*dst=res;
|
U8 *res=MAlloc(size),*dst=res;
|
||||||
CMeshEdVertex *tempv=e->vertex_head.next;
|
CMeshEdVertex *tmpv=e->vertex_head.next;
|
||||||
CMeshEdTri *tempt=e->tri_head.next;
|
CMeshEdTri *tmpt=e->tri_head.next;
|
||||||
|
|
||||||
*dst(I32 *)++=e->vertex_cnt;
|
*dst(I32 *)++=e->vertex_cnt;
|
||||||
*dst(I32 *)++=e->tri_cnt;
|
*dst(I32 *)++=e->tri_cnt;
|
||||||
|
|
||||||
e->vertex_cnt=0;
|
e->vertex_cnt=0;
|
||||||
while (tempv!=&e->vertex_head) {
|
while (tmpv!=&e->vertex_head) {
|
||||||
MemCpy(dst,&tempv->start,offset(CMeshEdVertex.end)
|
MemCpy(dst,&tmpv->start,offset(CMeshEdVertex.end)
|
||||||
-offset(CMeshEdVertex.start));
|
-offset(CMeshEdVertex.start));
|
||||||
dst+=offset(CMeshEdVertex.end)-offset(CMeshEdVertex.start);
|
dst+=offset(CMeshEdVertex.end)-offset(CMeshEdVertex.start);
|
||||||
tempv=tempv->next;
|
tmpv=tmpv->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
e->tri_cnt=0;
|
e->tri_cnt=0;
|
||||||
while (tempt!=&e->tri_head) {
|
while (tmpt!=&e->tri_head) {
|
||||||
MemCpy(dst,&tempt->start,offset(CMeshEdTri.end)-offset(CMeshEdTri.start));
|
MemCpy(dst,&tmpt->start,offset(CMeshEdTri.end)-offset(CMeshEdTri.start));
|
||||||
dst+=offset(CMeshEdTri.end)-offset(CMeshEdTri.start);
|
dst+=offset(CMeshEdTri.end)-offset(CMeshEdTri.start);
|
||||||
tempt=tempt->next;
|
tmpt=tmpt->next;
|
||||||
}
|
}
|
||||||
if (_size) *_size=size;
|
if (_size) *_size=size;
|
||||||
return res;
|
return res;
|
||||||
@@ -931,27 +931,27 @@ U0 MeshCleanUp(CMeshFrame *e)
|
|||||||
|
|
||||||
U0 MeshUpdateMenu(CMeshFrame *e)
|
U0 MeshUpdateMenu(CMeshFrame *e)
|
||||||
{
|
{
|
||||||
CMenuEntry *tempse;
|
CMenuEntry *tmpse;
|
||||||
if (tempse=MenuEntryFind(Fs->cur_menu,"View/Grid"))
|
if (tmpse=MenuEntryFind(Fs->cur_menu,"View/Grid"))
|
||||||
tempse->checked=ToBool(e->grid_on);
|
tmpse->checked=ToBool(e->grid_on);
|
||||||
if (tempse=MenuEntryFind(Fs->cur_menu,"View/Vertex"))
|
if (tmpse=MenuEntryFind(Fs->cur_menu,"View/Vertex"))
|
||||||
tempse->checked=ToBool(e->vertex_on);
|
tmpse->checked=ToBool(e->vertex_on);
|
||||||
if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/PlaceVertex"))
|
if (tmpse=MenuEntryFind(Fs->cur_menu,"Mode/PlaceVertex"))
|
||||||
tempse->checked=ToBool(e->ed_mode=='v');
|
tmpse->checked=ToBool(e->ed_mode=='v');
|
||||||
if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/MoveVertex"))
|
if (tmpse=MenuEntryFind(Fs->cur_menu,"Mode/MoveVertex"))
|
||||||
tempse->checked=ToBool(e->ed_mode=='m');
|
tmpse->checked=ToBool(e->ed_mode=='m');
|
||||||
if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/MoveVertexZ"))
|
if (tmpse=MenuEntryFind(Fs->cur_menu,"Mode/MoveVertexZ"))
|
||||||
tempse->checked=ToBool(e->ed_mode=='M');
|
tmpse->checked=ToBool(e->ed_mode=='M');
|
||||||
if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/Triangle"))
|
if (tmpse=MenuEntryFind(Fs->cur_menu,"Mode/Triangle"))
|
||||||
tempse->checked=ToBool(e->ed_mode=='t');
|
tmpse->checked=ToBool(e->ed_mode=='t');
|
||||||
if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/Polygon"))
|
if (tmpse=MenuEntryFind(Fs->cur_menu,"Mode/Polygon"))
|
||||||
tempse->checked=ToBool(e->ed_mode=='n');
|
tmpse->checked=ToBool(e->ed_mode=='n');
|
||||||
if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/Fence"))
|
if (tmpse=MenuEntryFind(Fs->cur_menu,"Mode/Fence"))
|
||||||
tempse->checked=ToBool(e->ed_mode=='f');
|
tmpse->checked=ToBool(e->ed_mode=='f');
|
||||||
if (tempse=MenuEntryFind(Fs->cur_menu,"Mode/Prism"))
|
if (tmpse=MenuEntryFind(Fs->cur_menu,"Mode/Prism"))
|
||||||
tempse->checked=ToBool(e->ed_mode=='p');
|
tmpse->checked=ToBool(e->ed_mode=='p');
|
||||||
if (tempse=MenuEntryFind(Fs->cur_menu,"View/FlipY"))
|
if (tmpse=MenuEntryFind(Fs->cur_menu,"View/FlipY"))
|
||||||
tempse->checked=ToBool(e->flip_y);
|
tmpse->checked=ToBool(e->flip_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
I32 *SpriteMeshEd(I32 *head=NULL,I64 *_size=NULL,Bool flip_y=FALSE)
|
I32 *SpriteMeshEd(I32 *head=NULL,I64 *_size=NULL,Bool flip_y=FALSE)
|
||||||
@@ -973,7 +973,7 @@ $WW,0$*/
|
|||||||
CViewAngles *s,*old_s;
|
CViewAngles *s,*old_s;
|
||||||
I64 i,msg_code,sel_mode,a1,a2,make_tri_vertex_num=0,x,y,z;
|
I64 i,msg_code,sel_mode,a1,a2,make_tri_vertex_num=0,x,y,z;
|
||||||
CD3I32 p0a,p0b;
|
CD3I32 p0a,p0b;
|
||||||
CMeshEdVertex *va[3],*tempv;
|
CMeshEdVertex *va[3],*tmpv;
|
||||||
Bool adjusting_z=FALSE,moving,save_and_exit;
|
Bool adjusting_z=FALSE,moving,save_and_exit;
|
||||||
CMeshFrame e;
|
CMeshFrame e;
|
||||||
|
|
||||||
@@ -1060,7 +1060,7 @@ $WW,0$*/
|
|||||||
"$$GREEN$$'p'$$FG$$: Prism Mode\n"
|
"$$GREEN$$'p'$$FG$$: Prism Mode\n"
|
||||||
"$$GREEN$$'c'$$FG$$: Set color\n"
|
"$$GREEN$$'c'$$FG$$: Set color\n"
|
||||||
"$$GREEN$$'s'$$FG$$: Set snap\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
|
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;
|
-WIF_SELF_CTRLS-WIF_FOCUS_TASK_MENU-WIF_SELF_GRAB_SCROLL;
|
||||||
@@ -1267,11 +1267,11 @@ me_clipboard_cut:
|
|||||||
case 'j':
|
case 'j':
|
||||||
if (moving)
|
if (moving)
|
||||||
MeshVertexIgnoreSet(&e,TRUE);
|
MeshVertexIgnoreSet(&e,TRUE);
|
||||||
if (tempv=MeshVertexFindScrPt(&e,
|
if (tmpv=MeshVertexFindScrPt(&e,
|
||||||
ip.pos.x-Fs->pix_left-Fs->scroll_x,
|
ip.pos.x-Fs->pix_left-Fs->scroll_x,
|
||||||
ip.pos.y-Fs->pix_top-Fs->scroll_y)) {
|
ip.pos.y-Fs->pix_top-Fs->scroll_y)) {
|
||||||
Noise(25,2000,8000);
|
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 {
|
} else {
|
||||||
Beep; Beep;
|
Beep; Beep;
|
||||||
e.ip_z=0;
|
e.ip_z=0;
|
||||||
@@ -1324,9 +1324,9 @@ me_clipboard_cut:
|
|||||||
case 'm':
|
case 'm':
|
||||||
if (!moving) {
|
if (!moving) {
|
||||||
if (!MeshSelCnt(&e) &&
|
if (!MeshSelCnt(&e) &&
|
||||||
(tempv=MeshVertexFindScrPt(&e,a1,a2))) {
|
(tmpv=MeshVertexFindScrPt(&e,a1,a2))) {
|
||||||
tempv->flags|=VF_SEL;
|
tmpv->flags|=VF_SEL;
|
||||||
e.ip_z=RoundI64(tempv->p.z,e.cur_snap);
|
e.ip_z=RoundI64(tmpv->p.z,e.cur_snap);
|
||||||
}
|
}
|
||||||
if (MeshSelCnt(&e)) {
|
if (MeshSelCnt(&e)) {
|
||||||
MeshCursorW(&e,Fs,&x,&y,&z);
|
MeshCursorW(&e,Fs,&x,&y,&z);
|
||||||
@@ -1341,9 +1341,9 @@ me_clipboard_cut:
|
|||||||
case 'M':
|
case 'M':
|
||||||
if (!adjusting_z && !moving) {
|
if (!adjusting_z && !moving) {
|
||||||
if (!MeshSelCnt(&e) &&
|
if (!MeshSelCnt(&e) &&
|
||||||
(tempv=MeshVertexFindScrPt(&e,a1,a2))) {
|
(tmpv=MeshVertexFindScrPt(&e,a1,a2))) {
|
||||||
tempv->flags|=VF_SEL;
|
tmpv->flags|=VF_SEL;
|
||||||
e.ip_z=RoundI64(tempv->p.z,e.cur_snap);
|
e.ip_z=RoundI64(tmpv->p.z,e.cur_snap);
|
||||||
}
|
}
|
||||||
if (MeshSelCnt(&e)) {
|
if (MeshSelCnt(&e)) {
|
||||||
MeshCursorW(&e,Fs,&x,&y,&z);
|
MeshCursorW(&e,Fs,&x,&y,&z);
|
||||||
@@ -1394,16 +1394,16 @@ me_clipboard_cut:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
if (tempv=MeshVertexFindScrPt(&e,a1,a2)) {
|
if (tmpv=MeshVertexFindScrPt(&e,a1,a2)) {
|
||||||
for (i=0;i<make_tri_vertex_num;i++)
|
for (i=0;i<make_tri_vertex_num;i++)
|
||||||
if (va[i]==tempv) {
|
if (va[i]==tmpv) {
|
||||||
Beep; Beep;
|
Beep; Beep;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i==make_tri_vertex_num) {
|
if (i==make_tri_vertex_num) {
|
||||||
Noise(25,2000,8000);
|
Noise(25,2000,8000);
|
||||||
va[make_tri_vertex_num++]=tempv;
|
va[make_tri_vertex_num++]=tmpv;
|
||||||
tempv->flags|=VF_SEL;
|
tmpv->flags|=VF_SEL;
|
||||||
if (make_tri_vertex_num==3) {
|
if (make_tri_vertex_num==3) {
|
||||||
e.cur_tri=MeshTriNew(&e,e.cur_color,va[0],va[1],va[2]);
|
e.cur_tri=MeshTriNew(&e,e.cur_color,va[0],va[1],va[2]);
|
||||||
for (i=0;i<make_tri_vertex_num;i++)
|
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);
|
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];
|
I64 i=sprite_elem_base_sizes[tmpg->type];
|
||||||
switch (tempg->type) {
|
switch (tmpg->type) {
|
||||||
case SPT_POLYLINE:
|
case SPT_POLYLINE:
|
||||||
i+=tempg->nu.num*sizeof(CD2I32);
|
i+=tmpg->nu.num*sizeof(CD2I32);
|
||||||
break;
|
break;
|
||||||
case SPT_TEXT:
|
case SPT_TEXT:
|
||||||
case SPT_TEXT_BOX:
|
case SPT_TEXT_BOX:
|
||||||
case SPT_TEXT_DIAMOND:
|
case SPT_TEXT_DIAMOND:
|
||||||
i+=StrLen(tempg->ps.st)+1;
|
i+=StrLen(tmpg->ps.st)+1;
|
||||||
break;
|
break;
|
||||||
case SPT_BITMAP:
|
case SPT_BITMAP:
|
||||||
i+=((tempg->pwhu.width+7)&~7)*tempg->pwhu.height;
|
i+=((tmpg->pwhu.width+7)&~7)*tmpg->pwhu.height;
|
||||||
break;
|
break;
|
||||||
case SPT_POLYPT:
|
case SPT_POLYPT:
|
||||||
i+=(tempg->npu.num*3+7)>>3;
|
i+=(tmpg->npu.num*3+7)>>3;
|
||||||
break;
|
break;
|
||||||
case SPT_BSPLINE2:
|
case SPT_BSPLINE2:
|
||||||
case SPT_BSPLINE3:
|
case SPT_BSPLINE3:
|
||||||
case SPT_BSPLINE2_CLOSED:
|
case SPT_BSPLINE2_CLOSED:
|
||||||
case SPT_BSPLINE3_CLOSED:
|
case SPT_BSPLINE3_CLOSED:
|
||||||
i+=tempg->nu.num*sizeof(CD3I32);
|
i+=tmpg->nu.num*sizeof(CD3I32);
|
||||||
break;
|
break;
|
||||||
case SPT_MESH:
|
case SPT_MESH:
|
||||||
i+=tempg->mu.vertex_cnt*sizeof(CD3I32)+
|
i+=tmpg->mu.vertex_cnt*sizeof(CD3I32)+
|
||||||
tempg->mu.tri_cnt*sizeof(CMeshTri);
|
tmpg->mu.tri_cnt*sizeof(CMeshTri);
|
||||||
break;
|
break;
|
||||||
case SPT_SHIFTABLE_MESH:
|
case SPT_SHIFTABLE_MESH:
|
||||||
i+=tempg->pmu.vertex_cnt*sizeof(CD3I32)+
|
i+=tmpg->pmu.vertex_cnt*sizeof(CD3I32)+
|
||||||
tempg->pmu.tri_cnt*sizeof(CMeshTri);
|
tmpg->pmu.tri_cnt*sizeof(CMeshTri);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
@@ -79,101 +79,101 @@ I64 SpriteElemSize(CSprite *tempg)
|
|||||||
|
|
||||||
public I64 SpriteSize(U8 *elems)
|
public I64 SpriteSize(U8 *elems)
|
||||||
{//Walk sprite elements and return size of sprite as binary data.
|
{//Walk sprite elements and return size of sprite as binary data.
|
||||||
CSprite *tempg=elems-offset(CSprite.start),*tempg1=tempg;
|
CSprite *tmpg=elems-offset(CSprite.start),*tmpg1=tmpg;
|
||||||
while (tempg->type)
|
while (tmpg->type)
|
||||||
tempg(U8 *)+=SpriteElemSize(tempg);
|
tmpg(U8 *)+=SpriteElemSize(tmpg);
|
||||||
return tempg(U8 *)-tempg1(U8 *)+sprite_elem_base_sizes[SPT_END];
|
return tmpg(U8 *)-tmpg1(U8 *)+sprite_elem_base_sizes[SPT_END];
|
||||||
}
|
}
|
||||||
|
|
||||||
I64 SpriteTypeMask(U8 *elems)
|
I64 SpriteTypeMask(U8 *elems)
|
||||||
{
|
{
|
||||||
I64 res=0;
|
I64 res=0;
|
||||||
CSprite *tempg=elems-offset(CSprite.start);
|
CSprite *tmpg=elems-offset(CSprite.start);
|
||||||
while (tempg->type) {
|
while (tmpg->type) {
|
||||||
if (tempg->type>=SPT_NUM_TYPES)
|
if (tmpg->type>=SPT_NUM_TYPES)
|
||||||
return 1<<SPT_NUM_TYPES;
|
return 1<<SPT_NUM_TYPES;
|
||||||
Bts(&res,tempg->type);
|
Bts(&res,tmpg->type);
|
||||||
tempg(U8 *)+=SpriteElemSize(tempg);
|
tmpg(U8 *)+=SpriteElemSize(tmpg);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
public U8 *DC2Sprite(CDC *tempb)
|
public U8 *DC2Sprite(CDC *tmpb)
|
||||||
{//Convert device context to sprite.
|
{//Convert device context to sprite.
|
||||||
CSprite *tempg;
|
CSprite *tmpg;
|
||||||
tempg=CAlloc(sprite_elem_base_sizes[SPT_BITMAP]+
|
tmpg=CAlloc(sprite_elem_base_sizes[SPT_BITMAP]+
|
||||||
tempb->width_internal*tempb->height+
|
tmpb->width_internal*tmpb->height+
|
||||||
sprite_elem_base_sizes[SPT_END])
|
sprite_elem_base_sizes[SPT_END])
|
||||||
(U8 *)-offset(CSprite.start);
|
(U8 *)-offset(CSprite.start);
|
||||||
tempg->type=SPT_BITMAP;
|
tmpg->type=SPT_BITMAP;
|
||||||
tempg->pwhu.width=tempb->width;
|
tmpg->pwhu.width=tmpb->width;
|
||||||
tempg->pwhu.height=tempb->height;
|
tmpg->pwhu.height=tmpb->height;
|
||||||
tempg->pwhu.x1=0;
|
tmpg->pwhu.x1=0;
|
||||||
tempg->pwhu.y1=0;
|
tmpg->pwhu.y1=0;
|
||||||
MemCpy(&tempg->pwhu.u,tempb->body,tempb->width_internal*tempb->height);
|
MemCpy(&tmpg->pwhu.u,tmpb->body,tmpb->width_internal*tmpb->height);
|
||||||
return tempg(U8 *)+offset(CSprite.start);
|
return tmpg(U8 *)+offset(CSprite.start);
|
||||||
}
|
}
|
||||||
|
|
||||||
public U8 *SpriteElem2Summary(CSprite *tempg)
|
public U8 *SpriteElem2Summary(CSprite *tmpg)
|
||||||
{//Study $LK,"::/Demo/Graphics/SpriteText.HC"$.
|
{//Study $LK,"::/Demo/Graphics/SpriteText.HC"$.
|
||||||
U8 buf[STR_LEN],buf2[STR_LEN];
|
U8 buf[STR_LEN],buf2[STR_LEN];
|
||||||
I32 *ptr;
|
I32 *ptr;
|
||||||
StrPrint(buf,"%Z",tempg->type,"ST_SPRITE_ELEM_TYPES");
|
StrPrint(buf,"%Z",tmpg->type,"ST_SPRITE_ELEM_TYPES");
|
||||||
switch (tempg->type) {
|
switch (tmpg->type) {
|
||||||
case SPT_COLOR:
|
case SPT_COLOR:
|
||||||
CatPrint(buf," %s",Color2Str(buf2,tempg->c.color));
|
CatPrint(buf," %s",Color2Str(buf2,tmpg->c.color));
|
||||||
break;
|
break;
|
||||||
case SPT_DITHER_COLOR:
|
case SPT_DITHER_COLOR:
|
||||||
CatPrint(buf," %s",Color2Str(buf2,ROPF_DITHER|tempg->d.dither_color.u8[0]|
|
CatPrint(buf," %s",Color2Str(buf2,ROPF_DITHER|tmpg->d.dither_color.u8[0]|
|
||||||
tempg->d.dither_color.u8[1]<<COLORROP_BITS));
|
tmpg->d.dither_color.u8[1]<<COLORROP_BITS));
|
||||||
break;
|
break;
|
||||||
case SPT_PT:
|
case SPT_PT:
|
||||||
case SPT_FLOOD_FILL:
|
case SPT_FLOOD_FILL:
|
||||||
case SPT_FLOOD_FILL_NOT:
|
case SPT_FLOOD_FILL_NOT:
|
||||||
case SPT_SHIFT:
|
case SPT_SHIFT:
|
||||||
CatPrint(buf," (%d,%d)",tempg->p.x1,tempg->p.y1);
|
CatPrint(buf," (%d,%d)",tmpg->p.x1,tmpg->p.y1);
|
||||||
break;
|
break;
|
||||||
case SPT_LINE:
|
case SPT_LINE:
|
||||||
case SPT_ARROW:
|
case SPT_ARROW:
|
||||||
case SPT_PLANAR_SYMMETRY:
|
case SPT_PLANAR_SYMMETRY:
|
||||||
case SPT_RECT:
|
case SPT_RECT:
|
||||||
case SPT_ROTATED_RECT:
|
case SPT_ROTATED_RECT:
|
||||||
CatPrint(buf," (%d,%d),(%d,%d)",tempg->pp.x1,tempg->pp.y1,
|
CatPrint(buf," (%d,%d),(%d,%d)",tmpg->pp.x1,tmpg->pp.y1,
|
||||||
tempg->pp.x2,tempg->pp.y2);
|
tmpg->pp.x2,tmpg->pp.y2);
|
||||||
break;
|
break;
|
||||||
case SPT_CIRCLE:
|
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;
|
break;
|
||||||
case SPT_WIDTH:
|
case SPT_WIDTH:
|
||||||
CatPrint(buf," %d",tempg->w.width);
|
CatPrint(buf," %d",tmpg->w.width);
|
||||||
break;
|
break;
|
||||||
case SPT_TEXT:
|
case SPT_TEXT:
|
||||||
case SPT_TEXT_BOX:
|
case SPT_TEXT_BOX:
|
||||||
case SPT_TEXT_DIAMOND:
|
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;
|
break;
|
||||||
case SPT_POLYLINE:
|
case SPT_POLYLINE:
|
||||||
case SPT_POLYPT:
|
case SPT_POLYPT:
|
||||||
ptr=&tempg->npu.x;
|
ptr=&tmpg->npu.x;
|
||||||
CatPrint(buf," %d (%d,%d)",tempg->npu.num,ptr[0],ptr[1]);
|
CatPrint(buf," %d (%d,%d)",tmpg->npu.num,ptr[0],ptr[1]);
|
||||||
break;
|
break;
|
||||||
case SPT_ELLIPSE:
|
case SPT_ELLIPSE:
|
||||||
case SPT_POLYGON:
|
case SPT_POLYGON:
|
||||||
case SPT_BITMAP:
|
case SPT_BITMAP:
|
||||||
CatPrint(buf," (%d,%d):%dW,%dH",tempg->pwhu.x1,tempg->pwhu.y1,
|
CatPrint(buf," (%d,%d):%dW,%dH",tmpg->pwhu.x1,tmpg->pwhu.y1,
|
||||||
tempg->pwhu.width,tempg->pwhu.height);
|
tmpg->pwhu.width,tmpg->pwhu.height);
|
||||||
break;
|
break;
|
||||||
case SPT_BSPLINE2:
|
case SPT_BSPLINE2:
|
||||||
case SPT_BSPLINE3:
|
case SPT_BSPLINE3:
|
||||||
case SPT_BSPLINE2_CLOSED:
|
case SPT_BSPLINE2_CLOSED:
|
||||||
case SPT_BSPLINE3_CLOSED:
|
case SPT_BSPLINE3_CLOSED:
|
||||||
CatPrint(buf," %d",tempg->nu.num);
|
CatPrint(buf," %d",tmpg->nu.num);
|
||||||
break;
|
break;
|
||||||
case SPT_MESH:
|
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;
|
break;
|
||||||
case SPT_SHIFTABLE_MESH:
|
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;
|
break;
|
||||||
}
|
}
|
||||||
return StrNew(buf);
|
return StrNew(buf);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#help_index "AutoFile;Help System/Training"
|
#help_index "InFile;Help System/Training"
|
||||||
#help_file "::/Doc/AutoFile"
|
#help_file "::/Doc/InFile"
|
||||||
|
|
||||||
public U0 AFGetStr(U8 *st)
|
public U0 InGetStr(U8 *st)
|
||||||
{//Wait for user to type certain str.
|
{//Wait for user to type certain str.
|
||||||
I64 ch,sc;
|
I64 ch,sc;
|
||||||
U8 buf[256],*st2;
|
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.
|
{//Print message with delay after each char.
|
||||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv),*st=buf;
|
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv),*st=buf;
|
||||||
I64 ch;
|
I64 ch;
|
||||||
@@ -34,7 +34,7 @@ public U0 AFPrint(I64 ms=100,U8 *fmt,...)
|
|||||||
Free(buf);
|
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.
|
{//Wait for user to press certain key.
|
||||||
I64 sc,ch;
|
I64 sc,ch;
|
||||||
U8 buf[STR_LEN],*st;
|
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);
|
Msg(MSG_KEY_DOWN,ch,sc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public I64 AFGetChar(...)
|
public I64 InGetChar(...)
|
||||||
{//Wait for user to press one of set of chars.
|
{//Wait for user to press one of set of chars.
|
||||||
I64 i,sc,ch;
|
I64 i,sc,ch;
|
||||||
U8 buf[512],*st;
|
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.
|
{//Let user type until he presses certain key.
|
||||||
I64 sc,ch;
|
I64 sc,ch;
|
||||||
do {
|
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);
|
} 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.
|
{//Let user type until he presses one of set of chars.
|
||||||
I64 i,sc,ch;
|
I64 i,sc,ch;
|
||||||
while (TRUE) {
|
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);
|
Sleep(ms);
|
||||||
return TRUE;
|
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)
|
I64 l=MAX_I64,I64 r=MAX_I64)
|
||||||
{//Move input pointer (mouse) to spot at certain speed.
|
{//Move input pointer (mouse) to spot at certain speed.
|
||||||
if (!(0<=x<GR_WIDTH))
|
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;
|
l=ip.lb;
|
||||||
if (!(FALSE<=r<=TRUE))
|
if (!(FALSE<=r<=TRUE))
|
||||||
r=ip.rb;
|
r=ip.rb;
|
||||||
af_l=l; af_r=r;
|
in_plot_l=l; in_plot_r=r;
|
||||||
Line(ms,ip.pos.x,ip.pos.y,ip.pos.z,x,y,z,&AFSetIPPlot);
|
Line(ms,ip.pos.x,ip.pos.y,ip.pos.z,x,y,z,&InSetIPPlot);
|
||||||
}
|
|
||||||
|
|
||||||
public Bool AFView()
|
|
||||||
{//Let user type until <ESC> or <SHIFT-ESC>.
|
|
||||||
Bool res=View;
|
|
||||||
DocBottom;
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
+3
-3
@@ -9,14 +9,14 @@ Cd(__DIR__);;
|
|||||||
#include "Snd/MakeSnd"
|
#include "Snd/MakeSnd"
|
||||||
#include "ABlkDev/MakeABlkDev"
|
#include "ABlkDev/MakeABlkDev"
|
||||||
#include "Menu"
|
#include "Menu"
|
||||||
#include "WinA"
|
#include "Win"
|
||||||
#include "WinB"
|
#include "WinMgr"
|
||||||
#include "ADbg"
|
#include "ADbg"
|
||||||
#include "::/Adam/God/GodExt"
|
#include "::/Adam/God/GodExt"
|
||||||
#include "DolDoc/MakeDoc"
|
#include "DolDoc/MakeDoc"
|
||||||
LBts(&sys_run_level,RLf_DOC);
|
LBts(&sys_run_level,RLf_DOC);
|
||||||
#include "Ctrls/MakeCtrls"
|
#include "Ctrls/MakeCtrls"
|
||||||
#include "AutoFile"
|
#include "InFile"
|
||||||
#include "ARegistry"
|
#include "ARegistry"
|
||||||
#include "AutoComplete/MakeAC"
|
#include "AutoComplete/MakeAC"
|
||||||
#include "God/MakeGod"
|
#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.
|
{//Find pulldown entry. Fs->cur_menu is probably the menu you want.
|
||||||
//Just 2 levels -- across top and down are valid, currently.
|
//Just 2 levels -- across top and down are valid, currently.
|
||||||
U8 *st,*st2;
|
U8 *st,*st2;
|
||||||
CMenuEntry *tempse;
|
CMenuEntry *tmpse;
|
||||||
if (!haystack_menu || !needle_full_name)
|
if (!haystack_menu || !needle_full_name)
|
||||||
return NULL;
|
return NULL;
|
||||||
st=StrNew(needle_full_name);
|
st=StrNew(needle_full_name);
|
||||||
st2=StrNew(needle_full_name);
|
st2=StrNew(needle_full_name);
|
||||||
tempse=(&haystack_menu->sub)(U8 *)-offset(CMenuEntry.sub);
|
tmpse=(&haystack_menu->sub)(U8 *)-offset(CMenuEntry.sub);
|
||||||
while (*st && tempse) {
|
while (*st && tmpse) {
|
||||||
StrFirstRem(st,"/",st2);
|
StrFirstRem(st,"/",st2);
|
||||||
tempse=MenuSubEntryFind(tempse->sub,st2);
|
tmpse=MenuSubEntryFind(tmpse->sub,st2);
|
||||||
}
|
}
|
||||||
Free(st);
|
Free(st);
|
||||||
Free(st2);
|
Free(st2);
|
||||||
return tempse;
|
return tmpse;
|
||||||
}
|
}
|
||||||
|
|
||||||
CMenuEntry *MenuNewSub(CCmpCtrl *cc,CTask *task)
|
CMenuEntry *MenuNewSub(CCmpCtrl *cc,CTask *task)
|
||||||
{
|
{
|
||||||
CMenuEntry *tempme=NULL,*tempse;
|
CMenuEntry *tmpme=NULL,*tmpse;
|
||||||
if (cc->token==TK_IDENT) {
|
if (cc->token==TK_IDENT) {
|
||||||
tempme=CAlloc(sizeof(CMenuEntry),task);
|
tmpme=CAlloc(sizeof(CMenuEntry),task);
|
||||||
if (StrLen(cc->cur_str)>31)
|
if (StrLen(cc->cur_str)>31)
|
||||||
cc->cur_str[31]=0;
|
cc->cur_str[31]=0;
|
||||||
StrCpy(tempme->name,cc->cur_str);
|
StrCpy(tmpme->name,cc->cur_str);
|
||||||
if (Lex(cc)=='(') {
|
if (Lex(cc)=='(') {
|
||||||
tempme->msg_code=MSG_KEY_DOWN_UP;
|
tmpme->msg_code=MSG_KEY_DOWN_UP;
|
||||||
if (Lex(cc)!=',' && cc->token!=')')
|
if (Lex(cc)!=',' && cc->token!=')')
|
||||||
tempme->msg_code=LexExpressionI64(cc);
|
tmpme->msg_code=LexExpressionI64(cc);
|
||||||
if (cc->token==',')
|
if (cc->token==',')
|
||||||
Lex(cc);
|
Lex(cc);
|
||||||
if (cc->token!=',' && cc->token!=')')
|
if (cc->token!=',' && cc->token!=')')
|
||||||
tempme->a1=LexExpressionI64(cc);
|
tmpme->a1=LexExpressionI64(cc);
|
||||||
if (cc->token==',')
|
if (cc->token==',')
|
||||||
Lex(cc);
|
Lex(cc);
|
||||||
if (cc->token!=',' && cc->token!=')')
|
if (cc->token!=',' && cc->token!=')')
|
||||||
tempme->a2=LexExpressionI64(cc);
|
tmpme->a2=LexExpressionI64(cc);
|
||||||
if (cc->token!=')')
|
if (cc->token!=')')
|
||||||
LexExcept(cc,"Missing ')' at ");
|
LexExcept(cc,"Missing ')' at ");
|
||||||
if (Lex(cc)!=';')
|
if (Lex(cc)!=';')
|
||||||
@@ -68,10 +68,10 @@ CMenuEntry *MenuNewSub(CCmpCtrl *cc,CTask *task)
|
|||||||
Lex(cc); //Skip ;
|
Lex(cc); //Skip ;
|
||||||
} else if (cc->token=='{') {
|
} else if (cc->token=='{') {
|
||||||
Lex(cc); //Skip {
|
Lex(cc); //Skip {
|
||||||
tempme->dir=TRUE;
|
tmpme->dir=TRUE;
|
||||||
tempse=&tempme->sub;
|
tmpse=&tmpme->sub;
|
||||||
while (tempse && cc->token!='}')
|
while (tmpse && cc->token!='}')
|
||||||
tempse=tempse->next=MenuNewSub(cc,task);
|
tmpse=tmpse->next=MenuNewSub(cc,task);
|
||||||
if (cc->token!='}')
|
if (cc->token!='}')
|
||||||
LexExcept(cc,"Missing '}' at ");
|
LexExcept(cc,"Missing '}' at ");
|
||||||
else
|
else
|
||||||
@@ -79,13 +79,13 @@ CMenuEntry *MenuNewSub(CCmpCtrl *cc,CTask *task)
|
|||||||
} else
|
} else
|
||||||
LexExcept(cc,"Expecting '{' at ");
|
LexExcept(cc,"Expecting '{' at ");
|
||||||
}
|
}
|
||||||
return tempme;
|
return tmpme;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CMenu *MenuNew(U8 *st,I64 flags=0,CTask *task=NULL)
|
public CMenu *MenuNew(U8 *st,I64 flags=0,CTask *task=NULL)
|
||||||
{//Parse a menu. You probably don't need this.
|
{//Parse a menu. You probably don't need this.
|
||||||
CMenu *m;
|
CMenu *m;
|
||||||
CMenuEntry *tempse;
|
CMenuEntry *tmpse;
|
||||||
CCmpCtrl *cc=CmpCtrlNew(st,CCF_DONT_FREE_BUF);
|
CCmpCtrl *cc=CmpCtrlNew(st,CCF_DONT_FREE_BUF);
|
||||||
if (!task) task=Fs;
|
if (!task) task=Fs;
|
||||||
Lex(cc);
|
Lex(cc);
|
||||||
@@ -93,9 +93,9 @@ public CMenu *MenuNew(U8 *st,I64 flags=0,CTask *task=NULL)
|
|||||||
m->task=task;
|
m->task=task;
|
||||||
m->flags=flags;
|
m->flags=flags;
|
||||||
m->attr =BLUE<<4+YELLOW;
|
m->attr =BLUE<<4+YELLOW;
|
||||||
tempse=&m->sub;
|
tmpse=&m->sub;
|
||||||
while (tempse)
|
while (tmpse)
|
||||||
tempse=tempse->next=MenuNewSub(cc,task);
|
tmpse=tmpse->next=MenuNewSub(cc,task);
|
||||||
CmpCtrlDel(cc);
|
CmpCtrlDel(cc);
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
@@ -109,40 +109,40 @@ public CMenu *MenuFile(U8 *filename,I64 flags=0,CTask *task=NULL)
|
|||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 MenuDelSub(CMenuEntry *tempme)
|
U0 MenuDelSub(CMenuEntry *tmpme)
|
||||||
{
|
{
|
||||||
CMenuEntry *tempse,*tempse1;
|
CMenuEntry *tmpse,*tmpse1;
|
||||||
if (tempme) {
|
if (tmpme) {
|
||||||
tempse=tempme->sub;
|
tmpse=tmpme->sub;
|
||||||
while (tempse) {
|
while (tmpse) {
|
||||||
tempse1=tempse->next;
|
tmpse1=tmpse->next;
|
||||||
MenuDelSub(tempse);
|
MenuDelSub(tmpse);
|
||||||
tempse=tempse1;
|
tmpse=tmpse1;
|
||||||
}
|
}
|
||||||
Free(tempme);
|
Free(tmpme);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public U0 MenuDel(CMenu *m)
|
public U0 MenuDel(CMenu *m)
|
||||||
{//Delete a manu. You probably don't need this.
|
{//Delete a manu. You probably don't need this.
|
||||||
CMenuEntry *tempme,*tempme1;
|
CMenuEntry *tmpme,*tmpme1;
|
||||||
if (!m) return;
|
if (!m) return;
|
||||||
tempme=m->sub;
|
tmpme=m->sub;
|
||||||
while (tempme) {
|
while (tmpme) {
|
||||||
tempme1=tempme->next;
|
tmpme1=tmpme->next;
|
||||||
MenuDelSub(tempme);
|
MenuDelSub(tmpme);
|
||||||
tempme=tempme1;
|
tmpme=tmpme1;
|
||||||
}
|
}
|
||||||
Free(m);
|
Free(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
I64 MenuEntryWidth(CMenuEntry *tempme)
|
I64 MenuEntryWidth(CMenuEntry *tmpme)
|
||||||
{
|
{
|
||||||
I64 res=StrLen(tempme->name);
|
I64 res=StrLen(tmpme->name);
|
||||||
CMenuEntry *tempse=tempme->sub;
|
CMenuEntry *tmpse=tmpme->sub;
|
||||||
while (tempse) {
|
while (tmpse) {
|
||||||
res=MaxI64(res,StrLen(tempse->name));
|
res=MaxI64(res,StrLen(tmpse->name));
|
||||||
tempse=tempse->next;
|
tmpse=tmpse->next;
|
||||||
}
|
}
|
||||||
return res+1;
|
return res+1;
|
||||||
}
|
}
|
||||||
@@ -174,7 +174,7 @@ public U0 MenuPop()
|
|||||||
U0 DrawMenu(CDC *dc)
|
U0 DrawMenu(CDC *dc)
|
||||||
{
|
{
|
||||||
CMenu *m;
|
CMenu *m;
|
||||||
CMenuEntry *tempme,*tempse,*cur_submenu=NULL;
|
CMenuEntry *tmpme,*tmpse,*cur_submenu=NULL;
|
||||||
U8 *st=NULL;
|
U8 *st=NULL;
|
||||||
CTask *task=MenuTask;
|
CTask *task=MenuTask;
|
||||||
I64 i,w,x0,y0,x1=ip.pos.x,y1=ip.pos.y;
|
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;
|
dc->color=m->attr>>4;
|
||||||
GrRect(dc,0,0,GR_WIDTH,FONT_HEIGHT);
|
GrRect(dc,0,0,GR_WIDTH,FONT_HEIGHT);
|
||||||
x0=0;
|
x0=0;
|
||||||
tempme=m->sub;
|
tmpme=m->sub;
|
||||||
while (tempme) {
|
while (tmpme) {
|
||||||
w=MenuEntryWidth(tempme)*FONT_WIDTH;
|
w=MenuEntryWidth(tmpme)*FONT_WIDTH;
|
||||||
if (x0<=x1<x0+w) {
|
if (x0<=x1<x0+w) {
|
||||||
if (0<=y1<FONT_HEIGHT) {
|
if (0<=y1<FONT_HEIGHT) {
|
||||||
dc->color=m->attr&15;
|
dc->color=m->attr&15;
|
||||||
@@ -195,26 +195,26 @@ U0 DrawMenu(CDC *dc)
|
|||||||
dc->color=m->attr>>4;
|
dc->color=m->attr>>4;
|
||||||
} else
|
} else
|
||||||
dc->color=m->attr&15;
|
dc->color=m->attr&15;
|
||||||
GrPrint(dc,x0,0,"%s",tempme->name);
|
GrPrint(dc,x0,0,"%s",tmpme->name);
|
||||||
y0=FONT_HEIGHT;
|
y0=FONT_HEIGHT;
|
||||||
tempse=tempme->sub;
|
tmpse=tmpme->sub;
|
||||||
while (tempse) {
|
while (tmpse) {
|
||||||
if (tempse->checked)
|
if (tmpse->checked)
|
||||||
i=m->attr^0xFF;
|
i=m->attr^0xFF;
|
||||||
else
|
else
|
||||||
i=m->attr;
|
i=m->attr;
|
||||||
if (y0<=y1<y0+FONT_HEIGHT) {
|
if (y0<=y1<y0+FONT_HEIGHT) {
|
||||||
if (tempse->msg_code==MSG_KEY_DOWN||
|
if (tmpse->msg_code==MSG_KEY_DOWN||
|
||||||
tempse->msg_code==MSG_KEY_DOWN_UP) {
|
tmpse->msg_code==MSG_KEY_DOWN_UP) {
|
||||||
if (!tempse->a2)
|
if (!tmpse->a2)
|
||||||
tempse->a2=Char2ScanCode(tempse->a1);
|
tmpse->a2=Char2ScanCode(tmpse->a1);
|
||||||
st=ScanCode2KeyName(tempse->a2);
|
st=ScanCode2KeyName(tmpse->a2);
|
||||||
}
|
}
|
||||||
sys_cur_submenu_entry=cur_submenu=tempse;
|
sys_cur_submenu_entry=cur_submenu=tmpse;
|
||||||
dc->color=i&15;
|
dc->color=i&15;
|
||||||
GrRect(dc,x0,y0,w,FONT_HEIGHT);
|
GrRect(dc,x0,y0,w,FONT_HEIGHT);
|
||||||
dc->color=i>>4;
|
dc->color=i>>4;
|
||||||
GrPrint(dc,x0,y0,"%s",tempse->name);
|
GrPrint(dc,x0,y0,"%s",tmpse->name);
|
||||||
if (st) {
|
if (st) {
|
||||||
dc->color=i>>4;
|
dc->color=i>>4;
|
||||||
GrRect(dc,x0+w,y0-FONT_HEIGHT,
|
GrRect(dc,x0+w,y0-FONT_HEIGHT,
|
||||||
@@ -227,17 +227,17 @@ U0 DrawMenu(CDC *dc)
|
|||||||
dc->color=i>>4;
|
dc->color=i>>4;
|
||||||
GrRect(dc,x0,y0,w,FONT_HEIGHT);
|
GrRect(dc,x0,y0,w,FONT_HEIGHT);
|
||||||
dc->color=i&15;
|
dc->color=i&15;
|
||||||
GrPrint(dc,x0,y0,"%s",tempse->name);
|
GrPrint(dc,x0,y0,"%s",tmpse->name);
|
||||||
}
|
}
|
||||||
y0+=FONT_HEIGHT;
|
y0+=FONT_HEIGHT;
|
||||||
tempse=tempse->next;
|
tmpse=tmpse->next;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
dc->color=m->attr&15;
|
dc->color=m->attr&15;
|
||||||
GrPrint(dc,x0,0,"%s",tempme->name);
|
GrPrint(dc,x0,0,"%s",tmpme->name);
|
||||||
}
|
}
|
||||||
x0+=w;
|
x0+=w;
|
||||||
tempme=tempme->next;
|
tmpme=tmpme->next;
|
||||||
}
|
}
|
||||||
sys_cur_submenu_entry=cur_submenu;
|
sys_cur_submenu_entry=cur_submenu;
|
||||||
}
|
}
|
||||||
+112
-112
@@ -6,12 +6,12 @@ class CCDVDUserData //Create DVD
|
|||||||
short_dir_blks,long_dir_blks;
|
short_dir_blks,long_dir_blks;
|
||||||
};
|
};
|
||||||
|
|
||||||
I64 DVDFileCreate2(CFile *out_file,CDirEntry *tempde,CISO1DirEntry *tempi,
|
I64 DVDFileCreate2(CFile *out_file,CDirEntry *tmpde,CISO1DirEntry *tmpi,
|
||||||
CISO1DirEntry *tempi2,I64 *_cur_blk,CDirEntry *parent,Bool write,
|
CISO1DirEntry *tmpi2,I64 *_cur_blk,CDirEntry *parent,Bool write,
|
||||||
U8 *stage2_filename,I64 *_stage2_blk)
|
U8 *stage2_filename,I64 *_stage2_blk)
|
||||||
{
|
{
|
||||||
CCDVDUserData *tempc;
|
CCDVDUserData *tmpc;
|
||||||
CDirEntry *tempde1,*tempde2;
|
CDirEntry *tmpde1,*tmpde2;
|
||||||
CFile *in_file;
|
CFile *in_file;
|
||||||
U8 *buf=MAlloc(DVD_BLK_SIZE),*ptr1,*ptr2;
|
U8 *buf=MAlloc(DVD_BLK_SIZE),*ptr1,*ptr2;
|
||||||
CISO1DirEntry *dir_blk_buf =CAlloc(DVD_BLK_SIZE*128),
|
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;
|
*de2=dir_blk_buf2,*de12;
|
||||||
I64 i,n;
|
I64 i,n;
|
||||||
|
|
||||||
tempc=parent->user_data;
|
tmpc=parent->user_data;
|
||||||
|
|
||||||
de->len=sizeof(CISO1DirEntry)-1;
|
de->len=sizeof(CISO1DirEntry)-1;
|
||||||
de->ext_attr_len=0;
|
de->ext_attr_len=0;
|
||||||
FillU16Palindrome(&de->vol_seq_num,1);
|
FillU16Palindrome(&de->vol_seq_num,1);
|
||||||
Date2ISO1(&de->date,tempde->datetime);
|
Date2ISO1(&de->date,tmpde->datetime);
|
||||||
de->flags=ISO1_ATTR_DIR;
|
de->flags=ISO1_ATTR_DIR;
|
||||||
de->name_len=1;
|
de->name_len=1;
|
||||||
de->name=0;
|
de->name=0;
|
||||||
@@ -34,8 +34,8 @@ I64 DVDFileCreate2(CFile *out_file,CDirEntry *tempde,CISO1DirEntry *tempi,
|
|||||||
|
|
||||||
de->len=sizeof(CISO1DirEntry)-1;
|
de->len=sizeof(CISO1DirEntry)-1;
|
||||||
de->ext_attr_len=0;
|
de->ext_attr_len=0;
|
||||||
FillU32Palindrome(&de->loc,tempc->loc);
|
FillU32Palindrome(&de->loc,tmpc->loc);
|
||||||
FillU32Palindrome(&de->size,tempc->short_dir_blks*DVD_BLK_SIZE);
|
FillU32Palindrome(&de->size,tmpc->short_dir_blks*DVD_BLK_SIZE);
|
||||||
FillU16Palindrome(&de->vol_seq_num,1);
|
FillU16Palindrome(&de->vol_seq_num,1);
|
||||||
Date2ISO1(&de->date,parent->datetime);
|
Date2ISO1(&de->date,parent->datetime);
|
||||||
de->flags=ISO1_ATTR_DIR;
|
de->flags=ISO1_ATTR_DIR;
|
||||||
@@ -47,7 +47,7 @@ I64 DVDFileCreate2(CFile *out_file,CDirEntry *tempde,CISO1DirEntry *tempi,
|
|||||||
de2->len=sizeof(CISO1DirEntry)-1;
|
de2->len=sizeof(CISO1DirEntry)-1;
|
||||||
de2->ext_attr_len=0;
|
de2->ext_attr_len=0;
|
||||||
FillU16Palindrome(&de2->vol_seq_num,1);
|
FillU16Palindrome(&de2->vol_seq_num,1);
|
||||||
Date2ISO1(&de2->date,tempde->datetime);
|
Date2ISO1(&de2->date,tmpde->datetime);
|
||||||
de2->flags=ISO1_ATTR_DIR;
|
de2->flags=ISO1_ATTR_DIR;
|
||||||
de2->name_len=1;
|
de2->name_len=1;
|
||||||
de2->name=0;
|
de2->name=0;
|
||||||
@@ -56,8 +56,8 @@ I64 DVDFileCreate2(CFile *out_file,CDirEntry *tempde,CISO1DirEntry *tempi,
|
|||||||
|
|
||||||
de2->len=sizeof(CISO1DirEntry)-1;
|
de2->len=sizeof(CISO1DirEntry)-1;
|
||||||
de2->ext_attr_len=0;
|
de2->ext_attr_len=0;
|
||||||
FillU32Palindrome(&de2->loc,tempc->loc+tempc->short_dir_blks);
|
FillU32Palindrome(&de2->loc,tmpc->loc+tmpc->short_dir_blks);
|
||||||
FillU32Palindrome(&de2->size,tempc->long_dir_blks*DVD_BLK_SIZE);
|
FillU32Palindrome(&de2->size,tmpc->long_dir_blks*DVD_BLK_SIZE);
|
||||||
FillU16Palindrome(&de2->vol_seq_num,1);
|
FillU16Palindrome(&de2->vol_seq_num,1);
|
||||||
Date2ISO1(&de2->date,parent->datetime);
|
Date2ISO1(&de2->date,parent->datetime);
|
||||||
de2->flags=ISO1_ATTR_DIR;
|
de2->flags=ISO1_ATTR_DIR;
|
||||||
@@ -66,49 +66,49 @@ I64 DVDFileCreate2(CFile *out_file,CDirEntry *tempde,CISO1DirEntry *tempi,
|
|||||||
de2->len+=de2->name_len;
|
de2->len+=de2->name_len;
|
||||||
de2(U8 *)+=de2->len;
|
de2(U8 *)+=de2->len;
|
||||||
|
|
||||||
tempde1=tempde->sub;
|
tmpde1=tmpde->sub;
|
||||||
while (tempde1) {
|
while (tmpde1) {
|
||||||
tempde2=tempde1->next;
|
tmpde2=tmpde1->next;
|
||||||
if (!write) tempde1->user_data=CAlloc(sizeof(CCDVDUserData));
|
if (!write) tmpde1->user_data=CAlloc(sizeof(CCDVDUserData));
|
||||||
de1=de;
|
de1=de;
|
||||||
de12=de2;
|
de12=de2;
|
||||||
if (tempde1->attr & RS_ATTR_DIR) {
|
if (tmpde1->attr & RS_ATTR_DIR) {
|
||||||
n=DVDFileCreate2(out_file,tempde1,de,de2,_cur_blk,
|
n=DVDFileCreate2(out_file,tmpde1,de,de2,_cur_blk,
|
||||||
tempde,write,stage2_filename,_stage2_blk);
|
tmpde,write,stage2_filename,_stage2_blk);
|
||||||
de(U8 *)+=sizeof(CISO1DirEntry)-1+n;
|
de(U8 *)+=sizeof(CISO1DirEntry)-1+n;
|
||||||
de2(U8 *)+=sizeof(CISO1DirEntry)-1+n<<1;
|
de2(U8 *)+=sizeof(CISO1DirEntry)-1+n<<1;
|
||||||
} else {
|
} else {
|
||||||
tempc=tempde1->user_data;
|
tmpc=tmpde1->user_data;
|
||||||
de->len=sizeof(CISO1DirEntry)-1;
|
de->len=sizeof(CISO1DirEntry)-1;
|
||||||
de->ext_attr_len=0;
|
de->ext_attr_len=0;
|
||||||
FillU32Palindrome(&de->loc,*_cur_blk);
|
FillU32Palindrome(&de->loc,*_cur_blk);
|
||||||
tempc->loc=*_cur_blk;
|
tmpc->loc=*_cur_blk;
|
||||||
if (write) {
|
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";
|
"$$RED$$!!! Boot Stage 2 !!!$$FG$$\n";
|
||||||
if (_stage2_blk) *_stage2_blk=*_cur_blk;
|
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);
|
FillU16Palindrome(&de->vol_seq_num,1);
|
||||||
Date2ISO1(&de->date,tempde1->datetime);
|
Date2ISO1(&de->date,tmpde1->datetime);
|
||||||
de->flags=0;
|
de->flags=0;
|
||||||
de->name_len=StrLen(tempde1->name);
|
de->name_len=StrLen(tmpde1->name);
|
||||||
StrCpy(&de->name,tempde1->name);
|
StrCpy(&de->name,tmpde1->name);
|
||||||
de->len=de->len+de->name_len;
|
de->len=de->len+de->name_len;
|
||||||
de(U8 *)+=de->len;
|
de(U8 *)+=de->len;
|
||||||
|
|
||||||
de2->len=sizeof(CISO1DirEntry)-1;
|
de2->len=sizeof(CISO1DirEntry)-1;
|
||||||
de2->ext_attr_len=0;
|
de2->ext_attr_len=0;
|
||||||
FillU32Palindrome(&de2->loc,*_cur_blk);
|
FillU32Palindrome(&de2->loc,*_cur_blk);
|
||||||
FillU32Palindrome(&de2->size,tempde1->size);
|
FillU32Palindrome(&de2->size,tmpde1->size);
|
||||||
FillU16Palindrome(&de2->vol_seq_num,1);
|
FillU16Palindrome(&de2->vol_seq_num,1);
|
||||||
Date2ISO1(&de2->date,tempde1->datetime);
|
Date2ISO1(&de2->date,tmpde1->datetime);
|
||||||
de2->flags=0;
|
de2->flags=0;
|
||||||
de2->name_len=StrLen(tempde1->name)<<1;
|
de2->name_len=StrLen(tmpde1->name)<<1;
|
||||||
ptr1=&de2->name;
|
ptr1=&de2->name;
|
||||||
ptr2=&tempde1->name;
|
ptr2=&tmpde1->name;
|
||||||
for (i=0;i<de2->name_len;i=i+2) {
|
for (i=0;i<de2->name_len;i=i+2) {
|
||||||
ptr1++;
|
ptr1++;
|
||||||
*ptr1++=*ptr2++;
|
*ptr1++=*ptr2++;
|
||||||
@@ -116,7 +116,7 @@ I64 DVDFileCreate2(CFile *out_file,CDirEntry *tempde,CISO1DirEntry *tempi,
|
|||||||
de2->len+=de2->name_len;
|
de2->len+=de2->name_len;
|
||||||
de2(U8 *)+=de2->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++) {
|
for (i=0;i<(FSize(in_file)+DVD_BLK_SIZE-1)/DVD_BLK_SIZE;i++) {
|
||||||
n=4;
|
n=4;
|
||||||
if ((i+1)<<2>(FSize(in_file)+BLK_SIZE-1)>>BLK_SIZE_BITS) {
|
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);
|
MemCpy(de2,buf,i);
|
||||||
de2(U8 *)+=i;
|
de2(U8 *)+=i;
|
||||||
}
|
}
|
||||||
tempde1=tempde2;
|
tmpde1=tmpde2;
|
||||||
}
|
}
|
||||||
|
|
||||||
tempc=tempde->user_data;
|
tmpc=tmpde->user_data;
|
||||||
|
|
||||||
tempi->len=sizeof(CISO1DirEntry)-1;
|
tmpi->len=sizeof(CISO1DirEntry)-1;
|
||||||
tempi->ext_attr_len=0;
|
tmpi->ext_attr_len=0;
|
||||||
tempi->flags=ISO1_ATTR_DIR;
|
tmpi->flags=ISO1_ATTR_DIR;
|
||||||
if (!tempde->name[0]) {
|
if (!tmpde->name[0]) {
|
||||||
tempi->name_len=1;
|
tmpi->name_len=1;
|
||||||
tempi->name=1;
|
tmpi->name=1;
|
||||||
} else {
|
} else {
|
||||||
tempi->name_len=StrLen(tempde->name);
|
tmpi->name_len=StrLen(tmpde->name);
|
||||||
StrCpy(&tempi->name,tempde->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=de(U8 *)+1-dir_blk_buf(U8 *);
|
||||||
n=(n+DVD_BLK_SIZE-1)/DVD_BLK_SIZE;
|
n=(n+DVD_BLK_SIZE-1)/DVD_BLK_SIZE;
|
||||||
FillU32Palindrome(&tempi->size,n*DVD_BLK_SIZE);
|
FillU32Palindrome(&tmpi->size,n*DVD_BLK_SIZE);
|
||||||
FillU32Palindrome(&tempi->loc,*_cur_blk);
|
FillU32Palindrome(&tmpi->loc,*_cur_blk);
|
||||||
tempc->short_dir_blks=n;
|
tmpc->short_dir_blks=n;
|
||||||
tempc->loc=*_cur_blk;
|
tmpc->loc=*_cur_blk;
|
||||||
FillU32Palindrome(&dir_blk_buf->size,n*DVD_BLK_SIZE);
|
FillU32Palindrome(&dir_blk_buf->size,n*DVD_BLK_SIZE);
|
||||||
FillU32Palindrome(&dir_blk_buf->loc,*_cur_blk);
|
FillU32Palindrome(&dir_blk_buf->loc,*_cur_blk);
|
||||||
FillU16Palindrome(&tempi->vol_seq_num,1);
|
FillU16Palindrome(&tmpi->vol_seq_num,1);
|
||||||
Date2ISO1(&tempi->date,tempde->datetime);
|
Date2ISO1(&tmpi->date,tmpde->datetime);
|
||||||
if (write)
|
if (write)
|
||||||
"%X:%s\n",*_cur_blk,tempde->full_name;
|
"%X:%s\n",*_cur_blk,tmpde->full_name;
|
||||||
if (write)
|
if (write)
|
||||||
FWBlks(out_file,dir_blk_buf,*_cur_blk<<2,n<<2);
|
FWBlks(out_file,dir_blk_buf,*_cur_blk<<2,n<<2);
|
||||||
*_cur_blk+=n;
|
*_cur_blk+=n;
|
||||||
|
|
||||||
tempi2->len=sizeof(CISO1DirEntry)-1;
|
tmpi2->len=sizeof(CISO1DirEntry)-1;
|
||||||
tempi2->ext_attr_len=0;
|
tmpi2->ext_attr_len=0;
|
||||||
tempi2->flags=ISO1_ATTR_DIR;
|
tmpi2->flags=ISO1_ATTR_DIR;
|
||||||
if (!tempde->name[0]) {
|
if (!tmpde->name[0]) {
|
||||||
tempi2->name_len=1;
|
tmpi2->name_len=1;
|
||||||
tempi->name=1;
|
tmpi->name=1;
|
||||||
} else {
|
} else {
|
||||||
tempi2->name_len=StrLen(tempde->name)<<1;
|
tmpi2->name_len=StrLen(tmpde->name)<<1;
|
||||||
ptr1=&tempi2->name;
|
ptr1=&tmpi2->name;
|
||||||
ptr2=&tempde->name;
|
ptr2=&tmpde->name;
|
||||||
for (i=0;i<tempi2->name_len;i=i+2) {
|
for (i=0;i<tmpi2->name_len;i=i+2) {
|
||||||
ptr1++;
|
ptr1++;
|
||||||
*ptr1++=*ptr2++;
|
*ptr1++=*ptr2++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tempi2->len+=tempi2->name_len;
|
tmpi2->len+=tmpi2->name_len;
|
||||||
n=de2(U8 *)+1-dir_blk_buf2(U8 *);
|
n=de2(U8 *)+1-dir_blk_buf2(U8 *);
|
||||||
n=(n+DVD_BLK_SIZE-1)/DVD_BLK_SIZE;
|
n=(n+DVD_BLK_SIZE-1)/DVD_BLK_SIZE;
|
||||||
FillU32Palindrome(&tempi2->size,n*DVD_BLK_SIZE);
|
FillU32Palindrome(&tmpi2->size,n*DVD_BLK_SIZE);
|
||||||
FillU32Palindrome(&tempi2->loc,*_cur_blk);
|
FillU32Palindrome(&tmpi2->loc,*_cur_blk);
|
||||||
tempc->long_dir_blks=n;
|
tmpc->long_dir_blks=n;
|
||||||
FillU32Palindrome(&dir_blk_buf2->size,n*DVD_BLK_SIZE);
|
FillU32Palindrome(&dir_blk_buf2->size,n*DVD_BLK_SIZE);
|
||||||
FillU32Palindrome(&dir_blk_buf2->loc,*_cur_blk);
|
FillU32Palindrome(&dir_blk_buf2->loc,*_cur_blk);
|
||||||
FillU16Palindrome(&tempi2->vol_seq_num,1);
|
FillU16Palindrome(&tmpi2->vol_seq_num,1);
|
||||||
Date2ISO1(&tempi2->date,tempde->datetime);
|
Date2ISO1(&tmpi2->date,tmpde->datetime);
|
||||||
if (write)
|
if (write)
|
||||||
"%X:%s\n",*_cur_blk,tempde->full_name;
|
"%X:%s\n",*_cur_blk,tmpde->full_name;
|
||||||
if (write)
|
if (write)
|
||||||
FWBlks(out_file,dir_blk_buf2,*_cur_blk<<2,n<<2);
|
FWBlks(out_file,dir_blk_buf2,*_cur_blk<<2,n<<2);
|
||||||
*_cur_blk+=n;
|
*_cur_blk+=n;
|
||||||
@@ -218,26 +218,26 @@ I64 DVDFileCreate2(CFile *out_file,CDirEntry *tempde,CISO1DirEntry *tempi,
|
|||||||
Free(dir_blk_buf);
|
Free(dir_blk_buf);
|
||||||
Free(dir_blk_buf2);
|
Free(dir_blk_buf2);
|
||||||
Free(buf);
|
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
|
{//Returns depth
|
||||||
CDirEntry *tempde1=tempde->sub;
|
CDirEntry *tmpde1=tmpde->sub;
|
||||||
I64 max_depth=cur_depth,i;
|
I64 max_depth=cur_depth,i;
|
||||||
while (tempde1) {
|
while (tmpde1) {
|
||||||
if (tempde1->attr & RS_ATTR_DIR) {
|
if (tmpde1->attr & RS_ATTR_DIR) {
|
||||||
*size1+=sizeof(CISO1PathEntry)-2+ (StrLen(tempde1->name)+1)&-0x2;
|
*size1+=sizeof(CISO1PathEntry)-2+ (StrLen(tmpde1->name)+1)&-0x2;
|
||||||
*size2+=sizeof(CISO1PathEntry)-2+StrLen(tempde1->name)<<1;
|
*size2+=sizeof(CISO1PathEntry)-2+StrLen(tmpde1->name)<<1;
|
||||||
i=DVDTableLen(tempde1,size1,size2,cur_depth+1);
|
i=DVDTableLen(tmpde1,size1,size2,cur_depth+1);
|
||||||
if (i>max_depth) max_depth=i;
|
if (i>max_depth) max_depth=i;
|
||||||
}
|
}
|
||||||
tempde1=tempde1->next;
|
tmpde1=tmpde1->next;
|
||||||
}
|
}
|
||||||
return max_depth;
|
return max_depth;
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 DVDFillPathTable(CDirEntry *tempde,
|
U0 DVDFillPathTable(CDirEntry *tmpde,
|
||||||
CISO1PathEntry **_itabbuf,CISO1PathEntry **_itabbuf2,
|
CISO1PathEntry **_itabbuf,CISO1PathEntry **_itabbuf2,
|
||||||
I64 parent_entry_num,Bool big_endian,I64 *first_free,
|
I64 parent_entry_num,Bool big_endian,I64 *first_free,
|
||||||
I64 cur_level,I64 output_level)
|
I64 cur_level,I64 output_level)
|
||||||
@@ -245,59 +245,59 @@ U0 DVDFillPathTable(CDirEntry *tempde,
|
|||||||
U8 *ptr1,*ptr2;
|
U8 *ptr1,*ptr2;
|
||||||
I64 i;
|
I64 i;
|
||||||
CISO1PathEntry *tabbuf=*_itabbuf,*tabbuf2=*_itabbuf2;
|
CISO1PathEntry *tabbuf=*_itabbuf,*tabbuf2=*_itabbuf2;
|
||||||
CDirEntry *tempde1=tempde->sub,*tempde2;
|
CDirEntry *tmpde1=tmpde->sub,*tmpde2;
|
||||||
CCDVDUserData *tempc;
|
CCDVDUserData *tmpc;
|
||||||
|
|
||||||
if (cur_level==output_level) {
|
if (cur_level==output_level) {
|
||||||
while (tempde1) {
|
while (tmpde1) {
|
||||||
if (tempde1->attr & RS_ATTR_DIR) {
|
if (tmpde1->attr & RS_ATTR_DIR) {
|
||||||
tempc=tempde1->user_data;
|
tmpc=tmpde1->user_data;
|
||||||
tempc->path_entry_num=*first_free;
|
tmpc->path_entry_num=*first_free;
|
||||||
tabbuf->name_len=StrLen(tempde1->name);
|
tabbuf->name_len=StrLen(tmpde1->name);
|
||||||
if (big_endian) {
|
if (big_endian) {
|
||||||
tabbuf->blk=EndianU32(tempc->loc);
|
tabbuf->blk=EndianU32(tmpc->loc);
|
||||||
tabbuf->parent_entry_num=EndianU16(parent_entry_num);
|
tabbuf->parent_entry_num=EndianU16(parent_entry_num);
|
||||||
} else {
|
} else {
|
||||||
tabbuf->blk=tempc->loc;
|
tabbuf->blk=tmpc->loc;
|
||||||
tabbuf->parent_entry_num=parent_entry_num;
|
tabbuf->parent_entry_num=parent_entry_num;
|
||||||
}
|
}
|
||||||
StrCpy(&tabbuf->name,tempde1->name);
|
StrCpy(&tabbuf->name,tmpde1->name);
|
||||||
|
|
||||||
tabbuf(U8 *)+=sizeof(CISO1PathEntry)-2+
|
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) {
|
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);
|
tabbuf2->parent_entry_num=EndianU16(parent_entry_num);
|
||||||
} else {
|
} else {
|
||||||
tabbuf2->blk=tempc->loc+tempc->short_dir_blks;
|
tabbuf2->blk=tmpc->loc+tmpc->short_dir_blks;
|
||||||
tabbuf2->parent_entry_num=parent_entry_num;
|
tabbuf2->parent_entry_num=parent_entry_num;
|
||||||
}
|
}
|
||||||
ptr1=&tabbuf2->name;
|
ptr1=&tabbuf2->name;
|
||||||
ptr2=&tempde1->name;
|
ptr2=&tmpde1->name;
|
||||||
for (i=0;i<tabbuf2->name_len;i=i+2) {
|
for (i=0;i<tabbuf2->name_len;i=i+2) {
|
||||||
ptr1++;
|
ptr1++;
|
||||||
*ptr1++=*ptr2++;
|
*ptr1++=*ptr2++;
|
||||||
}
|
}
|
||||||
tabbuf2(U8 *)+=sizeof(CISO1PathEntry)-2+
|
tabbuf2(U8 *)+=sizeof(CISO1PathEntry)-2+
|
||||||
StrLen(tempde1->name)<<1;
|
StrLen(tmpde1->name)<<1;
|
||||||
*first_free+=1;
|
*first_free+=1;
|
||||||
}
|
}
|
||||||
tempde1=tempde1->next;
|
tmpde1=tmpde1->next;
|
||||||
}
|
}
|
||||||
*_itabbuf=tabbuf;
|
*_itabbuf=tabbuf;
|
||||||
*_itabbuf2=tabbuf2;
|
*_itabbuf2=tabbuf2;
|
||||||
}
|
}
|
||||||
tempde1=tempde->sub;
|
tmpde1=tmpde->sub;
|
||||||
while (tempde1) {
|
while (tmpde1) {
|
||||||
tempde2=tempde1->next;
|
tmpde2=tmpde1->next;
|
||||||
if (tempde1->attr & RS_ATTR_DIR) {
|
if (tmpde1->attr & RS_ATTR_DIR) {
|
||||||
tempc=tempde1->user_data;
|
tmpc=tmpde1->user_data;
|
||||||
DVDFillPathTable(tempde1,_itabbuf,_itabbuf2,tempc->path_entry_num,
|
DVDFillPathTable(tmpde1,_itabbuf,_itabbuf2,tmpc->path_entry_num,
|
||||||
big_endian,first_free,cur_level+1,output_level);
|
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);
|
*zero_buf=CAlloc(DVD_BLK_SIZE);
|
||||||
CISO1PathEntry *tabbuf=NULL,*tabbuf2=NULL,*itabbuf,*itabbuf2;
|
CISO1PathEntry *tabbuf=NULL,*tabbuf2=NULL,*itabbuf,*itabbuf2;
|
||||||
CFile *out_file=NULL;
|
CFile *out_file=NULL;
|
||||||
CISO1DirEntry *tempi;
|
CISO1DirEntry *tmpi;
|
||||||
CCDVDUserData *tempc;
|
CCDVDUserData *tmpc;
|
||||||
|
|
||||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r");
|
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r");
|
||||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
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->sub=FilesFind(src_files_find_mask,fuf_flags);
|
||||||
headdir->datetime=Now;
|
headdir->datetime=Now;
|
||||||
headdir->user_data=CAlloc(sizeof(CCDVDUserData));
|
headdir->user_data=CAlloc(sizeof(CCDVDUserData));
|
||||||
tempc=headdir->user_data;
|
tmpc=headdir->user_data;
|
||||||
tempc->path_entry_num=1;
|
tmpc->path_entry_num=1;
|
||||||
|
|
||||||
cur_blk=20<<2>>2;
|
cur_blk=20<<2>>2;
|
||||||
if (stage2_filename) //preboot and bootloader
|
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);
|
tabbuf=CAlloc(tabsize*DVD_BLK_SIZE);
|
||||||
iso_pri->type_l_path_table=cur_blk;
|
iso_pri->type_l_path_table=cur_blk;
|
||||||
tabbuf->name_len=2; //Fill-in adam entry
|
tabbuf->name_len=2; //Fill-in adam entry
|
||||||
tempi=&iso_pri->root_dir_record;
|
tmpi=&iso_pri->root_dir_record;
|
||||||
tabbuf->blk=tempi->loc.little;
|
tabbuf->blk=tmpi->loc.little;
|
||||||
tabbuf->parent_entry_num=1;
|
tabbuf->parent_entry_num=1;
|
||||||
tabbuf2=CAlloc(tabsize2*DVD_BLK_SIZE);
|
tabbuf2=CAlloc(tabsize2*DVD_BLK_SIZE);
|
||||||
iso_sup->type_l_path_table=cur_blk+tabsize;
|
iso_sup->type_l_path_table=cur_blk+tabsize;
|
||||||
tabbuf2->name_len=2; //Fill-in adam entry
|
tabbuf2->name_len=2; //Fill-in adam entry
|
||||||
tempi=&iso_sup->root_dir_record;
|
tmpi=&iso_sup->root_dir_record;
|
||||||
tabbuf2->blk=tempi->loc.little;
|
tabbuf2->blk=tmpi->loc.little;
|
||||||
tabbuf2->parent_entry_num=1;
|
tabbuf2->parent_entry_num=1;
|
||||||
itabbuf=tabbuf+1;
|
itabbuf=tabbuf+1;
|
||||||
itabbuf2=tabbuf2+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);
|
MemSet(tabbuf,0,tabsize*DVD_BLK_SIZE);
|
||||||
iso_pri->type_m_path_table=EndianU32(cur_blk);
|
iso_pri->type_m_path_table=EndianU32(cur_blk);
|
||||||
tabbuf->name_len=2; //Fill-in adam entry
|
tabbuf->name_len=2; //Fill-in adam entry
|
||||||
tempi=&iso_pri->root_dir_record;
|
tmpi=&iso_pri->root_dir_record;
|
||||||
tabbuf->blk=tempi->loc.big;
|
tabbuf->blk=tmpi->loc.big;
|
||||||
tabbuf->parent_entry_num=EndianU16(1);
|
tabbuf->parent_entry_num=EndianU16(1);
|
||||||
MemSet(tabbuf2,0,tabsize2*DVD_BLK_SIZE);
|
MemSet(tabbuf2,0,tabsize2*DVD_BLK_SIZE);
|
||||||
iso_sup->type_m_path_table=EndianU32(cur_blk+tabsize);
|
iso_sup->type_m_path_table=EndianU32(cur_blk+tabsize);
|
||||||
tabbuf2->name_len=2; //Fill-in adam entry
|
tabbuf2->name_len=2; //Fill-in adam entry
|
||||||
tempi=&iso_sup->root_dir_record;
|
tmpi=&iso_sup->root_dir_record;
|
||||||
tabbuf2->blk=tempi->loc.big;
|
tabbuf2->blk=tmpi->loc.big;
|
||||||
tabbuf2->parent_entry_num=EndianU16(1);
|
tabbuf2->parent_entry_num=EndianU16(1);
|
||||||
itabbuf=tabbuf+1;
|
itabbuf=tabbuf+1;
|
||||||
itabbuf2=tabbuf2+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);
|
Free(iso_term);
|
||||||
}
|
}
|
||||||
|
|
||||||
I64 RedSeaISOPass1(CDirEntry *tempde)
|
I64 RedSeaISOPass1(CDirEntry *tmpde)
|
||||||
{
|
{
|
||||||
I64 dir_entry_cnt=3+LinkedLstCnt(tempde),res=0;
|
I64 dir_entry_cnt=3+LinkedLstCnt(tmpde),res=0;
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
if (tempde->attr & RS_ATTR_DIR) {
|
if (tmpde->attr & RS_ATTR_DIR) {
|
||||||
if (tempde->sub)
|
if (tmpde->sub)
|
||||||
res+=RedSeaISOPass1(tempde->sub);
|
res+=RedSeaISOPass1(tmpde->sub);
|
||||||
else
|
else
|
||||||
res+=BLK_SIZE; //Empty dir
|
res+=BLK_SIZE; //Empty dir
|
||||||
} else
|
} else
|
||||||
res+=CeilU64(tempde->size,BLK_SIZE);
|
res+=CeilU64(tmpde->size,BLK_SIZE);
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
res+=CeilU64(dir_entry_cnt<<6,BLK_SIZE); //Size in bytes
|
res+=CeilU64(dir_entry_cnt<<6,BLK_SIZE); //Size in bytes
|
||||||
#assert CDIR_SIZE==64
|
#assert CDIR_SIZE==64
|
||||||
@@ -129,7 +129,7 @@ public I64 RedSeaISO(U8 *_iso_filename=NULL,U8 *_src_dir,
|
|||||||
U8 *_stage2_filename=NULL)
|
U8 *_stage2_filename=NULL)
|
||||||
{//See $LK,"::/Misc/DoDistro.HC"$. Must be ISO.C
|
{//See $LK,"::/Misc/DoDistro.HC"$. Must be ISO.C
|
||||||
I64 i,res,root_cnt,root_dir_blks,bitmap_blks,bitmap_blks1;
|
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;
|
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"$
|
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);
|
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);
|
StrCpy(stage2_filename+3,stage2_filename+i);
|
||||||
} else
|
} else
|
||||||
stage2_filename=NULL;
|
stage2_filename=NULL;
|
||||||
tempde=FilesFind(src_dir,FUF_RECURSE);
|
tmpde=FilesFind(src_dir,FUF_RECURSE);
|
||||||
root_cnt=LinkedLstCnt(tempde)+3;
|
root_cnt=LinkedLstCnt(tmpde)+3;
|
||||||
root_dir_blks=CeilU64(root_cnt<<6,BLK_SIZE)>>BLK_SIZE_BITS;
|
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;
|
bd->drv_offset=19<<2+(DVD_BLK_SIZE*2+DVD_BOOT_LOADER_SIZE)/BLK_SIZE;
|
||||||
bitmap_blks=1;
|
bitmap_blks=1;
|
||||||
do {
|
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)
|
Bool DiffBins(CDoc *doc1,CDoc *doc2)
|
||||||
{
|
{
|
||||||
CDocBin *tempb1=doc1->bin_head.next,
|
CDocBin *tmpb1=doc1->bin_head.next,
|
||||||
*tempb2=doc2->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;
|
return TRUE;
|
||||||
while (tempb1!=&doc1->bin_head) {
|
while (tmpb1!=&doc1->bin_head) {
|
||||||
if (tempb1->size!=tempb2->size ||
|
if (tmpb1->size!=tmpb2->size ||
|
||||||
MemCmp(tempb1->data,tempb2->data,tempb1->size))
|
MemCmp(tmpb1->data,tmpb2->data,tmpb1->size))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
tempb1=tempb1->next;
|
tmpb1=tmpb1->next;
|
||||||
tempb2=tempb2->next;
|
tmpb2=tmpb2->next;
|
||||||
}
|
}
|
||||||
return FALSE;
|
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
|
//Dft is just src files. (Used to spot
|
||||||
//src files with redundancy in them.)
|
//src files with redundancy in them.)
|
||||||
I64 i=0,cnt,size,fuf_flags=0;
|
I64 i=0,cnt,size,fuf_flags=0;
|
||||||
CDirEntry *tempde,*tempde1,**sort_buf;
|
CDirEntry *tmpde,*tmpde1,**sort_buf;
|
||||||
U8 *buf;
|
U8 *buf;
|
||||||
CArcCompress *arc;
|
CArcCompress *arc;
|
||||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+F+S");
|
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+F+S");
|
||||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||||
cnt=FileCnt(tempde);
|
cnt=FileCnt(tmpde);
|
||||||
sort_buf=MAlloc(sizeof(CDirEntry *)*cnt);
|
sort_buf=MAlloc(sizeof(CDirEntry *)*cnt);
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
sort_buf[i++]=tempde;
|
sort_buf[i++]=tmpde;
|
||||||
buf=FileRead(tempde->full_name,&size);
|
buf=FileRead(tmpde->full_name,&size);
|
||||||
if (just_text_not_graphics)
|
if (just_text_not_graphics)
|
||||||
size=StrLen(buf);
|
size=StrLen(buf);
|
||||||
arc=CompressBuf(buf,size);
|
arc=CompressBuf(buf,size);
|
||||||
Free(buf);
|
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);
|
Free(arc);
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
QSortI64(sort_buf,cnt,&ZRepCompare);
|
QSortI64(sort_buf,cnt,&ZRepCompare);
|
||||||
for (i=0;i<cnt;i++) {
|
for (i=0;i<cnt;i++) {
|
||||||
@@ -349,5 +349,5 @@ public U0 ZipRep(U8 *files_find_mask="/*",U8 *fu_flags=NULL,
|
|||||||
'\n';
|
'\n';
|
||||||
}
|
}
|
||||||
Free(sort_buf);
|
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);
|
DCDel(dc);
|
||||||
}
|
}
|
||||||
|
|
||||||
#help_index "Graphics/Windows BMP Files;Graphics/Screen"
|
#help_index "Graphics/Windows BMP Files;Graphics/Scrn"
|
||||||
public I64 BMPScreenCapture(U8 *filename,I64 bits=4,Bool include_zoom=TRUE)
|
public I64 BMPScrnCapture(U8 *filename,I64 bits=4,Bool include_zoom=TRUE)
|
||||||
{//Capture screen as BMP file.
|
{//Capture scrn as BMP file.
|
||||||
CDC *dc=DCScreenCapture(include_zoom);
|
CDC *dc=DCScrnCapture(include_zoom);
|
||||||
I64 size=BMPWrite(filename,dc,bits);
|
I64 size=BMPWrite(filename,dc,bits);
|
||||||
DCDel(dc);
|
DCDel(dc);
|
||||||
return size;
|
return size;
|
||||||
|
|||||||
@@ -161,21 +161,21 @@ before or after "dd" are label characters.
|
|||||||
"+la"=only checks for label chars after.
|
"+la"=only checks for label chars after.
|
||||||
*/
|
*/
|
||||||
I64 cnt=0,fuf_flags=0;
|
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"),"+r+i+f+F+T");
|
||||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||||
if (fuf_flags&~(FUG_FILES_FIND|FUF_IGNORE|FUF_ALL|
|
if (fuf_flags&~(FUG_FILES_FIND|FUF_IGNORE|FUF_ALL|
|
||||||
FUF_WHOLE_LABELS|FUF_WHOLE_LABELS_BEFORE|FUF_WHOLE_LABELS_AFTER))
|
FUF_WHOLE_LABELS|FUF_WHOLE_LABELS_BEFORE|FUF_WHOLE_LABELS_AFTER))
|
||||||
throw('FUF');
|
throw('FUF');
|
||||||
LBEqu(&fuf_flags,FUf_REPLACE,replace_text);
|
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_flags&=FUF_ALL|FUF_REPLACE|FUF_IGNORE|FUF_WHOLE_LABELS|
|
||||||
FUF_WHOLE_LABELS_BEFORE|FUF_WHOLE_LABELS_AFTER;
|
FUF_WHOLE_LABELS_BEFORE|FUF_WHOLE_LABELS_AFTER;
|
||||||
while (tempde && !Bt(&fuf_flags,FUf_CANCEL)) {
|
while (tmpde && !Bt(&fuf_flags,FUf_CANCEL)) {
|
||||||
cnt+=FindFile(needle_str,tempde->full_name,&fuf_flags,replace_text);
|
cnt+=FindFile(needle_str,tmpde->full_name,&fuf_flags,replace_text);
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
DirTreeDel(tempde1);
|
DirTreeDel(tmpde1);
|
||||||
return cnt;
|
return cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+41
-41
@@ -25,19 +25,19 @@ CHeapLogHash *heaplog_head=NULL;
|
|||||||
|
|
||||||
U0 HeapLogMAlloc(U8 *addr)
|
U0 HeapLogMAlloc(U8 *addr)
|
||||||
{
|
{
|
||||||
CHeapLog *temphl;
|
CHeapLog *tmphl;
|
||||||
I64 i;
|
I64 i;
|
||||||
if (MHeapCtrl(addr)==heaplog_hc_watched) {
|
if (MHeapCtrl(addr)==heaplog_hc_watched) {
|
||||||
temphl=MAlloc(sizeof(CHeapLog),heaplog_hc);
|
tmphl=MAlloc(sizeof(CHeapLog),heaplog_hc);
|
||||||
temphl->addr=addr;
|
tmphl->addr=addr;
|
||||||
for (i=0;i<HL_CALLER_DEPTH;i++)
|
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);
|
i=addr>>3 &(HL_HASH_SIZE-1);
|
||||||
PUSHFD
|
PUSHFD
|
||||||
CLI
|
CLI
|
||||||
while (LBts(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0))
|
while (LBts(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0))
|
||||||
PAUSE
|
PAUSE
|
||||||
QueIns(temphl,heaplog_head[i].last);
|
QueIns(tmphl,heaplog_head[i].last);
|
||||||
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
|
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
|
||||||
POPFD
|
POPFD
|
||||||
}
|
}
|
||||||
@@ -46,7 +46,7 @@ U0 HeapLogMAlloc(U8 *addr)
|
|||||||
U0 HeapLogFree(U8 *addr)
|
U0 HeapLogFree(U8 *addr)
|
||||||
{
|
{
|
||||||
I64 i;
|
I64 i;
|
||||||
CHeapLog *temphl;
|
CHeapLog *tmphl;
|
||||||
if (!addr) return;
|
if (!addr) return;
|
||||||
if (MHeapCtrl(addr)==heaplog_hc_watched) {
|
if (MHeapCtrl(addr)==heaplog_hc_watched) {
|
||||||
i=addr>>3 &(HL_HASH_SIZE-1);
|
i=addr>>3 &(HL_HASH_SIZE-1);
|
||||||
@@ -54,16 +54,16 @@ U0 HeapLogFree(U8 *addr)
|
|||||||
CLI
|
CLI
|
||||||
while (LBts(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0))
|
while (LBts(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0))
|
||||||
PAUSE
|
PAUSE
|
||||||
temphl=heaplog_head[i].next;
|
tmphl=heaplog_head[i].next;
|
||||||
while (temphl!=&heaplog_head[i]) {
|
while (tmphl!=&heaplog_head[i]) {
|
||||||
if (addr==temphl->addr) {
|
if (addr==tmphl->addr) {
|
||||||
QueRem(temphl);
|
QueRem(tmphl);
|
||||||
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
|
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
|
||||||
POPFD
|
POPFD
|
||||||
Free(temphl);
|
Free(tmphl);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
temphl=temphl->next;
|
tmphl=tmphl->next;
|
||||||
}
|
}
|
||||||
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
|
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
|
||||||
POPFD
|
POPFD
|
||||||
@@ -115,7 +115,7 @@ public Bool HeapLog(Bool val=ON,CTask *task=NULL)
|
|||||||
public U0 HeapLogAddrRep(Bool leave_it=OFF)
|
public U0 HeapLogAddrRep(Bool leave_it=OFF)
|
||||||
{//Call $LK,"HeapLog",A="MN:HeapLog"$() first and collect data.
|
{//Call $LK,"HeapLog",A="MN:HeapLog"$() first and collect data.
|
||||||
I64 i,j,total=0;
|
I64 i,j,total=0;
|
||||||
CHeapLog *temphl,hl;
|
CHeapLog *tmphl,hl;
|
||||||
if (!LBtr(&sys_semas[SYS_SEMA_HEAPLOG_ACTIVE],0)) {
|
if (!LBtr(&sys_semas[SYS_SEMA_HEAPLOG_ACTIVE],0)) {
|
||||||
"HeapLog Not Active\n";
|
"HeapLog Not Active\n";
|
||||||
return;
|
return;
|
||||||
@@ -124,16 +124,16 @@ public U0 HeapLogAddrRep(Bool leave_it=OFF)
|
|||||||
while (LBts(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0))
|
while (LBts(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0))
|
||||||
PAUSE
|
PAUSE
|
||||||
for (i=0;i<HL_HASH_SIZE;i++) {
|
for (i=0;i<HL_HASH_SIZE;i++) {
|
||||||
temphl=heaplog_head[i].next;
|
tmphl=heaplog_head[i].next;
|
||||||
while (temphl!=&heaplog_head[i]) {
|
while (tmphl!=&heaplog_head[i]) {
|
||||||
//Take snapshot in case modified. (while we work)
|
//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;
|
"$$PURPLE$$%08X$$FG$$ %08X",MSize(hl.addr),hl.addr;
|
||||||
for (j=0;j<HL_CALLER_DEPTH;j++)
|
for (j=0;j<HL_CALLER_DEPTH;j++)
|
||||||
" %P",hl.caller[j];
|
" %P",hl.caller[j];
|
||||||
'\n';
|
'\n';
|
||||||
total+=MSize(hl.addr);
|
total+=MSize(hl.addr);
|
||||||
temphl=hl.next;
|
tmphl=hl.next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
|
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)
|
public U0 HeapLogSizeRep(Bool leave_it=OFF)
|
||||||
{//Call $LK,"HeapLog",A="MN:HeapLog"$() first and collect data.
|
{//Call $LK,"HeapLog",A="MN:HeapLog"$() first and collect data.
|
||||||
I64 i,j,k,total=0;
|
I64 i,j,k,total=0;
|
||||||
CHeapLog *temphla,hla,*temphls,*temphls1;
|
CHeapLog *tmphla,hla,*tmphls,*tmphls1;
|
||||||
CHeapLogHash *size_head;
|
CHeapLogHash *size_head;
|
||||||
if (!LBtr(&sys_semas[SYS_SEMA_HEAPLOG_ACTIVE],0)) {
|
if (!LBtr(&sys_semas[SYS_SEMA_HEAPLOG_ACTIVE],0)) {
|
||||||
"HeapLog Not Active\n";
|
"HeapLog Not Active\n";
|
||||||
@@ -161,45 +161,45 @@ public U0 HeapLogSizeRep(Bool leave_it=OFF)
|
|||||||
while (LBts(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0))
|
while (LBts(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0))
|
||||||
PAUSE
|
PAUSE
|
||||||
for (i=0;i<HL_HASH_SIZE;i++) {
|
for (i=0;i<HL_HASH_SIZE;i++) {
|
||||||
temphla=heaplog_head[i].next;
|
tmphla=heaplog_head[i].next;
|
||||||
while (temphla!=&heaplog_head[i]) {
|
while (tmphla!=&heaplog_head[i]) {
|
||||||
//Take snapshot in case modified. (while we work)
|
//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);
|
k=(MSize(hla.addr)>>3+hla.caller[0])&(HL_HASH_SIZE-1);
|
||||||
temphls=size_head[k].next;
|
tmphls=size_head[k].next;
|
||||||
while (temphls!=&size_head[k]) {
|
while (tmphls!=&size_head[k]) {
|
||||||
if (MSize(hla.addr)==temphls->size) {
|
if (MSize(hla.addr)==tmphls->size) {
|
||||||
for (j=0;j<HL_CALLER_DEPTH;j++)
|
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;
|
goto hl_next;
|
||||||
temphls->cnt++;
|
tmphls->cnt++;
|
||||||
goto hl_found;
|
goto hl_found;
|
||||||
}
|
}
|
||||||
hl_next:
|
hl_next:
|
||||||
temphls=temphls->next;
|
tmphls=tmphls->next;
|
||||||
}
|
}
|
||||||
temphls=MAlloc(sizeof(CHeapLog),heaplog_hc);
|
tmphls=MAlloc(sizeof(CHeapLog),heaplog_hc);
|
||||||
MemCpy(temphls,&hla,sizeof(CHeapLog));
|
MemCpy(tmphls,&hla,sizeof(CHeapLog));
|
||||||
temphls->cnt=1;
|
tmphls->cnt=1;
|
||||||
temphls->size=MSize(hla.addr);
|
tmphls->size=MSize(hla.addr);
|
||||||
QueIns(temphls,size_head[k].last);
|
QueIns(tmphls,size_head[k].last);
|
||||||
hl_found:
|
hl_found:
|
||||||
temphla=hla.next;
|
tmphla=hla.next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
|
LBtr(&sys_semas[SYS_SEMA_HEAPLOG_LOCK],0);
|
||||||
|
|
||||||
for (i=0;i<HL_HASH_SIZE;i++) {
|
for (i=0;i<HL_HASH_SIZE;i++) {
|
||||||
temphls=size_head[i].next;
|
tmphls=size_head[i].next;
|
||||||
while (temphls!=&size_head[i]) {
|
while (tmphls!=&size_head[i]) {
|
||||||
temphls1=temphls->next;
|
tmphls1=tmphls->next;
|
||||||
"%08X*%08X=%08X",temphls->size,temphls->cnt,temphls->size*temphls->cnt;
|
"%08X*%08X=%08X",tmphls->size,tmphls->cnt,tmphls->size*tmphls->cnt;
|
||||||
for (j=0;j<HL_CALLER_DEPTH;j++)
|
for (j=0;j<HL_CALLER_DEPTH;j++)
|
||||||
" %P",temphls->caller[j];
|
" %P",tmphls->caller[j];
|
||||||
'\n';
|
'\n';
|
||||||
total+=temphls->size*temphls->cnt;
|
total+=tmphls->size*tmphls->cnt;
|
||||||
Free(temphls);
|
Free(tmphls);
|
||||||
temphls=temphls1;
|
tmphls=tmphls1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Free(size_head);
|
Free(size_head);
|
||||||
|
|||||||
+42
-42
@@ -1,107 +1,107 @@
|
|||||||
#help_index "Cmd Line (Typically)"
|
#help_index "Cmd Line (Typically)"
|
||||||
|
|
||||||
I64 LineRep1(CDirEntry *tempde)
|
I64 LineRep1(CDirEntry *tmpde)
|
||||||
{
|
{
|
||||||
CDoc *doc;
|
CDoc *doc;
|
||||||
I64 res=0,i;
|
I64 res=0,i;
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
i=0;
|
i=0;
|
||||||
if (tempde->attr&RS_ATTR_DIR)
|
if (tmpde->attr&RS_ATTR_DIR)
|
||||||
i=LineRep1(tempde->sub);
|
i=LineRep1(tmpde->sub);
|
||||||
else {
|
else {
|
||||||
doc=DocRead(tempde->full_name);
|
doc=DocRead(tmpde->full_name);
|
||||||
if (doc->head.next!=doc)
|
if (doc->head.next!=doc)
|
||||||
i=doc->head.last->y+2;
|
i=doc->head.last->y+2;
|
||||||
DocDel(doc);
|
DocDel(doc);
|
||||||
}
|
}
|
||||||
tempde->user_data=i;
|
tmpde->user_data=i;
|
||||||
res+=i;
|
res+=i;
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
U0 LineRep2(CDoc *doc,CDirEntry *tempde)
|
U0 LineRep2(CDoc *doc,CDirEntry *tmpde)
|
||||||
{
|
{
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
if (tempde->attr&RS_ATTR_DIR) {
|
if (tmpde->attr&RS_ATTR_DIR) {
|
||||||
DocPrint(doc,"%8,d $$TR+C,\"%s\"$$\n$$ID,2$$",tempde->user_data,tempde->name);
|
DocPrint(doc,"%8,d $$TR+C,\"%s\"$$\n$$ID,2$$",tmpde->user_data,tmpde->name);
|
||||||
LineRep2(doc,tempde->sub);
|
LineRep2(doc,tmpde->sub);
|
||||||
DocPrint(doc,"$$ID,-2$$");
|
DocPrint(doc,"$$ID,-2$$");
|
||||||
} else
|
} else
|
||||||
DocPrint(doc,"%8,d $$LK,\"%s\",A=\"FI:%s\"$$\n",
|
DocPrint(doc,"%8,d $$LK,\"%s\",A=\"FI:%s\"$$\n",
|
||||||
tempde->user_data,tempde->name,tempde->full_name);
|
tmpde->user_data,tmpde->name,tmpde->full_name);
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public I64 LineRep(U8 *files_find_mask="/*",U8 *fu_flags=NULL)
|
public I64 LineRep(U8 *files_find_mask="/*",U8 *fu_flags=NULL)
|
||||||
{//Source line-of-code count report.
|
{//Source line-of-code count report.
|
||||||
I64 fuf_flags=0,res=0;
|
I64 fuf_flags=0,res=0;
|
||||||
CDoc *doc=DocNew;
|
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"),"+r+S");
|
||||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||||
if (tempde1=FilesFind(files_find_mask,fuf_flags)) {
|
if (tmpde1=FilesFind(files_find_mask,fuf_flags)) {
|
||||||
res=LineRep1(tempde1);
|
res=LineRep1(tmpde1);
|
||||||
DocPrint(doc,"%8,d $$TR+C,\"%s\"$$\n$$ID,2$$",res,files_find_mask);
|
DocPrint(doc,"%8,d $$TR+C,\"%s\"$$\n$$ID,2$$",res,files_find_mask);
|
||||||
LineRep2(doc,tempde1);
|
LineRep2(doc,tmpde1);
|
||||||
DocPrint(doc,"$$ID,-2$$");
|
DocPrint(doc,"$$ID,-2$$");
|
||||||
DirTreeDel(tempde1);
|
DirTreeDel(tmpde1);
|
||||||
}
|
}
|
||||||
DocInsDoc(DocPut,doc);
|
DocInsDoc(DocPut,doc);
|
||||||
DocDel(doc);
|
DocDel(doc);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
I64 SizeRep1(CDirEntry *tempde,I64 *_fuf_flags)
|
I64 SizeRep1(CDirEntry *tmpde,I64 *_fuf_flags)
|
||||||
{
|
{
|
||||||
I64 res=0,i;
|
I64 res=0,i;
|
||||||
U8 buf[BLK_SIZE];
|
U8 buf[BLK_SIZE];
|
||||||
CDrv *dv;
|
CDrv *dv;
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
if (tempde->attr&RS_ATTR_DIR)
|
if (tmpde->attr&RS_ATTR_DIR)
|
||||||
i=SizeRep1(tempde->sub,_fuf_flags);
|
i=SizeRep1(tmpde->sub,_fuf_flags);
|
||||||
else if ((i=tempde->size) && Bt(_fuf_flags,FUf_EXPAND) &&
|
else if ((i=tmpde->size) && Bt(_fuf_flags,FUf_EXPAND) &&
|
||||||
FileAttr(tempde->name)&RS_ATTR_COMPRESSED) {
|
FileAttr(tmpde->name)&RS_ATTR_COMPRESSED) {
|
||||||
dv=Let2Drv(*tempde->full_name);
|
dv=Let2Drv(*tmpde->full_name);
|
||||||
RBlks(dv,buf,Cluster2Blk(dv,tempde->cluster),1);
|
RBlks(dv,buf,Cluster2Blk(dv,tmpde->cluster),1);
|
||||||
i=(&buf)(CArcCompress *)->expanded_size;
|
i=(&buf)(CArcCompress *)->expanded_size;
|
||||||
}
|
}
|
||||||
tempde->user_data=i;
|
tmpde->user_data=i;
|
||||||
res+=i;
|
res+=i;
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
U0 SizeRep2(CDoc *doc,CDirEntry *tempde)
|
U0 SizeRep2(CDoc *doc,CDirEntry *tmpde)
|
||||||
{
|
{
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
if (tempde->attr&RS_ATTR_DIR) {
|
if (tmpde->attr&RS_ATTR_DIR) {
|
||||||
DocPrint(doc,"%10,d $$TR+C,\"%s\"$$\n$$ID,2$$",
|
DocPrint(doc,"%10,d $$TR+C,\"%s\"$$\n$$ID,2$$",
|
||||||
tempde->user_data,tempde->name);
|
tmpde->user_data,tmpde->name);
|
||||||
SizeRep2(doc,tempde->sub);
|
SizeRep2(doc,tmpde->sub);
|
||||||
DocPrint(doc,"$$ID,-2$$");
|
DocPrint(doc,"$$ID,-2$$");
|
||||||
} else {
|
} else {
|
||||||
DocPrint(doc,"%10,d ",tempde->user_data);
|
DocPrint(doc,"%10,d ",tmpde->user_data);
|
||||||
DocPrint(doc,"$$LK,\"%s\",A=\"FI:%s\"$$\n",
|
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)
|
public I64 SizeRep(U8 *files_find_mask="/*",U8 *fu_flags=NULL)
|
||||||
{//Report file sizes. "+x" for expanded size of compressed files.
|
{//Report file sizes. "+x" for expanded size of compressed files.
|
||||||
I64 fuf_flags=0,res=0;
|
I64 fuf_flags=0,res=0;
|
||||||
CDoc *doc=DocNew;
|
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"),"+r");
|
||||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
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;
|
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);
|
DocPrint(doc,"%10,d $$TR+C,\"%s\"$$\n$$ID,2$$",res,files_find_mask);
|
||||||
SizeRep2(doc,tempde1);
|
SizeRep2(doc,tmpde1);
|
||||||
DocPrint(doc,"$$ID,-2$$");
|
DocPrint(doc,"$$ID,-2$$");
|
||||||
DirTreeDel(tempde1);
|
DirTreeDel(tmpde1);
|
||||||
}
|
}
|
||||||
DocInsDoc(DocPut,doc);
|
DocInsDoc(DocPut,doc);
|
||||||
DocDel(doc);
|
DocDel(doc);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ I64 LinkChkDoc(CDoc *doc,I64 *_fuf_flags)
|
|||||||
old_doc=DocPut;
|
old_doc=DocPut;
|
||||||
DocLock(old_doc);
|
DocLock(old_doc);
|
||||||
Fs->put_doc=doc;
|
Fs->put_doc=doc;
|
||||||
found=DocLinkChk(st);
|
found=DocLinkChk(doc,st);
|
||||||
Fs->put_doc=old_doc;
|
Fs->put_doc=old_doc;
|
||||||
DocUnlock(old_doc);
|
DocUnlock(old_doc);
|
||||||
if (!found) {
|
if (!found) {
|
||||||
@@ -47,14 +47,14 @@ I64 LinkChkFile(U8 *filename,I64 *_fuf_flags)
|
|||||||
public I64 LinkChk(U8 *files_find_mask="/*",U8 *fu_flags=NULL)
|
public I64 LinkChk(U8 *files_find_mask="/*",U8 *fu_flags=NULL)
|
||||||
{//Check documents for broken file links.
|
{//Check documents for broken file links.
|
||||||
I64 fuf_flags=0,res=0;
|
I64 fuf_flags=0,res=0;
|
||||||
CDirEntry *tempde,*tempde1;
|
CDirEntry *tmpde,*tmpde1;
|
||||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+T+f+F+O");
|
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+$$+f+F+O");
|
||||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||||
while (tempde && !Bt(&fuf_flags,FUf_CANCEL)) {
|
while (tmpde && !Bt(&fuf_flags,FUf_CANCEL)) {
|
||||||
res+=LinkChkFile(tempde->full_name,&fuf_flags);
|
res+=LinkChkFile(tmpde->full_name,&fuf_flags);
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
DirTreeDel(tempde1);
|
DirTreeDel(tmpde1);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
+20
-20
@@ -14,46 +14,46 @@ I64 PenBrushesSize()
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
I64 ScreenZoomTablesSize()
|
I64 ScrnZoomTablesSize()
|
||||||
{
|
{
|
||||||
I64 res=0,i;
|
I64 res=0,i;
|
||||||
for (i=1;i<=GR_MAX_SCREEN_ZOOM;i++)
|
for (i=1;i<=GR_MAX_SCRN_ZOOM;i++)
|
||||||
res+=MSize2(gr.screen_zoom_tables[i]);
|
res+=MSize2(gr.scrn_zoom_tables[i]);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
I64 TaskStkSize(CTask *task)
|
I64 TaskStkSize(CTask *task)
|
||||||
{
|
{
|
||||||
CTaskStk *temps=task->stk;
|
CTaskStk *tmps=task->stk;
|
||||||
I64 res=0;
|
I64 res=0;
|
||||||
while (temps) {
|
while (tmps) {
|
||||||
res+=MSize2(temps);
|
res+=MSize2(tmps);
|
||||||
temps=temps->next_stk;
|
tmps=tmps->next_stk;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
I64 TaskQueSize(CTask *task)
|
I64 TaskQueSize(CTask *task)
|
||||||
{
|
{
|
||||||
CSrvCmd *tempc,*tempc1;
|
CSrvCmd *tmpc,*tmpc1;
|
||||||
I64 res=0;
|
I64 res=0;
|
||||||
PUSHFD
|
PUSHFD
|
||||||
CLI
|
CLI
|
||||||
while (LBts(&task->srv_ctrl.flags,SVCRf_LOCKED))
|
while (LBts(&task->srv_ctrl.flags,SVCRf_LOCKED))
|
||||||
PAUSE
|
PAUSE
|
||||||
|
|
||||||
tempc1=&task->srv_ctrl.next_waiting;
|
tmpc1=&task->srv_ctrl.next_waiting;
|
||||||
tempc=tempc1->next;
|
tmpc=tmpc1->next;
|
||||||
while (tempc!=tempc1) {
|
while (tmpc!=tmpc1) {
|
||||||
res+=MSize2(tempc)+MSize2(tempc->aux_str);
|
res+=MSize2(tmpc)+MSize2(tmpc->aux_str);
|
||||||
tempc=tempc->next;
|
tmpc=tmpc->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
tempc1=&task->srv_ctrl.next_done;
|
tmpc1=&task->srv_ctrl.next_done;
|
||||||
tempc=tempc1->next;
|
tmpc=tmpc1->next;
|
||||||
while (tempc!=tempc1) {
|
while (tmpc!=tmpc1) {
|
||||||
res+=MSize2(tempc)+MSize2(tempc->aux_str);
|
res+=MSize2(tmpc)+MSize2(tmpc->aux_str);
|
||||||
tempc=tempc->next;
|
tmpc=tmpc->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
LBtr(&task->srv_ctrl.flags,SVCRf_LOCKED);
|
LBtr(&task->srv_ctrl.flags,SVCRf_LOCKED);
|
||||||
@@ -136,7 +136,7 @@ Bool MemRepTask(CTask *task,Bool override_validate=FALSE)
|
|||||||
|
|
||||||
if (task==sys_winmgr_task) {
|
if (task==sys_winmgr_task) {
|
||||||
"gr.pen_brushes\t:%010X\n",PenBrushesSize;
|
"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) {
|
} else if (task==adam_task) {
|
||||||
j=0;k=0;m=0;n=0;
|
j=0;k=0;m=0;n=0;
|
||||||
for (i=0;i<mp_cnt;i++) {
|
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.dc1\t\t:%010X\n",DCSize(gr.dc1);
|
||||||
"gr.dc2\t\t:%010X\n",DCSize(gr.dc2);
|
"gr.dc2\t\t:%010X\n",DCSize(gr.dc2);
|
||||||
"gr.dc_cache\t\t:%010X\n",DCSize(gr.dc_cache);
|
"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);
|
"gr.zoomed_dc\t:%010X\n",DCSize(gr.zoomed_dc);
|
||||||
}
|
}
|
||||||
"$$ID,-2$$";
|
"$$ID,-2$$";
|
||||||
|
|||||||
+26
-26
@@ -10,28 +10,28 @@ CDirEntry MGFind(CDirEntry *needle_entry,CDirEntry *haystack_lst)
|
|||||||
return NULL;
|
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;
|
CDirEntry *tmpde;
|
||||||
while (tempde1 && !(*_df_flags & DF_ABORT_ALL_FILES)) {
|
while (tmpde1 && !(*_df_flags & DF_ABORT_ALL_FILES)) {
|
||||||
tempde=MGFind(tempde1,tempde2);
|
tmpde=MGFind(tmpde1,tmpde2);
|
||||||
if (!tempde)
|
if (!tmpde)
|
||||||
"$$BROWN$$Does Not Exist:%s$$FG$$\n",tempde1->full_name;
|
"$$BROWN$$Does Not Exist:%s$$FG$$\n",tmpde1->full_name;
|
||||||
else {
|
else {
|
||||||
if (tempde1->attr & RS_ATTR_DIR)
|
if (tmpde1->attr & RS_ATTR_DIR)
|
||||||
Merge2(tempde1->sub,tempde->sub,_fuf_flags,_df_flags);
|
Merge2(tmpde1->sub,tmpde->sub,_fuf_flags,_df_flags);
|
||||||
else {
|
else {
|
||||||
if (AbsI64(tempde1->datetime-tempde->datetime)>CDATE_FREQ*2) {//slop
|
if (AbsI64(tmpde1->datetime-tmpde->datetime)>CDATE_FREQ*2) {//slop
|
||||||
"%s",tempde1->full_name;
|
"%s",tmpde1->full_name;
|
||||||
'\n';
|
'\n';
|
||||||
if (Bt(_fuf_flags,FUf_DIFF)) {
|
if (Bt(_fuf_flags,FUf_DIFF)) {
|
||||||
if (FilesFindMatch(tempde1->full_name,FILEMASK_TXT))
|
if (FilesFindMatch(tmpde1->full_name,FILEMASK_TXT))
|
||||||
Diff(tempde->full_name,tempde1->full_name,_df_flags);
|
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="/*",
|
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.
|
destination files.
|
||||||
*/
|
*/
|
||||||
I64 df_flags=0,fuf_flags=0;
|
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"),"+r");
|
||||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||||
if (fuf_flags&~(FUG_FILES_FIND|FUF_DIFF))
|
if (fuf_flags&~(FUG_FILES_FIND|FUF_DIFF))
|
||||||
throw('FUF');
|
throw('FUF');
|
||||||
PrintWarn("This is based strictly on file dates.\n");
|
PrintWarn("This is based strictly on file dates.\n");
|
||||||
tempde1=FilesFind(src_files_find_mask,fuf_flags&FUG_FILES_FIND);
|
tmpde1=FilesFind(src_files_find_mask,fuf_flags&FUG_FILES_FIND);
|
||||||
tempde2=FilesFind(dst_files_find_mask,fuf_flags&FUG_FILES_FIND);
|
tmpde2=FilesFind(dst_files_find_mask,fuf_flags&FUG_FILES_FIND);
|
||||||
fuf_flags&=FUF_DIFF;
|
fuf_flags&=FUF_DIFF;
|
||||||
Merge2(tempde1,tempde2,&fuf_flags,&df_flags);
|
Merge2(tmpde1,tmpde2,&fuf_flags,&df_flags);
|
||||||
DirTreeDel(tempde1);
|
DirTreeDel(tmpde1);
|
||||||
DirTreeDel(tempde2);
|
DirTreeDel(tmpde2);
|
||||||
}
|
}
|
||||||
|
|
||||||
#help_index "Utils;Cmd Line (Typically)"
|
#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)
|
public U0 NewFiles(U8 *files_find_mask="/*",CDate cdt=0,U8 *fu_flags=NULL)
|
||||||
{//Report files newer than a certain date.
|
{//Report files newer than a certain date.
|
||||||
I64 fuf_flags=0;
|
I64 fuf_flags=0;
|
||||||
CDirEntry *tempde,*tempde1;
|
CDirEntry *tmpde,*tmpde1;
|
||||||
if (!cdt) cdt=sys_compile_time;
|
if (!cdt) cdt=sys_compile_time;
|
||||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+F");
|
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+F");
|
||||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
if (tempde->datetime>cdt)
|
if (tmpde->datetime>cdt)
|
||||||
"%s\n",tempde->full_name;
|
"%s\n",tmpde->full_name;
|
||||||
tempde=tempde->next;
|
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.
|
{//Break file into list of not-unique words.
|
||||||
I64 fuf_flags=0,res=0;
|
I64 fuf_flags=0,res=0;
|
||||||
CDoc *doc_out=DocNew;
|
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"),"+r+f+F+T");
|
||||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
res+=DocWordsFile(doc_out,tempde->full_name,chars_bmp);
|
res+=DocWordsFile(doc_out,tmpde->full_name,chars_bmp);
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
DirTreeDel(tempde1);
|
DirTreeDel(tmpde1);
|
||||||
DocInsDoc(NULL,doc_out);
|
DocInsDoc(NULL,doc_out);
|
||||||
DocDel(doc_out);
|
DocDel(doc_out);
|
||||||
return res;
|
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)
|
public I64 LongLines(U8 *files_find_mask="*",I64 cols=80,U8 *fu_flags=NULL)
|
||||||
{//Report files with lines of too many cols.
|
{//Report files with lines of too many cols.
|
||||||
I64 res=0,fuf_flags=0;
|
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"),"+r+f+F+S");
|
||||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
if (LongLinesFile(tempde->full_name,cols))
|
if (LongLinesFile(tmpde->full_name,cols))
|
||||||
res++;
|
res++;
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
DirTreeDel(tempde1);
|
DirTreeDel(tmpde1);
|
||||||
return res;
|
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.
|
//or removing trailing spaces on lines.
|
||||||
//See $LK,"SUF Flags",A="MN:SUF_SINGLE_SPACE"$.
|
//See $LK,"SUF Flags",A="MN:SUF_SINGLE_SPACE"$.
|
||||||
I64 fuf_flags=0;
|
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"),"+f+F+T");
|
||||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
SUFile(tempde->full_name,suf_flags,indent_scale_factor);
|
SUFile(tmpde->full_name,suf_flags,indent_scale_factor);
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
DirTreeDel(tempde1);
|
DirTreeDel(tmpde1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public U0 S2T(U8 *files_find_mask,U8 *fu_flags=NULL)
|
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.
|
{//Convert text file to $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ by making double $$'s.
|
||||||
CDoc *doc;
|
CDoc *doc;
|
||||||
I64 fuf_flags=0;
|
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"),"+r+f+F");
|
||||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||||
tempde=tempde1=FilesFind(files_find_mask,fuf_flags);
|
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
"%s\n",tempde->full_name;
|
"%s\n",tmpde->full_name;
|
||||||
doc=DocRead(tempde->full_name,DOCF_PLAIN_TEXT|DOCF_DBL_DOLLARS);
|
doc=DocRead(tmpde->full_name,DOCF_PLAIN_TEXT|DOCF_DBL_DOLLARS);
|
||||||
DocWrite(doc);
|
DocWrite(doc);
|
||||||
DocDel(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.note_len=1.0;
|
||||||
music.meter_top=4;
|
music.meter_top=4;
|
||||||
music.meter_bottom=4;
|
music.meter_bottom=4;
|
||||||
|
SndRst;
|
||||||
PUSHFD
|
PUSHFD
|
||||||
CLI
|
CLI
|
||||||
if (mp_cnt>1)
|
if (mp_cnt>1)
|
||||||
|
|||||||
+3
-6
@@ -2,14 +2,11 @@
|
|||||||
U0 TaskRepTask(CTask *task,I64 indent)
|
U0 TaskRepTask(CTask *task,I64 indent)
|
||||||
{
|
{
|
||||||
CTask *task1;
|
CTask *task1;
|
||||||
U8 *st,*desc=MStrUtil(task->task_title,SUF_SAFE_DOLLAR);
|
"%h*c$$MA,T=\"%08X\",LM=\"Kill(0x%X);\n\",$$ $$BLACK$$#%d$$FG$$ "
|
||||||
st=MStrPrint("$$MA,T=\"%08X\",LM=\"Kill(0x%X);\n\",$$",task,task,task);
|
"$$TX,\"%$$Q...\",SCX=16$$\n",indent,CH_SPACE,task,task,task->task_num,
|
||||||
"%h*c%s $$TX,\"%$$Q...\",SCX=16$$\n",indent,CH_SPACE,
|
task->task_title;
|
||||||
st,desc;
|
|
||||||
"%h*c%08X %04X:%04X:%08X\n",indent+2,CH_SPACE,TaskMemAlloced(task),
|
"%h*c%08X %04X:%04X:%08X\n",indent+2,CH_SPACE,TaskMemAlloced(task),
|
||||||
task->task_flags,task->display_flags,task->win_inhibit;
|
task->task_flags,task->display_flags,task->win_inhibit;
|
||||||
Free(st);
|
|
||||||
Free(desc);
|
|
||||||
task1=task->next_child_task;
|
task1=task->next_child_task;
|
||||||
while (task1!=(&task->next_child_task)(U8 *)
|
while (task1!=(&task->next_child_task)(U8 *)
|
||||||
-offset(CTask.next_sibling_task)) {
|
-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
|
//It saves many settings so they can be restored
|
||||||
//at the end of the application with $LK,"SettingsPop",A="MN:SettingsPop"$().
|
//at the end of the application with $LK,"SettingsPop",A="MN:SettingsPop"$().
|
||||||
|
|
||||||
CTaskSettings *tempse;
|
CTaskSettings *tmpse;
|
||||||
CDoc *doc;
|
CDoc *doc;
|
||||||
if (!task) task=Fs;
|
if (!task) task=Fs;
|
||||||
if (!TaskValidate(task)) return NULL;
|
if (!TaskValidate(task)) return NULL;
|
||||||
tempse=CAlloc(sizeof(CTaskSettings),task);
|
tmpse=CAlloc(sizeof(CTaskSettings),task);
|
||||||
tempse->cur_dir=CurDir(task,task);
|
tmpse->cur_dir=CurDir(task,task);
|
||||||
tempse->draw_it=task->draw_it;
|
tmpse->draw_it=task->draw_it;
|
||||||
GrPaletteGet(tempse->palette);
|
GrPaletteGet(tmpse->palette);
|
||||||
tempse->task_end_cb=task->task_end_cb;
|
tmpse->task_end_cb=task->task_end_cb;
|
||||||
|
|
||||||
if (!(flags&TSF_SAME_SONG)) {
|
if (!(flags&TSF_SAME_SONG)) {
|
||||||
if (tempse->song_task=task->song_task) {
|
if (tmpse->song_task=task->song_task) {
|
||||||
Suspend(task->song_task);
|
Suspend(task->song_task);
|
||||||
Snd(0);
|
Snd(0);
|
||||||
}
|
}
|
||||||
task->song_task=NULL;
|
task->song_task=NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tempse->animate_task=task->animate_task)
|
if (tmpse->animate_task=task->animate_task)
|
||||||
Suspend(task->animate_task);
|
Suspend(task->animate_task);
|
||||||
task->animate_task=NULL;
|
task->animate_task=NULL;
|
||||||
|
|
||||||
if (doc=DocPut(task)) {
|
if (doc=DocPut(task)) {
|
||||||
tempse->hide_cursor=!Bt(&doc->flags,DOCf_HIDE_CURSOR);
|
tmpse->hide_cursor=!Bt(&doc->flags,DOCf_HIDE_CURSOR);
|
||||||
tempse->highlight_cursor=!Bt(&doc->flags,DOCf_DONT_HIGHLIGHT_CURSOR);
|
tmpse->highlight_cursor=!Bt(&doc->flags,DOCf_DONT_HIGHLIGHT_CURSOR);
|
||||||
tempse->scroll=!Bt(&doc->flags,DOCf_NO_SCROLL_BARS);
|
tmpse->scroll=!Bt(&doc->flags,DOCf_NO_SCROLL_BARS);
|
||||||
}
|
}
|
||||||
|
|
||||||
tempse->left=task->win_left;
|
tmpse->left=task->win_left;
|
||||||
tempse->right=task->win_right;
|
tmpse->right=task->win_right;
|
||||||
tempse->top=task->win_top;
|
tmpse->top=task->win_top;
|
||||||
tempse->bottom=task->win_bottom;
|
tmpse->bottom=task->win_bottom;
|
||||||
|
|
||||||
tempse->scroll_x=task->scroll_x;
|
tmpse->scroll_x=task->scroll_x;
|
||||||
tempse->scroll_y=task->scroll_y;
|
tmpse->scroll_y=task->scroll_y;
|
||||||
tempse->scroll_z=task->scroll_z;
|
tmpse->scroll_z=task->scroll_z;
|
||||||
|
|
||||||
tempse->win_inhibit=task->win_inhibit;
|
tmpse->win_inhibit=task->win_inhibit;
|
||||||
tempse->text_attr=task->text_attr;
|
tmpse->text_attr=task->text_attr;
|
||||||
StrCpy(tempse->task_title,task->task_title);
|
StrCpy(tmpse->task_title,task->task_title);
|
||||||
tempse->title_src =task->title_src;
|
tmpse->title_src =task->title_src;
|
||||||
tempse->border_attr=task->border_attr;
|
tmpse->border_attr=task->border_attr;
|
||||||
tempse->border_src =task->border_src;
|
tmpse->border_src =task->border_src;
|
||||||
tempse->border=!Bt(&task->display_flags,DISPLAYf_NO_BORDER);
|
tmpse->border=!Bt(&task->display_flags,DISPLAYf_NO_BORDER);
|
||||||
if (TaskValidate(ac.task))
|
if (TaskValidate(ac.task))
|
||||||
tempse->autocomplete=TRUE;
|
tmpse->autocomplete=TRUE;
|
||||||
else
|
else
|
||||||
tempse->autocomplete=FALSE;
|
tmpse->autocomplete=FALSE;
|
||||||
|
|
||||||
tempse->next=task->next_settings;
|
tmpse->next=task->next_settings;
|
||||||
task->next_settings=tempse;
|
task->next_settings=tmpse;
|
||||||
return tempse;
|
return tmpse;
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 SettingsPop2(CTask *task,CTaskSettings *tempse)
|
U0 SettingsPop2(CTask *task,CTaskSettings *tmpse)
|
||||||
{
|
{
|
||||||
CDoc *doc;
|
CDoc *doc;
|
||||||
|
|
||||||
if (doc=DocPut(task)) {
|
if (doc=DocPut(task)) {
|
||||||
LBEqu(&doc->flags,DOCf_HIDE_CURSOR,!tempse->hide_cursor);
|
LBEqu(&doc->flags,DOCf_HIDE_CURSOR,!tmpse->hide_cursor);
|
||||||
LBEqu(&doc->flags,DOCf_DONT_HIGHLIGHT_CURSOR,!tempse->highlight_cursor);
|
LBEqu(&doc->flags,DOCf_DONT_HIGHLIGHT_CURSOR,!tmpse->highlight_cursor);
|
||||||
LBEqu(&doc->flags,DOCf_NO_SCROLL_BARS,!tempse->scroll);
|
LBEqu(&doc->flags,DOCf_NO_SCROLL_BARS,!tmpse->scroll);
|
||||||
}
|
}
|
||||||
|
|
||||||
WinBorder(tempse->border,task);
|
WinBorder(tmpse->border,task);
|
||||||
WinHorz(tempse->left,tempse->right,task);
|
WinHorz(tmpse->left,tmpse->right,task);
|
||||||
WinVert(tempse->top,tempse->bottom,task);
|
WinVert(tmpse->top,tmpse->bottom,task);
|
||||||
task->scroll_x=tempse->scroll_x;
|
task->scroll_x=tmpse->scroll_x;
|
||||||
task->scroll_y=tempse->scroll_y;
|
task->scroll_y=tmpse->scroll_y;
|
||||||
task->scroll_z=tempse->scroll_z;
|
task->scroll_z=tmpse->scroll_z;
|
||||||
task->win_inhibit=tempse->win_inhibit;
|
task->win_inhibit=tmpse->win_inhibit;
|
||||||
task->text_attr=tempse->text_attr;
|
task->text_attr=tmpse->text_attr;
|
||||||
task->border_attr=tempse->border_attr;
|
task->border_attr=tmpse->border_attr;
|
||||||
task->border_src =tempse->border_src;
|
task->border_src =tmpse->border_src;
|
||||||
task->title_src =tempse->title_src;
|
task->title_src =tmpse->title_src;
|
||||||
StrCpy(task->task_title,tempse->task_title);
|
StrCpy(task->task_title,tmpse->task_title);
|
||||||
AutoComplete(tempse->autocomplete);
|
AutoComplete(tmpse->autocomplete);
|
||||||
GrPaletteSet(tempse->palette);
|
GrPaletteSet(tmpse->palette);
|
||||||
Snd(0);
|
Snd(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public U0 SettingsPop(CTask *task=NULL,I64 flags=0)
|
public U0 SettingsPop(CTask *task=NULL,I64 flags=0)
|
||||||
{//Typically, called at end of an application.
|
{//Typically, called at end of an application.
|
||||||
CTaskSettings *tempse;
|
CTaskSettings *tmpse;
|
||||||
if (!task) task=Fs;
|
if (!task) task=Fs;
|
||||||
if (!TaskValidate(task))
|
if (!TaskValidate(task))
|
||||||
return;
|
return;
|
||||||
if (tempse=task->next_settings) {
|
if (tmpse=task->next_settings) {
|
||||||
task->next_settings=tempse->next;
|
task->next_settings=tmpse->next;
|
||||||
Cd(tempse->cur_dir);
|
Cd(tmpse->cur_dir);
|
||||||
Free(tempse->cur_dir);
|
Free(tmpse->cur_dir);
|
||||||
task->draw_it=tempse->draw_it;
|
task->draw_it=tmpse->draw_it;
|
||||||
task->task_end_cb=tempse->task_end_cb;
|
task->task_end_cb=tmpse->task_end_cb;
|
||||||
|
|
||||||
if (task->animate_task)
|
if (task->animate_task)
|
||||||
Kill(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);
|
Suspend(task->animate_task,FALSE);
|
||||||
|
|
||||||
if (!(flags&TSF_SAME_SONG)) {
|
if (!(flags&TSF_SAME_SONG)) {
|
||||||
if (task->song_task)
|
if (task->song_task)
|
||||||
Kill(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);
|
Suspend(task->song_task,FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsPop2(task,tempse); //Do it to get ress fast
|
SettingsPop2(task,tmpse); //Do it to get ress fast
|
||||||
WinMgrSync(,TRUE);
|
Refresh(,TRUE);
|
||||||
SettingsPop2(task,tempse); //Redo in case was lost by old update
|
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);
|
PutKey(a1,a2);
|
||||||
else
|
else
|
||||||
PostMsg(task,MSG_KEY_DOWN,a1,a2);
|
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.
|
Sleep(1); //Open loop because might be no response. TODO: Drops msgs.
|
||||||
}
|
}
|
||||||
if (*keydev.desc && StrNCmp(keydev.desc,"Char /",7))
|
if (*keydev.desc && StrNCmp(keydev.desc,"Char /",7))
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ U0 WinFinalUpdate(CDC *dc)
|
|||||||
DrawInputPtr(dc);
|
DrawInputPtr(dc);
|
||||||
}
|
}
|
||||||
|
|
||||||
gr.fp_final_screen_update=&WinFinalUpdate;
|
gr.fp_final_scrn_update=&WinFinalUpdate;
|
||||||
|
|
||||||
U0 WinIPUpdate()
|
U0 WinIPUpdate()
|
||||||
{
|
{
|
||||||
@@ -215,15 +215,15 @@ U0 WinIPUpdate()
|
|||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
ip.speed*=0.95;
|
ip.speed*=0.95;
|
||||||
if (gr.screen_zoom!=1) {
|
if (gr.scrn_zoom!=1) {
|
||||||
if (gr.continuous_scroll)
|
if (gr.continuous_scroll)
|
||||||
GrScaleZoom(1.0);
|
GrScaleZoom(1.0);
|
||||||
else {
|
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))
|
if (!(8<=dd<GR_WIDTH-8))
|
||||||
GrScaleZoom(1.0);
|
GrScaleZoom(1.0);
|
||||||
else {
|
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))
|
if (!(8<=dd<GR_HEIGHT-8))
|
||||||
GrScaleZoom(1.0);
|
GrScaleZoom(1.0);
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#help_index "Windows;Task/Delay"
|
#help_index "Windows;Task/Delay"
|
||||||
|
|
||||||
public U0 WinMgrSync(I64 cnt=1,Bool force=FALSE)
|
public U0 Refresh(I64 cnt=1,Bool force=FALSE)
|
||||||
{//Wait for win manager to start and finish updating screen.
|
{//Wait for 30fps WinMgr to start & finish scrn refresh.
|
||||||
//0,FALSE Cnt Sync to WinMgr. (not used)
|
//0,FALSE Cnt Sync to WinMgr. (not used)
|
||||||
//0,TRUE Pump Msgs.
|
//0,TRUE Pump Msgs.
|
||||||
//1 Cnt Wait and 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)) {
|
if (!LBtr(&sys_semas[SYS_SEMA_JUST_PUMP_MSGS],0)) {
|
||||||
timeout_val=cnts.jiffies+JIFFY_FREQ/WINMGR_FPS;
|
timeout_val=cnts.jiffies+JIFFY_FREQ/WINMGR_FPS;
|
||||||
LBts(&sys_semas[SYS_SEMA_REFRESH_IN_PROGRESS],0);
|
LBts(&sys_semas[SYS_SEMA_REFRESH_IN_PROGRESS],0);
|
||||||
GrUpdateScreen;
|
GrUpdateScrn;
|
||||||
LBtr(&sys_semas[SYS_SEMA_REFRESH_IN_PROGRESS],0);
|
LBtr(&sys_semas[SYS_SEMA_REFRESH_IN_PROGRESS],0);
|
||||||
|
|
||||||
if (sys_focus_task && !Bt(&sys_focus_task->task_flags,TASKf_HAS_SONG)) {
|
if (sys_focus_task && !Bt(&sys_focus_task->task_flags,TASKf_HAS_SONG)) {
|
||||||
@@ -331,7 +331,7 @@ Bool WinKeyNavMenu()
|
|||||||
I64 i,old_key_cnt;
|
I64 i,old_key_cnt;
|
||||||
CD3I64 old_pos,new_pos;
|
CD3I64 old_pos,new_pos;
|
||||||
CMenu *m;
|
CMenu *m;
|
||||||
CMenuEntry *tempme;
|
CMenuEntry *tmpme;
|
||||||
CTask *focus=MenuTask;
|
CTask *focus=MenuTask;
|
||||||
if (Bt(kbd.down_bitmap,SC_GUI) && focus && (m=focus->cur_menu)) {
|
if (Bt(kbd.down_bitmap,SC_GUI) && focus && (m=focus->cur_menu)) {
|
||||||
winmgr.show_menu=TRUE;
|
winmgr.show_menu=TRUE;
|
||||||
@@ -345,14 +345,14 @@ Bool WinKeyNavMenu()
|
|||||||
WinMgrSleep(TRUE);
|
WinMgrSleep(TRUE);
|
||||||
if (new_pos.x) {
|
if (new_pos.x) {
|
||||||
i=0;
|
i=0;
|
||||||
tempme=m->sub;
|
tmpme=m->sub;
|
||||||
while (tempme) {
|
while (tmpme) {
|
||||||
if (i+MenuEntryWidth(tempme)*FONT_WIDTH==new_pos.x) {
|
if (i+MenuEntryWidth(tmpme)*FONT_WIDTH==new_pos.x) {
|
||||||
new_pos.x=i;
|
new_pos.x=i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
i+=MenuEntryWidth(tempme)*FONT_WIDTH;
|
i+=MenuEntryWidth(tmpme)*FONT_WIDTH;
|
||||||
tempme=tempme->next;
|
tmpme=tmpme->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
new_pos.y=0;
|
new_pos.y=0;
|
||||||
@@ -360,15 +360,15 @@ Bool WinKeyNavMenu()
|
|||||||
while (Bt(kbd.down_bitmap,SC_CURSOR_RIGHT) && kbd.cnt==old_key_cnt)
|
while (Bt(kbd.down_bitmap,SC_CURSOR_RIGHT) && kbd.cnt==old_key_cnt)
|
||||||
WinMgrSleep(TRUE);
|
WinMgrSleep(TRUE);
|
||||||
i=0;
|
i=0;
|
||||||
tempme=m->sub;
|
tmpme=m->sub;
|
||||||
while (tempme) {
|
while (tmpme) {
|
||||||
if (i==new_pos.x) {
|
if (i==new_pos.x) {
|
||||||
if (tempme->next)
|
if (tmpme->next)
|
||||||
new_pos.x=i+MenuEntryWidth(tempme)*FONT_WIDTH;
|
new_pos.x=i+MenuEntryWidth(tmpme)*FONT_WIDTH;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
i+=MenuEntryWidth(tempme)*FONT_WIDTH;
|
i+=MenuEntryWidth(tmpme)*FONT_WIDTH;
|
||||||
tempme=tempme->next;
|
tmpme=tmpme->next;
|
||||||
}
|
}
|
||||||
new_pos.y=0;
|
new_pos.y=0;
|
||||||
} else if (Bt(kbd.down_bitmap,SC_CURSOR_UP)) {
|
} else if (Bt(kbd.down_bitmap,SC_CURSOR_UP)) {
|
||||||
@@ -132,7 +132,7 @@ Bool TakeTurn()
|
|||||||
}
|
}
|
||||||
res=TRUE;
|
res=TRUE;
|
||||||
}
|
}
|
||||||
WinMgrSync;
|
Refresh;
|
||||||
Fs->song_task=NULL;
|
Fs->song_task=NULL;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -151,7 +151,7 @@ U0 TMsg(CDC *dc,U8 *msg)
|
|||||||
dc->color=YELLOW;
|
dc->color=YELLOW;
|
||||||
GrPrint(dc,(GR_WIDTH-StrLen(msg)*FONT_WIDTH)/2,
|
GrPrint(dc,(GR_WIDTH-StrLen(msg)*FONT_WIDTH)/2,
|
||||||
GR_HEIGHT-5*FONT_HEIGHT/2,"%s",msg);
|
GR_HEIGHT-5*FONT_HEIGHT/2,"%s",msg);
|
||||||
WinMgrSync;
|
Refresh;
|
||||||
if (ScanChar)
|
if (ScanChar)
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@@ -2,25 +2,25 @@ U0 ViewComics()
|
|||||||
{
|
{
|
||||||
I64 i=0;
|
I64 i=0;
|
||||||
U8 *st;
|
U8 *st;
|
||||||
CDirEntry *tempde=FilesFind("Comics/*.DD*"),*tempde1=tempde;
|
CDirEntry *tmpde=FilesFind("Comics/*.DD*"),*tmpde1=tmpde;
|
||||||
CDoc *doc=DocNew;
|
CDoc *doc=DocNew;
|
||||||
DocPrint(doc,"$$LTBLUE$$");
|
DocPrint(doc,"$$LTBLUE$$");
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
st=StrNew(tempde->name);
|
st=StrNew(tmpde->name);
|
||||||
FileExtRem(st);
|
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);
|
Free(st);
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
if ((i++&3)==3)
|
if ((i++&3)==3)
|
||||||
DocPrint(doc,"\n");
|
DocPrint(doc,"\n");
|
||||||
}
|
}
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
if ((tempde=PopUpMenu(doc))>0)
|
if ((tmpde=PopUpMenu(doc))>0)
|
||||||
Ed(tempde->full_name);
|
Ed(tmpde->full_name);
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
DocDel(doc);
|
DocDel(doc);
|
||||||
DirTreeDel(tempde1);
|
DirTreeDel(tmpde1);
|
||||||
}
|
}
|
||||||
|
|
||||||
+23
-23
@@ -7,47 +7,47 @@ U0 MPDrawHoreb(CDC *dc2)
|
|||||||
CDC *dc=DCAlias(dc2,task);
|
CDC *dc=DCAlias(dc2,task);
|
||||||
I64 i,j,dx,dy,dz,w=task->pix_width,h=task->pix_height,r[16],cx=w>>1;
|
I64 i,j,dx,dy,dz,w=task->pix_width,h=task->pix_height,r[16],cx=w>>1;
|
||||||
F64 s,m,a,x1,y1,x2,y2;
|
F64 s,m,a,x1,y1,x2,y2;
|
||||||
Obj *tempo;
|
Obj *tmpo;
|
||||||
|
|
||||||
Mat4x4IdentEqu(r);
|
Mat4x4IdentEqu(r);
|
||||||
Mat4x4RotY(r,-é);
|
Mat4x4RotY(r,-é);
|
||||||
Mat4x4RotX(r,77*ã/180);
|
Mat4x4RotX(r,77*ã/180);
|
||||||
for (i=Gs->num;i<O_NUM_OBJS+O_NUM_PEBBLES;i+=mp_cnt) {
|
for (i=Gs->num;i<O_NUM_OBJS+O_NUM_PEBBLES;i+=mp_cnt) {
|
||||||
tempo=&objs[i];
|
tmpo=&objs[i];
|
||||||
tempo->x1=tempo->x+vx; tempo->y1=tempo->y; tempo->z1=tempo->z+vz;
|
tmpo->x1=tmpo->x+vx; tmpo->y1=tmpo->y; tmpo->z1=tmpo->z+vz;
|
||||||
Mat4x4MulXYZ(r,&tempo->x1,&tempo->y1,&tempo->z1);
|
Mat4x4MulXYZ(r,&tmpo->x1,&tmpo->y1,&tmpo->z1);
|
||||||
if (tempo->type==OT_SHEEP ||
|
if (tmpo->type==OT_SHEEP ||
|
||||||
tempo->type==OT_GOAT1 || tempo->type==OT_GOAT2) {
|
tmpo->type==OT_GOAT1 || tmpo->type==OT_GOAT2) {
|
||||||
dx=100*tempo->dx; dy=100*tempo->dy; dz=100*tempo->dz;
|
dx=100*tmpo->dx; dy=100*tmpo->dy; dz=100*tmpo->dz;
|
||||||
Mat4x4MulXYZ(r,&dx,&dy,&dz);
|
Mat4x4MulXYZ(r,&dx,&dy,&dz);
|
||||||
if (dx<0)
|
if (dx<0)
|
||||||
tempo->sym=TRUE;
|
tmpo->sym=TRUE;
|
||||||
else
|
else
|
||||||
tempo->sym=FALSE;
|
tmpo->sym=FALSE;
|
||||||
}
|
}
|
||||||
if (tempo->z1>=0) {
|
if (tmpo->z1>=0) {
|
||||||
s=100.0/(AbsI64(tempo->z1)+50);
|
s=100.0/(AbsI64(tmpo->z1)+50);
|
||||||
if (tempo->type) {
|
if (tmpo->type) {
|
||||||
Mat4x4IdentEqu(dc->r);
|
Mat4x4IdentEqu(dc->r);
|
||||||
Mat4x4Scale(dc->r,s*2);
|
Mat4x4Scale(dc->r,s*2);
|
||||||
DCMat4x4Set(dc,dc->r);
|
DCMat4x4Set(dc,dc->r);
|
||||||
dc->flags|=DCF_TRANSFORMATION;
|
dc->flags|=DCF_TRANSFORMATION;
|
||||||
if (tempo->sym) {
|
if (tmpo->sym) {
|
||||||
dc->flags|=DCF_SYMMETRY|DCF_JUST_MIRROR;
|
dc->flags|=DCF_SYMMETRY|DCF_JUST_MIRROR;
|
||||||
DCSymmetrySet(dc,s*tempo->x1+cx,s*tempo->y1+h,
|
DCSymmetrySet(dc,s*tmpo->x1+cx,s*tmpo->y1+h,
|
||||||
s*tempo->x1+cx,s*tempo->y1+h+10);
|
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 {
|
} else {
|
||||||
dc->flags&=~DCF_TRANSFORMATION;
|
dc->flags&=~DCF_TRANSFORMATION;
|
||||||
dc->color=pebble_colors[tempo->num&3];
|
dc->color=pebble_colors[tmpo->num&3];
|
||||||
GrPlot3(dc,s*tempo->x1+cx,s*tempo->y1+h,tempo->z1);
|
GrPlot3(dc,s*tmpo->x1+cx,s*tmpo->y1+h,tmpo->z1);
|
||||||
}
|
}
|
||||||
dc->flags&=~(DCF_SYMMETRY|DCF_JUST_MIRROR);
|
dc->flags&=~(DCF_SYMMETRY|DCF_JUST_MIRROR);
|
||||||
if (tempo==&objs[O_BURNING_BUSH]) {//draw burning bush
|
if (tmpo==&objs[O_BURNING_BUSH]) {//draw burning bush
|
||||||
dc->x=s*tempo->x1+cx;
|
dc->x=s*tmpo->x1+cx;
|
||||||
dc->y=s*tempo->y1+h;
|
dc->y=s*tmpo->y1+h;
|
||||||
dc->z=tempo->z1;
|
dc->z=tmpo->z1;
|
||||||
dc->pen_width=1;
|
dc->pen_width=1;
|
||||||
dc->color=winmgr.updates&15;
|
dc->color=winmgr.updates&15;
|
||||||
for (j=0;j<45;j++) {
|
for (j=0;j<45;j++) {
|
||||||
@@ -57,7 +57,7 @@ U0 MPDrawHoreb(CDC *dc2)
|
|||||||
P2R(&x2,&y2,m,a);
|
P2R(&x2,&y2,m,a);
|
||||||
GrLine3(dc,20*x1,20*y1-25,0,20*x2,20*y2-25,0);
|
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;
|
horeb_done=TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+23
-23
@@ -12,7 +12,7 @@ U0 DrawHoreb(CTask *task,CDC *dc)
|
|||||||
h=task->pix_height,r[16],
|
h=task->pix_height,r[16],
|
||||||
cx=w>>1,cy=h>>1;
|
cx=w>>1,cy=h>>1;
|
||||||
F64 s,m,a,x1,y1,x2,y2;
|
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);
|
Mat4x4IdentEqu(r);
|
||||||
Mat4x4RotY(r,-é);
|
Mat4x4RotY(r,-é);
|
||||||
@@ -30,46 +30,46 @@ U0 DrawHoreb(CTask *task,CDC *dc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i=0;i<O_NUM_OBJS+O_NUM_PEBBLES;i++) {
|
for (i=0;i<O_NUM_OBJS+O_NUM_PEBBLES;i++) {
|
||||||
tempo=&objs[i];
|
tmpo=&objs[i];
|
||||||
o_sort[i]=tempo;
|
o_sort[i]=tmpo;
|
||||||
tempo->x1=tempo->x+vx; tempo->y1=tempo->y; tempo->z1=tempo->z+vz;
|
tmpo->x1=tmpo->x+vx; tmpo->y1=tmpo->y; tmpo->z1=tmpo->z+vz;
|
||||||
Mat4x4MulXYZ(r,&tempo->x1,&tempo->y1,&tempo->z1);
|
Mat4x4MulXYZ(r,&tmpo->x1,&tmpo->y1,&tmpo->z1);
|
||||||
if (tempo->type==OT_SHEEP ||
|
if (tmpo->type==OT_SHEEP ||
|
||||||
tempo->type==OT_GOAT1 || tempo->type==OT_GOAT2) {
|
tmpo->type==OT_GOAT1 || tmpo->type==OT_GOAT2) {
|
||||||
dx=100*tempo->dx; dy=100*tempo->dy; dz=100*tempo->dz;
|
dx=100*tmpo->dx; dy=100*tmpo->dy; dz=100*tmpo->dz;
|
||||||
Mat4x4MulXYZ(r,&dx,&dy,&dz);
|
Mat4x4MulXYZ(r,&dx,&dy,&dz);
|
||||||
if (dx<0)
|
if (dx<0)
|
||||||
tempo->sym=TRUE;
|
tmpo->sym=TRUE;
|
||||||
else
|
else
|
||||||
tempo->sym=FALSE;
|
tmpo->sym=FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QSortI64(o_sort,O_NUM_OBJS+O_NUM_PEBBLES,&ObjCompare);
|
QSortI64(o_sort,O_NUM_OBJS+O_NUM_PEBBLES,&ObjCompare);
|
||||||
|
|
||||||
for (i=0;i<O_NUM_OBJS+O_NUM_PEBBLES;i++) {
|
for (i=0;i<O_NUM_OBJS+O_NUM_PEBBLES;i++) {
|
||||||
tempo=o_sort[i];
|
tmpo=o_sort[i];
|
||||||
if (tempo->z1<0) break;
|
if (tmpo->z1<0) break;
|
||||||
s=100.0/(AbsI64(tempo->z1)+50);
|
s=100.0/(AbsI64(tmpo->z1)+50);
|
||||||
if (tempo->type) {
|
if (tmpo->type) {
|
||||||
Mat4x4IdentEqu(dc->r);
|
Mat4x4IdentEqu(dc->r);
|
||||||
Mat4x4Scale(dc->r,s*2);
|
Mat4x4Scale(dc->r,s*2);
|
||||||
DCMat4x4Set(dc,dc->r);
|
DCMat4x4Set(dc,dc->r);
|
||||||
dc->flags|=DCF_TRANSFORMATION;
|
dc->flags|=DCF_TRANSFORMATION;
|
||||||
if (tempo->sym) {
|
if (tmpo->sym) {
|
||||||
dc->flags|=DCF_SYMMETRY|DCF_JUST_MIRROR;
|
dc->flags|=DCF_SYMMETRY|DCF_JUST_MIRROR;
|
||||||
DCSymmetrySet(dc,s*tempo->x1+cx,s*tempo->y1+h,
|
DCSymmetrySet(dc,s*tmpo->x1+cx,s*tmpo->y1+h,
|
||||||
s*tempo->x1+cx,s*tempo->y1+h+10);
|
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 {
|
} else {
|
||||||
dc->flags&=~DCF_TRANSFORMATION;
|
dc->flags&=~DCF_TRANSFORMATION;
|
||||||
dc->color=pebble_colors[tempo->num&3];
|
dc->color=pebble_colors[tmpo->num&3];
|
||||||
GrPlot3(dc,s*tempo->x1+cx,s*tempo->y1+h,tempo->z1);
|
GrPlot3(dc,s*tmpo->x1+cx,s*tmpo->y1+h,tmpo->z1);
|
||||||
}
|
}
|
||||||
dc->flags&=~(DCF_SYMMETRY|DCF_JUST_MIRROR);
|
dc->flags&=~(DCF_SYMMETRY|DCF_JUST_MIRROR);
|
||||||
if (o_sort[i]==&objs[O_BURNING_BUSH]) {//draw burning bush
|
if (o_sort[i]==&objs[O_BURNING_BUSH]) {//draw burning bush
|
||||||
dc->x=s*tempo->x1+cx;
|
dc->x=s*tmpo->x1+cx;
|
||||||
dc->y=s*tempo->y1+h;
|
dc->y=s*tmpo->y1+h;
|
||||||
dc->z=0;
|
dc->z=0;
|
||||||
|
|
||||||
dc->pen_width=1;
|
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);
|
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;
|
horeb_done=TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+19
-19
@@ -2,18 +2,18 @@ U0 AnimateTask(I64)
|
|||||||
{
|
{
|
||||||
I64 i;
|
I64 i;
|
||||||
F64 t;
|
F64 t;
|
||||||
Obj *tempo;
|
Obj *tmpo;
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
t=tS;
|
t=tS;
|
||||||
for (i=0;i<O_NUM_OBJS+O_NUM_PEBBLES;i++) {
|
for (i=0;i<O_NUM_OBJS+O_NUM_PEBBLES;i++) {
|
||||||
tempo=&objs[i];
|
tmpo=&objs[i];
|
||||||
if (tempo->type==OT_SHEEP ||
|
if (tmpo->type==OT_SHEEP ||
|
||||||
tempo->type==OT_GOAT1 || tempo->type==OT_GOAT2) {
|
tmpo->type==OT_GOAT1 || tmpo->type==OT_GOAT2) {
|
||||||
tempo->x+=tempo->dx;
|
tmpo->x+=tmpo->dx;
|
||||||
tempo->y+=tempo->dy;
|
tmpo->y+=tmpo->dy;
|
||||||
tempo->z+=tempo->dz;
|
tmpo->z+=tmpo->dz;
|
||||||
tempo->dx=5*Cos(0.5*t+tempo->é);
|
tmpo->dx=5*Cos(0.5*t+tmpo->é);
|
||||||
tempo->dz=5*Sin(0.5*t+tempo->é);
|
tmpo->dz=5*Sin(0.5*t+tmpo->é);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Sleep(20);
|
Sleep(20);
|
||||||
@@ -22,7 +22,7 @@ U0 AnimateTask(I64)
|
|||||||
|
|
||||||
U0 Init()
|
U0 Init()
|
||||||
{
|
{
|
||||||
Obj *tempo;
|
Obj *tmpo;
|
||||||
I64 i,j,k,total=0;
|
I64 i,j,k,total=0;
|
||||||
|
|
||||||
for (i=0;i<OT_NUM_TYPES;i++)
|
for (i=0;i<OT_NUM_TYPES;i++)
|
||||||
@@ -30,13 +30,13 @@ U0 Init()
|
|||||||
|
|
||||||
MemSet(objs,0,sizeof(objs));
|
MemSet(objs,0,sizeof(objs));
|
||||||
for (i=0;i<O_NUM_OBJS+O_NUM_PEBBLES;i++) {
|
for (i=0;i<O_NUM_OBJS+O_NUM_PEBBLES;i++) {
|
||||||
tempo=&objs[i];
|
tmpo=&objs[i];
|
||||||
tempo->num=i;
|
tmpo->num=i;
|
||||||
tempo->x=RandU32&0x1FFF-0x1000;
|
tmpo->x=RandU32&0x1FFF-0x1000;
|
||||||
tempo->y=0;
|
tmpo->y=0;
|
||||||
tempo->z=RandU32&0x1FFF-0x1000;
|
tmpo->z=RandU32&0x1FFF-0x1000;
|
||||||
tempo->é=2*ã*Rand;
|
tmpo->é=2*ã*Rand;
|
||||||
tempo->sym=RandU16&1;
|
tmpo->sym=RandU16&1;
|
||||||
|
|
||||||
if (i<O_NUM_OBJS) {
|
if (i<O_NUM_OBJS) {
|
||||||
k=0;
|
k=0;
|
||||||
@@ -48,9 +48,9 @@ U0 Init()
|
|||||||
else
|
else
|
||||||
k++;
|
k++;
|
||||||
}
|
}
|
||||||
tempo->type=k;
|
tmpo->type=k;
|
||||||
} else
|
} else
|
||||||
tempo->type=OT_PEBBLE;
|
tmpo->type=OT_PEBBLE;
|
||||||
}
|
}
|
||||||
objs[O_BURNING_BUSH].type=OT_BUSH1;
|
objs[O_BURNING_BUSH].type=OT_BUSH1;
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
+22
-22
@@ -1,24 +1,24 @@
|
|||||||
U0 BgtAcctsUpdate()
|
U0 BgtAcctsUpdate()
|
||||||
{
|
{
|
||||||
CBgtEntry *tempb;
|
CBgtEntry *tmpb;
|
||||||
CBgtTemplate *tempt;
|
CBgtTemplate *tmpt;
|
||||||
tempb=b_head.next;
|
tmpb=b_head.next;
|
||||||
while (tempb!=&b_head) {
|
while (tmpb!=&b_head) {
|
||||||
if (tempb->type!=BE_TEMPLATE_COPY) {
|
if (tmpb->type!=BE_TEMPLATE_COPY) {
|
||||||
tempb->credit_idx=StrFileAdd(tempb->credit,
|
tmpb->credit_idx=StrFileAdd(tmpb->credit,
|
||||||
&accts_table_strs,accts_table);
|
&accts_table_strs,accts_table);
|
||||||
tempb->debit_idx =StrFileAdd(tempb->debit,
|
tmpb->debit_idx =StrFileAdd(tmpb->debit,
|
||||||
&accts_table_strs,accts_table);
|
&accts_table_strs,accts_table);
|
||||||
}
|
}
|
||||||
tempb=tempb->next;
|
tmpb=tmpb->next;
|
||||||
}
|
}
|
||||||
tempt=t_head.next;
|
tmpt=t_head.next;
|
||||||
while (tempt!=&t_head) {
|
while (tmpt!=&t_head) {
|
||||||
tempt->b.credit_idx=StrFileAdd(tempt->b.credit,
|
tmpt->b.credit_idx=StrFileAdd(tmpt->b.credit,
|
||||||
&accts_table_strs,accts_table);
|
&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);
|
&accts_table_strs,accts_table);
|
||||||
tempt=tempt->next;
|
tmpt=tmpt->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,9 +44,9 @@ U0 BgtAcctsRead()
|
|||||||
|
|
||||||
I64 BgtAcctColor(U8 *st)
|
I64 BgtAcctColor(U8 *st)
|
||||||
{
|
{
|
||||||
CHashGeneric *temph;
|
CHashGeneric *tmph;
|
||||||
if (temph=HashFind(st,accts_table,SFT_GENERIC))
|
if (tmph=HashFind(st,accts_table,SFT_GENERIC))
|
||||||
return temph->user_data1;
|
return tmph->user_data1;
|
||||||
else
|
else
|
||||||
return BLACK;
|
return BLACK;
|
||||||
}
|
}
|
||||||
@@ -57,19 +57,19 @@ U8 *BgtPopUpAcct(U8 *header=NULL,U8 *dft=NULL)
|
|||||||
U8 *res;
|
U8 *res;
|
||||||
CDoc *doc=DocNew;
|
CDoc *doc=DocNew;
|
||||||
CDocEntry *doc_e,*doc_dft=NULL;
|
CDocEntry *doc_e,*doc_dft=NULL;
|
||||||
CHashGeneric *temph;
|
CHashGeneric *tmph;
|
||||||
|
|
||||||
if (header)
|
if (header)
|
||||||
DocPrint(doc,"%s",header);
|
DocPrint(doc,"%s",header);
|
||||||
|
|
||||||
for (i=0;i<=accts_table->mask;i++) {
|
for (i=0;i<=accts_table->mask;i++) {
|
||||||
temph=accts_table->body[i];
|
tmph=accts_table->body[i];
|
||||||
while (temph) {
|
while (tmph) {
|
||||||
doc_e=DocPrint(doc,"$$FG,%d$$$$MU-UL,\"%s\",LE=0x%X$$\n",
|
doc_e=DocPrint(doc,"$$FG,%d$$$$MU-UL,\"%s\",LE=0x%X$$\n",
|
||||||
temph->user_data1,temph->str,temph->str);
|
tmph->user_data1,tmph->str,tmph->str);
|
||||||
if (dft && !StrCmp(dft,temph->str))
|
if (dft && !StrCmp(dft,tmph->str))
|
||||||
doc_dft=doc_e;
|
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) {
|
if (tmpb->type!=BE_TEMPLATE_COPY) {
|
||||||
Free(tempb->credit);
|
Free(tmpb->credit);
|
||||||
Free(tempb->debit);
|
Free(tmpb->debit);
|
||||||
Free(tempb->desc);
|
Free(tmpb->desc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 BgtEntryDel(CBgtEntry *tempb)
|
U0 BgtEntryDel(CBgtEntry *tmpb)
|
||||||
{
|
{
|
||||||
BgtEntryDel2(tempb);
|
BgtEntryDel2(tmpb);
|
||||||
Free(tempb);
|
Free(tmpb);
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 BgtIns(CBgtEntry *tempb)
|
U0 BgtIns(CBgtEntry *tmpb)
|
||||||
{
|
{
|
||||||
CBgtEntry *tempb1=b_head.next;
|
CBgtEntry *tmpb1=b_head.next;
|
||||||
while (tempb1!=&b_head && tempb1->date<tempb->date)
|
while (tmpb1!=&b_head && tmpb1->date<tmpb->date)
|
||||||
tempb1=tempb1->next;
|
tmpb1=tmpb1->next;
|
||||||
QueIns(tempb,tempb1->last);
|
QueIns(tmpb,tmpb1->last);
|
||||||
}
|
}
|
||||||
|
|
||||||
class CBgtEntryForm
|
class CBgtEntryForm
|
||||||
@@ -33,7 +33,7 @@ class CBgtEntryForm
|
|||||||
CBgtEntry *BgtEntryPmt(CBgtEntry *dft=NULL)
|
CBgtEntry *BgtEntryPmt(CBgtEntry *dft=NULL)
|
||||||
{
|
{
|
||||||
CBgtEntryForm b;
|
CBgtEntryForm b;
|
||||||
CBgtEntry *tempb;
|
CBgtEntry *tmpb;
|
||||||
U8 *st;
|
U8 *st;
|
||||||
MemSet(&b,0,sizeof(CBgtEntryForm));
|
MemSet(&b,0,sizeof(CBgtEntryForm));
|
||||||
StrCpy(&b.date,"*");
|
StrCpy(&b.date,"*");
|
||||||
@@ -55,16 +55,16 @@ CBgtEntry *BgtEntryPmt(CBgtEntry *dft=NULL)
|
|||||||
if (st!=DOCM_CANCEL)
|
if (st!=DOCM_CANCEL)
|
||||||
StrCpy(b.debit,st);
|
StrCpy(b.debit,st);
|
||||||
} else {
|
} else {
|
||||||
tempb=CAlloc(sizeof(CBgtEntry));
|
tmpb=CAlloc(sizeof(CBgtEntry));
|
||||||
tempb->date =Str2Date(b.date);
|
tmpb->date =Str2Date(b.date);
|
||||||
tempb->amount=b.amount;
|
tmpb->amount=b.amount;
|
||||||
tempb->credit=StrNew(b.credit);
|
tmpb->credit=StrNew(b.credit);
|
||||||
tempb->debit =StrNew(b.debit);
|
tmpb->debit =StrNew(b.debit);
|
||||||
tempb->desc =StrNew(b.desc);
|
tmpb->desc =StrNew(b.desc);
|
||||||
tempb->type =BE_NORMAL;
|
tmpb->type =BE_NORMAL;
|
||||||
StrFileAdd(tempb->credit,&accts_table_strs,accts_table);
|
StrFileAdd(tmpb->credit,&accts_table_strs,accts_table);
|
||||||
StrFileAdd(tempb->debit,&accts_table_strs,accts_table);
|
StrFileAdd(tmpb->debit,&accts_table_strs,accts_table);
|
||||||
return tempb;
|
return tmpb;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
+59
-59
@@ -1,7 +1,7 @@
|
|||||||
U0 BgtDataRead()
|
U0 BgtDataRead()
|
||||||
{
|
{
|
||||||
CBgtEntry *tempb;
|
CBgtEntry *tmpb;
|
||||||
CBgtTemplate *tempt;
|
CBgtTemplate *tmpt;
|
||||||
I64 i,cnt,size;
|
I64 i,cnt,size;
|
||||||
U8 *b,*ptr;
|
U8 *b,*ptr;
|
||||||
I64 max_num;
|
I64 max_num;
|
||||||
@@ -17,26 +17,26 @@ U0 BgtDataRead()
|
|||||||
if (ptr=b=FileRead(BGT_DATA_FILE,&size)) {
|
if (ptr=b=FileRead(BGT_DATA_FILE,&size)) {
|
||||||
cnt=*ptr(I64 *)++;
|
cnt=*ptr(I64 *)++;
|
||||||
for (i=0;i<cnt;i++) {
|
for (i=0;i<cnt;i++) {
|
||||||
tempb=CAlloc(sizeof(CBgtEntry));
|
tmpb=CAlloc(sizeof(CBgtEntry));
|
||||||
MemCpy(&tempb->start,ptr,BE_SIZE);
|
MemCpy(&tmpb->start,ptr,BE_SIZE);
|
||||||
tempb->credit=StrNew(s[tempb->credit_idx]);
|
tmpb->credit=StrNew(s[tmpb->credit_idx]);
|
||||||
tempb->debit =StrNew(s[tempb->debit_idx]);
|
tmpb->debit =StrNew(s[tmpb->debit_idx]);
|
||||||
tempb->desc =StrNew(s[tempb->desc_idx]);
|
tmpb->desc =StrNew(s[tmpb->desc_idx]);
|
||||||
QueIns(tempb,b_head.last);
|
QueIns(tmpb,b_head.last);
|
||||||
ptr+=BE_SIZE;
|
ptr+=BE_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
cnt=*ptr(I64 *)++;
|
cnt=*ptr(I64 *)++;
|
||||||
for (i=0;i<cnt;i++) {
|
for (i=0;i<cnt;i++) {
|
||||||
tempt=CAlloc(sizeof(CBgtTemplate));
|
tmpt=CAlloc(sizeof(CBgtTemplate));
|
||||||
MemCpy(&tempt->start,ptr,BT_SIZE);
|
MemCpy(&tmpt->start,ptr,BT_SIZE);
|
||||||
ptr+=BT_SIZE;
|
ptr+=BT_SIZE;
|
||||||
MemCpy(&tempt->b.start,ptr,BE_SIZE);
|
MemCpy(&tmpt->b.start,ptr,BE_SIZE);
|
||||||
ptr+=BE_SIZE;
|
ptr+=BE_SIZE;
|
||||||
tempt->b.credit=StrNew(s[tempt->b.credit_idx]);
|
tmpt->b.credit=StrNew(s[tmpt->b.credit_idx]);
|
||||||
tempt->b.debit =StrNew(s[tempt->b.debit_idx]);
|
tmpt->b.debit =StrNew(s[tmpt->b.debit_idx]);
|
||||||
tempt->b.desc =StrNew(s[tempt->b.desc_idx]);
|
tmpt->b.desc =StrNew(s[tmpt->b.desc_idx]);
|
||||||
QueIns(tempt,t_head.last);
|
QueIns(tmpt,t_head.last);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,39 +50,39 @@ U0 BgtDataWrite()
|
|||||||
{
|
{
|
||||||
I64 i,num=0,size,cnt1,cnt2;
|
I64 i,num=0,size,cnt1,cnt2;
|
||||||
CHashTable *table=HashTableNew(1024);
|
CHashTable *table=HashTableNew(1024);
|
||||||
CBgtEntry *tempb;
|
CBgtEntry *tmpb;
|
||||||
CBgtTemplate *tempt;
|
CBgtTemplate *tmpt;
|
||||||
CHashGeneric *temph;
|
CHashGeneric *tmph;
|
||||||
U8 *buf,*ptr;
|
U8 *buf,*ptr;
|
||||||
|
|
||||||
for (i=0;i<=accts_table->mask;i++) {
|
for (i=0;i<=accts_table->mask;i++) {
|
||||||
temph=accts_table->body[i];
|
tmph=accts_table->body[i];
|
||||||
while (temph) {
|
while (tmph) {
|
||||||
StrFileAdd(temph->str,&num,table); //Cosmetics -- make accts appear first.
|
StrFileAdd(tmph->str,&num,table); //Cosmetics -- make accts appear first.
|
||||||
temph=temph->next;
|
tmph=tmph->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tempb=b_head.next;
|
tmpb=b_head.next;
|
||||||
cnt1=0;
|
cnt1=0;
|
||||||
while (tempb!=&b_head) {
|
while (tmpb!=&b_head) {
|
||||||
if (tempb->type!=BE_TEMPLATE_COPY) {
|
if (tmpb->type!=BE_TEMPLATE_COPY) {
|
||||||
tempb->credit_idx =StrFileAdd(tempb->credit,&num,table);
|
tmpb->credit_idx =StrFileAdd(tmpb->credit,&num,table);
|
||||||
tempb->debit_idx =StrFileAdd(tempb->debit,&num,table);
|
tmpb->debit_idx =StrFileAdd(tmpb->debit,&num,table);
|
||||||
tempb->desc_idx =StrFileAdd(tempb->desc,&num,table);
|
tmpb->desc_idx =StrFileAdd(tmpb->desc,&num,table);
|
||||||
cnt1++;
|
cnt1++;
|
||||||
}
|
}
|
||||||
tempb=tempb->next;
|
tmpb=tmpb->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
tempt=t_head.next;
|
tmpt=t_head.next;
|
||||||
cnt2=0;
|
cnt2=0;
|
||||||
while (tempt!=&t_head) {
|
while (tmpt!=&t_head) {
|
||||||
tempt->b.credit_idx =StrFileAdd(tempt->b.credit,&num,table);
|
tmpt->b.credit_idx =StrFileAdd(tmpt->b.credit,&num,table);
|
||||||
tempt->b.debit_idx =StrFileAdd(tempt->b.debit,&num,table);
|
tmpt->b.debit_idx =StrFileAdd(tmpt->b.debit,&num,table);
|
||||||
tempt->b.desc_idx =StrFileAdd(tempt->b.desc,&num,table);
|
tmpt->b.desc_idx =StrFileAdd(tmpt->b.desc,&num,table);
|
||||||
cnt2++;
|
cnt2++;
|
||||||
tempt=tempt->next;
|
tmpt=tmpt->next;
|
||||||
}
|
}
|
||||||
StrFileWrite(BGT_STRINGS_FILE,table);
|
StrFileWrite(BGT_STRINGS_FILE,table);
|
||||||
StrFileDel(table);
|
StrFileDel(table);
|
||||||
@@ -92,24 +92,24 @@ U0 BgtDataWrite()
|
|||||||
|
|
||||||
MemCpy(ptr,&cnt1,sizeof(I64));
|
MemCpy(ptr,&cnt1,sizeof(I64));
|
||||||
ptr+=sizeof(I64);
|
ptr+=sizeof(I64);
|
||||||
tempb=b_head.next;
|
tmpb=b_head.next;
|
||||||
while (tempb!=&b_head) {
|
while (tmpb!=&b_head) {
|
||||||
if (tempb->type!=BE_TEMPLATE_COPY) {
|
if (tmpb->type!=BE_TEMPLATE_COPY) {
|
||||||
MemCpy(ptr,&tempb->start,BE_SIZE);
|
MemCpy(ptr,&tmpb->start,BE_SIZE);
|
||||||
ptr+=BE_SIZE;
|
ptr+=BE_SIZE;
|
||||||
}
|
}
|
||||||
tempb=tempb->next;
|
tmpb=tmpb->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
MemCpy(ptr,&cnt2,sizeof(I64));
|
MemCpy(ptr,&cnt2,sizeof(I64));
|
||||||
ptr+=sizeof(I64);
|
ptr+=sizeof(I64);
|
||||||
tempt=t_head.next;
|
tmpt=t_head.next;
|
||||||
while (tempt!=&t_head) {
|
while (tmpt!=&t_head) {
|
||||||
MemCpy(ptr,&tempt->start,BT_SIZE);
|
MemCpy(ptr,&tmpt->start,BT_SIZE);
|
||||||
ptr+=BT_SIZE;
|
ptr+=BT_SIZE;
|
||||||
MemCpy(ptr,&tempt->b.start,BE_SIZE);
|
MemCpy(ptr,&tmpt->b.start,BE_SIZE);
|
||||||
ptr+=BE_SIZE;
|
ptr+=BE_SIZE;
|
||||||
tempt=tempt->next;
|
tmpt=tmpt->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileWrite(BGT_DATA_FILE,buf,size);
|
FileWrite(BGT_DATA_FILE,buf,size);
|
||||||
@@ -118,21 +118,21 @@ U0 BgtDataWrite()
|
|||||||
|
|
||||||
U0 BgtDel()
|
U0 BgtDel()
|
||||||
{
|
{
|
||||||
CBgtEntry *tempb,*tempb1;
|
CBgtEntry *tmpb,*tmpb1;
|
||||||
CBgtTemplate *tempt,*tempt1;
|
CBgtTemplate *tmpt,*tmpt1;
|
||||||
tempb=b_head.next;
|
tmpb=b_head.next;
|
||||||
while (tempb!=&b_head) {
|
while (tmpb!=&b_head) {
|
||||||
tempb1=tempb->next;
|
tmpb1=tmpb->next;
|
||||||
BgtEntryDel2(tempb);
|
BgtEntryDel2(tmpb);
|
||||||
Free(tempb);
|
Free(tmpb);
|
||||||
tempb=tempb1;
|
tmpb=tmpb1;
|
||||||
}
|
}
|
||||||
tempt=t_head.next;
|
tmpt=t_head.next;
|
||||||
while (tempt!=&t_head) {
|
while (tmpt!=&t_head) {
|
||||||
tempt1=tempt->next;
|
tmpt1=tmpt->next;
|
||||||
BgtEntryDel2(&tempt->b);
|
BgtEntryDel2(&tmpt->b);
|
||||||
Free(tempt);
|
Free(tmpt);
|
||||||
tempt=tempt1;
|
tmpt=tmpt1;
|
||||||
}
|
}
|
||||||
StrFileDel(accts_table);
|
StrFileDel(accts_table);
|
||||||
accts_table=NULL;
|
accts_table=NULL;
|
||||||
|
|||||||
+49
-49
@@ -3,30 +3,30 @@ extern U0 BgtRegen();
|
|||||||
Bool BgtPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
|
Bool BgtPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
|
||||||
{//ch=ASCII; sc=scan_code
|
{//ch=ASCII; sc=scan_code
|
||||||
no_warn sc;
|
no_warn sc;
|
||||||
CBgtEntry *tempb,*tempb1;
|
CBgtEntry *tmpb,*tmpb1;
|
||||||
CBgtTemplate *tempt,*tempt1;
|
CBgtTemplate *tmpt,*tmpt1;
|
||||||
CDocEntry *doc_ce;
|
CDocEntry *doc_ce;
|
||||||
U8 *st;
|
U8 *st;
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case '\n':
|
case '\n':
|
||||||
if ((doc_ce=doc->cur_entry) && doc_ce!=doc &&
|
if ((doc_ce=doc->cur_entry) && doc_ce!=doc &&
|
||||||
doc_ce->type_u8==DOCT_MENU_VAL) {
|
doc_ce->type_u8==DOCT_MENU_VAL) {
|
||||||
tempb=doc_ce->user_data;
|
tmpb=doc_ce->user_data;
|
||||||
if (tempt=tempb->template) {
|
if (tmpt=tmpb->template) {
|
||||||
if (tempt1=BgtTemplatePmt(tempt)) {
|
if (tmpt1=BgtTemplatePmt(tmpt)) {
|
||||||
QueRem(tempt);
|
QueRem(tmpt);
|
||||||
BgtTemplatePurge(tempt);
|
BgtTemplatePurge(tmpt);
|
||||||
BgtEntryDel2(&tempt->b);
|
BgtEntryDel2(&tmpt->b);
|
||||||
Free(tempt);
|
Free(tmpt);
|
||||||
QueIns(tempt1,t_head.last);
|
QueIns(tmpt1,t_head.last);
|
||||||
BgtTemplateExpand(tempt1);
|
BgtTemplateExpand(tmpt1);
|
||||||
BgtRegen;
|
BgtRegen;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (tempb1=BgtEntryPmt(tempb)) {
|
if (tmpb1=BgtEntryPmt(tmpb)) {
|
||||||
QueRem(tempb);
|
QueRem(tmpb);
|
||||||
BgtEntryDel(tempb);
|
BgtEntryDel(tmpb);
|
||||||
BgtIns(tempb1);
|
BgtIns(tmpb1);
|
||||||
BgtRegen;
|
BgtRegen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -35,15 +35,15 @@ Bool BgtPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
|
|||||||
case CH_CTRLY:
|
case CH_CTRLY:
|
||||||
if ((doc_ce=doc->cur_entry) && doc_ce!=doc &&
|
if ((doc_ce=doc->cur_entry) && doc_ce!=doc &&
|
||||||
doc_ce->type_u8==DOCT_MENU_VAL) {
|
doc_ce->type_u8==DOCT_MENU_VAL) {
|
||||||
tempb=doc_ce->user_data;
|
tmpb=doc_ce->user_data;
|
||||||
if (tempt=tempb->template) {
|
if (tmpt=tmpb->template) {
|
||||||
QueRem(tempt);
|
QueRem(tmpt);
|
||||||
BgtTemplatePurge(tempt);
|
BgtTemplatePurge(tmpt);
|
||||||
BgtEntryDel2(&tempt->b);
|
BgtEntryDel2(&tmpt->b);
|
||||||
Free(tempt);
|
Free(tmpt);
|
||||||
} else {
|
} else {
|
||||||
QueRem(tempb);
|
QueRem(tmpb);
|
||||||
BgtEntryDel(tempb);
|
BgtEntryDel(tmpb);
|
||||||
}
|
}
|
||||||
BgtRegen;
|
BgtRegen;
|
||||||
}
|
}
|
||||||
@@ -64,26 +64,26 @@ Bool BgtPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
|
|||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
case 'n':
|
case 'n':
|
||||||
if (tempb1=BgtEntryPmt) {
|
if (tmpb1=BgtEntryPmt) {
|
||||||
BgtIns(tempb1);
|
BgtIns(tmpb1);
|
||||||
BgtRegen;
|
BgtRegen;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
case 't':
|
case 't':
|
||||||
if (tempt1=BgtTemplatePmt) {
|
if (tmpt1=BgtTemplatePmt) {
|
||||||
QueIns(tempt1,t_head.last);
|
QueIns(tmpt1,t_head.last);
|
||||||
BgtTemplateExpand(tempt1);
|
BgtTemplateExpand(tmpt1);
|
||||||
BgtRegen;
|
BgtRegen;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
case 'c':
|
case 'c':
|
||||||
if ((doc_ce=doc->cur_entry) && doc_ce!=doc &&
|
if ((doc_ce=doc->cur_entry) && doc_ce!=doc &&
|
||||||
doc_ce->type_u8==DOCT_MENU_VAL)
|
doc_ce->type_u8==DOCT_MENU_VAL)
|
||||||
tempb=doc_ce->user_data;
|
tmpb=doc_ce->user_data;
|
||||||
else
|
else
|
||||||
tempb=NULL;
|
tmpb=NULL;
|
||||||
if (tempb1=BgtEntryPmt(tempb)) {
|
if (tmpb1=BgtEntryPmt(tmpb)) {
|
||||||
BgtIns(tempb1);
|
BgtIns(tmpb1);
|
||||||
BgtRegen;
|
BgtRegen;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -97,24 +97,24 @@ U0 BgtRegen()
|
|||||||
F64 balance=0;
|
F64 balance=0;
|
||||||
CDoc *doc,*pdoc,*ddoc;
|
CDoc *doc,*pdoc,*ddoc;
|
||||||
CDocEntry *doc_ce;
|
CDocEntry *doc_ce;
|
||||||
CBgtEntry *tempb=b_head.next,*tempb_ce;
|
CBgtEntry *tmpb=b_head.next,*tmpb_ce;
|
||||||
doc=DocNew;
|
doc=DocNew;
|
||||||
doc->flags|=DOCF_FORM;
|
doc->flags|=DOCF_FORM;
|
||||||
while (tempb!=&b_head) {
|
while (tmpb!=&b_head) {
|
||||||
if (!StrCmp(view_acct,tempb->credit))
|
if (!StrCmp(view_acct,tmpb->credit))
|
||||||
balance-=tempb->amount;
|
balance-=tmpb->amount;
|
||||||
if (!StrCmp(view_acct,tempb->debit))
|
if (!StrCmp(view_acct,tmpb->debit))
|
||||||
balance+=tempb->amount;
|
balance+=tmpb->amount;
|
||||||
c=BgtAcctColor(tempb->credit);
|
c=BgtAcctColor(tmpb->credit);
|
||||||
if (c!=color) {
|
if (c!=color) {
|
||||||
color=c;
|
color=c;
|
||||||
DocPrint(doc,"$$FG,%d$$",color);
|
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",
|
"$$MU-UL,\"%D %8ts %8ts:%8.2f %8.2f:%$$Q\",U=0x%X$$\n",
|
||||||
tempb->date,tempb->credit,tempb->debit,balance,
|
tmpb->date,tmpb->credit,tmpb->debit,balance,
|
||||||
tempb->amount,tempb->desc,tempb);
|
tmpb->amount,tmpb->desc,tmpb);
|
||||||
tempb=tempb->next;
|
tmpb=tmpb->next;
|
||||||
}
|
}
|
||||||
DocRecalc(doc);
|
DocRecalc(doc);
|
||||||
|
|
||||||
@@ -130,19 +130,19 @@ U0 BgtRegen()
|
|||||||
doc_ce=pdoc->cur_entry;
|
doc_ce=pdoc->cur_entry;
|
||||||
timeout_jiffy=cnts.jiffies+JIFFY_FREQ; //Max one second.
|
timeout_jiffy=cnts.jiffies+JIFFY_FREQ; //Max one second.
|
||||||
while (doc_ce!=pdoc && cnts.jiffies<timeout_jiffy) {
|
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;
|
doc_ce=doc_ce->next;
|
||||||
if (doc_ce==pdoc) goto br_cont;
|
if (doc_ce==pdoc) goto br_cont;
|
||||||
}
|
}
|
||||||
tempb=b_head.next;
|
tmpb=b_head.next;
|
||||||
while (tempb!=&b_head) {
|
while (tmpb!=&b_head) {
|
||||||
if (tempb==tempb_ce) {
|
if (tmpb==tmpb_ce) {
|
||||||
doc->cur_entry=tempb->doc_e;
|
doc->cur_entry=tmpb->doc_e;
|
||||||
doc->cur_col=0;
|
doc->cur_col=0;
|
||||||
DocCenter(doc);
|
DocCenter(doc);
|
||||||
goto br_cont;
|
goto br_cont;
|
||||||
}
|
}
|
||||||
tempb=tempb->next;
|
tmpb=tmpb->next;
|
||||||
}
|
}
|
||||||
doc_ce=doc_ce->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,
|
public I64 StrFileAdd(U8 *st,I64 *_num,
|
||||||
CHashTable *table,I64 color=COLOR_INVALID)
|
CHashTable *table,I64 color=COLOR_INVALID)
|
||||||
{
|
{
|
||||||
CHashGeneric *temph;
|
CHashGeneric *tmph;
|
||||||
if (!st) return 0;
|
if (!st) return 0;
|
||||||
if (!(temph=HashFind(st,table,SFT_GENERIC))) {
|
if (!(tmph=HashFind(st,table,SFT_GENERIC))) {
|
||||||
temph=CAlloc(sizeof(CHashGeneric));
|
tmph=CAlloc(sizeof(CHashGeneric));
|
||||||
temph->type=SFT_GENERIC;
|
tmph->type=SFT_GENERIC;
|
||||||
temph->str=StrNew(st);
|
tmph->str=StrNew(st);
|
||||||
temph->user_data0=(*_num)++;
|
tmph->user_data0=(*_num)++;
|
||||||
HashAdd(temph,table);
|
HashAdd(tmph,table);
|
||||||
}
|
}
|
||||||
if (color!=COLOR_INVALID)
|
if (color!=COLOR_INVALID)
|
||||||
temph->user_data1=color;
|
tmph->user_data1=color;
|
||||||
return temph->user_data0;
|
return tmph->user_data0;
|
||||||
}
|
}
|
||||||
|
|
||||||
I64 StrEntriesCompare(CHashGeneric *h1,CHashGeneric *h2)
|
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;
|
I64 i,j,cnt,color=BLACK;
|
||||||
CDoc *doc=DocNew(name);
|
CDoc *doc=DocNew(name);
|
||||||
CHashGeneric *temph,**a;
|
CHashGeneric *tmph,**a;
|
||||||
if (table) {
|
if (table) {
|
||||||
cnt=0; //Count Strings
|
cnt=0; //Count Strings
|
||||||
for (i=0;i<=table->mask;i++)
|
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 *));
|
a=MAlloc(cnt*sizeof(CHashGeneric *));
|
||||||
j=0; //Load Strings
|
j=0; //Load Strings
|
||||||
for (i=0;i<=table->mask;i++) {
|
for (i=0;i<=table->mask;i++) {
|
||||||
temph=table->body[i];
|
tmph=table->body[i];
|
||||||
while (temph) {
|
while (tmph) {
|
||||||
a[j++]=temph;
|
a[j++]=tmph;
|
||||||
temph=temph->next;
|
tmph=tmph->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QSortI64(a,cnt,&StrEntriesCompare);
|
QSortI64(a,cnt,&StrEntriesCompare);
|
||||||
for (i=0;i<cnt;i++) {
|
for (i=0;i<cnt;i++) {
|
||||||
temph=a[i];
|
tmph=a[i];
|
||||||
if (temph->user_data1&15!=color) {
|
if (tmph->user_data1&15!=color) {
|
||||||
DocPrint(doc,"$$FG,%d$$",temph->user_data1&15);
|
DocPrint(doc,"$$FG,%d$$",tmph->user_data1&15);
|
||||||
color=temph->user_data1&15;
|
color=tmph->user_data1&15;
|
||||||
}
|
}
|
||||||
if (no_nums)
|
if (no_nums)
|
||||||
DocPrint(doc,"%s\n",temph->str);
|
DocPrint(doc,"%s\n",tmph->str);
|
||||||
else
|
else
|
||||||
DocPrint(doc,"%d,%s\n",temph->user_data0,temph->str);
|
DocPrint(doc,"%d,%s\n",tmph->user_data0,tmph->str);
|
||||||
}
|
}
|
||||||
Free(a);
|
Free(a);
|
||||||
}
|
}
|
||||||
@@ -116,15 +116,15 @@ public U0 StrFileWrite(U8 *name,CHashTable *table,Bool no_nums=FALSE)
|
|||||||
public U0 StrFileDel(CHashTable *table)
|
public U0 StrFileDel(CHashTable *table)
|
||||||
{
|
{
|
||||||
I64 i;
|
I64 i;
|
||||||
CHashGeneric *temph,*temph1;
|
CHashGeneric *tmph,*tmph1;
|
||||||
if (!table) return;
|
if (!table) return;
|
||||||
for (i=0;i<=table->mask;i++) {
|
for (i=0;i<=table->mask;i++) {
|
||||||
temph=table->body[i];
|
tmph=table->body[i];
|
||||||
while (temph) {
|
while (tmph) {
|
||||||
temph1=temph->next;
|
tmph1=tmph->next;
|
||||||
Free(temph->str);
|
Free(tmph->str);
|
||||||
Free(temph);
|
Free(tmph);
|
||||||
temph=temph1;
|
tmph=tmph1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Free(table->body);
|
Free(table->body);
|
||||||
|
|||||||
+54
-54
@@ -1,37 +1,37 @@
|
|||||||
U0 BgtTemplatePurge(CBgtTemplate *tempt)
|
U0 BgtTemplatePurge(CBgtTemplate *tmpt)
|
||||||
{
|
{
|
||||||
CBgtEntry *tempb,*tempb1;
|
CBgtEntry *tmpb,*tmpb1;
|
||||||
tempb=b_head.next;
|
tmpb=b_head.next;
|
||||||
while (tempb!=&b_head) {
|
while (tmpb!=&b_head) {
|
||||||
tempb1=tempb->next;
|
tmpb1=tmpb->next;
|
||||||
if (tempb->template==tempt) {
|
if (tmpb->template==tmpt) {
|
||||||
QueRem(tempb);
|
QueRem(tmpb);
|
||||||
BgtEntryDel2(tempb);
|
BgtEntryDel2(tmpb);
|
||||||
Free(tempb);
|
Free(tmpb);
|
||||||
}
|
}
|
||||||
tempb=tempb1;
|
tmpb=tmpb1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
U0 BgtTemplateExpand(CBgtTemplate *tempt)
|
U0 BgtTemplateExpand(CBgtTemplate *tmpt)
|
||||||
{
|
{
|
||||||
CDate d,start,end;
|
CDate d,start,end;
|
||||||
CDateStruct ds;
|
CDateStruct ds;
|
||||||
CBgtEntry *tempb;
|
CBgtEntry *tmpb;
|
||||||
|
|
||||||
start=MyStr2Date(tempt->start_date);
|
start=MyStr2Date(tmpt->start_date);
|
||||||
end =MyStr2Date(tempt->end_date);
|
end =MyStr2Date(tmpt->end_date);
|
||||||
tempt->b.template=tempt;
|
tmpt->b.template=tmpt;
|
||||||
switch (tempt->type) {
|
switch (tmpt->type) {
|
||||||
case BT_INTERVAL:
|
case BT_INTERVAL:
|
||||||
d=start;
|
d=start;
|
||||||
while (d<=end) {
|
while (d<=end) {
|
||||||
tempb=CAlloc(sizeof(CBgtEntry));
|
tmpb=CAlloc(sizeof(CBgtEntry));
|
||||||
MemCpy(tempb,&tempt->b,sizeof(CBgtEntry));
|
MemCpy(tmpb,&tmpt->b,sizeof(CBgtEntry));
|
||||||
tempb->date=d;
|
tmpb->date=d;
|
||||||
tempb->type=BE_TEMPLATE_COPY;
|
tmpb->type=BE_TEMPLATE_COPY;
|
||||||
BgtIns(tempb);
|
BgtIns(tmpb);
|
||||||
d+=tempt->period*0x100000000;
|
d+=tmpt->period*0x100000000;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BT_MONTHLY:
|
case BT_MONTHLY:
|
||||||
@@ -39,11 +39,11 @@ U0 BgtTemplateExpand(CBgtTemplate *tempt)
|
|||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
d=Struct2Date(&ds);
|
d=Struct2Date(&ds);
|
||||||
if (d<=end) {
|
if (d<=end) {
|
||||||
tempb=CAlloc(sizeof(CBgtEntry));
|
tmpb=CAlloc(sizeof(CBgtEntry));
|
||||||
MemCpy(tempb,&tempt->b,sizeof(CBgtEntry));
|
MemCpy(tmpb,&tmpt->b,sizeof(CBgtEntry));
|
||||||
tempb->date=d;
|
tmpb->date=d;
|
||||||
tempb->type=BE_TEMPLATE_COPY;
|
tmpb->type=BE_TEMPLATE_COPY;
|
||||||
BgtIns(tempb);
|
BgtIns(tmpb);
|
||||||
} else
|
} else
|
||||||
break;
|
break;
|
||||||
if (++ds.mon>11) {
|
if (++ds.mon>11) {
|
||||||
@@ -57,11 +57,11 @@ U0 BgtTemplateExpand(CBgtTemplate *tempt)
|
|||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
d=Struct2Date(&ds);
|
d=Struct2Date(&ds);
|
||||||
if (d<=end) {
|
if (d<=end) {
|
||||||
tempb=CAlloc(sizeof(CBgtEntry));
|
tmpb=CAlloc(sizeof(CBgtEntry));
|
||||||
MemCpy(tempb,&tempt->b,sizeof(CBgtEntry));
|
MemCpy(tmpb,&tmpt->b,sizeof(CBgtEntry));
|
||||||
tempb->date=d;
|
tmpb->date=d;
|
||||||
tempb->type=BE_TEMPLATE_COPY;
|
tmpb->type=BE_TEMPLATE_COPY;
|
||||||
BgtIns(tempb);
|
BgtIns(tmpb);
|
||||||
} else
|
} else
|
||||||
break;
|
break;
|
||||||
ds.mon+=2;
|
ds.mon+=2;
|
||||||
@@ -76,11 +76,11 @@ U0 BgtTemplateExpand(CBgtTemplate *tempt)
|
|||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
d=Struct2Date(&ds);
|
d=Struct2Date(&ds);
|
||||||
if (d<=end) {
|
if (d<=end) {
|
||||||
tempb=CAlloc(sizeof(CBgtEntry));
|
tmpb=CAlloc(sizeof(CBgtEntry));
|
||||||
MemCpy(tempb,&tempt->b,sizeof(CBgtEntry));
|
MemCpy(tmpb,&tmpt->b,sizeof(CBgtEntry));
|
||||||
tempb->date=d;
|
tmpb->date=d;
|
||||||
tempb->type=BE_TEMPLATE_COPY;
|
tmpb->type=BE_TEMPLATE_COPY;
|
||||||
BgtIns(tempb);
|
BgtIns(tmpb);
|
||||||
} else
|
} else
|
||||||
break;
|
break;
|
||||||
ds.mon+=6;
|
ds.mon+=6;
|
||||||
@@ -95,11 +95,11 @@ U0 BgtTemplateExpand(CBgtTemplate *tempt)
|
|||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
d=Struct2Date(&ds);
|
d=Struct2Date(&ds);
|
||||||
if (d<=end) {
|
if (d<=end) {
|
||||||
tempb=CAlloc(sizeof(CBgtEntry));
|
tmpb=CAlloc(sizeof(CBgtEntry));
|
||||||
MemCpy(tempb,&tempt->b,sizeof(CBgtEntry));
|
MemCpy(tmpb,&tmpt->b,sizeof(CBgtEntry));
|
||||||
tempb->date=d;
|
tmpb->date=d;
|
||||||
tempb->type=BE_TEMPLATE_COPY;
|
tmpb->type=BE_TEMPLATE_COPY;
|
||||||
BgtIns(tempb);
|
BgtIns(tmpb);
|
||||||
} else
|
} else
|
||||||
break;
|
break;
|
||||||
ds.year++;
|
ds.year++;
|
||||||
@@ -110,17 +110,17 @@ U0 BgtTemplateExpand(CBgtTemplate *tempt)
|
|||||||
|
|
||||||
U0 CBgtTemplatesExpand()
|
U0 CBgtTemplatesExpand()
|
||||||
{
|
{
|
||||||
CBgtTemplate *tempt=t_head.next;
|
CBgtTemplate *tmpt=t_head.next;
|
||||||
while (tempt!=&t_head) {
|
while (tmpt!=&t_head) {
|
||||||
BgtTemplateExpand(tempt);
|
BgtTemplateExpand(tmpt);
|
||||||
tempt=tempt->next;
|
tmpt=tmpt->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CBgtTemplate *BgtTemplatePmt(CBgtTemplate *dft_t=NULL)
|
CBgtTemplate *BgtTemplatePmt(CBgtTemplate *dft_t=NULL)
|
||||||
{
|
{
|
||||||
CBgtTemplate t,*tempt;
|
CBgtTemplate t,*tmpt;
|
||||||
CBgtEntry *tempb,*dft_b;
|
CBgtEntry *tmpb,*dft_b;
|
||||||
MemSet(&t,0,sizeof(CBgtTemplate));
|
MemSet(&t,0,sizeof(CBgtTemplate));
|
||||||
if (dft_t) {
|
if (dft_t) {
|
||||||
MemCpy(&t.start,&dft_t->start,BT_SIZE);
|
MemCpy(&t.start,&dft_t->start,BT_SIZE);
|
||||||
@@ -134,12 +134,12 @@ CBgtTemplate *BgtTemplatePmt(CBgtTemplate *dft_t=NULL)
|
|||||||
while (TRUE)
|
while (TRUE)
|
||||||
if (PopUpForm(&t) && ((t.type==BT_INTERVAL && t.period>0) ||
|
if (PopUpForm(&t) && ((t.type==BT_INTERVAL && t.period>0) ||
|
||||||
t.type>BT_INTERVAL)) {
|
t.type>BT_INTERVAL)) {
|
||||||
if (tempb=BgtEntryPmt(dft_b)) {
|
if (tmpb=BgtEntryPmt(dft_b)) {
|
||||||
tempt=CAlloc(sizeof(CBgtTemplate));
|
tmpt=CAlloc(sizeof(CBgtTemplate));
|
||||||
MemCpy(&tempt->start,&t.start,BT_SIZE);
|
MemCpy(&tmpt->start,&t.start,BT_SIZE);
|
||||||
MemCpy(&tempt->b,tempb,sizeof(CBgtEntry));
|
MemCpy(&tmpt->b,tmpb,sizeof(CBgtEntry));
|
||||||
Free(tempb);
|
Free(tmpb);
|
||||||
return tempt;
|
return tmpt;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#define BGT_STRINGS_FILE "~/Budget/Strs.DD.Z"
|
#define BGT_STRINGS_FILE "~/Budget/Strs.DD.Z"
|
||||||
#define BGT_ACCTS_FILE "~/Budget/Accts.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_NORMAL 0
|
||||||
#define BE_GAS 1
|
#define BE_GAS 1
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ just to be different.
|
|||||||
|
|
||||||
U0 DrawObj(CDC *dc,Obj *o,F64 tt)
|
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);
|
F64 r1=Max(9-0.1*o->z,1),r2=Max(r1/4,1);
|
||||||
|
|
||||||
if (o==human)
|
if (o==human)
|
||||||
@@ -280,11 +280,11 @@ U0 DrawObj(CDC *dc,Obj *o,F64 tt)
|
|||||||
if (o==ball)
|
if (o==ball)
|
||||||
Sprite3(dc,o->x,(o->y-o->z)/2,GR_Z_ALL-o->y,$IB,"<1>",BI=1$);
|
Sprite3(dc,o->x,(o->y-o->z)/2,GR_Z_ALL-o->y,$IB,"<1>",BI=1$);
|
||||||
else {
|
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->last_img].img[o->team],
|
||||||
imgs[o->next_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->é);
|
SpriteY3B(dc,o->x,(o->y-o->z)/2,GR_Z_ALL-o->y,tmps,o->é);
|
||||||
Free(temps);
|
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;
|
Fs->draw_it=&DrawIt;
|
||||||
GetChar;
|
GetChar;
|
||||||
DocClear;
|
DocClear;
|
||||||
WinMgrSync(2,TRUE);
|
Refresh(2,TRUE);
|
||||||
DocBottom;
|
DocBottom;
|
||||||
}
|
}
|
||||||
} catch
|
} catch
|
||||||
|
|||||||
+24
-24
@@ -18,20 +18,20 @@ CTask *SingleSong(U8 *msg,U8 *name)
|
|||||||
Bool JBPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
|
Bool JBPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
|
||||||
{//ch=ASCII; sc=scan_code
|
{//ch=ASCII; sc=scan_code
|
||||||
CDocEntry *doc_ce=doc->cur_entry,*doc_e;
|
CDocEntry *doc_ce=doc->cur_entry,*doc_e;
|
||||||
CDirEntry *tempde;
|
CDirEntry *tmpde;
|
||||||
CDoc *s;
|
CDoc *s;
|
||||||
if (!(sc&(SCF_ALT|SCF_CTRL|SCF_SHIFT))
|
if (!(sc&(SCF_ALT|SCF_CTRL|SCF_SHIFT))
|
||||||
&& doc_ce->type_u8==DOCT_MENU_VAL && doc_ce->left_exp>=0) {
|
&& 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 ) {
|
if (sc.u8[0]==SC_DELETE ) {
|
||||||
Beep;
|
Beep;
|
||||||
Silent;
|
Silent;
|
||||||
Del(tempde->full_name);
|
Del(tmpde->full_name);
|
||||||
Silent(OFF);
|
Silent(OFF);
|
||||||
} else if ('0'<=ch<='9') {
|
} else if ('0'<=ch<='9') {
|
||||||
if (StrLen(doc_ce->tag)>1)
|
if (StrLen(doc_ce->tag)>1)
|
||||||
doc_ce->tag[0]=ch;
|
doc_ce->tag[0]=ch;
|
||||||
s=DocRead(tempde->full_name);
|
s=DocRead(tmpde->full_name);
|
||||||
doc_e=s->head.next;
|
doc_e=s->head.next;
|
||||||
while (doc_e!=s && doc_e->type_u8!=DOCT_TEXT)
|
while (doc_e!=s && doc_e->type_u8!=DOCT_TEXT)
|
||||||
doc_e=doc_e->next;
|
doc_e=doc_e->next;
|
||||||
@@ -42,7 +42,7 @@ Bool JBPutKey(CDoc *doc,U8 *,I64 ch,I64 sc)
|
|||||||
DocDel(s);
|
DocDel(s);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else if (ch==CH_SPACE||ch==CH_ESC)
|
} 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
|
//<SPACE> is followed by <ESC> --> JB_RUN_LEVEL_TWO
|
||||||
//Actual <ESC> just exits --> JB_RUN_LEVEL_ONE
|
//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.
|
{//_filename is for using this as a song-chooser program.
|
||||||
I64 i=0,rating;
|
I64 i=0,rating;
|
||||||
U8 *st,*st2;
|
U8 *st,*st2;
|
||||||
CDirEntry *tempde,*tempde1;
|
CDirEntry *tmpde,*tmpde1;
|
||||||
CDoc *doc=DocNew,*s;
|
CDoc *doc=DocNew,*s;
|
||||||
CDocEntry *doc_e;
|
CDocEntry *doc_e;
|
||||||
CTask *task=NULL;
|
CTask *task=NULL;
|
||||||
@@ -61,7 +61,7 @@ public U0 JukeBox(U8 *dirname="~/Psalmody",U8 **_filename=NULL)
|
|||||||
*_filename=NULL;
|
*_filename=NULL;
|
||||||
dirname=StrNew(dirname);
|
dirname=StrNew(dirname);
|
||||||
st=MStrPrint("%s/*.HC.Z",dirname);
|
st=MStrPrint("%s/*.HC.Z",dirname);
|
||||||
tempde=tempde1=FilesFind(st);
|
tmpde=tmpde1=FilesFind(st);
|
||||||
Free(st);
|
Free(st);
|
||||||
Free(dirname);
|
Free(dirname);
|
||||||
doc->user_put_key=&JBPutKey;
|
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"
|
"$$BLACK$$Incomplete $$CYAN$$Special$$FG$$\n\n"
|
||||||
"$$GREEN$$<DELETE>$$FG$$ to delete a song.\n"
|
"$$GREEN$$<DELETE>$$FG$$ to delete a song.\n"
|
||||||
"Press a number to rate a song.\n");
|
"Press a number to rate a song.\n");
|
||||||
while (tempde) {
|
while (tmpde) {
|
||||||
if (!(i++%5))
|
if (!(i++%5))
|
||||||
DocPrint(doc,"\n");
|
DocPrint(doc,"\n");
|
||||||
if (FileOcc("Play(",tempde->full_name,"")) {
|
if (FileOcc("Play(",tmpde->full_name,"")) {
|
||||||
st=StrNew(tempde->name);
|
st=StrNew(tmpde->name);
|
||||||
FileExtRem(st);
|
FileExtRem(st);
|
||||||
s=DocRead(tempde->full_name);
|
s=DocRead(tmpde->full_name);
|
||||||
doc_e=s->head.next;
|
doc_e=s->head.next;
|
||||||
while (doc_e!=s && doc_e->type_u8!=DOCT_TEXT)
|
while (doc_e!=s && doc_e->type_u8!=DOCT_TEXT)
|
||||||
doc_e=doc_e->next;
|
doc_e=doc_e->next;
|
||||||
@@ -94,7 +94,7 @@ public U0 JukeBox(U8 *dirname="~/Psalmody",U8 **_filename=NULL)
|
|||||||
DocPrint(doc,"$$CYAN$$");
|
DocPrint(doc,"$$CYAN$$");
|
||||||
else if (StrMatch("no nothing",doc_e->tag)) {
|
else if (StrMatch("no nothing",doc_e->tag)) {
|
||||||
DocPrint(doc,"$$RED$$");
|
DocPrint(doc,"$$RED$$");
|
||||||
if (FileOcc("\\0",tempde->full_name,"")) {
|
if (FileOcc("\\0",tmpde->full_name,"")) {
|
||||||
s->cur_entry=doc_e->next;
|
s->cur_entry=doc_e->next;
|
||||||
s->cur_col=0;
|
s->cur_col=0;
|
||||||
DocEntryDel(s,doc_e);
|
DocEntryDel(s,doc_e);
|
||||||
@@ -102,37 +102,37 @@ public U0 JukeBox(U8 *dirname="~/Psalmody",U8 **_filename=NULL)
|
|||||||
DocWrite(s);
|
DocWrite(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DocPrint(doc,"$$MU-UL,\"%c%-8ts\",LE=%d$$ ",rating,st,tempde);
|
DocPrint(doc,"$$MU-UL,\"%c%-8ts\",LE=%d$$ ",rating,st,tmpde);
|
||||||
tempde->user_data=JB_RUN_LEVEL_NULL;
|
tmpde->user_data=JB_RUN_LEVEL_NULL;
|
||||||
}
|
}
|
||||||
DocDel(s);
|
DocDel(s);
|
||||||
Free(st);
|
Free(st);
|
||||||
}
|
}
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
DocPrint(doc,"\n$$CYAN$$$$MU-UL,\"DONE\",LE=%d$$\n",DOCM_CANCEL);
|
DocPrint(doc,"\n$$CYAN$$$$MU-UL,\"DONE\",LE=%d$$\n",DOCM_CANCEL);
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
if (_filename)
|
if (_filename)
|
||||||
tempde=PopUpMenu(doc,DOF_INTERCEPT_TASK_END);
|
tmpde=PopUpMenu(doc,DOF_INTERCEPT_TASK_END);
|
||||||
else
|
else
|
||||||
tempde=PopUpMenu(doc);
|
tmpde=PopUpMenu(doc);
|
||||||
if (task)
|
if (task)
|
||||||
Kill(task);
|
Kill(task);
|
||||||
if (tempde<=0) break;
|
if (tmpde<=0) break;
|
||||||
st2=StrNew(tempde->name);
|
st2=StrNew(tmpde->name);
|
||||||
if (_filename) {
|
if (_filename) {
|
||||||
Free(*_filename);
|
Free(*_filename);
|
||||||
*_filename=StrNew(tempde->full_name);
|
*_filename=StrNew(tmpde->full_name);
|
||||||
}
|
}
|
||||||
if (tempde->user_data==JB_RUN_LEVEL_ONE) break; //<ESC>
|
if (tmpde->user_data==JB_RUN_LEVEL_ONE) break; //<ESC>
|
||||||
tempde->user_data=JB_RUN_LEVEL_NULL; //Rst from <SPACE>
|
tmpde->user_data=JB_RUN_LEVEL_NULL; //Rst from <SPACE>
|
||||||
FileExtRem(st2);
|
FileExtRem(st2);
|
||||||
st=MStrPrint("ExeFile(\"%s\");",tempde->full_name);
|
st=MStrPrint("ExeFile(\"%s\");",tmpde->full_name);
|
||||||
MusicSettingsRst;
|
MusicSettingsRst;
|
||||||
task=SingleSong(st,st2);
|
task=SingleSong(st,st2);
|
||||||
Free(st2);
|
Free(st2);
|
||||||
Free(st);
|
Free(st);
|
||||||
}
|
}
|
||||||
DocDel(doc);
|
DocDel(doc);
|
||||||
DirTreeDel(tempde1);
|
DirTreeDel(tmpde1);
|
||||||
}
|
}
|
||||||
+11
-11
@@ -2,13 +2,13 @@ U0 SongPuppet(CTask *task,I64 passes)
|
|||||||
{
|
{
|
||||||
CDbgInfo *dbg_info;
|
CDbgInfo *dbg_info;
|
||||||
I64 i,start,end,rip,last_rip;
|
I64 i,start,end,rip,last_rip;
|
||||||
CHashFun *tempf=NULL;
|
CHashFun *tmpf=NULL;
|
||||||
for (i=0;i<250 && TaskValidate(task);i++) {
|
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;
|
break;
|
||||||
Sleep(1);
|
Sleep(1);
|
||||||
}
|
}
|
||||||
if (tempf && (dbg_info=tempf->dbg_info)) {
|
if (tmpf && (dbg_info=tmpf->dbg_info)) {
|
||||||
start=dbg_info->body[0];
|
start=dbg_info->body[0];
|
||||||
end =dbg_info->body[dbg_info->max_line+1-dbg_info->min_line];
|
end =dbg_info->body[dbg_info->max_line+1-dbg_info->min_line];
|
||||||
last_rip=0;
|
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)
|
I64 start_song=0,I64 end_song=MAX_I64)
|
||||||
{//Help make music video by puppeting JukeBox task.
|
{//Help make music video by puppeting JukeBox task.
|
||||||
I64 i;
|
I64 i;
|
||||||
CDirEntry *tempde,*tempde1;
|
CDirEntry *tmpde,*tmpde1;
|
||||||
CTask *juke_task=User("JukeBox(0x%X);\n",dirname);
|
CTask *juke_task=User("JukeBox(0x%X);\n",dirname);
|
||||||
Cd(dirname);
|
Cd(dirname);
|
||||||
tempde1=FilesFind("*",FUF_RECURSE|FUF_JUST_TXT|FUF_JUST_FILES);
|
tmpde1=FilesFind("*",FUF_RECURSE|FUF_JUST_TXT|FUF_JUST_FILES);
|
||||||
for (tempde=tempde1,i=0;tempde && i<start_song;i++)
|
for (tmpde=tmpde1,i=0;tmpde && i<start_song;i++)
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
for (i=start_song;tempde && i<end_song;i++) {
|
for (i=start_song;tmpde && i<end_song;i++) {
|
||||||
JukeSongPuppet(juke_task,passes,i,tempde->name);
|
JukeSongPuppet(juke_task,passes,i,tmpde->name);
|
||||||
tempde=tempde->next;
|
tmpde=tmpde->next;
|
||||||
}
|
}
|
||||||
DirTreeDel(tempde1);
|
DirTreeDel(tmpde1);
|
||||||
Kill(juke_task);
|
Kill(juke_task);
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,7 @@ This uses four types of output
|
|||||||
|
|
||||||
4) The Fs->next_ctrl for the tempo/stacatto sliders.
|
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$*/
|
$WW,1$$WW,0$*/
|
||||||
|
|
||||||
#define NOTE_REST MIN_I64
|
#define NOTE_REST MIN_I64
|
||||||
@@ -62,20 +62,13 @@ class PsmCtrl
|
|||||||
PsmNote head;
|
PsmNote head;
|
||||||
PsmNote clipboard;
|
PsmNote clipboard;
|
||||||
CMenuEntry *incomplete_entry,*record_entry;
|
CMenuEntry *incomplete_entry,*record_entry;
|
||||||
I64 screen_x,
|
I64 scrn_x,
|
||||||
tool;
|
tool;
|
||||||
PsmNote *cur_note;
|
PsmNote *cur_note;
|
||||||
CDC *dc2;
|
CDC *dc2;
|
||||||
Bool playing;
|
Bool playing;
|
||||||
} oc;
|
} psm;
|
||||||
|
|
||||||
U8 *psm_note_lst="A\0A#\0B\0C\0C#\0D\0D#\0E\0F\0F#\0G\0G#\0";
|
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_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};
|
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