Avoid some warnings on GCC
This was SVN commit r4623.
This commit is contained in:
parent
83928926ec
commit
75f2f9fd5f
@ -220,7 +220,7 @@ JSBool JSI_Camera::lookAt( JSContext* cx, JSObject* obj, uint argc, jsval* argv,
|
||||
JSU_REQUIRE_PARAM_RANGE(2, 3);
|
||||
|
||||
cameraInfo->m_sv_Position = GETVECTOR( argv[0] );
|
||||
cameraInfo->m_sv_Orientation = ( GETVECTOR( argv[1] ) - GETVECTOR( argv[0] ) );
|
||||
cameraInfo->m_sv_Orientation = GETVECTOR( argv[1] ) - cameraInfo->m_sv_Position;
|
||||
cameraInfo->m_sv_Orientation.Normalize();
|
||||
|
||||
if( argc == 2 )
|
||||
|
@ -116,7 +116,8 @@ void CMiniMap::SetCameraPos()
|
||||
CVector3D CamOrient=m_Camera->m_Orientation.GetTranslation();
|
||||
|
||||
//get center point of screen
|
||||
int x = (int)g_Renderer.GetWidth()/2.f, y = (int)g_Renderer.GetHeight()/2.f;
|
||||
int x = g_Renderer.GetWidth()/2;
|
||||
int y = g_Renderer.GetHeight()/2;
|
||||
CVector3D ScreenMiddle=m_Camera->GetWorldCoordinates(x,y);
|
||||
|
||||
//Get Vector required to go from camera position to ScreenMiddle
|
||||
@ -167,8 +168,8 @@ void CMiniMap::FireWorldClickEvent(uint button, int clicks)
|
||||
NMT_Run,
|
||||
-1,
|
||||
NULL,
|
||||
Destination.x,
|
||||
Destination.y);
|
||||
(int)Destination.x,
|
||||
(int)Destination.y);
|
||||
}
|
||||
|
||||
// render view rect : John M. Mena
|
||||
|
@ -31,4 +31,4 @@ extern LibError dir_cancel_watch(intptr_t watch);
|
||||
|
||||
extern LibError dir_get_changed_file(char* fn);
|
||||
|
||||
#endif // #ifndef DIR_WATCH_H__
|
||||
#endif // #ifndef DIR_WATCH_H__
|
||||
|
@ -40,4 +40,4 @@ void snd_detect()
|
||||
SAFE_STRCPY(snd_card, "Unknown");
|
||||
SAFE_STRCPY(snd_drv_ver, "Unknown");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -546,6 +546,10 @@ void CPatchRData::RenderBlends()
|
||||
|
||||
// setup data pointers
|
||||
u32 stride=sizeof(SBlendVertex);
|
||||
// ((GCC warns about offsetof: SBlendVertex contains a CVector3D which has
|
||||
// a constructor, and so is not a POD type, and so offsetof is theoretically
|
||||
// invalid - see http://gcc.gnu.org/ml/gcc/2003-11/msg00281.html - but it
|
||||
// doesn't seem to be worth changing this code since it works anyway.))
|
||||
glVertexPointer(3,GL_FLOAT,stride,base+offsetof(SBlendVertex,m_Position));
|
||||
glColorPointer(4,GL_UNSIGNED_BYTE,stride,base+offsetof(SBlendVertex,m_LOSColor));
|
||||
|
||||
|
@ -25,7 +25,8 @@ sEnvironmentSettings GetSettings()
|
||||
s.watermurkiness = wm->m_Murkiness;
|
||||
s.waterreflectiontintstrength = wm->m_ReflectionTintStrength;
|
||||
|
||||
#define COLOUR(A, B) A = Colour(B.r*255, B.g*255, B.b*255)
|
||||
// CColor colours
|
||||
#define COLOUR(A, B) A = Colour((int)(B.r*255), (int)(B.g*255), (int)(B.b*255))
|
||||
COLOUR(s.watercolour, wm->m_WaterColor);
|
||||
COLOUR(s.watertint, wm->m_WaterTint);
|
||||
COLOUR(s.waterreflectiontint, wm->m_ReflectionTint);
|
||||
@ -39,7 +40,8 @@ sEnvironmentSettings GetSettings()
|
||||
|
||||
s.skyset = g_Renderer.GetSkyManager()->GetSkySet();
|
||||
|
||||
#define COLOUR(A, B) A = Colour(B.X*255, B.Y*255, B.Z*255)
|
||||
// RGBColor (CVector3D) colours
|
||||
#define COLOUR(A, B) A = Colour((int)(B.X*255), (int)(B.Y*255), (int)(B.Z*255))
|
||||
COLOUR(s.suncolour, g_LightEnv.m_SunColor);
|
||||
COLOUR(s.terraincolour, g_LightEnv.m_TerrainAmbientColor);
|
||||
COLOUR(s.unitcolour, g_LightEnv.m_UnitsAmbientColor);
|
||||
|
Loading…
Reference in New Issue
Block a user