Ticket #50 (new defect)

Opened 10 months ago

Last modified 10 months ago

Some warning and deprecation fixes

Reported by: Rakhun Owned by:
Priority: minor Milestone:
Component: general Version:
Keywords: Cc:

Description (last modified by res) (diff)

Please look through and commit if there is nothing wrong :)

Index: plugins/propclass/newcamera/modes/tracking.cpp
===================================================================
--- plugins/propclass/newcamera/modes/tracking.cpp      (revision 3127)
+++ plugins/propclass/newcamera/modes/tracking.cpp      (working copy)
@@ -84,19 +84,6 @@
   if (!init_reset)
     init_reset = ResetCamera ();
 
-  csVector3 tarpos;
-  switch (targetstate)
-  {
-    case (TARGET_BASE):
-      tarpos = GetAnchorPosition ();
-      break;
-    case (TARGET_OBJ):
-      tarpos = GetTargetPosition ();
-      break;
-    case (TARGET_NONE):
-    default:
-      break;
-  }
   // get the position of the object we are anchored to in camera space
   const csVector3 &playpos (camtrans.Other2This (GetAnchorPosition ()));
   // calculate the position (in camera) space to get within the range
@@ -113,9 +100,20 @@
   // actually move the camera
   camtrans.SetOrigin (camtrans.GetOrigin () + cammove);
   // track the target
-  if (targetstate != TARGET_NONE)
+  csVector3 tarpos;
+  switch (targetstate)
   {
-    camtrans.LookAt (tarpos - camtrans.GetOrigin (), up);
+    case (TARGET_BASE):
+      tarpos = GetAnchorPosition ();
+      camtrans.LookAt (tarpos - camtrans.GetOrigin (), up);
+      break;
+    case (TARGET_OBJ):
+      tarpos = GetTargetPosition ();
+      camtrans.LookAt (tarpos - camtrans.GetOrigin (), up);
+      break;
+    case (TARGET_NONE):
+    default:
+      break;
   }
 
   // since the camera transform exists in the same plane as the anchor
Index: plugins/propclass/wheeled/wheeled.cpp
===================================================================
--- plugins/propclass/wheeled/wheeled.cpp       (revision 3127)
+++ plugins/propclass/wheeled/wheeled.cpp       (working copy)
@@ -277,14 +277,16 @@
          CEL_DATA_FLOAT, true, "Anti-sway factor.",&antiswayfactor);
   AddProperty (propid_antiswaylimit, "cel.property.antiswaylimit",
          CEL_DATA_FLOAT, true, "Anti-sway limit.",&antiswaylimit);
-
+
   params = new celGenericParameterBlock (5);
   params->SetParameterDef (0, param_otherbody, "otherbody");
   params->SetParameterDef (1, param_position, "position");
   params->SetParameterDef (2, param_normal, "normal");
   params->SetParameterDef (3, param_depth, "depth");
   params->SetParameterDef (4, param_index, "index");
-
+
+  csVector3 rot(0, 0, 0);
+
   pl->CallbackOnce ((iCelTimerListener*)this, 25, CEL_EVENT_PRE);
 }
 
Index: plugins/propclass/damage/damagefact.cpp
===================================================================
--- plugins/propclass/damage/damagefact.cpp     (revision 3127)
+++ plugins/propclass/damage/damagefact.cpp     (working copy)
@@ -295,6 +295,8 @@
        new_amount = float (amount) / sqdist;
       }
       break;
+    default:
+      return; // Should never happen
   }
   params->GetParameter (0).Set (new_amount);
   if (behave)
@@ -351,6 +353,8 @@
     case FALLOFF_NORMAL:
       max_radius = sqrt (float (amount) / MIN_FORCE);
       break;
+    default:
+      return; // Shouldn't happen
   }
   iSector* s;
   csVector3 p;
@@ -382,6 +386,8 @@
     case FALLOFF_NORMAL:
       max_radius = sqrt (float (amount) / MIN_FORCE);
       break;
+    default:
+      return; // Shouldn't happen
   }
   iSector* s;
   csVector3 p;
Index: plugins/propclass/mechanics/thruster_controller.cpp
===================================================================
--- plugins/propclass/mechanics/thruster_controller.cpp (revision 3127)
+++ plugins/propclass/mechanics/thruster_controller.cpp (working copy)
@@ -368,7 +368,7 @@
   csRef<iCelPropertyClass> pc = databuf->GetPC ();
   csRef<iPcMechanicsObject> mechobj = scfQueryInterface<iPcMechanicsObject> (pc);
   int32 axessize = databuf->GetInt32 ();
-  int32 tgsize, i, j;
+  int32 tgsize, i, j = 1;
   csRef<iPcMechanicsBalancedGroup> tg;
   for (i = 1; i <= axessize; i++)
   {
Index: plugins/propclass/actormove/actormove.cpp
===================================================================
--- plugins/propclass/actormove/actormove.cpp   (revision 3127)
+++ plugins/propclass/actormove/actormove.cpp   (working copy)
@@ -519,15 +519,26 @@
 
       celAnimationName animid;
       if (strcmp(animationid,"idle") == 0)
+      {
         animid = CEL_ANIM_IDLE;
+        SetAnimationMapping (animid, animationname);
+      }
       else if (strcmp(animationid,"walk") == 0)
+      {
         animid = CEL_ANIM_WALK;
+        SetAnimationMapping (animid, animationname);
+      }
       else if (strcmp(animationid,"run") == 0)
+      {
         animid = CEL_ANIM_RUN;
+        SetAnimationMapping (animid, animationname);
+      }
       else if (strcmp(animationid,"jump") == 0)
+      {
         animid = CEL_ANIM_JUMP;
+        SetAnimationMapping (animid, animationname);
+      }
 
-      SetAnimationMapping (animid, animationname);
       return true;
     }
     default:
Index: plugins/stdphyslayer/pl.cpp
===================================================================
--- plugins/stdphyslayer/pl.cpp (revision 3127)
+++ plugins/stdphyslayer/pl.cpp (working copy)
@@ -903,7 +903,7 @@
 
 void celPlLayer::UnattachEntity (iObject* object, iCelEntity* entity)
 {
-  csRef<celEntityFinder> cef (CS_GET_CHILD_OBJECT (object, celEntityFinder));
+  csRef<celEntityFinder> cef (CS::GetChildObject<celEntityFinder>(object));
   if (cef)
   {
     if (cef->GetEntity () != entity)
@@ -915,7 +915,7 @@
 
 iCelEntity* celPlLayer::FindAttachedEntity (iObject* object)
 {
-  csRef<celEntityFinder> cef (CS_GET_CHILD_OBJECT (object, celEntityFinder));
+  csRef<celEntityFinder> cef (CS::GetChildObject<celEntityFinder>(object));
   if (cef)
     return cef->GetEntity ();
   return 0;

Attachments

CEL.diff (6.0 kB) - added by Rakhun 10 months ago.
the diff as a file instead :)

Change History

follow-up: ↓ 2   Changed 10 months ago by res

  • type changed from defect to enhancement
  • description modified (diff)

Changed 10 months ago by Rakhun

the diff as a file instead :)

in reply to: ↑ 1   Changed 10 months ago by Rakhun

  • type changed from enhancement to defect

oops, skip the first difference in the diff file

Add/Change #50 (Some warning and deprecation fixes)

Author



Action
as new
 
Note: See TracTickets for help on using tickets.