Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dedicated/console.cc11
-rw-r--r--src/game/base/game.cc9
-rw-r--r--src/model/asefile.cc12
-rw-r--r--src/model/vertexarray.cc6
-rw-r--r--src/render/pngfile.cc6
5 files changed, 18 insertions, 26 deletions
diff --git a/src/dedicated/console.cc b/src/dedicated/console.cc
index 0e30262..6b3746b 100644
--- a/src/dedicated/console.cc
+++ b/src/dedicated/console.cc
@@ -438,14 +438,13 @@ void Console::draw()
{
if (!console_initialized)
return;
-
+
+ getmaxyx(stdwin, console_height, console_width);
#ifdef _WIN32
- console_width = stdwin->_maxx - 1;
- console_height = stdwin->_maxy - 1;
-#else
- console_width = stdwin->_maxx;
- console_height = stdwin->_maxy;
+ console_width -= 1;
+ console_height -= 1;
#endif
+
draw_background();
draw_status();
draw_text();
diff --git a/src/game/base/game.cc b/src/game/base/game.cc
index 0b7e18d..b943f83 100644
--- a/src/game/base/game.cc
+++ b/src/game/base/game.cc
@@ -2278,8 +2278,6 @@ bool Game::load_zone(core::Zone *zone)
con_print << "^BLoading zone " << zone->label() << "..." << std::endl;
- size_t count = 0;
-
math::Color color;
core::Entity *entity = 0;
@@ -2315,26 +2313,22 @@ bool Game::load_zone(core::Zone *zone)
star = new Star();
entity = star;
star->set_zone(zone);
- count ++;
} else if (zoneini.got_section("navpoint")) {
navpoint = new NavPoint();
entity = navpoint;
navpoint->set_zone(zone);
- count ++;
} else if (zoneini.got_section("jumpgate")) {
jumppoint = new JumpGate();
entity = jumppoint;
jumppoint->set_zone(zone);
//jumppoint->set_radius(0);
- count ++;
} else if (zoneini.got_section("jumppoint")) {
jumppoint = new JumpPoint();
entity = jumppoint;
jumppoint->set_zone(zone);
- count ++;
} else if (zoneini.got_section("racetrack")) {
racetrack = new RaceTrack();
@@ -2390,20 +2384,17 @@ bool Game::load_zone(core::Zone *zone)
planet = new Planet();
entity = planet;
planet->set_zone(zone);
- count ++;
} else if (zoneini.got_section("station")) {
station = new Station();
entity = station;
station->set_zone(zone);
station->set_radius(0);
- count ++;
} else if (zoneini.got_section("entity")) {
entity = new core::Entity();
entity->set_zone(zone);
entity->set_radius(0);
- count ++;
} else if (zoneini.got_section("cargo")) {
// new cargo trading definition for the current base
diff --git a/src/model/asefile.cc b/src/model/asefile.cc
index ce43cd0..bbcc6e3 100644
--- a/src/model/asefile.cc
+++ b/src/model/asefile.cc
@@ -315,7 +315,7 @@ bool ASEFile::read_mesh_normals(std::istream &is)
char data[1024];
memset(data, 0, sizeof(data));
- size_t count = 0;
+ //size_t count = 0;
size_t index = 0;
size_t vertindex = 0;
@@ -337,7 +337,7 @@ bool ASEFile::read_mesh_normals(std::istream &is)
it = ase_facelist.find(index);
if (it != ase_facelist.end()) {
(*it).second->normal().assign(x, y, z);
- count++;
+ //count++;
} else {
con_warn << " could not find face " << index << std::endl;
}
@@ -366,7 +366,7 @@ bool ASEFile::read_mesh_normals(std::istream &is)
}
bool ASEFile::read_mesh_tvertex_list(std::istream &is)
{
- size_t count = 0;
+ //size_t count = 0;
char data[1024];
memset(data, 0, sizeof(data));
@@ -387,7 +387,7 @@ bool ASEFile::read_mesh_tvertex_list(std::istream &is)
if (line >> index >> x >> y >> z) {
math::Vector3f *v = new math::Vector3f(x, y, z);
ase_tvertexlist[index] = v;
- count++;
+ //count++;
}
}
}
@@ -397,7 +397,7 @@ bool ASEFile::read_mesh_tvertex_list(std::istream &is)
bool ASEFile::read_mesh_tface_list(std::istream &is)
{
- size_t count = 0;
+ //size_t count = 0;
char data[1024];
memset(data, 0, sizeof(data));
@@ -428,7 +428,7 @@ bool ASEFile::read_mesh_tface_list(std::istream &is)
if (t2)
triangle->t2().assign(t2->x(), 1.0f - t2->y());
}
- count++;
+ //count++;
}
}
}
diff --git a/src/model/vertexarray.cc b/src/model/vertexarray.cc
index a5820d7..4c25e06 100644
--- a/src/model/vertexarray.cc
+++ b/src/model/vertexarray.cc
@@ -74,7 +74,7 @@ void VertexArray::add_sphere()
math::Vector3f n;
float texx, texy;
- int quad_count = 0;
+ //int quad_count = 0;
// add sphere
for (int j = 0; j < (SPHERESEGMENTS - 1) / 2; j++) {
@@ -98,9 +98,9 @@ void VertexArray::add_sphere()
texy = 2.0f * (float)(j + 1) / (float)(SPHERESEGMENTS - 1);
add_vertex(v, n, texx, texy);
- quad_count++;
+ //quad_count++;
}
- quad_count--;
+ //quad_count--;
}
delete[] sintable;
diff --git a/src/render/pngfile.cc b/src/render/pngfile.cc
index 70833f3..09a5d95 100644
--- a/src/render/pngfile.cc
+++ b/src/render/pngfile.cc
@@ -144,7 +144,7 @@ void PNG::save(const char *filename, Image & image)
}
if (setjmp(png_jmpbuf(png_ptr))) {
- con_warn << "Error reading " << filename << ": error during init_io!" << std::endl;
+ con_warn << "Error writing " << filename << ": error during init_io!" << std::endl;
fclose(png_file);
png_destroy_write_struct(&png_ptr, &info_ptr);
return;
@@ -175,8 +175,10 @@ void PNG::save(const char *filename, Image & image)
png_bytep row_pointers[image.height()];
- for (size_t i = 0; i < image.height(); i++)
+ for (size_t i = 0; i < image.height(); i++) {
+ // image.operator[index] returns a pointer and not the data itself
row_pointers[i] = (png_bytep) image[i * image.width() * image.channels()];
+ }
png_write_image(png_ptr, row_pointers);