- Joined
- Mar 28, 2008
- Messages
- 2,670
- Reaction score
- 799
- Points
- 128
New information. Based on the replies I got from martin in the other thread, and a few experiments, it turns out that the size of the animation list in orbiter indeed never shrinks. When an animation is deleted, it is kept in the list, but identified by having zero components.
So we literally have to do nothing to fix the issue in D3D9 client. Marking the animstates of deleted animations with -1 as suggested is still a good idea, and I'll see if there are any queries to that where a validation check is in order, but just removing the resizing of animstate in DelAnimation already seems to be producing stable results.
That's a good news, we don't have to speculate any longer. So, let's remove the code from DelAnimation and add some comments.
Commenting out the call to CheckVisual() in Scene::Initialise() fixes my issue, but I don't know why the call is in there in the first place. Might be that by taking it out we're creating other issues, though judging by the comments the only reason for the call is to create the visuals... which is exactly what shouldn't happen yet. Oppinions?
Yes, it should be safe to remove the code. The reason why the code is placed there is to load and construct visuals before letting Orbiter to start the clock. It was a sort of "pre-load vessel visuals" hack. When the D3D9 project was started there was a problem with too early simulation start. Several seconds of simulation were passed before the first frames were rendered.
It's also good to check the "Start Paused" launch pad option. At least in 2010-P1 it causes some callbacks being called in a different order.
Other problem causing issues are likely fixed from the Beta and some checks are probably no-longer needed.
PHP:
if (!parser) {
clbkPostCreation();
LogErr("clbkUpdate() called before clbkPostCreation()");
}
PHP:
if (nanim>0 && animstate==NULL) {
LogErr("[ANOMALY] UpdateAnimations() called before the animations are initialized. Calling InitAnimations()...");
InitAnimations();
}
PHP:
if (hSun==NULL) {
LogErr("Scene::Update() Scene not yet initialized");
//Initialise();
return;
}