Browse Source

Refactored Sample.h to use class forward for Sprite class. Fixed the alignment of the forward classes to be inlined with convention used by other codes in Urho3D. Added the generated LuaScript wiki into SVN.

Wei Tjong Yao 12 years ago
parent
commit
205fffb4ad

+ 0 - 3
Source/Samples/01_HelloWorld/HelloWorld.h

@@ -24,9 +24,6 @@
 
 
 #include "Sample.h"
 #include "Sample.h"
 
 
-// All Urho3D classes reside in namespace Urho3D
-using namespace Urho3D;
-
 /// This first example, maintaining tradition, prints a "Hello World" message.
 /// This first example, maintaining tradition, prints a "Hello World" message.
 /// Furthermore it shows:
 /// Furthermore it shows:
 ///     - Using the Sample / Application classes, which initialize the Urho3D engine and run the main loop;
 ///     - Using the Sample / Application classes, which initialize the Urho3D engine and run the main loop;

+ 3 - 4
Source/Samples/02_HelloGUI/HelloGUI.h

@@ -24,13 +24,12 @@
 
 
 #include "Sample.h"
 #include "Sample.h"
 
 
-// Do forward declarations for the engine classes we have as member variables
 namespace Urho3D
 namespace Urho3D
 {
 {
-    class Window;
-}
 
 
-using namespace Urho3D;
+class Window;
+
+}
 
 
 /// A simple 'HelloWorld' GUI created purely from code.
 /// A simple 'HelloWorld' GUI created purely from code.
 /// This sample demonstrates:
 /// This sample demonstrates:

+ 0 - 7
Source/Samples/03_Sprites/Sprites.h

@@ -24,13 +24,6 @@
 
 
 #include "Sample.h"
 #include "Sample.h"
 
 
-namespace Urho3D
-{
-    class Sprite;
-}
-
-using namespace Urho3D;
-
 /// Moving sprites example.
 /// Moving sprites example.
 /// This sample demonstrates:
 /// This sample demonstrates:
 ///     - Adding Sprite elements to the UI;
 ///     - Adding Sprite elements to the UI;

+ 4 - 4
Source/Samples/04_StaticScene/StaticScene.h

@@ -26,11 +26,11 @@
 
 
 namespace Urho3D
 namespace Urho3D
 {
 {
-    class Node;
-    class Scene;
-}
 
 
-using namespace Urho3D;
+class Node;
+class Scene;
+
+}
 
 
 /// Static 3D scene example.
 /// Static 3D scene example.
 /// This sample demonstrates:
 /// This sample demonstrates:

+ 4 - 4
Source/Samples/05_AnimatingScene/AnimatingScene.h

@@ -26,11 +26,11 @@
 
 
 namespace Urho3D
 namespace Urho3D
 {
 {
-    class Node;
-    class Scene;
-}
 
 
-using namespace Urho3D;
+class Node;
+class Scene;
+
+}
 
 
 /// Animating 3D scene example.
 /// Animating 3D scene example.
 /// This sample demonstrates:
 /// This sample demonstrates:

+ 4 - 5
Source/Samples/06_SkeletalAnimation/SkeletalAnimation.h

@@ -26,12 +26,11 @@
 
 
 namespace Urho3D
 namespace Urho3D
 {
 {
-    class Node;
-    class Scene;
-}
 
 
-// All Urho3D classes reside in namespace Urho3D
-using namespace Urho3D;
+class Node;
+class Scene;
+
+}
 
 
 /// Skeletal animation example.
 /// Skeletal animation example.
 /// This sample demonstrates:
 /// This sample demonstrates:

+ 4 - 4
Source/Samples/07_Billboards/Billboards.h

@@ -26,11 +26,11 @@
 
 
 namespace Urho3D
 namespace Urho3D
 {
 {
-    class Node;
-    class Scene;
-}
 
 
-using namespace Urho3D;
+class Node;
+class Scene;
+
+}
 
 
 /// Billboard example.
 /// Billboard example.
 /// This sample demonstrates:
 /// This sample demonstrates:

+ 5 - 5
Source/Samples/08_Decals/Decals.h

@@ -26,12 +26,12 @@
 
 
 namespace Urho3D
 namespace Urho3D
 {
 {
-    class Drawable;
-    class Node;
-    class Scene;
-}
 
 
-using namespace Urho3D;
+class Drawable;
+class Node;
+class Scene;
+
+}
 
 
 /// Decals example.
 /// Decals example.
 /// This sample demonstrates:
 /// This sample demonstrates:

+ 4 - 4
Source/Samples/09_MultipleViewports/MultipleViewports.h

@@ -26,11 +26,11 @@
 
 
 namespace Urho3D
 namespace Urho3D
 {
 {
-    class Node;
-    class Scene;
-}
 
 
-using namespace Urho3D;
+class Node;
+class Scene;
+
+}
 
 
 /// Multiple viewports example.
 /// Multiple viewports example.
 /// This sample demonstrates:
 /// This sample demonstrates:

+ 4 - 4
Source/Samples/10_RenderToTexture/RenderToTexture.h

@@ -26,11 +26,11 @@
 
 
 namespace Urho3D
 namespace Urho3D
 {
 {
-    class Node;
-    class Scene;
-}
 
 
-using namespace Urho3D;
+class Node;
+class Scene;
+
+}
 
 
 /// Render to texture example
 /// Render to texture example
 /// This sample demonstrates:
 /// This sample demonstrates:

+ 4 - 4
Source/Samples/11_Physics/Physics.h

@@ -26,11 +26,11 @@
 
 
 namespace Urho3D
 namespace Urho3D
 {
 {
-    class Node;
-    class Scene;
-}
 
 
-using namespace Urho3D;
+class Node;
+class Scene;
+
+}
 
 
 /// Physics example.
 /// Physics example.
 /// This sample demonstrates:
 /// This sample demonstrates:

+ 4 - 4
Source/Samples/12_PhysicsStressTest/PhysicsStressTest.h

@@ -26,11 +26,11 @@
 
 
 namespace Urho3D
 namespace Urho3D
 {
 {
-    class Node;
-    class Scene;
-}
 
 
-using namespace Urho3D;
+class Node;
+class Scene;
+
+}
 
 
 /// Physics stress test example.
 /// Physics stress test example.
 /// This sample demonstrates:
 /// This sample demonstrates:

+ 1 - 1
Source/Samples/13_Ragdolls/CreateRagdoll.h

@@ -47,4 +47,4 @@ private:
     void CreateRagdollBone(const String& boneName, ShapeType type, const Vector3& size, const Vector3& position, const Quaternion& rotation);
     void CreateRagdollBone(const String& boneName, ShapeType type, const Vector3& size, const Vector3& position, const Quaternion& rotation);
     /// Join two bones with a Constraint component.
     /// Join two bones with a Constraint component.
     void CreateRagdollConstraint(const String& boneName, const String& parentName, ConstraintType type, const Vector3& axis, const Vector3& parentAxis, const Vector2& highLimit, const Vector2& lowLimit, bool disableCollision = true);
     void CreateRagdollConstraint(const String& boneName, const String& parentName, ConstraintType type, const Vector3& axis, const Vector3& parentAxis, const Vector2& highLimit, const Vector2& lowLimit, bool disableCollision = true);
-};
+};

+ 4 - 4
Source/Samples/13_Ragdolls/Ragdolls.h

@@ -26,11 +26,11 @@
 
 
 namespace Urho3D
 namespace Urho3D
 {
 {
-    class Node;
-    class Scene;
-}
 
 
-using namespace Urho3D;
+class Node;
+class Scene;
+
+}
 
 
 /// Ragdoll example.
 /// Ragdoll example.
 /// This sample demonstrates:
 /// This sample demonstrates:

+ 5 - 5
Source/Samples/14_SoundEffects/SoundEffects.h

@@ -26,12 +26,12 @@
 
 
 namespace Urho3D
 namespace Urho3D
 {
 {
-    class Button;
-    class Scene;
-    class Slider;
-}
 
 
-using namespace Urho3D;
+class Button;
+class Scene;
+class Slider;
+
+}
 
 
 /// Sound effects example
 /// Sound effects example
 /// This sample demonstrates:
 /// This sample demonstrates:

+ 5 - 5
Source/Samples/15_Navigation/Navigation.h

@@ -26,12 +26,12 @@
 
 
 namespace Urho3D
 namespace Urho3D
 {
 {
-    class Drawable;
-    class Node;
-    class Scene;
-}
 
 
-using namespace Urho3D;
+class Drawable;
+class Node;
+class Scene;
+
+}
 
 
 /// Navigation example.
 /// Navigation example.
 /// This sample demonstrates:
 /// This sample demonstrates:

+ 6 - 8
Source/Samples/16_Chat/Chat.h

@@ -26,13 +26,13 @@
 
 
 namespace Urho3D
 namespace Urho3D
 {
 {
-    class Button;
-    class LineEdit;
-    class Text;
-    class UIElement;
-}
 
 
-using namespace Urho3D;
+class Button;
+class LineEdit;
+class Text;
+class UIElement;
+
+}
 
 
 /// Chat example
 /// Chat example
 /// This sample demonstrates:
 /// This sample demonstrates:
@@ -91,5 +91,3 @@ private:
     /// Start server button.
     /// Start server button.
     SharedPtr<Button> startServerButton_;
     SharedPtr<Button> startServerButton_;
 };
 };
-
-

+ 7 - 7
Source/Samples/17_SceneReplication/SceneReplication.h

@@ -26,14 +26,14 @@
 
 
 namespace Urho3D
 namespace Urho3D
 {
 {
-    class Button;
-    class Connection;
-    class Scene;
-    class Text;
-    class UIElement;
-}
 
 
-using namespace Urho3D;
+class Button;
+class Connection;
+class Scene;
+class Text;
+class UIElement;
+
+}
 
 
 /// Scene network replication example.
 /// Scene network replication example.
 /// This sample demonstrates:
 /// This sample demonstrates:

+ 4 - 4
Source/Samples/18_CharacterDemo/CharacterDemo.h

@@ -26,11 +26,11 @@
 
 
 namespace Urho3D
 namespace Urho3D
 {
 {
-    class Node;
-    class Scene;
-}
 
 
-using namespace Urho3D;
+class Node;
+class Scene;
+
+}
 
 
 class Character;
 class Character;
 
 

+ 5 - 3
Source/Samples/19_VehicleDemo/Vehicle.h

@@ -27,9 +27,11 @@
 
 
 namespace Urho3D
 namespace Urho3D
 {
 {
-    class Constraint;
-    class Node;
-    class RigidBody;
+
+class Constraint;
+class Node;
+class RigidBody;
+
 }
 }
 
 
 using namespace Urho3D;
 using namespace Urho3D;

+ 4 - 4
Source/Samples/19_VehicleDemo/VehicleDemo.h

@@ -26,11 +26,11 @@
 
 
 namespace Urho3D
 namespace Urho3D
 {
 {
-    class Node;
-    class Scene;
-}
 
 
-using namespace Urho3D;
+class Node;
+class Scene;
+
+}
 
 
 class Vehicle;
 class Vehicle;
 
 

+ 4 - 4
Source/Samples/20_HugeObjectCount/HugeObjectCount.h

@@ -26,11 +26,11 @@
 
 
 namespace Urho3D
 namespace Urho3D
 {
 {
-    class Node;
-    class Scene;
-}
 
 
-using namespace Urho3D;
+class Node;
+class Scene;
+
+}
 
 
 /// Huge object count example.
 /// Huge object count example.
 ///  This sample demonstrates:
 ///  This sample demonstrates:

+ 7 - 1
Source/Samples/Sample.h

@@ -23,7 +23,13 @@
 #pragma once
 #pragma once
 
 
 #include "Application.h"
 #include "Application.h"
-#include "Sprite.h"
+
+namespace Urho3D
+{
+
+class Sprite;
+
+}
 
 
 // All Urho3D classes reside in namespace Urho3D
 // All Urho3D classes reside in namespace Urho3D
 using namespace Urho3D;
 using namespace Urho3D;

+ 1 - 0
Source/Samples/Sample.inl

@@ -27,6 +27,7 @@
 #include "InputEvents.h"
 #include "InputEvents.h"
 #include "Renderer.h"
 #include "Renderer.h"
 #include "ResourceCache.h"
 #include "ResourceCache.h"
+#include "Sprite.h"
 #include "Texture2D.h"
 #include "Texture2D.h"
 #include "UI.h"
 #include "UI.h"
 #include "XMLFile.h"
 #include "XMLFile.h"