Gamestudio Links
Zorro Links
Newest Posts
FXCM => AVA Trade Plugin???
by Martin_HH. 11/17/26 17:02
contractUpdate() is filtering if >2 rows
by mistery. 11/09/26 12:06
New Zorro version 3.15
by jcl. 11/09/26 09:24
Removing outliers from files
by jcl. 11/04/26 10:30
[MED] Import from FBX (2010) missing!!!
by rayp. 11/03/26 14:33
What are you working on?
by rayp. 11/02/26 13:57
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (Martin_HH, Quad, 1 invisible), 26,128 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rht, MaliceTheMaker, Haitao_Ren, JimSimons, julienp
19249 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Question about add_struct() #361133
03/01/11 02:13
03/01/11 02:13
Joined: Aug 2005
Posts: 238
Caermundh Offline OP
Member
Caermundh  Offline OP
Member

Joined: Aug 2005
Posts: 238
I can use add_struct() to mark an area of dynamically allocated memory that will then be saved when calling game_save()with SV_STRUCT.

My question is, once i have marked an area with add_struct, is there any way to unmark it? (say i allocate an area of memory to store an object, then that object is destroyed in game, so i release the memory). If there is no way to un-mark the memory, what happens when i have game_save() save an area of memeory that is no longer valid?

Re: Question about add_struct() [Re: Caermundh] #361140
03/01/11 04:34
03/01/11 04:34
Joined: Aug 2005
Posts: 238
Caermundh Offline OP
Member
Caermundh  Offline OP
Member

Joined: Aug 2005
Posts: 238
Another thing i thought of, if i have the following code:

typedef struct my_struct1
{ var my_var1;
var my_var2;
} my_struct1

typedef struct my_struct2
{ my_var3;
my_var4;
} my_struct2;

typedef struct my_struct3
{ my_var5;
my_var6;
my_struct1* struct1_ptr;
my_struct2* struct2_ptr;
struct my_struct3* next;
}

In order for game_save to save the *entire* my_struct3, i would have to do an add_struct for each of the structs, IE:

add_struct(my_struct3_ptr,sizeof(my_struct3));
add_struct(my_struct2_ptr,sizeof(my_struct2));
add_struct(my_struct1_ptr,sizeof(my_struct1));

is this correct?


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1