Browse Source

fix compiler warnings

David Rose 16 years ago
parent
commit
0592074c95

+ 4 - 4
direct/src/plugin/p3dInstance.cxx

@@ -3334,8 +3334,8 @@ handle_event_osx_event_record(const P3D_event_data &event) {
                    kHICoordSpaceWindow, window);
                    kHICoordSpaceWindow, window);
 
 
     // Then convert to plugin coordinates.
     // Then convert to plugin coordinates.
-    pt.h = cgpt.x - _wparams.get_win_x();
-    pt.v = cgpt.y - _wparams.get_win_y();
+    pt.h = (short)(cgpt.x - _wparams.get_win_x());
+    pt.v = (short)(cgpt.y - _wparams.get_win_y());
   }
   }
 
 
   SubprocessWindowBuffer::Event swb_event;
   SubprocessWindowBuffer::Event swb_event;
@@ -3483,8 +3483,8 @@ handle_event_osx_cocoa(const P3D_event_data &event) {
   case P3DCocoaEventMouseDown:
   case P3DCocoaEventMouseDown:
   case P3DCocoaEventMouseMoved:
   case P3DCocoaEventMouseMoved:
   case P3DCocoaEventMouseDragged:
   case P3DCocoaEventMouseDragged:
-    swb_event._x = ce.data.mouse.pluginX;
-    swb_event._y = ce.data.mouse.pluginY;
+    swb_event._x = (int)ce.data.mouse.pluginX;
+    swb_event._y = (int)ce.data.mouse.pluginY;
     swb_event._flags |= SubprocessWindowBuffer::EF_mouse_position;
     swb_event._flags |= SubprocessWindowBuffer::EF_mouse_position;
   }
   }
 
 

+ 13 - 8
direct/src/plugin/p3dOsxSplashWindow.cxx

@@ -86,8 +86,12 @@ set_wparams(const P3DWindowParams &wparams) {
       if (r.top == -1) r.top = 50;
       if (r.top == -1) r.top = 50;
       // A coordinate of -2 means to center the window on the screen.
       // A coordinate of -2 means to center the window on the screen.
       CGRect display_bounds = CGDisplayBounds(kCGDirectMainDisplay);
       CGRect display_bounds = CGDisplayBounds(kCGDirectMainDisplay);
-      if (r.left == -2) r.left = 0.5 * (CGRectGetWidth(display_bounds) - _win_width);
-      if (r.top == -2) r.top = 0.5 * (CGRectGetHeight(display_bounds) - _win_height);
+      if (r.left == -2) {
+        r.left = (short)(0.5 * (CGRectGetWidth(display_bounds) - _win_width));
+      }
+      if (r.top == -2) {
+        r.top = (short)(0.5 * (CGRectGetHeight(display_bounds) - _win_height));
+      }
 
 
       r.right = r.left + _win_width;
       r.right = r.left + _win_width;
       r.bottom = r.top + _win_height;
       r.bottom = r.top + _win_height;
@@ -299,7 +303,8 @@ paint_window() {
     
     
     paint_window_osx_cgcontext(context);
     paint_window_osx_cgcontext(context);
 
 
-    // CGContextSynchronize(context);
+    // We need to synchronize, or we don't see the update every frame.
+    CGContextSynchronize(context);
     CGContextRelease(context);
     CGContextRelease(context);
     
     
   } else {
   } else {
@@ -400,8 +405,8 @@ handle_event_osx_event_record(const P3D_event_data &event) {
                    kHICoordSpaceWindow, window);
                    kHICoordSpaceWindow, window);
 
 
     // Then convert to plugin coordinates.
     // Then convert to plugin coordinates.
-    pt.h = cgpt.x - _wparams.get_win_x();
-    pt.v = cgpt.y - _wparams.get_win_y();
+    pt.h = (short)(cgpt.x - _wparams.get_win_x());
+    pt.v = (short)(cgpt.y - _wparams.get_win_y());
   }
   }
   
   
   switch (er->what) {
   switch (er->what) {
@@ -455,18 +460,18 @@ handle_event_osx_cocoa(const P3D_event_data &event) {
     break;
     break;
 
 
   case P3DCocoaEventMouseDown:
   case P3DCocoaEventMouseDown:
-    set_mouse_data(ce.data.mouse.pluginX, ce.data.mouse.pluginY, true);
+    set_mouse_data((int)ce.data.mouse.pluginX, (int)ce.data.mouse.pluginY, true);
     retval = true;
     retval = true;
     break;
     break;
 
 
   case P3DCocoaEventMouseUp:
   case P3DCocoaEventMouseUp:
-    set_mouse_data(ce.data.mouse.pluginX, ce.data.mouse.pluginY, false);
+    set_mouse_data((int)ce.data.mouse.pluginX, (int)ce.data.mouse.pluginY, false);
     retval = true;
     retval = true;
     break;
     break;
 
 
   case P3DCocoaEventMouseMoved:
   case P3DCocoaEventMouseMoved:
   case P3DCocoaEventMouseDragged:
   case P3DCocoaEventMouseDragged:
-    set_mouse_data(ce.data.mouse.pluginX, ce.data.mouse.pluginY, _mouse_down);
+    set_mouse_data((int)ce.data.mouse.pluginX, (int)ce.data.mouse.pluginY, _mouse_down);
     retval = true;
     retval = true;
     break;
     break;
 
 

+ 3 - 3
direct/src/plugin_standalone/Sources.pp

@@ -13,7 +13,7 @@
   #define OTHER_LIBS \
   #define OTHER_LIBS \
     prc:c dtoolutil:c dtoolbase:c dtool:m \
     prc:c dtoolutil:c dtoolbase:c dtool:m \
     interrogatedb:c dconfig:c dtoolconfig:m \
     interrogatedb:c dconfig:c dtoolconfig:m \
-    downloader:c express:c pandaexpress:m \
+    pandabase:c downloader:c express:c pandaexpress:m \
     pystub
     pystub
 
 
   #define OSX_SYS_FRAMEWORKS Foundation AppKit Carbon
   #define OSX_SYS_FRAMEWORKS Foundation AppKit Carbon
@@ -40,7 +40,7 @@
   #define OTHER_LIBS \
   #define OTHER_LIBS \
     prc:c dtoolutil:c dtoolbase:c dtool:m \
     prc:c dtoolutil:c dtoolbase:c dtool:m \
     interrogatedb:c dconfig:c dtoolconfig:m \
     interrogatedb:c dconfig:c dtoolconfig:m \
-    express:c downloader:c pandaexpress:m \
+    pandabase:c downloader:c express:c pandaexpress:m \
     pystub
     pystub
 
 
   #define OSX_SYS_FRAMEWORKS Foundation AppKit Carbon
   #define OSX_SYS_FRAMEWORKS Foundation AppKit Carbon
@@ -68,7 +68,7 @@
   #define OTHER_LIBS \
   #define OTHER_LIBS \
     prc:c dtoolutil:c dtoolbase:c dtool:m \
     prc:c dtoolutil:c dtoolbase:c dtool:m \
     interrogatedb:c dconfig:c dtoolconfig:m \
     interrogatedb:c dconfig:c dtoolconfig:m \
-    downloader:c express:c pandaexpress:m \
+    pandabase:c downloader:c express:c pandaexpress:m \
     pystub
     pystub
 
 
   #define OSX_SYS_FRAMEWORKS Foundation AppKit Carbon
   #define OSX_SYS_FRAMEWORKS Foundation AppKit Carbon