HomeHome  CalendarCalendar  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log inLog in  

Share | 
 

 Crash when use Group::reallocate()

View previous topic View next topic Go down 
AuthorMessage
terror
Guest



PostSubject: Crash when use Group::reallocate()   Thu Mar 25, 2010 1:51 pm

Hi, my question concerning function SPK:: Group::reallocate () when I cause it, the program crash. It is a problem in the function or it is necessary to make something before it to cause?
Back to top Go down
Juff
Developer


Messages : 539
Date d'inscription : 2009-07-14
Age : 34

PostSubject: Re: Crash when use Group::reallocate()   Sun Mar 28, 2010 12:42 pm

Hi,

I will take a look at the code to check that.

But be aware that with a regular use of the engine, you normally dont have to call the reallocate method as it is slow (every arrays of data have to be recreated). Your groups should be built with their maximum capacity at construction and never be reallocated after that.

Anyway, i will check that.

Thanks for reporting.
Back to top Go down
View user profile http://spark.developpez.com
Terror



Messages : 2
Date d'inscription : 2010-03-27
Age : 31

PostSubject: Re: Crash when use Group::reallocate()   Sun Mar 28, 2010 1:43 pm

Thanks for the answer.
I use this function only in the editor.
As not always you know how many a maximum it is required on this or that effect. I have looked your code and have a little altered function, I am not assured that it correctly, but it works for me. I have added pool.clear (); and program falling have stopped. I use DX9Renderer and consequently it was necessary to make some changes to it.
1) has added DX9DestroyBuffers (group);
void DX9QuadRenderer:: destroyBuffers (const Group AND group)
{
group.destroyBuffer (VERTEX_BUFFER_NAME);
group.destroyBuffer (COLOR_BUFFER_NAME);
group.destroyBuffer (TEXTURE_BUFFER_NAME);
group.destroyBuffer (INDEX_BUFFER_NAME);
offsetIndex = 0;
DX9DestroyBuffers (group);
}
2) has changed in places in render () prepareBuffers () and DX9PrepareBuffers ()
void DX9QuadRenderer:: render (const Group AND group)
{
HRESULT hr = 0;
int nb_part = group.getNbParticles ();

if (! prepareBuffers (group))
return;

if (! DX9PrepareBuffers (group))
return;

D3DXMATRIX view;
...
}

Still I had problems with Model:: getParamValue (), I could not receive last parametre. I have corrected so:
float Model:: getParamValue (ModelParam type, size_t index) const
{
unsigned int nbValues = getNbValues (type);

if ((nbValues - 1> = index) && (nbValues! = 0))
return params [indices [type] + index];

return DEFAULT_VALUES [type];
}
Probably it was possible and so to make
if ((nbValues> index) && (nbValues! = 0))
Back to top Go down
View user profile
Juff
Developer


Messages : 539
Date d'inscription : 2009-07-14
Age : 34

PostSubject: Re: Crash when use Group::reallocate()   Fri Apr 02, 2010 1:34 pm

Hi,

yes you are right for the reallocate and the getParamValue stuff, I will fix them on the svn.

Regarding the directX9 issue, the module is not considered as stable at the moment and will be rebuilt with the version 2 of spark to come, so I dont touch it at the moment.

Thanks
Back to top Go down
View user profile http://spark.developpez.com
Sponsored content




PostSubject: Re: Crash when use Group::reallocate()   Today at 3:39 am

Back to top Go down
 
Crash when use Group::reallocate()
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Selecting Radio button in radio group
» What ethnical group do you belong to?
» RMD Group Halloween Photo Contest
» Webdrivers is Crashing IE8
» problem in selecting radio button in selenium RC

Permissions in this forum:You cannot reply to topics in this forum
 :: English Forum :: Evolution (en)-
Jump to: