Anything related in any way to game development as a whole is welcome here. Tell us about your game, grace us with your project, show us your new YouTube video, etc.
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...
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;
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...
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
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.
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".
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
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".
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"
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)
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?
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.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
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