Remove variables which are set but unused.

This commit is contained in:
feb 2011-07-17 19:30:31 +00:00
parent 716cdb44ef
commit f8fc99df26
9 changed files with 6 additions and 38 deletions

View file

@ -423,12 +423,6 @@ namespace gcn
graphics->setColor(getBackgroundColor());
graphics->fillRectangle(getContentDimension());
int alpha = getBaseColor().a;
Color highlightColor = getBaseColor() + 0x303030;
highlightColor.a = alpha;
Color shadowColor = getBaseColor() - 0x303030;
shadowColor.a = alpha;
if (mVBarVisible)
{
drawUpButton(graphics);

View file

@ -225,15 +225,12 @@ void MapSight(const CPlayer *player, int x, int y, int w, int h, int range,
int cy[4];
int steps;
int cycle;
int p;
// Units under construction have no sight range.
if (!range) {
return;
}
p = player->Index;
// Mark Horizontal sight for unit
for (mx = x - range; mx < x + range + w; ++mx) {
for (my = y; my < y + h; ++my) {
@ -500,14 +497,12 @@ void CViewport::DrawMapFogOfWar() const
int sx, sy;
int dx, dy;
int ex, ey;
int p;
int mx, my;
// flags must redraw or not
if (ReplayRevealMap) {
return;
}
p = ThisPlayer->Index;
sx = std::max(MapX - 1, 0);
ex = std::min(MapX + MapWidth + 1, Map.Info.MapWidth);

View file

@ -1399,13 +1399,9 @@ StatBoxWidget::StatBoxWidget(int width, int height) : percent(100)
*/
void StatBoxWidget::draw(gcn::Graphics *graphics)
{
int x;
int y;
int width;
int height;
x = getX();
y = getY();
width = getWidth();
height = getHeight();

View file

@ -347,7 +347,6 @@ bool CanBuildOn(int x, int y, int mask)
*/
CUnit *CanBuildUnitType(const CUnit *unit, const CUnitType *type, int x, int y, int real)
{
int j;
int testmask;
CPlayer *player;
CUnit *ontop;
@ -364,7 +363,6 @@ CUnit *CanBuildUnitType(const CUnit *unit, const CUnitType *type, int x, int y,
//
// Remove unit that is building!
//
j = 0;
if (unit) {
UnmarkUnitFieldFlags(unit);
}

View file

@ -293,7 +293,6 @@ static int CclDefineUnitType(lua_State *l)
CUnitType *type;
const char *str;
int i;
int redefine;
int subargs;
int k;
@ -303,11 +302,8 @@ static int CclDefineUnitType(lua_State *l)
// Slot identifier
str = LuaToString(l, 1);
type = UnitTypeByIdent(str);
if (type) {
redefine = 1;
} else {
if (!type) {
type = NewUnitTypeSlot(str);
redefine = 0;
}
type->NumDirections = 0;

View file

@ -1758,13 +1758,9 @@ CUnit *UnitFindResource(const CUnit *unit, int x, int y, int range, int resource
unsigned char *matrix;
CUnit *res;
CUnit *bestres;
int destx;
int desty;
int bestd;
int cdist;
destx = x;
desty = y;
size = std::min(Map.Info.MapWidth * Map.Info.MapHeight / 4, range * range * 5);
points = new p[size];

View file

@ -272,8 +272,6 @@ static CUnit *FindRangeAttack(const CUnit *u, int range)
const CPlayer *player;
int xx;
int yy;
int best_x;
int best_y;
int best_cost;
int i;
int sbad;
@ -450,8 +448,6 @@ static CUnit *FindRangeAttack(const CUnit *u, int range)
// Find the best area...
// The target which provide the best bad/good ratio is choosen...
best_x = -1;
best_y = -1;
best_cost = -1;
best = NoUnitP;
for (i = 0; i < n; ++i) {

View file

@ -327,6 +327,7 @@ static void VideoDrawCharClip(const CGraphic *g, int gx, int gy, int w, int h,
int ex;
CLIP_RECTANGLE_OFS(x, y, w, h, ox, oy, ex);
VideoDrawChar(g, gx + ox, gy + oy, w, h, x, y);
ex = ex; // make the compiler to shut up.
}
/**

View file

@ -233,17 +233,16 @@ void CGraphic::DoDrawFrameClip(GLuint *textures,
int skip;
int w;
int h;
int sx, sy, ex, ey, n;
int sx, sy, n;
n = GraphicWidth / Width;
sx = (frame % n) * Width;
ex = sx + Width;
sy = (frame / n) * Height;
ey = sy + Height;
w = Width;
h = Height;
CLIP_RECTANGLE_OFS(x, y, w, h, ox, oy, skip);
skip = skip; // avoid a compiler warning
DrawTexture(this, textures, sx + ox, sy + oy, sx + ox + w, sy + oy + h, x, y, 0);
}
@ -361,17 +360,16 @@ void CGraphic::DoDrawFrameClipX(GLuint *textures, unsigned frame,
int skip;
int w;
int h;
int sx, sy, ex, ey, n;
int sx, sy, n;
n = GraphicWidth / Width;
sx = (frame % n) * Width;
ex = sx + Width;
sy = (frame / n) * Height;
ey = sy + Height;
w = Width;
h = Height;
CLIP_RECTANGLE_OFS(x, y, w, h, ox, oy, skip);
skip = skip; // avoid a compiler warning
if (w < Width) {
if (ox == 0) {
@ -961,7 +959,6 @@ static void MakeTextures2(CGraphic *g, GLuint texture, CUnitColors *colors,
unsigned char *tex;
unsigned char *tp;
const unsigned char *sp;
int fl;
Uint32 ckey;
int useckey;
int bpp;
@ -973,7 +970,6 @@ static void MakeTextures2(CGraphic *g, GLuint texture, CUnitColors *colors,
int maxw;
int maxh;
fl = g->GraphicWidth / g->Width;
useckey = g->Surface->flags & SDL_SRCCOLORKEY;
f = g->Surface->format;
bpp = f->BytesPerPixel;