- Joined
- Mar 28, 2008
- Messages
- 2,668
- Reaction score
- 796
- Points
- 128
Yes, I agree. It happens easily here too, just checking out a few things before going to sleep and then suddenly it's 4am at morning.Ah ok, I'll look into that. I was pushing out the new commit after 4am this morning, which is never a good idea, especially if you have to get up a few hours later for work :zzz:
Anyway, it looks as if I left a superfluous oapiMeshMaterial call in the loop. That line should probably go.
I actually added that to initialize the material structure before modifying it and setting it back to the mesh.
---------- Post added at 19:43 ---------- Previous post was at 17:46 ----------
I got the MFD brightness to work in inline engine and D3D9.
Looks like "vis" is NULL in void Atlantis::UpdateMesh () with the inline engine but appears to be properly initialized elsewhere ??
Adding oapiMeshMaterial() in this section fixed the problem with the MFD brightness:
PHP:
} else if (event & PANEL_MOUSE_LBPRESSED) {
double dt = oapiGetSysTime()-t0;
double brt, dbrt = dt * 0.2;
if (up) brt = min (1.0, brt0 + dbrt);
else brt = max (0.25, brt0 - dbrt);
mfdbright[mfd] = brt;
if (vis) {
MATERIAL mat;
DEVMESHHANDLE hMesh = GetDevMesh (vis, mesh_vc);
oapiMeshMaterial (hMesh, 10+mfd, &mat);
mat.emissive.r = mat.emissive.g = mat.emissive.b = (float)brt;
oapiSetMaterial (hMesh, 10+mfd, &mat);
}
}
} return false;
Last edited: