diff --git a/OVP/D3D9Client/VVessel.cpp b/OVP/D3D9Client/VVessel.cpp index ad61dba0e..57166d0a8 100644 --- a/OVP/D3D9Client/VVessel.cpp +++ b/OVP/D3D9Client/VVessel.cpp @@ -2032,7 +2032,7 @@ static inline const int clip(int v, int vMin, int vMax) inline const char *value_string (char *buf, size_t buf_size, double val) { - static const char unit_prefixes[] = { (char)230/*'µ'*/, 'm', '\0', 'k' , 'M' , 'G' , 'T' , 'P'}; + static const char unit_prefixes[] = { (char)181/*'µ'*/, 'm', '\0', 'k' , 'M' , 'G' , 'T' , 'P'}; int index = (int) (log10(val)) / 3; val /= pow(10.0, index*3); diff --git a/OVP/D3D9Client/samples/GenericCamera/MFD.cpp b/OVP/D3D9Client/samples/GenericCamera/MFD.cpp index 2c7baf6b3..7275a6ad1 100644 --- a/OVP/D3D9Client/samples/GenericCamera/MFD.cpp +++ b/OVP/D3D9Client/samples/GenericCamera/MFD.cpp @@ -443,7 +443,7 @@ bool CameraMFD::Update(oapi::Sketchpad *pSkp) hShell->Title (pSkp, text); - sprintf_s(text, 256, "[%s] FOV=%0.0f° Ofs=%2.2f[m]", paci[bParent], fov*2.0, offset); + sprintf_s(text, 256, "[%s] FOV=%0.0f%c Ofs=%2.2f[m]", paci[bParent], fov*2.0, (char)176/*°*/, offset); pSkp->Text(10, H - tbgh, text, lstrlen(text)); diff --git a/Orbitersdk/include/DrawAPI.h b/Orbitersdk/include/DrawAPI.h index 7af58ca10..bc85c6887 100644 --- a/Orbitersdk/include/DrawAPI.h +++ b/Orbitersdk/include/DrawAPI.h @@ -443,7 +443,9 @@ namespace oapi { */ typedef union FMATRIX4 { - FMATRIX4() {} + FMATRIX4() { + m11 = m12 = m13, m14 = m21 = m22 = m23 = m24 = m31 = m32 = m33 = m34 = m41 = m42 = m43 = m44 = 0; + } FMATRIX4(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, diff --git a/Src/Orbiter/Vessel.cpp b/Src/Orbiter/Vessel.cpp index 1adb7a5ff..dceb9b03b 100644 --- a/Src/Orbiter/Vessel.cpp +++ b/Src/Orbiter/Vessel.cpp @@ -7695,7 +7695,7 @@ void VESSEL::ShiftCG (const VECTOR3 &shift) vessel->ShiftDocks (vs); vessel->ShiftLightEmitters (nshift); vessel->campos.Set (vessel->campos+vs); - if (g_pane) g_pane->ShiftVC (vs); + if ((g_pane) && (g_focusobj == vessel)) g_pane->ShiftVC (vs); ShiftCentreOfMass (shift); } diff --git a/Src/Vessel/Atlantis/Atlantis/AscentAP.cpp b/Src/Vessel/Atlantis/Atlantis/AscentAP.cpp index 8d4aefecf..e6ab5ae45 100644 --- a/Src/Vessel/Atlantis/Atlantis/AscentAP.cpp +++ b/Src/Vessel/Atlantis/Atlantis/AscentAP.cpp @@ -658,11 +658,12 @@ void AscentApMfd::UpdatePg_Gbl (oapi::Sketchpad *skp) { double pitch, yaw; int i; - int s2 = W/16; + int iW = (int)W; + int s2 = iW/16; int s1 = s2*2; - int cx = W/2; + int cx = iW/2; int cy = ch*3+s1; - int ssme_cx[3] = {(2*W)/10, (8*W)/10, cx}; + int ssme_cx[3] = {(2*iW)/10, (8*iW)/10, cx}; int ssme_cy[3] = {cy+(3*s1)/2, cy+(3*s1)/2, cy}; skp->SetTextAlign (oapi::Sketchpad::CENTER); @@ -674,7 +675,7 @@ void AscentApMfd::UpdatePg_Gbl (oapi::Sketchpad *skp) if (ap->GetVessel()->status < 2) { int srb_cy = H-s1-ch; - int srb_cx[2] = {(2*W)/10, (8*W)/10}; + int srb_cx[2] = {(2*iW)/10, (8*iW)/10}; skp->Line (0, srb_cy-s1-ch*2, W, srb_cy-s1-ch*2); skp->Text (W/2, srb_cy-s1-(3*ch)/2, "Gimbal SRB", 10); for (i = 0; i < 2; i++) { @@ -1455,9 +1456,9 @@ const char *MetStr (double met) } else str[0] = ' '; h = (int)(met/3600.0); - met -= h*3600; + met -= (double)h*3600; m = (int)(met/60.0); - met -= m*60; + met -= (double)m*60; int nh = (h < 100 ? 2:3); h = min(h,999); sprintf (str+1, "%0*d:%02d:%04.1f", nh, h, m, met); diff --git a/Src/Vessel/DeltaGlider/FuelMfd.cpp b/Src/Vessel/DeltaGlider/FuelMfd.cpp index ba53d77eb..b8b8ec58f 100644 --- a/Src/Vessel/DeltaGlider/FuelMfd.cpp +++ b/Src/Vessel/DeltaGlider/FuelMfd.cpp @@ -78,7 +78,7 @@ void FuelMFD::ResetVC (DEVMESHHANDLE hMesh) vc_grp.nVtx = 20; if (!vc_grp.Vtx) vc_grp.Vtx = new NTVERTEX[vc_grp.nVtx]; - GROUPEDITSPEC ges = { GRPEDIT_SETUSERFLAG, isScram ? 3 : 0, 0, 0, 0 }; + GROUPEDITSPEC ges = { GRPEDIT_SETUSERFLAG, (DWORD)(isScram ? 3 : 0), 0, 0, 0 }; oapiEditMeshGroup(hMesh, GRP_PROPELLANT_STATUS_NOSCRAM_VC, &ges); ges.UsrFlag = (isScram ? 0 : 3); oapiEditMeshGroup(hMesh, GRP_PROPELLANT_STATUS_SCRAM_VC, &ges); diff --git a/Src/Vessel/DeltaGlider/GearSubsys.cpp b/Src/Vessel/DeltaGlider/GearSubsys.cpp index 113594161..d014b958f 100644 --- a/Src/Vessel/DeltaGlider/GearSubsys.cpp +++ b/Src/Vessel/DeltaGlider/GearSubsys.cpp @@ -401,7 +401,7 @@ bool GearIndicator::RedrawVC (DEVMESHHANDLE hMesh, SURFHANDLE surf) GROUPEDITSPEC ges; static WORD vtxofs = VC_GEAR_INDICATOR_vofs; static const DWORD nvtx = 2; - static WORD vidx[nvtx] = {vtxofs,vtxofs+1}; + static WORD vidx[nvtx] = {vtxofs,(WORD)(vtxofs+1)}; static float v[2] = {0.2427f,0.3042f}; NTVERTEX vtx[nvtx]; for (DWORD i = 0; i < nvtx; i++) diff --git a/Src/Vessel/DeltaGlider/LightSubsys.cpp b/Src/Vessel/DeltaGlider/LightSubsys.cpp index 8c924bf0e..45c4ed2a8 100644 --- a/Src/Vessel/DeltaGlider/LightSubsys.cpp +++ b/Src/Vessel/DeltaGlider/LightSubsys.cpp @@ -86,7 +86,7 @@ void InstrumentLight::SetLight (bool on, bool force) mat.emissive.b *= scale; } oapiSetMaterial (DG()->vcmesh, 11, on ? &mat : &norm); - GROUPEDITSPEC ges = {on ? GRPEDIT_ADDUSERFLAG : GRPEDIT_DELUSERFLAG, 0x18, 0,0,0}; + GROUPEDITSPEC ges = {(DWORD)(on ? GRPEDIT_ADDUSERFLAG : GRPEDIT_DELUSERFLAG), 0x18, 0,0,0}; oapiEditMeshGroup (DG()->vcmesh, GRP_LIT_LABELS_VC, &ges); } } diff --git a/Src/Vessel/DeltaGlider/MomentInd.cpp b/Src/Vessel/DeltaGlider/MomentInd.cpp index 73bf29033..c97ad8fd8 100644 --- a/Src/Vessel/DeltaGlider/MomentInd.cpp +++ b/Src/Vessel/DeltaGlider/MomentInd.cpp @@ -73,7 +73,7 @@ void AngRateIndicator::ResetVC (DEVMESHHANDLE hMesh) if (!vtxbuf_VC) { vtxbuf_VC = new NTVERTEX[nvtx]; - GROUPREQUESTSPEC grs = {vtxbuf_VC, nvtx, 0, 0, 0, 0, 0, 0}; + GROUPREQUESTSPEC grs = {vtxbuf_VC, (DWORD)nvtx, 0, 0, 0, 0, 0, 0}; oapiGetMeshGroup(hMesh, GRP_ANGVEL_DISP_OVR_VC, &grs); w0_VC = (double)vtxbuf_VC[0].x - (double)vtxbuf_VC[1].x; for (i = 0; i < 3; i++) { @@ -207,7 +207,7 @@ bool AngRateIndicator::RedrawVC (DEVMESHHANDLE hMesh, SURFHANDLE surf) } } - GROUPEDITSPEC ges = {GRPEDIT_VTXCRD, 0, vtx, nvtx, 0}; + GROUPEDITSPEC ges = {GRPEDIT_VTXCRD, 0, vtx, (DWORD)nvtx, 0}; oapiEditMeshGroup(hMesh, GRP_ANGVEL_DISP_OVR_VC, &ges); return false; }