src/glRenderer.cpp

changeset 967
eb586d3e1a6a
parent 966
a834e43a57da
child 968
4b93b7963456
equal deleted inserted replaced
966:a834e43a57da 967:eb586d3e1a6a
810 pan (X) += 0.03f * dx * (zoom() / 7.5f); 810 pan (X) += 0.03f * dx * (zoom() / 7.5f);
811 pan (Y) -= 0.03f * dy * (zoom() / 7.5f); 811 pan (Y) -= 0.03f * dy * (zoom() / 7.5f);
812 m_panning = true; 812 m_panning = true;
813 setCameraMoving (true); 813 setCameraMoving (true);
814 } 814 }
815 elif (left and camera() == EFreeCamera) 815 else if (left and camera() == EFreeCamera)
816 { 816 {
817 rot (X) = rot (X) + dy; 817 rot (X) = rot (X) + dy;
818 rot (Y) = rot (Y) + dx; 818 rot (Y) = rot (Y) + dx;
819 819
820 clampAngle (rot (X)); 820 clampAngle (rot (X));
1221 info.img = img; 1221 info.img = img;
1222 info.invalid = false; 1222 info.invalid = false;
1223 1223
1224 if (info.lw == 0) 1224 if (info.lw == 0)
1225 info.lw = (info.lh * img->width()) / img->height(); 1225 info.lw = (info.lh * img->width()) / img->height();
1226 elif (info.lh == 0) 1226 else if (info.lh == 0)
1227 info.lh = (info.lw * img->height()) / img->width(); 1227 info.lh = (info.lw * img->height()) / img->width();
1228 1228
1229 const Axis x2d = getCameraAxis (false, cam), 1229 const Axis x2d = getCameraAxis (false, cam),
1230 y2d = getCameraAxis (true, cam); 1230 y2d = getCameraAxis (true, cam);
1231 const double negXFac = g_FixedCameras[cam].negX ? -1 : 1, 1231 const double negXFac = g_FixedCameras[cam].negX ? -1 : 1,
1439 if (ovlobj == null and meta.img != null) 1439 if (ovlobj == null and meta.img != null)
1440 { 1440 {
1441 delete meta.img; 1441 delete meta.img;
1442 meta.img = null; 1442 meta.img = null;
1443 } 1443 }
1444 elif (ovlobj != null and 1444 else if (ovlobj != null and
1445 (meta.img == null or meta.fname != ovlobj->fileName()) and 1445 (meta.img == null or meta.fname != ovlobj->fileName()) and
1446 not meta.invalid) 1446 not meta.invalid)
1447 { 1447 {
1448 setupOverlay (cam, ovlobj->fileName(), ovlobj->x(), 1448 setupOverlay (cam, ovlobj->fileName(), ovlobj->x(),
1449 ovlobj->y(), ovlobj->width(), ovlobj->height()); 1449 ovlobj->y(), ovlobj->width(), ovlobj->height());
1473 1473
1474 // If the overlay object was there and the overlay itself is 1474 // If the overlay object was there and the overlay itself is
1475 // not, remove the object. 1475 // not, remove the object.
1476 ovlobj->destroy(); 1476 ovlobj->destroy();
1477 } 1477 }
1478 elif (meta.img != null and ovlobj == null) 1478 else if (meta.img != null and ovlobj == null)
1479 { 1479 {
1480 // Inverse case: image is there but the overlay object is 1480 // Inverse case: image is there but the overlay object is
1481 // not, thus create the object. 1481 // not, thus create the object.
1482 ovlobj = LDSpawn<LDOverlay>(); 1482 ovlobj = LDSpawn<LDOverlay>();
1483 1483

mercurial