StelViewportEffect.cpp   StelViewportEffect.cpp 
skipping to change at line 20 skipping to change at line 20
* 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., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include "config.h"
#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"
#include "StelUtils.hpp"
#include <QOpenGLFramebufferObject> #include <QOpenGLFramebufferObject>
#include <QSettings> #include <QSettings>
#include <QFile> #include <QFile>
#include <QDir> #include <QDir>
void StelViewportEffect::paintViewportBuffer(const QOpenGLFramebufferObject * buf) const void StelViewportEffect::paintViewportBuffer(const QOpenGLFramebufferObject * buf) const
{ {
StelPainter sPainter(StelApp::getInstance().getCore()->getProjection 2d()); StelPainter sPainter(StelApp::getInstance().getCore()->getProjection 2d());
sPainter.setColor(1,1,1); sPainter.setColor(1,1,1);
skipping to change at line 120 skipping to change at line 120
// init transformation // init transformation
VertexPoint *vertex_point_array = 0; VertexPoint *vertex_point_array = 0;
const QString custom_distortion_file = conf.value("spheric_mirror/cu stom_distortion_file","").toString(); const QString custom_distortion_file = conf.value("spheric_mirror/cu stom_distortion_file","").toString();
if (custom_distortion_file.isEmpty()) if (custom_distortion_file.isEmpty())
{ {
float texture_triangle_base_length = conf.value("spheric_mir ror/texture_triangle_base_length",16.f).toFloat(); float texture_triangle_base_length = conf.value("spheric_mir ror/texture_triangle_base_length",16.f).toFloat();
if (texture_triangle_base_length > 256.f) if (texture_triangle_base_length > 256.f)
texture_triangle_base_length = 256.f; texture_triangle_base_length = 256.f;
else if (texture_triangle_base_length < 2.f) else if (texture_triangle_base_length < 2.f)
texture_triangle_base_length = 2.f; texture_triangle_base_length = 2.f;
max_x = (int)trunc(0.5 + screen_w/texture_triangle_base_leng th); max_x = (int)StelUtils::trunc(0.5 + screen_w/texture_triangle_base_ length);
step_x = screen_w / (double)(max_x-0.5); step_x = screen_w / (double)(max_x-0.5);
max_y = (int)trunc(screen_h/(texture_triangle_base_length*0. 5*sqrt(3.0))); max_y = (int)StelUtils::trunc(screen_h/(texture_triangle_base_lengt h*0.5*sqrt(3.0)));
step_y = screen_h/ (double)max_y; step_y = screen_h/ (double)max_y;
double gamma = conf.value("spheric_mirror/projector_gamma",0 .45).toDouble(); double gamma = conf.value("spheric_mirror/projector_gamma",0 .45).toDouble();
if (gamma < 0.0) if (gamma < 0.0)
gamma = 0.0; gamma = 0.0;
const float view_scaling_factor = 0.5 * newProjectorParams.v iewportFovDiameter / prj->fovToViewScalingFactor(distorter_max_fov*(M_PI/36 0.0)); const float view_scaling_factor = 0.5 * newProjectorParams.v iewportFovDiameter / prj->fovToViewScalingFactor(distorter_max_fov*(M_PI/36 0.0));
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)];
double max_h = 0; double max_h = 0;
skipping to change at line 373 skipping to change at line 373
x = screen_w*texture_x - viewport_texture_offset[0] + newProjectorPa rams.viewportXywh[0]; x = screen_w*texture_x - viewport_texture_offset[0] + newProjectorPa rams.viewportXywh[0];
y = screen_h*texture_y - viewport_texture_offset[1] + newProjectorPa rams.viewportXywh[1]; y = screen_h*texture_y - viewport_texture_offset[1] + newProjectorPa rams.viewportXywh[1];
} }
void StelViewportDistorterFisheyeToSphericMirror::paintViewportBuffer(const QOpenGLFramebufferObject* buf) const void StelViewportDistorterFisheyeToSphericMirror::paintViewportBuffer(const QOpenGLFramebufferObject* buf) const
{ {
StelPainter sPainter(StelApp::getInstance().getCore()->getProjection 2d()); StelPainter sPainter(StelApp::getInstance().getCore()->getProjection 2d());
sPainter.enableTexture2d(true); sPainter.enableTexture2d(true);
glBindTexture(GL_TEXTURE_2D, buf->texture()); glBindTexture(GL_TEXTURE_2D, buf->texture());
GL(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR))
;
GL(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR))
;
glDisable(GL_BLEND); glDisable(GL_BLEND);
sPainter.enableClientStates(true, true, true); sPainter.enableClientStates(true, true, true);
sPainter.setColorPointer(4, GL_FLOAT, displayColorList.constData()); sPainter.setColorPointer(4, GL_FLOAT, displayColorList.constData());
sPainter.setVertexPointer(2, GL_FLOAT, displayVertexList.constData() ); sPainter.setVertexPointer(2, GL_FLOAT, displayVertexList.constData() );
sPainter.setTexCoordPointer(2, GL_FLOAT, displayTexCoordList.constDa ta()); sPainter.setTexCoordPointer(2, GL_FLOAT, displayTexCoordList.constDa ta());
for (int j=0;j<max_y;j++) for (int j=0;j<max_y;j++)
{ {
glDrawArrays(GL_TRIANGLE_STRIP, j*(max_x+1)*2, (max_x+1)*2); glDrawArrays(GL_TRIANGLE_STRIP, j*(max_x+1)*2, (max_x+1)*2);
sPainter.drawFromArray(StelPainter::TriangleStrip, (max_x+1) *2, j*(max_x+1)*2, false); sPainter.drawFromArray(StelPainter::TriangleStrip, (max_x+1) *2, j*(max_x+1)*2, false);
} }
sPainter.enableClientStates(false); sPainter.enableClientStates(false);
GL(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)
);
GL(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST)
);
} }
 End of changes. 6 change blocks. 
3 lines changed or deleted 11 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/