- Joined
- Mar 28, 2008
- Messages
- 2,708
- Reaction score
- 881
- Points
- 128
I don't know about logicalWOW64 means [W]indows [O]n [W]indows-[64], so in that folder the 32bit world lives - logical, right?
I don't know about logicalWOW64 means [W]indows [O]n [W]indows-[64], so in that folder the 32bit world lives - logical, right?
000000.000: ---------------------------------------------------------------
000000.000: D3D9 DLLs : C:\WINDOWS\SYSTEM32\d3d9.dll [v 10.0.19041.928]
000000.000: : C:\WINDOWS\SYSTEM32\d3dx9_43.dll [v 9.29.952.3111]
000000.000: ---------------------------------------------------------------
Sadly, we don't have any readme yet. There's been lot of new things to learn and I haven't found the time to write that. Also some things regarding the build process are still under development.Still no luck compiling D3D9Client, and getting more confused ....
Is there a readme that explains the steps to compile, including prerequisites that need to be installed?
I installed the DirectX End-User Runtimes (June 2010) package. Do I also need to install any NVidia SDK stuff?
I haven't tried the "Ninja" yet, so, I don't know how that works yet. I have used the CMake-GUI to create VS Solution and Project files and after that I have clicked the D3D9Client.sln to launch the VS and build the projects from there. Usually I have removed BUILD_ALL, INSTALL "Projects" from the Solution.Should this compile with CMake, using the provided CMakeLists.txt, or do I have to use the VS solution files directly?
Yes, that is correct, the same that is used to build the Orbiter. And the CMAKE_SOURCE_DIR must point to the local D3D9Client.git repository.When compiling with CMake, the CMAKE_BINARY_DIR has to point to an Orbiter installation, correct?
No, I have no idea what happens if someone tries that. CMake should copy all necessary files to CMAKE_BINARY_DIR. Also CMake should copy/update the Shaders during every build.When compiling directly from the VS solution directory, does the D3D9Client git repository have to be placed directly inside an Orbiter installation?
I have left the old project files in-place just in case if we need them. There's been no reports regarding "_wassert" and it's been there probably 2-3 years. I have no idea why it fails.I found VS solution files in Orbitersdk/D3D9Client, but the VS2019 version only seems to be set up for x86. Should I use the VS2015 version and convert to VS2019?
I got errors relating to _wassert, had to convert all instances to assert. Has this been seen before?
#if defined(NDEBUG)
#define _wassert(message,filename,line)
#endif
#undef assert
#define assert(x) (x)
#ifdef NDEBUG
#define assert(expression) ((void)0)
#else
...
It's great hear that it finally worked. I googled about the NDEBUG (i.e. NO DEBUG) flag and it would seem to work as intended. It's purpose seem to be disabling these debug assertions. I have never used NDEBUG flag and it looks like CMake would define it for Release builds. I wonder are there any alternatives for asserts we could use. Or should we try to undefine NDEBUG and let the asserts to work ?I finally managed to compile D3D9Client x64 and run it under Orbiter x64! Thanks for your help in getting my problems worked out.
I have defined my own macros (in Src/Orbiter/Log.h: ASSERT and dASSERT). Log.h isn't currently exported to the SDK, so probably not visible to external plugin code. If it looks useful, I could copy it to Orbitersdk/include.How are the things with the rest of the Orbiter regarding assert behavior ?
That is fine as long as you are not relying on the side effect of the argument of assert() being evaluated even if the assertion is not tested. So you can doNever had problems with assert(): it's there in debug builds to catch programmer errors (hard-coded stuff and not, e.g., file parse errors), and in release builds all that "instrumentation" disappears.
assert macros should never contain code that needs to run in production. i.e., the assert documentation says this:This macro is disabled if, at the moment of including <assert.h>, a macro with the name NDEBUG has already been defined. This allows for a coder to include as many assert calls as needed in a source code while debugging the program and then disable all of them for the production version by simply including a line like:
#define NDEBUG
at the beginning of the code, before the inclusion of <assert.h>.
Therefore, this macro is designed to capture programming errors, not user or run-time errors, since it is generally disabled after a program exits its debugging phase.
assert , which may or may not run in production builds (and having any assert macros run in production builds is counter-intuitive, at least to me). But that's just my perspective, which may or may not be "correct". Therefore, this macro is designed to capture programming errors, not user or run-time errors, since it is generally disabled after a program exits its debugging phase.
For runtime errors you can throw an exception, catch it somewhere upstream, log the error and exit.We have used the assert to capture user and run-time errors as well. I thought it's better to assert when something goes very wrong rather than CTD in some point later on. So, is there a better way to capture run-time errors in release builds (hopefully equally easy) ?
For runtime errors you can throw an exception, catch it somewhere upstream, log the error and exit.
const int myResult = DoSomethingCool(...);
PRODUCTION_ASSERT((myResult > 0), "DoSomethingCool returned a bad value!");
PRODUCTION_ASSERT((DoSomethingCool(...) > 0), "DoSomethingCool returned a bad value!");
Maybe not intentionally, but as mentioned by several people now it is used for many compile-dependent things.[,,,] I have never used NDEBUG flag [...]
_DEBUG definition per default[*]NDEBUG definition accordingly._DEBUG when you specify the /MTd or /MDd optionBy default Orbiter uses incremental animations meaning that for each frame the previous animation state is incremented by small amount, which includes some errors, over time these errors accumulate and the animation is no longer in the orientation it's supposed to be. (3-10 mins in worst cases)What exactly does the "Enable absolute animation handling" option do, and is there any good reason for it to not be enabled by default?
Hi jarmonik.Absolute animations updates the animation state from a default state for each frame. Which doesn't suffer from the error mentioned. But the absolute animations can fail if an add-on alters the order of operations (rotations), so, it's not 100% backwards compatible. But so-far no add-on is known to fail.

// Gear anims
//Front Gear
static UINT GGrp1[9] = {6,7,8,9,10,11,12,13,125};
static MGROUP_ROTATE gear1 (0,GGrp1, 9, _V(0,-0.9227885,3.099234), _V(1,0,0), (float)(-115*RAD));
//Rear Gear Left
static UINT GGrp2[4] = {14,15,16,126};
static MGROUP_ROTATE gear2 (0,GGrp2, 4, _V(-1.15901,-0.4520788,-2.172986), _V(1,0,0), (float)(-99*RAD));
//Rear Gear Right
static UINT GGrp3[4] = {18,20,21,127};
static MGROUP_ROTATE gear3 (0,GGrp3, 4, _V(1.15901,-0.4520788,-2.172986), _V(1,0,0), (float)(-99*RAD));
//Front Gear Cover
static UINT GGrp5[1] = {5};
static MGROUP_ROTATE gear5 (0,GGrp5, 1, _V(0.2282761,-0.870366,3.679197), _V(0,0,1), (float)(-93*RAD));
//Rear Cover Left
static UINT GGrp12[2] = {173,174};
static MGROUP_ROTATE gear12 (0,GGrp12, 2, _V(-1.199155,-0.3544314,-1.368714), _V(0,0,1), (float)(99*RAD));
//Rear Cover Right
static UINT GGrp13[2] = {175,176};
static MGROUP_ROTATE gear13 (0,GGrp13, 2, _V(1.199155,-0.3544314,-1.368714), _V(0,0,1), (float)(-99*RAD));
//Rear Gear Left2
static UINT GGrp20[5] = {14,15,16,17,126};
static MGROUP_ROTATE gear20 (0,GGrp20, 5, _V(-1.15901,-0.4520788,-2.172986), _V(0,0,1), (float)(15*RAD));
//Rear Gear Right2
static UINT GGrp21[5] = {18,19,20,21,127};
static MGROUP_ROTATE gear21 (0,GGrp21, 5, _V(1.15901,-0.4520788,-2.172986), _V(0,0,1), (float)(-15*RAD));
//Rear Gear Left3
static UINT GGrp23[1] = {17};
static MGROUP_ROTATE gear23 (0,GGrp23, 1, _V(-1.15901,-0.4969712,-1.226534), _V(1,0,0), (float)(50*RAD));
//Rear Gear Right3
static UINT GGrp24[1] = {19};
static MGROUP_ROTATE gear24 (0,GGrp24, 1, _V(1.15901,-0.4969712,-1.226534), _V(1,0,0), (float)(50*RAD));
anim_gear = CreateAnimation (0);
AddAnimationComponent (anim_gear, 0, 0.5, &gear1);
AddAnimationComponent (anim_gear, 0.2, 0.5, &gear2);
AddAnimationComponent (anim_gear, 0.2, 0.5, &gear3);
AddAnimationComponent (anim_gear, 0.5, 1, &gear5);
AddAnimationComponent (anim_gear, 0.5, 1, &gear12);
AddAnimationComponent (anim_gear, 0.5, 1, &gear13);
AddAnimationComponent (anim_gear, 0, 0.2, &gear20);
AddAnimationComponent (anim_gear, 0, 0.2, &gear21);
AddAnimationComponent (anim_gear, 0.2, 0.5, &gear23);
AddAnimationComponent (anim_gear, 0.2, 0.5, &gear24);
Excellent idea, thank you.Also we could have something like oapiEnableAbsoluteAnimations(VISHANDLE hVisual, bool bSetEnabled) so that absolute animations could be disabled by default and then enabled for vessels those depend on it. The error accumulation isn't a problem in landing gear but it does create problems with robotic arms and ADI balls.