Explorar o código

define g_os_event_buffer in OS instead of EventBuffer

mikymod %!s(int64=12) %!d(string=hai) anos
pai
achega
34b832766e

+ 1 - 0
engine/CMakeLists.txt

@@ -302,6 +302,7 @@ set (RESOURCE_HEADERS
 )
 
 set (OS_SRC
+	os/OS.cpp
 	os/EventBuffer.cpp
 )
 

+ 1 - 0
engine/input/InputManager.cpp

@@ -28,6 +28,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "OS.h"
 #include "Log.h"
 #include "EventBuffer.h"
+#include "OsEvents.h"
 
 namespace crown
 {

+ 0 - 8
engine/os/EventBuffer.cpp

@@ -93,12 +93,4 @@ char* EventBuffer::buffer()
 	return m_buffer;
 }
 
-//-----------------------------------------------------------------------------
-EventBuffer g_os_event_buffer;
-
-EventBuffer* os_event_buffer()
-{
-	return &g_os_event_buffer;
-}
-
 } // namespace crown

+ 0 - 5
engine/os/EventBuffer.h

@@ -29,9 +29,6 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include <cstring>
 
 #include "Types.h"
-#include "OS.h"
-#include "Log.h"
-#include "OsEvents.h"
 
 #define MAX_OS_EVENT_BUFFER_SIZE 1024
 
@@ -73,6 +70,4 @@ public:
 	char		m_buffer[MAX_OS_EVENT_BUFFER_SIZE];
 };
 
-EventBuffer* os_event_buffer();
-
 } // namespace crown

+ 39 - 0
engine/os/OS.cpp

@@ -0,0 +1,39 @@
+/*
+Copyright (c) 2013 Daniele Bartolini, Michele Rossi
+Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#include "OS.h"
+
+namespace crown
+{
+
+EventBuffer g_os_event_buffer;
+
+EventBuffer* os_event_buffer()
+{
+	return &g_os_event_buffer;
+}
+
+} // namespace crown

+ 6 - 0
engine/os/OS.h

@@ -32,6 +32,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Types.h"
 #include "Vector.h"
 #include "DynamicString.h"
+#include "EventBuffer.h"
 
 namespace crown
 {
@@ -155,6 +156,11 @@ void*			lookup_symbol(void* library, const char* name);
 /// @a args[n] is NULL.
 void			execute_process(const char* args[]);
 
+//-----------------------------------------------------------------------------
+
 } // namespace os
+
+EventBuffer* 	os_event_buffer();
+
 } // namespace crown
 

+ 1 - 1
engine/os/android/AndroidOS.cpp

@@ -39,9 +39,9 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include <unistd.h>
 
 #include "OS.h"
+#include "OsEvents.h"
 #include "Assert.h"
 #include "StringUtils.h"
-#include "EventBuffer.h"
 
 namespace crown
 {

+ 1 - 1
engine/os/linux/OsWindow.cpp

@@ -29,7 +29,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "OS.h"
 #include "GLContext.h"
 #include "StringUtils.h"
-#include "EventBuffer.h"
+#include "OsEvents.h"
 
 namespace crown
 {