17,"Unexpected Data Save Acknowlege message received"
Object_save(
GetStr(b%+44),b%!36)
b%!12=My_Ref%
b%!16=3
"Wimp_SendMessage",17,b%,b%!4
Wimp_dataLoad(blk%)
blk%!40=&050
blk%!16=4
blk%!12=My_Ref%
"Wimp_SendMessage",17,blk%
Window_IsMain(blk%!20)
Object_merge(blk%+44)
blk%!20
(MainOn%
Changed%)
StartEditing
Object_load(blk%+44)
MainOn%=
dum%=
Wimp_Error(1,"Message from 3DEditor","At present this is a single document editor. To load this file, first run another copy of this program.","OK","","")
/Xdum%=
Wimp_Error(1,"Message from 3DEditor","This is not a 3DEditor file","OK","","")
Wimp_dataOpen(b%)
MainOn%
b%!40=&050
b%!20=-2
Wimp_dataLoad(b%)
Wimp_prequit(b%)
MainOn%
Changed%
;uret%=
Wimp_Error(2,"Warning","A 3DEditor file has not been saved. Do you still want to quit?","Quit","Cancel","")
ret%=2
b%!12=My_Ref%
"Wimp_SendMessage",19,b%
Wimp_menuwarning(b%)
b%!32
b%!36
Icon_UpText(SaveHandle%,1,File$)
Icon_UpValid(SaveHandle%,2,"sfile_050")
SaveType%=0
FileType%=&050
Window_openactive(SaveHandle%)
opt%=b%!40
SaveType%=opt%+2
FileType%=Export%(opt%,2)
Icon_UpText(SaveHandle%,1,Export$(opt%))
FileType%=&1000
Icon_UpValid(SaveHandle%,2,"sdirectory")
Icon_UpValid(SaveHandle%,2,"sfile_"+
~FileType%)
Window_openactive(SaveHandle%)
"Wimp_CreateSubMenu",,b%!20,b%!24,b%!28
Wimp_modechange
loop%,b%,b2%
<>OldMode%
"OS_ReadModeVariable",-1,5
,,yeig%
YResolution%=2^yeig%
Object_BuildColourTable
b%=Localblock%
b2%=Localblock%+&100
loop%=0
Fonts%?loop%>0
"XFont_ReadDefn",loop%,b%
,,xsize%,ysize%
"XFont_FindFont",,b%,xsize%,ysize%
handle%
Fonts%?loop%>0
"XFont_LoseFont",loop%:Fonts%?loop%-=1:
handle%>0
handle%<256
Fonts2%?loop%=handle%
Fonts%?handle%=1
loop%=0
WinPtr%-1
win%=Windows%(loop%,0)
"XWimp_WhichIcon",win%,b%,1<<6,1<<6
1)<>1
s at%=0
b%!at%<>-1
!b2%=win%
b2%!4=b%!at%
"Wimp_GetIconState",,b2%
x$fonthand%=(b2%!24>>24)
%11111111
y%fonthand%=(Fonts2%?fonthand%)<<24
b2%!8=fonthand%
b2%!12=%11111111<<24
"Wimp_SetIconState",,b2%
at%+=4
loop%
OldMode%=
Wimp_palettechange
Wimp_palettechange
b%=Localblock%
"Wimp_ReadPalette",,b%
red%=b%!(11*4):red%=red%
"node%=b%!(7*4):node%=node%
%white%=b%!(0*4):white%=white%
%black%=b%!(7*4):black%=black%
black%<>7
white%<>0
red%<>11
red%=white%
node%=white%
node%
black%=white%
black%
NodeTint%=(node%
&FF)<<6
RedTint%=(red%
&FF)<<6
BlackTint%=(black%
&FF)<<6
NodeColour%=node%>>2
RedColour%=red%>>2
BlackColour%=black%>>2
BlackColour%=black%
BlackTint%=0
RedColour%=red%
RedTint%=0
NodeColour%=node%
NodeTint%=0
Wimp_clickonbar(button%)
hand%,b%
b%=Localblock%
button%
MainOn%
StartEditing
Object_loaddefault
File$="Untitled"
Leaf$=File$
MainOn%=
Window_UpdateTitle
hand%=
Wimp_Error(1,"Message from 3DEditor","It is only possible to edit one image at a time, to edit another load another copy of this program","OK","","")
17,"Default file is not a 3DEditor file (File ID string incorrect)"
minorver%>progver%
dum%=
Wimp_Error(1,"Warning from 3DEditor","The default file was created with an newer version of 3DEditor and may contain features not present in this version","OK","","")
majorver%>filever%
17,"The default file is from a newer version of 3DEditor and cannot be loaded by this version"
Obend%=b%!16
majorver%>=201
zoom%=b%!28
Viewer_Xpos%=b%!32
Viewer_Ypos%=b%!36
Viewer_Zpos%=b%!40
majorver%>=203
u!LastColour%=b%!20/ColDataLen%
collen%=b%!20
b%+=64
Objects%=!b%
z b%+=4
b2%=ObjectList%
Objects%*16+4
b2%!l%=b%!l%
b%+=Objects%*16
ObjectSize%=Obend%+1024
:ObjectItem%=
Heap_ExtendBlock(ObjectItem%,ObjectSize%)
b2%=ObjectItem%
Obend%+4
b2%!l%=b%!l%
b%+=Obend%
AObjectColour%=
Heap_ExtendBlock(ObjectColour%,30*ColDataLen%)
majorver%>=203
b2%=ObjectColour%
collen%+4
b2%!l%=b%!l%
b%+=collen%
Changed%=
File$="Untitled"
Leaf$="Untitled"
Window_UpdateTitle
Selected=-1
Select_Tool%=-1
ObjectAtEnd%=-1
Object_BuildColourTable
Display_RedrawAll
Object_load(name%)
b%,dum%
handle%=
GetStr(name%))
b%=Localblock%
"OS_GBPB",4,handle%,b%,64
"progver%=
(ProgVersion*100+.5)
"filever%=
(FileVersion*100+.5)
majorver%=b%!8
minorver%=b%!12
b%?8=&0D:id$=$b%
id$<>"3DEditor"
#handle%:
17,"File is not a 3DEditor file (File ID string incorrect)"
minorver%>progver%
dum%=
Wimp_Error(1,"Warning from 3DEditor","This file was created with an newer version of 3DEditor and may contain features not present in this version","OK","","")
majorver%>filever%
#handle%:
17,"This file is from a newer version of 3DEditor and cannot be loaded by this version"
Obend%=b%!16
majorver%>=201
zoom%=b%!28
Viewer_Xpos%=b%!32
Viewer_Ypos%=b%!36
Viewer_Zpos%=b%!40
majorver%>=203
!LastColour%=b%!20/ColDataLen%
collen%=b%!20
"OS_GBPB",4,handle%,b%,4
Objects%=!b%
"OS_GBPB",4,handle%,ObjectList%,Objects%*16
ObjectSize%=Obend%+1024
:ObjectItem%=
Heap_ExtendBlock(ObjectItem%,ObjectSize%)
"OS_GBPB",4,handle%,ObjectItem%,Obend%
majorver%<204
Object_wordalign
AObjectColour%=
Heap_ExtendBlock(ObjectColour%,30*ColDataLen%)
majorver%>=203
"OS_GBPB",4,handle%,ObjectColour%,collen%
#handle%
Changed%=
File$=
GetStr(name%)
Leaf$=
Leaf(File$)
Window_UpdateTitle
Selected%=-1
Select_Tool%=-1
ObjectAtEnd%=-1
Object_BuildColourTable
Display_RedrawAll
Object_merge(name%)
handle%=
($name%)
b%=Localblock%
"OS_GBPB",4,handle%,b%,64
"progver%=
(ProgVersion*100+.5)
"filever%=
(FileVersion*100+.5)
majorver%=b%!8
minorver%=b%!12
b%?8=&0D:id$=$b%
id$<>"3DEditor"
#handle%:
17,"File is not a 3DEditor file (File ID string incorrect)"
minorver%>progver%
dum%=
Wimp_Error(1,"Warning from 3DEditor","This file was created with an newer version of 3DEditor and may contain features not present in this version","OK","","")
majorver%>filever%
#handle%:
17,"This file is from a newer version of 3DEditor and cannot be loaded by this version"