Jelajahi Sumber

Some deleted files I forgot to check in

Marko Pintera 12 tahun lalu
induk
melakukan
96900c0d9f

+ 2 - 2
CamelotClient/CamelotClient.cpp

@@ -36,9 +36,9 @@
 #include "CmRTTIType.h"
 #include "CmCursor.h"
 
-//#define DX11
+#define DX11
 //#define DX9
-#define GL
+//#define GL
 
 using namespace CamelotFramework;
 using namespace BansheeEditor;

+ 0 - 97
CamelotClient/CmDebugCamera.cpp

@@ -1,97 +0,0 @@
-#include "CmDebugCamera.h"
-#include "CmInput.h"
-#include "CmVector3.h"
-#include "CmTime.h"
-#include "CmMath.h"
-#include "CmSceneObject.h"
-#include "BsCamera.h"
-#include "CmCursor.h"
-
-using namespace BansheeEngine;
-
-namespace CamelotFramework
-{
-	const float DebugCamera::START_SPEED = 40.0f;
-	const float DebugCamera::TOP_SPEED = 130.0f;
-	const float DebugCamera::ACCELERATION = 10.0f;
-	const float DebugCamera::FAST_MODE_MULTIPLIER = 2.0f;
-	const float DebugCamera::ROTATION_SPEED = 0.5f; // Degrees/pixel
-
-	DebugCamera::DebugCamera(const HSceneObject& parent)
-		:Component(parent), mPitch(0.0f), mYaw(0.0f), mLastButtonState(false)
-	{
-		mCamera = sceneObject()->getComponent<Camera>();
-		mCamera->setNearClipDistance(5);
-
-		//gameObject()->setPosition(Vector3(0,0,5050));
-		//gameObject()->lookAt(Vector3(0,0,-300));
-
-		sceneObject()->setPosition(Vector3(0,0,0));
-		sceneObject()->lookAt(Vector3(0,0,-1));
-	}
-
-	void DebugCamera::update()
-	{
-		bool goingForward = gInput().isButtonDown(BC_W) || gInput().isButtonDown(BC_UP);
-		bool goingBack = gInput().isButtonDown(BC_S) || gInput().isButtonDown(BC_DOWN);
-		bool goingLeft = gInput().isButtonDown(BC_A) || gInput().isButtonDown(BC_LEFT);
-		bool goingRight = gInput().isButtonDown(BC_D) || gInput().isButtonDown(BC_RIGHT);
-		bool fastMove = gInput().isButtonDown(BC_LSHIFT);
-		bool camRotating = gInput().isButtonDown(BC_MOUSE_RIGHT);
-
-		if(camRotating != mLastButtonState)
-		{
-			if(camRotating)
-				Cursor::hide();
-			else
-				Cursor::show();
-
-			mLastButtonState = camRotating;
-		}
-
-		Vector3 direction = Vector3::ZERO;
-		if (goingForward) direction += SO()->getForward();
-		if (goingBack) direction -= SO()->getForward();
-		if (goingRight) direction += SO()->getRight();
-		if (goingLeft) direction -= SO()->getRight();
-
-		if (direction.squaredLength() != 0)
-		{
-			direction.normalize();
-
-			float multiplier = 1.0f;
-			if(fastMove)
-				multiplier = FAST_MODE_MULTIPLIER;
-
-			mCurrentSpeed = Math::Clamp(mCurrentSpeed + ACCELERATION * gTime().getFrameDelta(), START_SPEED, TOP_SPEED);
-			mCurrentSpeed *= multiplier;
-		}
-		else
-		{
-			mCurrentSpeed = 0.0f;
-		}
-
-		float tooSmall = std::numeric_limits<float>::epsilon();
-		if(mCurrentSpeed > tooSmall)
-		{
-			Vector3 velocity = direction * mCurrentSpeed;
-			SO()->move(velocity * gTime().getFrameDelta());
-		}
-
-		if(camRotating)
-		{
-			mYaw += Degree(gInput().getHorizontalAxis() * ROTATION_SPEED);
-			mPitch += Degree(gInput().getVerticalAxis() * ROTATION_SPEED);
-
-			Quaternion yRot;
-			yRot.FromAngleAxis(Radian(mYaw), Vector3::UP);
-
-			Quaternion xRot;
-			xRot.FromAngleAxis(Radian(mPitch), yRot.xAxis());
-
-			Quaternion camRot = xRot * yRot;
-
-			SO()->setRotation(camRot);
-		}
-	}
-}

+ 0 - 39
CamelotClient/CmDebugCamera.h

@@ -1,39 +0,0 @@
-#pragma once
-
-#include "BsPrerequisites.h"
-#include "CmComponent.h"
-#include "CmMath.h"
-
-namespace CamelotFramework
-{
-	class DebugCamera : public Component
-	{
-	private:
-		float mCurrentSpeed;
-
-		Degree mPitch;
-		Degree mYaw;
-		bool mLastButtonState;
-
-		BS::HCamera mCamera;
-
-		static const float START_SPEED;
-		static const float TOP_SPEED;
-		static const float ACCELERATION;
-		static const float FAST_MODE_MULTIPLIER;
-		static const float ROTATION_SPEED; // Degrees/second
-
-		/************************************************************************/
-		/* 						COMPONENT OVERRIDES                      		*/
-		/************************************************************************/
-	protected:
-		friend class SceneObject;
-
-		/** Standard constructor.
-        */
-		DebugCamera(const HSceneObject& parent);
-
-	public:
-		virtual void update();
-	};
-}

+ 0 - 39
CamelotClient/CmTestTextSprite.cpp

@@ -1,39 +0,0 @@
-#include "CmTestTextSprite.h"
-#include "CmSceneObject.h"
-#include "BsRenderable.h"
-#include "CmMesh.h"
-#include "CmVector2.h"
-#include "BsTextSprite.h"
-#include "CmFont.h"
-#include "CmMaterial.h"
-#include "BsGUILabel.h"
-#include "BsGUISkin.h"
-#include "BsOverlayManager.h"
-#include "BsSpriteTexture.h"
-#include "BsEngineGUI.h"
-
-using namespace BansheeEngine;
-
-namespace CamelotFramework
-{
-	TestTextSprite::TestTextSprite(const HSceneObject& parent)
-		:GUIWidget(parent)
-	{
-	}
-
-	TestTextSprite::~TestTextSprite()
-	{
-	}
-
-	void TestTextSprite::init(const HCamera& camera, const String& text)
-	{
-		setSkin(&EngineGUI::instance().getSkin());
-
-		GUILabel::create(*this, toWString(text));
-	}
-
-	void TestTextSprite::update()
-	{
-
-	}
-}

+ 0 - 19
CamelotClient/CmTestTextSprite.h

@@ -1,19 +0,0 @@
-#include "BsPrerequisites.h"
-#include "BsGUIWidget.h"
-
-namespace CamelotFramework
-{
-	class TestTextSprite : public BansheeEngine::GUIWidget
-	{
-	protected:
-		friend class CM::SceneObject;
-
-		TestTextSprite(const HSceneObject& parent);
-	public:
-		~TestTextSprite();
-
-		virtual void update();
-
-		void init(const BS::HCamera& camera, const String& text);
-	};
-}

+ 17 - 26
EditorWindowDock.txt

@@ -1,23 +1,3 @@
-DockManager
- - DOCKING: When user drags a window, EditorWidgetContainer detects that and reacts accordingly
-   - For title bar it draws the drop locations, and does the same for content
-   - After the drop is done it just notifies the DockManager (if the drop was on contents) with addWidgetRelativeToMe(this, location, draggedWidget)
-      - (If the drop was done on the title bar, then the EditorWidgetContainer can handle that internally)
-	  - Drop manager creates two new DockedWindowContainers
-	   - Existing a new widgets are moved into each. Existing container (for the existing widget) now becomes the parent of the two new containers.
-	   - Size of the new containers are adjusted (and containers internally adjust the size of their widgets, and/or their child containers)
-	  - A spacer widget is added between them, that may be used for resizing. DockedWindowContainers on both sides of the spacer and kept as a reference
-   - Also, make sure to detect a case when there are no widgets in the dock manager
-   - Resizing a DockedWindowContainer recursivelly resizes all child containers
- - UNDOCKING: If the last EditorWidget is removed from EditorWidgetContainer, DockManager is notified and it takes care of removing the relevant
-   DockedWindowContainer and the spacer.
-
-TODO - Possibly add a way to have hidden widgets in the EditorWidgetContainer (like side-bars that pop on mouse over in Visual Studio)
-TODO - A way to persist window states
-  - Also a way to reset all widgets to original locations
-
-------------------------
-
 DockManager implementation plan:
  - DockManager main class
    - When empty make sure it has a GUIElement that covers its entire space so it can catch and drop events. Will likely need a special transparent GUIElement?
@@ -39,16 +19,27 @@ DockContainer biggest issues:
 
 FIRST CREATE DOCK CONTAINER WITHOUT DRAG AND DROP SUPPORT
 
-Add RenderTexture::create
- - Attempt creating one and attaching it to the primary camera
- - Test DX9/DX11/OpenGL
- - Figure out how to use it for display, and then create a GUIRenderTexture element.
-    - Rendering from it should technically just involve setting it as a sprite texture and using ImageSprite
+RenderTexture issues:
+ Fix up GUI render texture so it isn't transparent
+ Rename waitUntilInitialized to synchronize()
+ Set up a GUIViewport element which sets up a camera so it renders to that part of the window
+
+ DirectX 9 currently DOES NOT support bindable render textures:
+  - Bindable render textures should be created using CreateTexture and D3DUSAGE_RENDERTARGET/D3DUSAGE_DEPTHSTENCIL
+   - UNLESS render target is using antialiasing, in which case it cannot be bound and should be created as it
+    - However if it cannot be bound I should warn the user (in RenderTexture::getBindable* methods)
 
 Make sure to test everything thoroughly - right now I have tested very little
 Drag and drop manager currently ignores the provided icon, but it should use it as a cursor
 
-TODO - Prevent docking if available size is less than 20 pixels, otherwise there might be some weirdness
+Prevent docking if available size is less than 20 pixels, otherwise there might be some weirdness
+
+------------------------
+
+Other things to remember:
+ - Possibly add a way to have hidden widgets in the EditorWidgetContainer (like side-bars that pop on mouse over in Visual Studio)
+ - A way to persist window states
+ - Also a way to reset all widgets to original locations
 
 ------------------------