Browse Source

Fixed script compilation warnings.

Lasse Öörni 11 years ago
parent
commit
c6890f7942
2 changed files with 6 additions and 5 deletions
  1. 2 2
      Bin/Data/Scripts/24_Urho2DSprite.as
  2. 4 3
      Bin/Data/Scripts/Editor/EditorSpawn.as

+ 2 - 2
Bin/Data/Scripts/24_Urho2DSprite.as

@@ -52,8 +52,8 @@ void CreateScene()
     if (sprite is null)
         return;
 
-    uint halfWidth = graphics.width * PIXEL_SIZE * 0.5f;
-    uint halfHeight = graphics.height * PIXEL_SIZE * 0.5f;
+    uint halfWidth = uint(graphics.width * PIXEL_SIZE * 0.5f);
+    uint halfHeight = uint(graphics.height * PIXEL_SIZE * 0.5f);
     // Create more StaticModel objects to the scene, randomly positioned, rotated and scaled. For rotation, we construct a
     // quaternion from Euler angles where the Y angle (rotation about the Y axis) is randomized. The mushroom model contains
     // LOD levels, so the StaticModel component will automatically select the LOD level according to the view distance (you'll

+ 4 - 3
Bin/Data/Scripts/Editor/EditorSpawn.as

@@ -239,10 +239,11 @@ Vector3 RandomizeSpawnPosition(const Vector3&in position)
 
 void SpawnObject()
 {
-    if(spawnedObjectsNames.length == 0) return;
+    if (spawnedObjectsNames.length == 0)
+        return;
     IntRect view = activeViewport.viewport.rect;
-    
-    for(int i = 0;i<spawnCount;i++)
+
+    for (uint i = 0; i < spawnCount; i++)
     {
         IntVector2 pos = IntVector2(ui.cursorPosition.x, ui.cursorPosition.y);
         Ray cameraRay = camera.GetScreenRay(