changeset 240:09f40db3f10c

Removed unused TimerListener. Fix: We really don't need to copy the instance list each frame! Fix: Don't swallow mouse focus events (i.o.w mouse entered/exited APP window events. These are now propagated as Command events (for now) and can be used to stop scrolling when the mouse leaves the app window).
author phoku@33b003aa-7bff-0310-803a-e67f0ece8222
date Tue, 24 Mar 2009 16:50:37 +0000
parents 3804348fe3fb
children 99b36f59a5d5
files engine/core/gui/guimanager.cpp engine/core/util/time/timer.cpp engine/core/util/time/timer.h engine/core/view/camera.cpp
diffstat 4 files changed, 4 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/engine/core/gui/guimanager.cpp	Tue Mar 24 16:32:08 2009 +0000
+++ b/engine/core/gui/guimanager.cpp	Tue Mar 24 16:50:37 2009 +0000
@@ -126,10 +126,8 @@
 				return false;
 
 			case SDL_ACTIVEEVENT:
-				if( evt.active.state & SDL_APPMOUSEFOCUS ) {
-					input->pushInput(evt);
-					return true;
-				}
+				// Actually Guichan doesn't care (it should!)
+				// so at least don't swallow mouse_focus events up.
 				return false;
 
 			default:
--- a/engine/core/util/time/timer.cpp	Tue Mar 24 16:32:08 2009 +0000
+++ b/engine/core/util/time/timer.cpp	Tue Mar 24 16:50:37 2009 +0000
@@ -35,8 +35,7 @@
 	// Remember TimeEvent(-1) means that even an registered event won't be called
 	Timer::Timer() 
 		: TimeEvent(-1), 
-		m_active(false),
-		m_listener(0) {
+		m_active(false) {
 	}
 
 	Timer::~Timer() {
@@ -66,10 +65,6 @@
 		m_callback = cb;
 	}
 
-	void Timer::setListener(TimerListener* listener) {
-		m_listener = listener;
-	}
-
 	void Timer::updateEvent(unsigned long) {
 		if(!m_active)
 			return;
@@ -77,8 +72,5 @@
 		if( m_callback ) {
 			m_callback();
 		}
-		if ( m_listener ) {
-			m_listener->onTimer();
-		}
 	}
 }
--- a/engine/core/util/time/timer.h	Tue Mar 24 16:32:08 2009 +0000
+++ b/engine/core/util/time/timer.h	Tue Mar 24 16:50:37 2009 +0000
@@ -35,12 +35,6 @@
 
 namespace FIFE {
 
-	class TimerListener {
-	public:
-		virtual void onTimer() = 0;
-		virtual ~TimerListener() {}
-	};
-
 	/** Simple Timer class
 	 *
 	 *  This is a simple wrapper around the TimeEvent,
@@ -109,16 +103,9 @@
 		 */
 		void setCallback(const type_callback& callback);
 
-		/** Set the listener that will be called
-		 *
-		 */
-		void setListener(TimerListener* listener);
-
-
 	protected:
 		bool m_active;
 		type_callback m_callback;
-		TimerListener* m_listener;
 		void updateEvent(unsigned long);
 	};
 
--- a/engine/core/view/camera.cpp	Tue Mar 24 16:32:08 2009 +0000
+++ b/engine/core/view/camera.cpp	Tue Mar 24 16:50:37 2009 +0000
@@ -497,7 +497,7 @@
 			//  here instead passing it to each renderer.
 			// instances are checked first if their image intersects with the viewport.
 			// this reduces processing load during sorting later
-			std::vector<Instance*> allinstances((*layer_it)->getInstances());
+			const std::vector<Instance*>& allinstances = (*layer_it)->getInstances();
 			std::vector<Instance*>::const_iterator instance_it = allinstances.begin();
 			std::vector<Instance*>& instances_to_render = m_layer_to_instances[*layer_it];
 			for (;instance_it != allinstances.end(); ++instance_it) {