mirror of
https://github.com/glest/glest-source.git
synced 2025-10-03 19:01:53 +02:00
- more compiler warning cleanup
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user