Page 2 of 2
Re: Vector arrays? ( luigi is a square lolz )
Posted: Wed Nov 24, 2010 11:38 am
by Falco Girgis
N64vSNES wrote:GyroVorbis wrote:Khearts wrote:I thought NULL == 0...?
It does. That's not the point, though.
If comparing a pointer to 0 were a good practice, why the hell would the keyword/macro NULL even exist? It's not a good practice.
I didn't think that assigning pointers to 0 was that big of a deal since the NULL marco is defined as 0 to begin with.
I suppose its better for readability so I'll start using NULL.
And yes I changed it from
std::Vector <Eternal::Npc> Npcs;
to
std::Vector <Eternal::Npc> Npcs;
Then dynamicly allocate a NPC and pass that onto the array and deallocate it when the NPC gets removed, this wasn't the issue?
First of all, I'm pretty sure you are forgetting an asterisk in your second line there.
Second of all, your previous post did not mention that you actually changed the datatype of the vector itself to contain NPC pointers, you simply said that you began PASSING a pointer.
Third of all, this means that however you were shallow copying one NPC to another was fucking the texture up. While the dynamic method (that you are using now), is probably preferred, for performance reasons (you aren't literally copying the data from point A to B upon insertion), the previous method should have worked as well...
Re: Vector arrays? ( luigi is a square lolz )
Posted: Wed Nov 24, 2010 11:43 am
by N64vSNES
GyroVorbis wrote:N64vSNES wrote:GyroVorbis wrote:Khearts wrote:I thought NULL == 0...?
It does. That's not the point, though.
If comparing a pointer to 0 were a good practice, why the hell would the keyword/macro NULL even exist? It's not a good practice.
I didn't think that assigning pointers to 0 was that big of a deal since the NULL marco is defined as 0 to begin with.
I suppose its better for readability so I'll start using NULL.
And yes I changed it from
std::Vector <Eternal::Npc> Npcs;
to
std::Vector <Eternal::Npc> Npcs;
Then dynamicly allocate a NPC and pass that onto the array and deallocate it when the NPC gets removed, this wasn't the issue?
First of all, I'm pretty sure you are forgetting an asterisk in your second line there.
Second of all, your previous post did not mention that you actually changed the datatype of the vector itself to contain NPC pointers, you simply said that you began PASSING a pointer.
Third of all, this means that however you were shallow copying one NPC to another was fucking the texture up. While the dynamic method (that you are using now), is probably preferred, for performance reasons (you aren't literally copying the data from point A to B upon insertion), the previous method should have worked as well...
Yeah sorry my bad, I meant to say
from this
std::Vector <Eternal::Npc> Npcs;
to this
std::Vector <Eternal::Npc*> Npcs;
:P I've not had much coffee today lol
So which method would you recommend?
Re: Vector arrays? ( luigi is a square lolz )
Posted: Wed Nov 24, 2010 12:05 pm
by dandymcgee
N64vSNES wrote:So which method would you recommend?
Did you even read Gyro's post?
GyroVorbis wrote:While the dynamic method (that you are using now), is probably preferred, for performance reasons (you aren't literally copying the data from point A to B upon insertion), the previous method should have worked as well...
Re: Vector arrays? ( luigi is a square lolz )
Posted: Wed Nov 24, 2010 12:12 pm
by N64vSNES
dandymcgee wrote:N64vSNES wrote:So which method would you recommend?
Did you even read Gyro's post?
GyroVorbis wrote:While the dynamic method (that you are using now), is probably preferred, for performance reasons (you aren't literally copying the data from point A to B upon insertion), the previous method should have worked as well...
GyroVorbis wrote:While the dynamic method (that you are using now), is probably preferred
the previous method should have worked as well
Dosen't sound like he's backing any perticular method, I was asking what method he personaly would use.
Re: Vector arrays? ( luigi is a square lolz )
Posted: Wed Nov 24, 2010 12:17 pm
by dandymcgee
N64vSNES wrote:
Dosen't sound like he's backing any perticular method, I was asking what method he personaly would use.
Then what does "probably preferred, for performance reasons (you aren't literally copying the data from point A to B upon insertion)" sound like to you?
Perhaps you should grab a dictionary and look up "preferred" vs. "works".
Re: Vector arrays? ( luigi is a square lolz )
Posted: Wed Nov 24, 2010 12:26 pm
by N64vSNES
dandymcgee wrote:N64vSNES wrote:
Dosen't sound like he's backing any perticular method, I was asking what method he personaly would use.
Then what does "probably preferred, for performance reasons (you aren't literally copying the data from point A to B upon insertion)" sound like to you?
Perhaps you should grab a dictionary and look up "preferred" vs. "works".
Perhaps you need to chill the fuck out?
Now isn't that better
Re: Vector arrays? ( luigi is a square lolz )
Posted: Wed Nov 24, 2010 1:25 pm
by dandymcgee
N64vSNES wrote:
Perhaps you need to chill the fuck out?
Now isn't that better
No need to get hostile. Simply pointing out that your question was already answered by Falco. Apparently you missed it the first time through.
Every heard the phrase, "Ask me a dumb question, I'll give you a dumb answer."?
Re: Vector arrays? ( luigi is a square lolz )
Posted: Thu Nov 25, 2010 9:26 am
by N64vSNES
dandymcgee wrote:N64vSNES wrote:
Perhaps you need to chill the fuck out?
Now isn't that better
No need to get hostile. Simply pointing out that your question was already answered by Falco. Apparently you missed it the first time through.
Every heard the phrase, "Ask me a dumb question, I'll give you a dumb answer."?
I'm not trying to get "hostile" but what your not getting is Gyro said dynamicly allocating the NPC every time you want to add one to the vector would slow take more processing power which is fair enough but he also said that method is probably "preferred", what I'm asking is what he would use because I'm not sure if he is saying
"No I wouldn't use that method because of the extra processing power it needs"
or he's saying
"I wouldn't use this method because of the extra processing power however its probably the generally prefered so its cool"
No need to start world war 3 eh?
Re: Vector arrays? ( luigi is a square lolz )
Posted: Thu Nov 25, 2010 12:39 pm
by Falco Girgis
N64vSNES wrote:Gyro said dynamicly allocating the NPC every time you want to add one to the vector would slow take more processing power
GyroVorbis wrote:While the dynamic method (that you are using now), is probably preferred, for performance reasons (you aren't literally copying the data from point A to B upon insertion)
Orly?
Re: Vector arrays? ( luigi is a square lolz )
Posted: Thu Nov 25, 2010 1:49 pm
by N64vSNES
GyroVorbis wrote:N64vSNES wrote:Gyro said dynamicly allocating the NPC every time you want to add one to the vector would slow take more processing power
GyroVorbis wrote:While the dynamic method (that you are using now), is probably preferred, for performance reasons (you aren't literally copying the data from point A to B upon insertion)
Orly?
Ok my bad I totally misread it even the second time
So dynamicly allocating them
is the best way to go?
Re: Vector arrays? ( luigi is a square lolz )
Posted: Thu Nov 25, 2010 3:00 pm
by dandymcgee
N64vSNES wrote:GyroVorbis wrote:N64vSNES wrote:Gyro said dynamicly allocating the NPC every time you want to add one to the vector would slow take more processing power
GyroVorbis wrote:While the dynamic method (that you are using now), is probably preferred, for performance reasons (you aren't literally copying the data from point A to B upon insertion)
Orly?
Ok my bad I totally misread it even the second time
So dynamicly allocating them
is the best way to go?
Yes. I see what you mean, Falco may have abused his commas just a bit.
Re: Vector arrays? ( luigi is a square lolz )
Posted: Thu Nov 25, 2010 3:10 pm
by N64vSNES
dandymcgee wrote:N64vSNES wrote:GyroVorbis wrote:N64vSNES wrote:Gyro said dynamicly allocating the NPC every time you want to add one to the vector would slow take more processing power
GyroVorbis wrote:While the dynamic method (that you are using now), is probably preferred, for performance reasons (you aren't literally copying the data from point A to B upon insertion)
Orly?
Ok my bad I totally misread it even the second time
So dynamicly allocating them
is the best way to go?
Yes. I see what you mean, Falco may have abused his commas just a bit.
Yeah lol, I'm still bad at misreading things.
Thanks though guys I learn somthing new every day since I thought dynamicly allocating all that crap would be slower than copying the data
Re: Vector arrays? ( luigi is a square lolz )
Posted: Fri Nov 26, 2010 3:08 pm
by adikid89
N64vSNES wrote:Yeah lol, I'm still bad at misreading things.
I think you meant "Yeah lol, I'm pretty good at misreading things."
Re: Vector arrays? ( luigi is a square lolz )
Posted: Sat Nov 27, 2010 7:44 am
by N64vSNES
adikid89 wrote:N64vSNES wrote:Yeah lol, I'm still bad at misreading things.
I think you meant "Yeah lol, I'm pretty good at misreading things."
Meh, thats kinda how we talk round'er