Skip to content

Commit 0c4fe91

Browse files
author
MaximDude
committed
File saving functional
1 parent e8f82a2 commit 0c4fe91

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

cccp-bender-main.bmx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Type TAppOutput
3939
Global sourceImage:TImage
4040
Global boneImage:TImage[BONES]
4141
'Output Settings
42-
Global ZOOM:Int = 2
42+
Global ZOOM:Int = 1
4343
Global FRAMES:Int = 7
4444
Global BACKGROUND_RED:Int = 50
4545
Global BACKGROUND_GREEN:Int = 170
@@ -58,8 +58,8 @@ Type TAppOutput
5858
Global angB:Float
5959
Global angC:Float
6060

61-
'Create bone tiles from source image
62-
Function FCreateBoneImage()
61+
'Create limb part tiles from source image
62+
Function FCreateLimbTiles()
6363
Local b:Int, i:Int
6464
For b = 0 To BONES-1 'Because I (arne) can't set handles on inidividial anim image frames, I must use my own frame sys
6565
boneImage[b] = CreateImage(TILESIZE,TILESIZE,1,MASKEDIMAGE)
@@ -83,7 +83,7 @@ Type TAppOutput
8383
SetMaskColor(255,0,255)
8484
'DrawImage(sourceImage,0,0)
8585
DrawImageRect(sourceImage,0,0,ImageWidth(sourceImage)*ZOOM,ImageHeight(sourceImage)*ZOOM)
86-
FCreateBoneImage()
86+
FCreateLimbTiles()
8787
FLimbBend()
8888
Flip(1)
8989
'FOutputDraw()
@@ -163,7 +163,7 @@ Type TAppOutput
163163
SetColor(255,255,255)
164164
DrawImageRect(sourceImage,0,0,ImageWidth(sourceImage)*ZOOM,ImageHeight(sourceImage)*ZOOM)
165165
If redoBoneImage Then
166-
FCreateBoneImage()
166+
FCreateLimbTiles()
167167
redoBoneImage = False
168168
EndIf
169169
FLimbBend()
@@ -352,7 +352,12 @@ While True
352352
'Saving
353353
Case TAppGUI.editSaveButton
354354
exportedFile = RequestFile("Save graphic file",fileFilers,True)
355-
355+
'Foolproofing
356+
If exportedFile <> Null Then
357+
'Writing new file
358+
Local tempOutputImage:TPixmap = GrabPixmap(0,0,640,480)
359+
SavePixmapPNG(tempOutputImage,exportedFile)
360+
EndIf
356361
'Settings textbox inputs
357362
'Scale
358363
Case TAppGUI.editSettingsZoomTextbox

0 commit comments

Comments
 (0)