Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (degenerate_762, ozgur, AndrewAMD), 1,289 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Does ptr_remove(PANEL*) removes bmap? #431579
10/18/13 19:58
10/18/13 19:58
Joined: Apr 2006
Posts: 159
Latvija
Arrovs Offline OP
Member
Arrovs  Offline OP
Member

Joined: Apr 2006
Posts: 159
Latvija
As perfect question can be. Please could i get some brightness?
Im often changing bmaps in my panels, but im confused what will happen at removing panels.Do i have to remove BMAP first or it will go together? Or i will fill up memory with bmaps when not doing it.

Last edited by Arrovs; 10/18/13 19:59.

Arrovs once will publish game
Re: Does ptr_remove(PANEL*) removes bmap? [Re: Arrovs] #431580
10/18/13 20:15
10/18/13 20:15
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Well it is a struct which contains a pointer to a struct.
So you have to remove both.

Re: Does ptr_remove(PANEL*) removes bmap? [Re: Ch40zzC0d3r] #431581
10/18/13 21:01
10/18/13 21:01
Joined: Apr 2006
Posts: 159
Latvija
Arrovs Offline OP
Member
Arrovs  Offline OP
Member

Joined: Apr 2006
Posts: 159
Latvija
did some tests, but i have feeling it remove bmap in some cases and in some dont.

PANEL* panel = pan_create("bmap = test.bmp", 1);
this seems to remove bmap too - atleast i dont see used memory growing when removing this.

PANEL* panel = pan_create("bmap = NULL", 1);
panel.bmap = test;
In this case it seems dont remove it.

So i need to be vary in situation like this
PANEL* panel = pan_create("bmap = test.bmp", 1);
ptr_remove(panel.bmap);
Because it seems im removing all images who now used test.bmp.

I have feeling pan_create makes global bmaps. So in first case it deletes panel, but possibly left bmap undeleted.


Arrovs once will publish game
Re: Does ptr_remove(PANEL*) removes bmap? [Re: Arrovs] #431582
10/18/13 21:15
10/18/13 21:15
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Well, in this case its somethign different I believe.
Creating them dynamicly could change my theory, so why not use draw_quad with the bmap pointer and see if the bmap will stay or not?

If you do it like this:
Code:
PANEL* panel = pan_create("bmap = test.bmp", 1);
ptr_remove(panel);



You cant check for panel.bmap because the panel pointer is invalid after ptr_remove call.

Re: Does ptr_remove(PANEL*) removes bmap? [Re: Ch40zzC0d3r] #431583
10/18/13 21:46
10/18/13 21:46
Joined: Apr 2006
Posts: 159
Latvija
Arrovs Offline OP
Member
Arrovs  Offline OP
Member

Joined: Apr 2006
Posts: 159
Latvija
i tried what you said and it really removes bmap in this case
BMAP* bmap;
PANEL* panel = pan_create("bmap = testa_bilde.bmp", 1);
bmap = panel.bmap;

I then added this bmap to other panel and after removing first panel second left without bmap. So in this case it removes bmap too;

But in case i added bmap after creating;
PANEL* panel = pan_create("bmap = NULL", 1);
panel.bmap = bmap;
Removing panel didnt remove bmap.

So now i know it, but it will make all tracking harded for deleted and undeleted things.


Arrovs once will publish game

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

Gamestudio download | chip programmers | 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