|
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
|
|
float tdx = t[0] - tc;
float tdy = t[1] - tr;
int type;
CBinTree::FindLeafTriangle(t, &type);
// Define the reference points, corner(0), delta x(1) and delta y(2)
int i;
// Reverse X
if (type &1)
{
px[0] = 1;
px[1] = 0;
px[2] = 1;
tdx = 1.0f - tdx;
}
// Reverse Y
if (type &2)
{
py[0] = 1;
py[1] = 1;
py[2] = 0;
tdy = 1.0f - tdy;
}
if (m_rContinent)
{
for (i=0; i <3; i++)
h[i] = m_rContinent->GetHeightData(gc+px[i],gr+py[i]);
}
|
h[3] = h[0] + (h[1]-h[0])*tdx + (h[2]-h[0])*tdy;
|
|
|
|
terrain.cpp, line 1149 : warning (1): using uninitialized memory 'h[0]'
problem occurs in function 'NRender::CHierarchicalTerrain::_GetHeight(class NMath::CPoint2,class NMath::CPoint2,class NMath::CPoint3 *)'
stack variable declared on line '1116'
Problem occurs when the following conditions are true:
when '(type) & 0x1 == 1' on line 1127
when '((type) >> 1) & 0x1 == 1' on line 1135
when '&m_rContinent->CContinent *() == 0' on line 1143
Comment: Valid
Path includes 24 statements on the following lines:
1109 1110 1112 1113 1115 1115 1116 1117 1118 1120 1121 1124 1127 1129
1130 1131 1132 1135 1137 1138 1139 1140 1143 1149
|
|
|
|