Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

105 fix cppcheck issues #130

Merged
merged 15 commits into from
Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions OVP/D3D7Client/CelSphere.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,16 @@ void CelestialSphere::LoadStars ()
gc->SetDefault (vbdesc);
vbdesc.dwFVF = D3DFVF_XYZ | D3DFVF_DIFFUSE;

struct StarRec {
float lng, lat, mag;
} *data = new StarRec[buflen];

if (prm->mag_lo <= prm->mag_hi) return;

// Read binary data from file
FILE *f = fopen ("Star.bin", "rb");
if (!f) return;

struct StarRec {
float lng, lat, mag;
} *data = new StarRec[buflen];

while (nv = fread (data, sizeof(StarRec), buflen, f)) {
// limit number of stars to predefined magnitude - SHOULD BE BINARY SEARCH
for (i = 0; i < nv; i++)
Expand All @@ -110,7 +111,7 @@ void CelestialSphere::LoadStars ()
for (j = 0; j < nv; j++) {
StarRec &rec = data[j];
VERTEX_XYZC &v = vbuf[j];
xz = sphere_r * cos (rec.lat);
xz = (double)sphere_r * cos (rec.lat);
v.x = (float)(xz * cos (rec.lng));
v.z = (float)(xz * sin (rec.lng));
v.y = (float)(sphere_r * sin (rec.lat));
Expand Down
1 change: 1 addition & 0 deletions OVP/D3D7Client/CloudMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ CloudManager::CloudManager (const D3D7Client *gclient, const vPlanet *vplanet)
lightfac = *(double*)gc->GetConfigParam (CFGPRM_SURFACELIGHTBRT);
nmask = 0;
nhitex = nhispec = 0;
cloudtexidx = 0;

atmc = oapiGetPlanetAtmConstants (obj);

Expand Down
6 changes: 3 additions & 3 deletions OVP/D3D7Client/surfmgr2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -650,9 +650,9 @@ void SurfTile::MatchEdges ()
edgeok = true;
if (!mesh) return; // sanity check

QuadTreeNode<SurfTile> *lngnbr = smgr->FindNode (lvl, ilat, ilng + (ilng & 1 ? 1 : -1));
QuadTreeNode<SurfTile> *latnbr = smgr->FindNode (lvl, ilat + (ilat & 1 ? 1 : -1), ilng);
QuadTreeNode<SurfTile> *dianbr = smgr->FindNode (lvl, ilat + (ilat & 1 ? 1 : -1), ilng + (ilng & 1 ? 1 : -1));
QuadTreeNode<SurfTile> *lngnbr = smgr->FindNode (lvl, ilng + (ilng & 1 ? 1 : -1), ilat);
QuadTreeNode<SurfTile> *latnbr = smgr->FindNode (lvl, ilng, ilat + (ilat & 1 ? 1 : -1));
QuadTreeNode<SurfTile> *dianbr = smgr->FindNode (lvl, ilng + (ilng & 1 ? 1 : -1), ilat + (ilat & 1 ? 1 : -1));

if (lngnbr && !(lngnbr->Entry()->state & TILE_VALID)) lngnbr = 0;
if (latnbr && !(latnbr->Entry()->state & TILE_VALID)) latnbr = 0;
Expand Down
2 changes: 1 addition & 1 deletion OVP/D3D7Client/tilemgr2_imp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// -----------------------------------------------------------------------

template<class TileType>
QuadTreeNode<TileType> *TileManager2Base::FindNode (QuadTreeNode<TileType> root[2], int lvl, int ilat, int ilng)
QuadTreeNode<TileType> *TileManager2Base::FindNode (QuadTreeNode<TileType> root[2], int lvl, int ilng, int ilat)
{
int i, sublat, sublng, subidx;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ double J77_Dens_low (double Z)
{
const double wm0 = 28.96;

double h, hbase, pbase, tbase, tgrad, T, CM, WM, x, y;
double h, hbase, pbase, tbase, tgrad, T, CM = 0.0, WM, x, y;
int flag;

// For Z < 86km, use US Standard Atmosphere 1976
Expand Down
2 changes: 1 addition & 1 deletion Src/Orbiter/Base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ void Base::ScanObjectMeshes () const
DWORD i, j, k, ng, spec, nvtx, nidx;
LONGLONG texid;
bool undersh, groundsh;
GroupSpec *grp_os, *grp_us; // mesh groups for the meshes compiled from generic primitives (over and under shadows)
GroupSpec *grp_os = 0, *grp_us = 0; // mesh groups for the meshes compiled from generic primitives (over and under shadows)
DWORD ngrp_os = 0, ngrp_us = 0;
nobjmsh_os = nobjmsh_us = nobjmsh_sh = 0;
bool bshadow = g_pOrbiter->Cfg()->CfgVisualPrm.bShadows;
Expand Down
2 changes: 1 addition & 1 deletion Src/Orbiter/FlightRecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ bool Vessel::FRecorder_Read (const char *scname)

void Vessel::FRecorder_Play ()
{
dASSERT (s1);
dASSERT (s1, "Update state not available.");
StateVectors *sv = s1;

if (fstatus == FLIGHTSTATUS_FREEFLIGHT) {
Expand Down
18 changes: 9 additions & 9 deletions Src/Orbiter/Log.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ void LogOut_Location(const char* func, const char* file, int line);

#ifdef GENERATE_LOG
#define INITLOG(x,app) InitLog(x,app)
#define LOGOUT(msg,...) LogOut(msg,__VA_ARGS__)
#define LOGOUT_FINE(msg,...) LogOutFine(msg,__VA_ARGS__)
#define LOGOUT_ERR(msg, ...) LogOut_Error(__FUNCTION__,__FILE__,__LINE__, msg, __VA_ARGS__)
#define LOGOUT(msg,...) LogOut(msg, ##__VA_ARGS__)
#define LOGOUT_FINE(msg,...) LogOutFine(msg, ##__VA_ARGS__)
#define LOGOUT_ERR(msg, ...) LogOut_Error(__FUNCTION__,__FILE__,__LINE__, msg, ##__VA_ARGS__)
#define LOGOUT_LASTERR() LogOut_LastError(__FUNCTION__,__FILE__,__LINE__);
#define LOGOUT_WARN(msg,...) LogOut_Warning(__FUNCTION__,__FILE__,__LINE__,msg,__VA_ARGS__)
#define LOGOUT_ERR_FILENOTFOUND(file) LogOut_Error(__FUNCTION__,__FILE__,__LINE__, "File not found: %s", file)
#define LOGOUT_WARN(msg,...) LogOut_Warning(__FUNCTION__, __FILE__, __LINE__, msg, ##__VA_ARGS__)
#define LOGOUT_ERR_FILENOTFOUND(file) LogOut_Error(__FUNCTION__, __FILE__, __LINE__, "File not found: %s", file)
#define LOGOUT_ERR_FILENOTFOUND_MSG(file,msg,...) { \
LogOut_Error_Start(); \
LogOut("File not found: %s", file); \
Expand Down Expand Up @@ -71,8 +71,8 @@ void LogOut_Location(const char* func, const char* file, int line);
if (!(test)) { \
LogOut_Error_Start(); \
LogOut("Assertion failure:"); \
LogOut(msg, __VA_ARGS__); \
LogOut_Location(__FUNCTION__,__FILE__,__LINE__); \
LogOut(msg, ##__VA_ARGS__); \
LogOut_Location(__FUNCTION__, __FILE__, __LINE__); \
LogOut_Error_End(); \
if(fatal) { \
LogOut(">>> TERMINATING <<<"); \
Expand All @@ -85,10 +85,10 @@ void LogOut_Location(const char* func, const char* file, int line);
// Debug build-only assertions. Assume debug assertion failures are always fatal
#ifdef _DEBUG
#define dASSERT(test,msg,...) { \
ASSERT(test, true, msg, __VA_ARGS__); \
ASSERT(test, true, msg, ##__VA_ARGS__); \
}
#define dVERIFY(test,msg,...) { \
ASSERT(!FAILED(test), true, msg, __VA_ARGS__); \
ASSERT(!FAILED(test), true, msg, ##__VA_ARGS__); \
}
#else
#define dASSERT(test,msg,...) (test)
Expand Down
2 changes: 1 addition & 1 deletion Src/Orbiter/MenuInfoBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void GraphInfoBar::LabelSmax (double smax)
void GraphInfoBar::RescaleGraph (double smax)
{
gc->clbkBeginBltGroup (infoSrc);
int i, i0, i1, n, y0, y1, h;
int i, i0 = 0, i1, n, y0, y1, h;
for (n = nsample-1, i = isample; n > 0; n--, i--) {
i1 = i;
if (i1 < 0) i1 += FPSMAXSAMPLE;
Expand Down
2 changes: 1 addition & 1 deletion Src/Orbiter/MfdDocking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ void Instrument_Docking::UpdateDraw (oapi::Sketchpad *skp)
x1 = x + msize; if (x1 > rlimit) x1 = rlimit;
y0 = y - msize; if (y0 < -rlimit) y0 = -rlimit;
y1 = y + msize; if (y1 > rlimit) y1 = rlimit;
skp->SetPen (draw[0][3].solidpen);
skp->SetPen (draw[r>z?0:3][0].solidpen);
skp->Line (circx+x0, circy-y, circx+x1+1, circy-y);
skp->Line (circx+x, circy-y0, circx+x, circy-y1-1);

Expand Down
2 changes: 1 addition & 1 deletion Src/Orbiter/MfdHsi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Instrument_HSI::Instrument_HSI (Pane *_pane, INT_PTR _id, const Spec &spec, Vess
pen[1] = gc->clbkCreatePen (1, 1, RGB(255,128,0));
brush = gc->clbkCreateBrush (col_yellow1);
} else {
for (i = 0; i < 5; i++) pen[i] = 0;
for (i = 0; i < 2; i++) pen[i] = 0;
brush = 0;
}
if (instrDT > 0.25) instrDT = 0.25; // force at least 4 Hz refresh rate
Expand Down
2 changes: 1 addition & 1 deletion Src/Orbiter/MfdMap_old.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ SURFHANDLE Instrument_MapOld::LoadBitmap (const char *cbuf, int *w, int *h)
void Instrument_MapOld::SetZoom (bool newzoom)
{
zoom = newzoom;
Spec spec; // dummy
Spec spec = { 10, 10, 0, 0, 0, 10, 0 }; // dummy
SetSize (spec);
needmap = true;
}
Expand Down
2 changes: 1 addition & 1 deletion Src/Orbiter/Vecmat.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ class Matrix4 {
m31=a31, m32=a32, m33=a33, m34=a34,
m41=a41, m42=a42, m43=a43, m44=a44; }

inline void Set (const Matrix &A)
inline void Set (const Matrix4 &A)
{ memcpy (data, A.data, 16*sizeof(double)); }

inline double &operator() (int i, int j)
Expand Down
8 changes: 4 additions & 4 deletions Src/Orbiter/VectorMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1155,15 +1155,15 @@ void VectorMap::DrawSunnySide (double sunlng, double sunlat, bool terminator)
pt[i].y = mapy(p[i].lat);
}
for (cut = 1; cut <= NVTX_CIRCLE; cut++) {
if (abs(pt[cut-1].x-pt[cut%NVTX_CIRCLE].x) > mapw/2) break;
if (abs(pt[cut-1].x-pt[cut % NVTX_CIRCLE].x) > mapw/2) break;
}
bool prograde = (pt[cut-1].x > pt[cut%NVTX_CIRCLE].x);
bool prograde = (pt[(cut-1) % NVTX_CIRCLE].x > pt[cut % NVTX_CIRCLE].x);
if (prograde) {
for (i = 0; i < NVTX_CIRCLE; i++)
ptt[2+i] = pt[(cut+i)%NVTX_CIRCLE];
ptt[2+i] = pt[(cut+i) % NVTX_CIRCLE];
} else {
for (i = 0; i < NVTX_CIRCLE; i++)
ptt[1+NVTX_CIRCLE-i] = pt[(cut+i)%NVTX_CIRCLE];
ptt[1+NVTX_CIRCLE-i] = pt[(cut+i) % NVTX_CIRCLE];
}
if (ptt[2].x > 0) {
ptt[1].x = ptt[NVTX_CIRCLE+1].x - mapw;
Expand Down
6 changes: 3 additions & 3 deletions Src/Orbiter/surfmgr2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,9 +673,9 @@ void SurfTile::MatchEdges ()
edgeok = true;
if (!mesh) return; // sanity check

QuadTreeNode<SurfTile> *lngnbr = smgr->FindNode (lvl, ilat, ilng + (ilng & 1 ? 1 : -1));
QuadTreeNode<SurfTile> *latnbr = smgr->FindNode (lvl, ilat + (ilat & 1 ? 1 : -1), ilng);
QuadTreeNode<SurfTile> *dianbr = smgr->FindNode (lvl, ilat + (ilat & 1 ? 1 : -1), ilng + (ilng & 1 ? 1 : -1));
QuadTreeNode<SurfTile> *lngnbr = smgr->FindNode (lvl, ilng + (ilng & 1 ? 1 : -1), ilat);
QuadTreeNode<SurfTile> *latnbr = smgr->FindNode (lvl, ilng, ilat + (ilat & 1 ? 1 : -1));
QuadTreeNode<SurfTile> *dianbr = smgr->FindNode (lvl, ilng + (ilng & 1 ? 1 : -1), ilat + (ilat & 1 ? 1 : -1));

if (lngnbr && !(lngnbr->Entry()->state & TILE_VALID)) lngnbr = 0;
if (latnbr && !(latnbr->Entry()->state & TILE_VALID)) latnbr = 0;
Expand Down
2 changes: 1 addition & 1 deletion Src/Orbiter/tilemgr2_imp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// -----------------------------------------------------------------------

template<class TileType>
QuadTreeNode<TileType> *TileManager2Base::FindNode (QuadTreeNode<TileType> root[2], int lvl, int ilat, int ilng)
QuadTreeNode<TileType> *TileManager2Base::FindNode (QuadTreeNode<TileType> root[2], int lvl, int ilng, int ilat)
{
int i, sublat, sublng, subidx;

Expand Down
3 changes: 3 additions & 0 deletions Src/Plugin/Common/Dialog/TabDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ TabbedDialog::TabbedDialog (int _dlgId, int _tabId)
dlgId = _dlgId;
tabId = _tabId;
nTab = 0;
pTab = NULL;
hDlg = NULL;
hInst = NULL;
}

// --------------------------------------------------------------
Expand Down Expand Up @@ -97,6 +99,7 @@ void TabbedDialog::ClearTabs ()
delete pTab[i];
delete []pTab;
nTab = 0;
pTab = NULL;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Src/Plugin/ScnEditor/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2678,7 +2678,7 @@ void EditorTab_Propellant::Refresh ()
if (!hP) return;
m0 = vessel->GetPropellantMaxMass (hP);
m = vessel->GetPropellantMass (hP);
sprintf (cbuf, "%Mass (0-%0.2f kg)", m0);
sprintf (cbuf, "Mass (0-%0.2f kg)", m0);
SetWindowText (GetDlgItem (hTab, IDC_STATIC2), cbuf);
sprintf (cbuf, "%0.4f", m/m0);
SetWindowText (GetDlgItem (hTab, IDC_EDIT2), cbuf);
Expand Down
5 changes: 3 additions & 2 deletions Src/Vessel/Atlantis/Atlantis/AscentAP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,9 @@ double AscentAP::SSMEThrustProfile(double met)
int i;
if (met < ts[nsample - 1]) {
for (i = nsample - 1; i >= 0; i--)
if (met >= ts[i]) break;
return (met - ts[i]) / (ts[i + 1] - ts[i]) * (lvls[i + 1] - lvls[i]) + lvls[i];
if (met >= ts[i])
return (met - ts[i]) / (ts[i + 1] - ts[i]) * (lvls[i + 1] - lvls[i]) + lvls[i];
return lvls[0];
}
else if (met < 400) {
return 1.0;
Expand Down
2 changes: 1 addition & 1 deletion Src/Vessel/Atlantis/Atlantis_SRB/Atlantis_SRB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ double Atlantis_SRB::ThrustProfile (double met)
else {
for (i = nsample-1; i >= 0; i--)
if (met >= ts[i]) break;
lvl = (met-ts[i])/(ts[i+1]-ts[i]) * (lvls[i+1]-lvls[i]) + lvls[i];
lvl = (i >= 0 ? (met-ts[i])/(ts[i+1]-ts[i]) * (lvls[i+1]-lvls[i]) + lvls[i] : lvls[0]);
}
return lvl;
}
Expand Down
23 changes: 17 additions & 6 deletions Src/Vessel/DeltaGlider/DeltaGlider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,21 @@ void UpdateCtrlDialog (DeltaGlider *dg, HWND hWnd = 0);

void VLiftCoeff (VESSEL *v, double aoa, double M, double Re, void *context, double *cl, double *cm, double *cd)
{
int i;
const int nabsc = 9;
static const double AOA[nabsc] = {-180*RAD,-60*RAD,-30*RAD, -2*RAD, 15*RAD,20*RAD,25*RAD,60*RAD,180*RAD};
static const double CL[nabsc] = { 0, 0, -0.4, 0, 0.7, 1, 0.8, 0, 0};
static const double CM[nabsc] = { 0, 0, 0.014, 0.0039, -0.006,-0.008,-0.010, 0, 0};
int i;
for (i = 0; i < nabsc-1 && AOA[i+1] < aoa; i++);
double f = (aoa-AOA[i]) / (AOA[i+1]-AOA[i]);
*cl = CL[i] + (CL[i+1]-CL[i]) * f; // aoa-dependent lift coefficient
*cm = CM[i] + (CM[i+1]-CM[i]) * f; // aoa-dependent moment coefficient
if (i < nabsc - 1) {
double f = (aoa - AOA[i]) / (AOA[i + 1] - AOA[i]);
*cl = CL[i] + (CL[i + 1] - CL[i]) * f; // aoa-dependent lift coefficient
*cm = CM[i] + (CM[i + 1] - CM[i]) * f; // aoa-dependent moment coefficient
}
else {
*cl = CL[nabsc - 1];
*cm = CM[nabsc - 1];
}
double saoa = sin(aoa);
double pd = 0.015 + 0.4*saoa*saoa; // profile drag
*cd = pd + oapiGetInducedDrag (*cl, 1.5, 0.7) + oapiGetWaveDrag (M, 0.75, 1.0, 1.1, 0.04);
Expand All @@ -126,7 +132,12 @@ void HLiftCoeff (VESSEL *v, double beta, double M, double Re, void *context, dou
static const double BETA[nabsc] = {-180*RAD,-135*RAD,-90*RAD,-45*RAD,45*RAD,90*RAD,135*RAD,180*RAD};
static const double CL[nabsc] = { 0, +0.3, 0, -0.3, +0.3, 0, -0.3, 0};
for (i = 0; i < nabsc-1 && BETA[i+1] < beta; i++);
*cl = CL[i] + (CL[i+1]-CL[i]) * (beta-BETA[i]) / (BETA[i+1]-BETA[i]);
if (i < nabsc - 1) {
*cl = CL[i] + (CL[i + 1] - CL[i]) * (beta - BETA[i]) / (BETA[i + 1] - BETA[i]);
}
else {
*cl = CL[nabsc - 1];
}
*cm = 0.0;
*cd = 0.015 + oapiGetInducedDrag (*cl, 1.5, 0.6) + oapiGetWaveDrag (M, 0.75, 1.0, 1.1, 0.04);
}
Expand Down Expand Up @@ -404,7 +415,7 @@ void DeltaGlider::clbkRenderHUD (int mode, const HUDPAINTSPEC *hps, SURFHANDLE h

static float texw = 512.0f, texh = 256.0f;
float cx = (float)hps->CX, cy = (float)hps->CY;
int i, nvtx = 0, nidx = 0;
DWORD i, nvtx = 0, nidx = 0;
static NTVERTEX vtx[12+16+4];
static WORD idx[18+36+6];
static float scl = 0;
Expand Down
4 changes: 2 additions & 2 deletions Src/Vessel/DeltaGlider/ThermalSubsys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,13 @@ double ThermalSubsystem::SolarRadiation(VECTOR3 *sdir)
// For simplicity, assume sun position is at origin
VECTOR3 Ppos, Vpos;
double vdist, pdist, prad, srad;
DG()->GetGlobalPos(Vpos);
vdist = length(Vpos); // distance from sun
OBJHANDLE hObj = DG()->GetSurfaceRef();
while (hObj && oapiGetObjectType(hObj) == OBJTP_PLANET) {
prad = oapiGetSize(hObj);
oapiGetGlobalPos(hObj, &Ppos);
pdist = length(Ppos);
DG()->GetGlobalPos(Vpos);
vdist = length(Vpos);
if (vdist > pdist) {
double d = length(crossp(Ppos, Ppos-Vpos))/vdist;
if (d < prad) return 0.0;
Expand Down
1 change: 1 addition & 0 deletions Src/Vessel/Dragonfly/Esystems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ Battery::Battery(e_object *i_src, double i_power)
load_handle=-1; //no loading;
max_power=power=i_power;
loading=0;
load_cb = 1; // MS 210831: added this since it was used undefined, causing an exception. No idea what it is or what it should be set to. It is never set anywhere.
c_breaker=1;
//Volts=28.8;
};
Expand Down
2 changes: 1 addition & 1 deletion Src/Vessel/Dragonfly/Internal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ Switch *sw1;
new Switch(810,260,-1,3,0,&Sock[4]->socket_handle ,&PanelList[i]);
new Switch(855,260,-1,3,0,&Sock[5]->socket_handle ,&PanelList[i]);

hg1=new HGauge(780,570,85,190,&FC[0]->O2_flow,&FC[3]->H2_flow,"gr/s",0,15,1,2,4,&PanelList[i]);
hg1=new HGauge(780,570,85,190,&FC[0]->O2_flow,&FC[0]->H2_flow,"gr/s",0,15,1,2,4,&PanelList[i]);
rot1=new Rotary(870,570,"FC SEL",names,0,2,&PanelList[i]);

RotEl=new RotElement(&hg1->SRC1,&rot1->set,&PanelList[i]);
Expand Down
8 changes: 0 additions & 8 deletions Src/Vessel/Dragonfly/Matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,6 @@ det-=p[_ZZ]*p[_XY]*p[_YX];
return det;
}

void matrix::trans(float ax,float ay,float az)
{
identity();
p[14]=az;
p[15]=ay;
p[16]=ax;
}

void matrix::setrot(float theta,vector3 axis)
{

Expand Down
4 changes: 2 additions & 2 deletions Src/Vessel/Dragonfly/instruments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ oapiBlt(parent->surf,temps,85-22,0,10,0,9,190);
Rotary::Rotary(int x,int y,char i_name[15],char i_names[7][12], int i_set, int i_poz,Panel* parent):instrument(x,y,parent)
{
strcpy(screentext,i_name);
for (int i=0;i<11;i++) strcpy(names[i],i_names[i]);
for (int i=0;i<7;i++) strcpy(names[i],i_names[i]);
set=i_set;poznr=i_poz;
draw[0].x=-11;draw[0].y=40;
draw[1].x= 11;draw[1].y=40;
Expand Down Expand Up @@ -1481,7 +1481,7 @@ else
void Radar::LBD(int x, int y)
{
y-=55;
int bt;
int bt = -1; // MS 210831: initialised this, assuming that no button is hit if the y condition is not met.
if (y%34 <18) bt=(int)(y/34);//which button
if ((bt>=0)&&(bt<=2)) {
if ((x>19)&&(x<47))
Expand Down
1 change: 0 additions & 1 deletion Src/Vessel/Dragonfly/matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class matrix
void identity();
matrix invert();

void trans(float ax,float ay,float az);
void rotx(float aa);
void roty(float aa);
void rotz(float aa);
Expand Down
Loading