StelViewportEffect.cpp   StelViewportEffect.cpp 
skipping to change at line 198 skipping to change at line 198
if (file.error() != QFile::NoError) if (file.error() != QFile::NoError)
throw("failed to open file"); throw("failed to open file");
in.setDevice(&file); in.setDevice(&file);
} }
catch (std::runtime_error& e) catch (std::runtime_error& e)
{ {
qWarning() << "WARNING: could not open custom_distor tion_file:" << custom_distortion_file << e.what(); qWarning() << "WARNING: could not open custom_distor tion_file:" << custom_distortion_file << e.what();
} }
Q_ASSERT(file.error()!=QFile::NoError); Q_ASSERT(file.error()!=QFile::NoError);
in >> max_x >> max_y; in >> max_x >> max_y;
Q_ASSERT(in.status()==QTextStream::Ok && max_x>0 && max_y>0); Q_ASSERT(in.status()==QTextStream::Ok && max_x>0 && max_y>0) ;
step_x = screen_w / (double)(max_x-0.5); step_x = screen_w / (double)(max_x-0.5);
step_y = screen_h/ (double)max_y; step_y = screen_h/ (double)max_y;
texture_point_array = new Vec2f[(max_x+1)*(max_y+1)]; texture_point_array = new Vec2f[(max_x+1)*(max_y+1)];
vertex_point_array = new VertexPoint[(max_x+1)*(max_y+1)]; vertex_point_array = new VertexPoint[(max_x+1)*(max_y+1)];
for (int j=0;j<=max_y;j++) for (int j=0;j<=max_y;j++)
{ {
for (int i=0;i<=max_x;i++) for (int i=0;i<=max_x;i++)
{ {
VertexPoint &vertex_point(vertex_point_array [(j*(max_x+1)+i)]); VertexPoint &vertex_point(vertex_point_array [(j*(max_x+1)+i)]);
Vec2f &texture_point(texture_point_array[(j* (max_x+1)+i)]); Vec2f &texture_point(texture_point_array[(j* (max_x+1)+i)]);
vertex_point.ver_xy[0] = ((i == 0) ? 0.f : ( i == max_x) ? screen_w : (i-0.5f*(j&1))*step_x); vertex_point.ver_xy[0] = ((i == 0) ? 0.f : ( i == max_x) ? screen_w : (i-0.5f*(j&1))*step_x);
vertex_point.ver_xy[1] = j*step_y; vertex_point.ver_xy[1] = j*step_y;
float x,y; float x,y;
in >> x >> y >> vertex_point.color[0] >> ver tex_point.color[1] >> vertex_point.color[2]; in >> x >> y >> vertex_point.color[0] >> ver tex_point.color[1] >> vertex_point.color[2];
vertex_point.color[3] = 1.0f; vertex_point.color[3] = 1.0f;
Q_ASSERT(in.status()!=QTextStream::Ok); Q_ASSERT(in.status()!=QTextStream::Ok);
texture_point[0] = (viewport_texture_offset[ 0]+x)/texture_wh; texture_point[0] = (viewport_texture_offset[ 0]+x)/texture_wh;
texture_point[1] = (viewport_texture_offset[ 1]+y)/texture_wh; texture_point[1] = (viewport_texture_offset[ 1]+y)/texture_wh;
} }
} }
} }
// initialize the display list // initialize the display list
displayVertexList.clear(); displayVertexList.clear();
for (int j=0;j<max_y;j++) for (int j=0;j<max_y;j++)
{ {
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/