- more compiler warning cleanup

This commit is contained in:
Mark Vejvoda
2010-10-21 16:36:26 +00:00
parent 45a26a4597
commit cbe6860826
6 changed files with 15 additions and 15 deletions

View File

@@ -591,7 +591,7 @@ void Map::loadFromFile(const string &path) {
//read header
MapFileHeader header;
fread(&header, sizeof(MapFileHeader), 1, f1);
size_t bytes = fread(&header, sizeof(MapFileHeader), 1, f1);
altFactor = header.altFactor;
waterLevel = header.waterLevel;
@@ -602,30 +602,30 @@ void Map::loadFromFile(const string &path) {
//read start locations
resetFactions(header.maxFactions);
for (int i = 0; i < maxFactions; ++i) {
fread(&startLocations[i].x, sizeof(int32), 1, f1);
fread(&startLocations[i].y, sizeof(int32), 1, f1);
bytes = fread(&startLocations[i].x, sizeof(int32), 1, f1);
bytes = fread(&startLocations[i].y, sizeof(int32), 1, f1);
}
//read Heights
reset(header.width, header.height, 10, 1);
for (int j = 0; j < h; ++j) {
for (int i = 0; i < w; ++i) {
fread(&cells[i][j].height, sizeof(float), 1, f1);
bytes = fread(&cells[i][j].height, sizeof(float), 1, f1);
}
}
//read surfaces
for (int j = 0; j < h; ++j) {
for (int i = 0; i < w; ++i) {
fread(&cells[i][j].surface, sizeof(int8), 1, f1);
bytes = fread(&cells[i][j].surface, sizeof(int8), 1, f1);
}
}
//read objects
for (int j = 0; j < h; ++j) {
for (int i = 0; i < w; ++i) {
int8 obj;
fread(&obj, sizeof(int8), 1, f1);
int8 obj=0;
bytes = fread(&obj, sizeof(int8), 1, f1);
if (obj <= 10) {
cells[i][j].object = obj;
} else {