Fix a few warnings in Win64 build.

issue1247
Sven Eberhardt 2015-01-25 16:43:51 +01:00
parent e1a09298d4
commit 089b4794a8
8 changed files with 20 additions and 13 deletions

View File

@ -133,7 +133,7 @@ public:
if (y<LeftOpen) return 0;
else return MCVehic;
}
if (x>=Width)
if (static_cast<uint32_t>(x) >= static_cast<uint32_t>(Width))
{
if (y<RightOpen) return 0;
else return MCVehic;
@ -142,7 +142,7 @@ public:
{
return TopRowPix[x];
}
if (y>=Height)
if (static_cast<uint32_t>(y) >= static_cast<uint32_t>(Height))
{
return BottomRowPix[x];
}

View File

@ -1233,6 +1233,9 @@ void StdMeshMaterialPass::LoadShaderRef(StdMeshMaterialParserCtx& ctx, StdMeshMa
shader = ctx.Manager.GetGeometryShader(program_name.getData());
shader_type_name = "geometry";
break;
default: // can't happen
assert(0);
return;
}
if(cur_shader->Shader != NULL)

View File

@ -368,8 +368,6 @@ StdMeshTransformation StdMeshMatrix::Decompose() const
const float ry = (rot.a[0][2] - rot.a[2][0]) / det;
const float rz = (rot.a[1][0] - rot.a[0][1]) / det;
const float angle = acos(cos_angle);
StdMeshTransformation trans;
trans.scale.x = sx;
trans.scale.y = sy;

View File

@ -682,8 +682,9 @@ void C4GameOptionButtons::OnBtnLeague(C4GUI::Control *btn)
void C4GameOptionButtons::OnBtnRecord(C4GUI::Control *btn)
{
bool fCheck = Config.General.DefRec = Game.Record = !Game.Record;
btnRecord->SetIcon(fCheck ? C4GUI::Ico_Ex_RecordOn : C4GUI::Ico_Ex_RecordOff);
Game.Record = !Game.Record;
Config.General.DefRec = Game.Record;
btnRecord->SetIcon(Game.Record ? C4GUI::Ico_Ex_RecordOn : C4GUI::Ico_Ex_RecordOff);
}
void C4GameOptionButtons::OnBtnPassword(C4GUI::Control *btn)

View File

@ -62,6 +62,8 @@ void C4DefGraphics::Clear()
// zero own fields
switch (Type)
{
case TYPE_None:
break;
case TYPE_Bitmap:
if (Bmp.BitmapNormal) { delete Bmp.BitmapNormal; Bmp.BitmapNormal=NULL; }
if (Bmp.BitmapClr) { delete Bmp.BitmapClr; Bmp.BitmapClr=NULL; }
@ -314,6 +316,9 @@ void C4DefGraphics::Draw(C4Facet &cgo, DWORD iColor, C4Object *pObj, int32_t iPh
switch(Type)
{
case C4DefGraphics::TYPE_None:
// Def has no graphics
break;
case C4DefGraphics::TYPE_Bitmap:
fctPicture.Set(GetBitmap(iColor),fctPicRect.x,fctPicRect.y,fctPicRect.Wdt,fctPicRect.Hgt);
fctPicture.DrawTUnscaled(cgo,true,iPhaseX,iPhaseY,trans);

View File

@ -560,6 +560,9 @@ void C4Object::DrawFaceImpl(C4TargetFacet &cgo, bool action, float fx, float fy,
C4Surface* sfc;
switch (GetGraphics()->Type)
{
case C4DefGraphics::TYPE_None:
// no graphics.
break;
case C4DefGraphics::TYPE_Bitmap:
sfc = action ? Action.Facet.Surface : GetGraphics()->GetBitmap(Color);
@ -2280,6 +2283,7 @@ void C4Object::DrawLine(C4TargetFacet &cgo)
// Draw line segments
C4Value colorsV; GetProperty(P_LineColors, &colorsV);
C4ValueArray *colors = colorsV.getArray();
// TODO: Edge color (color1) is currently ignored.
int32_t color0 = 0xFFFF00FF, color1 = 0xFFFF00FF; // use bright colors so author notices
if (colors)
{
@ -4624,8 +4628,8 @@ bool C4Object::SetGraphics(C4DefGraphics *pNewGfx, bool fTemp)
C4GraphicsOverlay *C4Object::GetGraphicsOverlay(int32_t iForID) const
{
// search in list until ID is found or passed
C4GraphicsOverlay *pOverlay = pGfxOverlay, *pPrevOverlay = NULL;
while (pOverlay && pOverlay->GetID() < iForID) { pPrevOverlay = pOverlay; pOverlay = pOverlay->GetNext(); }
C4GraphicsOverlay *pOverlay = pGfxOverlay;
while (pOverlay && pOverlay->GetID() < iForID) pOverlay = pOverlay->GetNext();
// exact match found?
if (pOverlay && pOverlay->GetID() == iForID) return pOverlay;
// none found
@ -4948,9 +4952,6 @@ bool C4Object::IsPlayerObject(int32_t iPlayerNumber) const
// and crew objects
if (fAnyPlr || Owner == iPlayerNumber)
{
// flags are player objects
if (id == C4ID::Flag) return true;
C4Player *pOwner = ::Players.Get(Owner);
if (pOwner)
{

View File

@ -27,7 +27,7 @@
#include <C4Game.h>
#include <C4GameObjects.h>
static const C4ObjectLink NULL_LINK = {};
static const C4ObjectLink NULL_LINK = { NULL, NULL, NULL };
C4ObjectList::C4ObjectList(): FirstIter(0)
{

View File

@ -1079,7 +1079,6 @@ static bool FnAddMenuItem(C4Object *Obj, C4String * szCaption, C4String * szComm
{
C4PropList *gfx_proplist = XPar.getPropList();
fctSymbol.Create(iSymbolSize,iSymbolSize);
uint32_t dwClr = XPar.getInt();
if (!Game.DrawPropListSpecImage(fctSymbol, gfx_proplist))
return false;
}