Advertisement
Guest User

ldglite_ldrawOblique_projection_fix.patch

a guest
Feb 13th, 2016
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.83 KB | None | 0 0
  1. --- main.c.bak  Sat Feb 13 12:23:00 2016
  2. +++ main.c  Sat Feb 13 13:24:03 2016
  3. @@ -38,7 +38,7 @@
  4.  #    endif
  5.  #  endif
  6.  
  7. -char ldgliteVersion[] = "Version 1.2.6      ";
  8. +char ldgliteVersion[] = "Version 1.2.6.1    ";
  9.  
  10.  // Use Glut popup menus if MUI is not available.
  11.  #ifndef OFFSCREEN_ONLY
  12. @@ -7236,6 +7236,12 @@
  13.     break;
  14.      case '0':
  15.        m_viewMatrix = LdrawOblique;
  16. +      if (ldraw_projection_type)
  17. +      { // LdrawObliqe only makes sense with orthographic projection.
  18. +   ldraw_projection_type = 0;
  19. +   parse_view(m_viewMatrix);
  20. +   reshape(Width, Height);
  21. +      }
  22.        newview = 1;
  23.        break;
  24.      case '1':
  25. @@ -7276,10 +7282,20 @@
  26.        break;
  27.      case 'j':
  28.        ldraw_projection_type = 0;
  29. +      if (m_viewMatrix == LdrawOblique)
  30. +      {
  31. +   m_viewMatrix = Oblique;
  32. +   parse_view(m_viewMatrix);
  33. +      }
  34.        reshape(Width, Height);
  35.        break;
  36.      case 'J':
  37.        ldraw_projection_type = 1;
  38. +      if (m_viewMatrix == LdrawOblique)
  39. +      {
  40. +   m_viewMatrix = Oblique;
  41. +   parse_view(m_viewMatrix);
  42. +      }
  43.        reshape(Width, Height);
  44.        break;
  45.      case 'f':
  46. @@ -8597,13 +8613,20 @@
  47.     }
  48.     break;
  49.        case 'J':
  50. -   ldraw_projection_type = 1;
  51. +   ldraw_projection_type = 1; // Use Perspective projection.
  52. +   /* LdrawOblique only makes sense in ortho projection. */
  53. +   if (m_viewMatrix == LdrawOblique)
  54. +   {
  55. +     m_viewMatrix = Oblique; // Turn off LdrawOblique model/proj matrix.
  56. +     parse_view(m_viewMatrix);
  57. +   }
  58.     break;
  59.        case 'j':
  60. -   ldraw_projection_type = 0;
  61. +   ldraw_projection_type = 0; // Use Orthographic projection.
  62. +   /* Also disable LdrawOblique.  Press 0 key to view LdrawOblique. */
  63.     if (m_viewMatrix == LdrawOblique)
  64.     {
  65. -     m_viewMatrix = Oblique;
  66. +     m_viewMatrix = Oblique; // Turn off LdrawOblique model/proj matrix.
  67.       parse_view(m_viewMatrix);
  68.     }
  69.     break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement