StelViewportEffect.cpp   StelViewportEffect.cpp 
skipping to change at line 17 skipping to change at line 17
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include "StelViewportEffect.hpp" #include "StelViewportEffect.hpp"
#include "StelApp.hpp" #include "StelApp.hpp"
#include "StelCore.hpp" #include "StelCore.hpp"
#include "StelPainter.hpp" #include "StelPainter.hpp"
#include "SphericMirrorCalculator.hpp" #include "SphericMirrorCalculator.hpp"
#include "StelFileMgr.hpp" #include "StelFileMgr.hpp"
#include "StelMovementMgr.hpp" #include "StelMovementMgr.hpp"
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()==QDataStream::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()!=QDataStream::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. 3 change blocks. 
3 lines changed or deleted 3 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/