Browse Source

fix pingpong for Win32

David Rose 24 years ago
parent
commit
1f24c4da3c
1 changed files with 6 additions and 3 deletions
  1. 6 3
      panda/src/chan/animControl.cxx

+ 6 - 3
panda/src/chan/animControl.cxx

@@ -199,6 +199,11 @@ loop(bool restart, int from, int to) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void AnimControl::
 void AnimControl::
 pingpong(bool restart, int from, int to) {
 pingpong(bool restart, int from, int to) {
+  if (from == to) {
+    pose(from);
+    return;
+  }
+
   nassertv(get_num_frames() > 0);
   nassertv(get_num_frames() > 0);
 
 
   nassertv(from >= 0 && from < get_num_frames());
   nassertv(from >= 0 && from < get_num_frames());
@@ -596,10 +601,9 @@ do_actions_forward(int from, int to) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 bool AnimControl::
 bool AnimControl::
 do_actions_backward(int from, int to) {
 do_actions_backward(int from, int to) {
-#ifndef WIN32_VC
   if (from >= to) {
   if (from >= to) {
 #if defined(WIN32_VC) && !defined(NO_PCH)
 #if defined(WIN32_VC) && !defined(NO_PCH)
-    typedef reverse_iterator<Actions::const_iterator, Actions::value_type> Action_reverse_iterator;
+    typedef Actions::const_reverse_iterator Action_reverse_iterator;
 #else
 #else
     typedef reverse_iterator<Actions::const_iterator> Action_reverse_iterator;
     typedef reverse_iterator<Actions::const_iterator> Action_reverse_iterator;
 #endif
 #endif
@@ -631,7 +635,6 @@ do_actions_backward(int from, int to) {
       return false;
       return false;
     }
     }
   }
   }
-#endif
 
 
   return true;
   return true;
 }
 }