Saved Game screenshot Bads
Displaying 1-4 of 4 total.
1
Khalil
|
Ok here's the thing, saving games works great; writevars and loadvars from files; the thing is I made a screen shot thing.... code goes something like this.
screenshot=malloc...
grabregion(blah
openfile
save all vars
closefile
free screenshot
now when I load the screenshot;
openfile
loadvars
closefile
copysprite(screenshot
free screenshot
sometimes it gets garbled... need more info just ask.... Thanks.
Posted on 2001-03-15 06:29:59
|
Devon
|
As far as I know, (never used it) WriteVars does not save the contents of any image pointers, only the value of the pointer itself. I don't know how the image could still exist at all following the example given. You would have to write the image to a file byte by byte and read it back the same way to do something like that.
-Devon
---
Square's making money.
We're making art.
Posted on 2001-03-15 13:48:21
|
grenideer
|
A lot of people hate REad/WriteVars because you are supposed to free all image pointers and such before using it. It was never a problem for me because I free stuff like that right after I first blit it to the screen. To my knowledge, I suspect Devon is right.
Maybe you could write the malloc(screenshot) info to a file and reload it when loading a game? Also, I'm not sure what you need the screenshot for, but there may be another way to do what you intend. Like cataloging several premade screenshots, or drawing the screenshot on the fly based on a set of saved variables.
On a sidenote, do you use v2.6? Whenever I ReadVars in the windows version it takes about 20 seconds to load the info. Does this happen to you?
Posted on 2001-03-16 03:03:22
|
Khalil
|
Readvars takes less than a sec, I load and save from and to files all the time; The screenshot was just to show where the character was when he/she saved the game, I replaced it with a window that shows what the character was wearing.
About the readwrite vars; my computer is very fast, I use v2k+j and even if I palletmorph every frame click it goes quick, I didn't even notice the difference till I tried it on a P500, and the palletmorph slowed it down lots.
Posted on 2001-03-17 13:52:45
|