瀏覽代碼

Fixed to compile and run on Ubuntu.

Lasse Öörni 14 年之前
父節點
當前提交
fa80179bdf

+ 13 - 11
CMakeLists.txt

@@ -43,12 +43,15 @@ if (MSVC)
     set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /GL")
     set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /OPT:REF /OPT:ICF /DEBUG")
     set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /OPT:REF /OPT:ICF /LTCG")
-endif ()
-if (MINGW)
+elseif (MINGW)
     set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof")
     set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++ -static-libgcc")
-    set (EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
-endif ()
+    set (EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/Bin)
+else ()
+    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof -m32")
+    set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32")
+    set (EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/Bin)
+endif ()
 
 # Macro for precompiled headers
 macro (enable_pch)
@@ -56,9 +59,9 @@ macro (enable_pch)
         foreach(FILE ${CPP_FILES})
             if (${FILE} MATCHES "Precompiled.cpp$")
                 set_source_files_properties(${FILE} PROPERTIES COMPILE_FLAGS "/YcPrecompiled.h")
-            else()
+            else ()
                 set_source_files_properties(${FILE} PROPERTIES COMPILE_FLAGS "/YuPrecompiled.h")
-            endif()
+            endif ()
         endforeach ()
     endif ()
 endmacro ()
@@ -66,12 +69,11 @@ endmacro ()
 # Macro for exe finalization
 macro (finalize_exe)
     if (MSVC)
-        add_custom_command (TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different $(TARGETPATH) ${PROJECT_BINARY_DIR}/bin)
-        add_custom_command (TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different $(TARGETDIR)$(TARGETNAME).pdb ${PROJECT_BINARY_DIR}/bin)
-    endif ()
-    if (MINGW)
+        add_custom_command (TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different $(TARGETPATH) ${PROJECT_BINARY_DIR}/Bin)
+        add_custom_command (TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different $(TARGETDIR)$(TARGETNAME).pdb ${PROJECT_BINARY_DIR}/Bin)
+    else ()
         add_custom_command (TARGET ${TARGET_NAME} POST_BUILD COMMAND strip ARGS ${EXECUTABLE_OUTPUT_PATH}/${TARGET_NAME}${CMAKE_EXECUTABLE_SUFFIX})
-    endif ()
+    endif ()
 endmacro ()
 
 # Macro for lib finalization

+ 4 - 4
Engine/Audio/Audio.cpp

@@ -208,13 +208,13 @@ bool Audio::SetMode(int bufferLengthMSec, int mixRate, bool sixteenBit, bool ste
     
     // For SDL, do not actually use the buffer length, but calculate a suitable power-of-two size from the mixrate
     if (desired.freq <= 11025)
-        desired.samples = 256;
-    else if (desired.freq <= 22050)
         desired.samples = 512;
-    else if (desired.freq <= 44100)
+    else if (desired.freq <= 22050)
         desired.samples = 1024;
-    else
+    else if (desired.freq <= 44100)
         desired.samples = 2048;
+    else
+        desired.samples = 4096;
     
     desired.callback = SDLAudioCallback;
     desired.userdata = this;

+ 3 - 3
Engine/Core/ProcessUtils.cpp

@@ -26,13 +26,13 @@
 #include "ProcessUtils.h"
 
 #include <cstdio>
-#include <list>
-#include <io.h>
 #include <fcntl.h>
 #include <time.h>
 
 #ifdef WIN32
 #include <Windows.h>
+#else
+#include <unistd.h>
 #endif
 
 #ifdef USE_SDL
@@ -51,7 +51,7 @@ void ErrorDialog(const char* title, const char* message)
     #ifdef WIN32
     MessageBox(0, message, title, 0);
     #else
-    printf("%s", message);
+    printf("%s\n", message);
     #endif
 }
 

+ 32 - 6
Engine/Graphics/OpenGL/OGLGraphics.cpp

@@ -54,14 +54,34 @@
 
 #ifdef _MSC_VER
 #include <float.h>
+#else
+// From http://stereopsis.com/FPU.html
+
+#define FPU_CW_PREC_MASK        0x0300
+#define FPU_CW_PREC_SINGLE      0x0000
+#define FPU_CW_PREC_DOUBLE      0x0200
+#define FPU_CW_PREC_EXTENDED    0x0300
+#define FPU_CW_ROUND_MASK       0x0c00
+#define FPU_CW_ROUND_NEAR       0x0000
+#define FPU_CW_ROUND_DOWN       0x0400
+#define FPU_CW_ROUND_UP         0x0800
+#define FPU_CW_ROUND_CHOP       0x0c00
+
+inline unsigned GetFPUState()
+{
+    unsigned control = 0;
+    __asm__ __volatile__ ("fnstcw %0" : "=m" (control));
+    return control;
+}
+
+inline void SetFPUState(unsigned control)
+{
+    __asm__ __volatile__ ("fldcw %0" : : "m" (control));
+}
 #endif
 
 #include "DebugNew.h"
 
-//#ifdef _MSC_VER
-//#pragma warning(disable:4355)
-//#endif
-
 static const unsigned glCmpFunc[] =
 {
     GL_ALWAYS,
@@ -223,9 +243,15 @@ bool Graphics::SetMode(RenderMode mode, int width, int height, bool fullscreen,
         }
     }
     
-    // Mimic Direct3D way of setting FPU into round-to-nearest, single precision mode
+    // Mimic Direct3D way of setting FPU into round-to-nearest, single precision mode
+    // This is actually needed for ODE to behave predictably in float mode
     #ifdef _MSC_VER
-    _controlfp(_RC_NEAR | _PC_24, _MCW_RC | _MCW_PC);
+    _controlfp(_RC_NEAR | _PC_24, _MCW_RC | _MCW_PC);
+    #else
+    unsigned control = GetFPUState();
+    control &= ~(FPU_CW_PREC_MASK | FPU_CW_ROUND_MASK);
+    control |= (FPU_CW_PREC_SINGLE | FPU_CW_ROUND_NEAR);
+    SetFPUState(control);
     #endif
     
     // If OpenGL extensions not yet initialized, initialize now

+ 2 - 1
Engine/Graphics/OpenGL/OGLGraphicsImpl.h

@@ -26,7 +26,8 @@
 #include "Color.h"
 #include "Map.h"
 
-#include <GLee.h>
+#include <GLee.h>
+#include <SDL.h>
 
 /// Graphics implementation
 class GraphicsImpl

+ 1 - 1
Engine/Graphics/OpenGL/OGLShader.cpp

@@ -31,7 +31,7 @@
 #include "ResourceCache.h"
 #include "Shader.h"
 #include "ShaderVariation.h"
-#include "XMLFIle.h"
+#include "XMLFile.h"
 
 OBJECTTYPESTATIC(Shader);
 

+ 0 - 1
Engine/Graphics/View.cpp

@@ -39,7 +39,6 @@
 #include "Technique.h"
 #include "Texture2D.h"
 #include "TextureCube.h"
-#include "Time.h"
 #include "VertexBuffer.h"
 #include "View.h"
 #include "Zone.h"

+ 22 - 13
Engine/IO/FileSystem.cpp

@@ -29,20 +29,23 @@
 #include "SharedArrayPtr.h"
 
 #include <cstdio>
-#include <direct.h>
-#include <process.h>
 
 #ifdef WIN32
 #include <Windows.h>
-#include <Shellapi.h>
+#include <Shellapi.h>
+#include <direct.h>
+#include <process.h>
 // Enable SHGetSpecialFolderPath on MinGW
 #ifndef _MSC_VER
-#define _WIN32_IE 0x0400
+#define _WIN32_IE 0x0400st
 #endif
 #include <Shlobj.h>
-#else
+#else
+#include <dirent.h>
+#include <errno.h>
 #include <unistd.h>
-#include <sys/stat.h>
+#include <sys/stat.h>
+#define MAX_PATH 256
 #endif
 
 #include "DebugNew.h"
@@ -117,7 +120,8 @@ int FileSystem::SystemCommand(const String& commandLine)
 }
 
 int FileSystem::SystemRun(const String& fileName, const Vector<String>& arguments)
-{
+{
+    #ifdef WIN32
     if (allowedPaths_.Empty())
     {
         String fixedFileName = GetNativePath(fileName);
@@ -134,7 +138,12 @@ int FileSystem::SystemRun(const String& fileName, const Vector<String>& argument
     {
         LOGERROR("Executing an external command is not allowed");
         return -1;
-    }
+    }
+    #else
+    /// \todo Implement on Unix-like systems
+    LOGERROR("SystemRun not implemented");
+    return false;
+    #endif
 }
 
 bool FileSystem::SystemOpen(const String& fileName, const String& mode)
@@ -160,7 +169,7 @@ bool FileSystem::SystemOpen(const String& fileName, const String& mode)
         return false;
     }
     #else
-    /// \todo Implement on Unix-like systems, if possible
+    /// \todo Implement on Unix-like systems
     LOGERROR("SystemOpen not implemented");
     return false;
     #endif
@@ -269,8 +278,8 @@ bool FileSystem::FileExists(const String& fileName)
     if ((attributes == INVALID_FILE_ATTRIBUTES) || (attributes & FILE_ATTRIBUTE_DIRECTORY))
         return false;
     #else
-    struct stat fileInfo;
-    if ((stat(fixedName.CString(), &fileInfo)) || (stat.st_mode & S_IFDIR))
+    struct stat st;
+    if ((stat(fixedName.CString(), &st)) || (st.st_mode & S_IFDIR))
         return false;
     #endif
     
@@ -288,8 +297,8 @@ bool FileSystem::DirExists(const String& pathName)
     if ((attributes == INVALID_FILE_ATTRIBUTES) || (!(attributes & FILE_ATTRIBUTE_DIRECTORY)))
         return false;
     #else
-    struct stat fileInfo;
-    if ((stat(fixedName.CString(), &fileInfo)) || (!(stat.st_mode & S_IFDIR)))
+    struct stat st;
+    if ((stat(fixedName.CString(), &st)) || (!(st.st_mode & S_IFDIR)))
         return false;
     #endif
     

+ 0 - 1
Engine/UI/UI.cpp

@@ -44,7 +44,6 @@
 #include "Slider.h"
 #include "Text.h"
 #include "Texture2D.h"
-#include "Time.h"
 #include "UI.h"
 #include "UIEvents.h"
 #include "Window.h"

+ 0 - 0
SourceAssets/Models/jack.mesh.xml → SourceAssets/Models/Jack.mesh.xml


+ 0 - 0
SourceAssets/Models/jack.skeleton.xml → SourceAssets/Models/Jack.skeleton.xml


+ 0 - 0
SourceAssets/Models/level.mesh.xml → SourceAssets/Models/Level.mesh.xml


+ 0 - 0
SourceAssets/Models/mushroom.mesh.xml → SourceAssets/Models/Mushroom.mesh.xml


+ 0 - 0
SourceAssets/Models/mushroom.skeleton.xml → SourceAssets/Models/Mushroom.skeleton.xml


+ 1 - 1
SourceAssets/Models/ninja.mesh.xml → SourceAssets/Models/Ninja.mesh.xml

@@ -7769,5 +7769,5 @@
             </boneassignments>
         </submesh>
     </submeshes>
-    <skeletonlink name="ninja.skeleton" />
+    <skeletonlink name="Ninja.skeleton" />
 </mesh>

+ 0 - 0
SourceAssets/Models/ninja.skeleton.xml → SourceAssets/Models/Ninja.skeleton.xml


+ 0 - 0
SourceAssets/Models/potion.mesh.xml → SourceAssets/Models/Potion.mesh.xml


+ 0 - 0
SourceAssets/Models/snowball.mesh.xml → SourceAssets/Models/SnowBall.mesh.xml


+ 0 - 0
SourceAssets/Models/snowcrate.mesh.xml → SourceAssets/Models/SnowCrate.mesh.xml


+ 6 - 2
ThirdParty/ENet/CMakeLists.txt

@@ -12,6 +12,10 @@ include_directories (
 )
 
 # Define target & libraries to link
-add_library (${TARGET_NAME} STATIC ${SOURCE_FILES})
-target_link_libraries (${TARGET_NAME} ws2_32.lib)
+add_library (${TARGET_NAME} STATIC ${SOURCE_FILES})
+
+if (WIN32)
+    target_link_libraries (${TARGET_NAME} ws2_32.lib)
+endif()
+
 finalize_lib ()

+ 0 - 4
ThirdParty/ENet/unix.c

@@ -30,10 +30,6 @@
 #include <sys/poll.h>
 #endif
 
-#ifndef HAS_SOCKLEN_T
-typedef int socklen_t;
-#endif
-
 #ifndef MSG_NOSIGNAL
 #define MSG_NOSIGNAL 0
 #endif

+ 2 - 0
ThirdParty/GLee/GLee.c

@@ -43,6 +43,8 @@
 #include <stdlib.h>
 #include <string.h>
 #include "GLee.h"
+
+#include <SDL.h>
 
 typedef GLuint(*GLEE_LINK_FUNCTION)(void);
 

+ 10 - 3
ThirdParty/GLee/GLee.h

@@ -38,10 +38,17 @@
 #ifndef __glee_h_
 #define __glee_h_
 
-#define NO_SDL_GLEXT
+// Do not include OpenGL extensions from the system headers
+#define __glext_h_
 
-#include <SDL.h>
-#include <SDL_opengl.h>
+#ifdef __WIN32__
+#include <Windows.h>
+#endif
+#if defined(__MACOSX__)
+#include <OpenGL/gl.h>
+#else
+#include <GL/gl.h>
+#endif
 
 #ifndef APIENTRY
 	#define APIENTRY

+ 22 - 5
ThirdParty/SDL/CMakeLists.txt

@@ -3,13 +3,30 @@ set (TARGET_NAME SDL)
 
 # Define source files
 file (GLOB C_FILES
-    src/*.c src/atomic/*.c src/audio/*.c src/audio/windx5/*.c src/audio/dummy/*.c src/core/windows/*.c src/cpuinfo/*.c src/events/*.c src/file/*.c src/libm/*.c src/loadso/windows/*.c src/render/*.c src/render/opengl/*.c src/render/software/*.c src/stdlib/*.c src/thread/*.c src/thread/windows/*.c src/timer/*.c src/timer/windows/*.c src/video/*.c src/video/windows/*.c)
-    
+    src/*.c src/atomic/*.c src/audio/*.c src/audio/dummy/*.c src/cpuinfo/*.c src/events/*.c src/file/*.c src/libm/*.c src/render/*.c src/render/opengl/*.c src/render/software/*.c src/stdlib/*.c src/thread/*.c src/timer/*.c src/video/*.c
+)
+    
+if (WIN32)
+    file (GLOB PLATFORM_C_FILES
+        src/audio/windx5/*.c src/core/windows/*.c src/loadso/windows/*.c src/thread/windows/*.c src/timer/windows/*.c src/video/windows/*.c
+    )
+elseif (UNIX)
+    file (GLOB PLATFORM_C_FILES
+        src/audio/alsa/*.c src/audio/dma/*.c src/audio/dsp/*.c src/loadso/dlopen/*.c src/thread/pthread/*.c src/timer/unix/*.c src/video/x11/*.c        
+    )
+endif ()
+
 file (GLOB H_FILES include/*.h)
 
-set (SOURCE_FILES ${C_FILES} ${H_FILES})
+set (SOURCE_FILES ${C_FILES} ${PLATFORM_C_FILES} ${H_FILES})
 
 # Define target & libraries to link
-add_library (${TARGET_NAME} STATIC ${SOURCE_FILES})
-target_link_libraries (${TARGET_NAME} winmm.lib opengl32.lib)
+add_library (${TARGET_NAME} STATIC ${SOURCE_FILES})
+
+if (WIN32)
+    target_link_libraries (${TARGET_NAME} winmm.lib opengl32.lib)
+elseif (UNIX)
+    target_link_libraries (${TARGET_NAME} dl GL pthread)
+endif ()
+
 finalize_lib ()

+ 3 - 7
ThirdParty/SDL/include/SDL_config.h

@@ -19,6 +19,8 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
+// Modified by Lasse Öörni for Urho3D
+
 #ifndef _SDL_config_h
 #define _SDL_config_h
 
@@ -35,14 +37,8 @@
 #include "SDL_config_windows.h"
 #elif defined(__MACOSX__)
 #include "SDL_config_macosx.h"
-#elif defined(__IPHONEOS__) 
-#include "SDL_config_iphoneos.h"
-#elif defined(__ANDROID__)
-#include "SDL_config_android.h"
-#elif defined(__NINTENDODS__)
-#include "SDL_config_nintendods.h"
 #else
-#include "SDL_config_minimal.h"
+#include "SDL_config_linux.h"
 #endif /* platform config */
 
 #endif /* _SDL_config_h */

+ 202 - 0
ThirdParty/SDL/include/SDL_config_linux.h

@@ -0,0 +1,202 @@
+/* include/SDL_config.h.  Generated from SDL_config.h.in by configure.  */
+/*
+  Simple DirectMedia Layer
+  Copyright (C) 1997-2011 Sam Lantinga <[email protected]>
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+*/
+
+// Modified by Lasse Öörni for Urho3D
+
+#ifndef _SDL_config_linux_h
+#define _SDL_config_linux_h
+
+/**
+ *  \file SDL_config.h.in
+ *
+ *  This is a set of defines to configure the SDL features
+ */
+
+/* General platform specific identifiers */
+#include "SDL_platform.h"
+
+
+/* Make sure that this isn't included by Visual C++ */
+#ifdef _MSC_VER
+#error You should run hg revert SDL_config.h 
+#endif
+
+/* C language features */
+/* #undef const */
+/* #undef inline */
+/* #undef volatile */
+
+/* C datatypes */
+#define SIZEOF_VOIDP 4
+#define HAVE_GCC_ATOMICS 1
+/* #undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET */
+
+/* Comment this if you want to build without any C library requirements */
+#define HAVE_LIBC 1
+#if HAVE_LIBC
+
+/* Useful headers */
+#define HAVE_ALLOCA_H 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_STDIO_H 1
+#define STDC_HEADERS 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STDARG_H 1
+#define HAVE_MALLOC_H 1
+#define HAVE_MEMORY_H 1
+#define HAVE_STRING_H 1
+#define HAVE_STRINGS_H 1
+#define HAVE_INTTYPES_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_CTYPE_H 1
+#define HAVE_MATH_H 1
+#define HAVE_ICONV_H 1
+#define HAVE_SIGNAL_H 1
+/* #undef HAVE_ALTIVEC_H */
+
+/* C library functions */
+#define HAVE_MALLOC 1
+#define HAVE_CALLOC 1
+#define HAVE_REALLOC 1
+#define HAVE_FREE 1
+#define HAVE_ALLOCA 1
+#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */
+#define HAVE_GETENV 1
+#define HAVE_SETENV 1
+#define HAVE_PUTENV 1
+#define HAVE_UNSETENV 1
+#endif
+#define HAVE_QSORT 1
+#define HAVE_ABS 1
+#define HAVE_BCOPY 1
+#define HAVE_MEMSET 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MEMCMP 1
+#define HAVE_STRLEN 1
+/* #undef HAVE_STRLCPY */
+/* #undef HAVE_STRLCAT */
+#define HAVE_STRDUP 1
+/* #undef HAVE__STRREV */
+/* #undef HAVE__STRUPR */
+/* #undef HAVE__STRLWR */
+/* #undef HAVE_INDEX */
+/* #undef HAVE_RINDEX */
+#define HAVE_STRCHR 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRSTR 1
+/* #undef HAVE_ITOA */
+/* #undef HAVE__LTOA */
+/* #undef HAVE__UITOA */
+/* #undef HAVE__ULTOA */
+#define HAVE_STRTOL 1
+#define HAVE_STRTOUL 1
+/* #undef HAVE__I64TOA */
+/* #undef HAVE__UI64TOA */
+#define HAVE_STRTOLL 1
+#define HAVE_STRTOULL 1
+#define HAVE_STRTOD 1
+#define HAVE_ATOI 1
+#define HAVE_ATOF 1
+#define HAVE_STRCMP 1
+#define HAVE_STRNCMP 1
+/* #undef HAVE__STRICMP */
+#define HAVE_STRCASECMP 1
+/* #undef HAVE__STRNICMP */
+#define HAVE_STRNCASECMP 1
+#define HAVE_SSCANF 1
+#define HAVE_SNPRINTF 1
+#define HAVE_VSNPRINTF 1
+#define HAVE_M_PI /**/
+#define HAVE_ATAN 1
+#define HAVE_ATAN2 1
+#define HAVE_CEIL 1
+#define HAVE_COPYSIGN 1
+#define HAVE_COS 1
+#define HAVE_COSF 1
+#define HAVE_FABS 1
+#define HAVE_FLOOR 1
+#define HAVE_LOG 1
+#define HAVE_POW 1
+#define HAVE_SCALBN 1
+#define HAVE_SIN 1
+#define HAVE_SINF 1
+#define HAVE_SQRT 1
+#define HAVE_SIGACTION 1
+#define HAVE_SETJMP 1
+#define HAVE_NANOSLEEP 1
+#define HAVE_SYSCONF 1
+/* #undef HAVE_SYSCTLBYNAME */
+/* #undef HAVE_CLOCK_GETTIME */
+/* #undef HAVE_GETPAGESIZE */
+#define HAVE_MPROTECT 1
+#define HAVE_ICONV 1
+
+#else
+/* We may need some replacement for stdarg.h here */
+#include <stdarg.h>
+#endif /* HAVE_LIBC */
+
+/* SDL internal assertion support */
+/* #undef SDL_DEFAULT_ASSERT_LEVEL */
+
+/* Allow disabling of core subsystems */
+#define SDL_JOYSTICK_DISABLED 1
+#define SDL_HAPTIC_DISABLED 1
+#define SDL_POWER_DISABLED 1
+
+/* Enable various audio drivers */
+#define SDL_AUDIO_DRIVER_ALSA 1
+#define SDL_AUDIO_DRIVER_ALSA_DYNAMIC "libasound.so.2"
+#define SDL_AUDIO_DRIVER_DUMMY 1
+#define SDL_AUDIO_DRIVER_OSS 1
+
+/* Enable various input drivers */
+#define SDL_INPUT_LINUXEV 1
+
+/* Enable various shared object loading systems */
+#define SDL_LOADSO_DLOPEN 1
+
+/* Enable various threading systems */
+#define SDL_THREAD_PTHREAD 1
+#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
+
+/* Enable various timer systems */
+#define SDL_TIMER_UNIX 1
+
+/* Enable various video drivers */
+#define SDL_VIDEO_DRIVER_X11 1
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC "libX11.so.6"
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "libXext.so.6"
+#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "libXxf86vm.so.1"
+#define SDL_VIDEO_DRIVER_X11_XSHAPE 1
+#define SDL_VIDEO_DRIVER_X11_XVIDMODE 1
+#define SDL_VIDEO_RENDER_OGL 1
+
+/* Enable OpenGL support */
+#define SDL_VIDEO_OPENGL 1
+#define SDL_VIDEO_OPENGL_GLX 1
+
+/* Enable assembly routines */
+#define SDL_ASSEMBLY_ROUTINES 1
+
+#endif /* _SDL_config_linux_h */

+ 1 - 1
Tools/OgreImporter/CMakeLists.txt

@@ -16,4 +16,4 @@ include_directories (
 add_executable (${TARGET_NAME} ${SOURCE_FILES})
 target_link_libraries (${TARGET_NAME} Container Core Graphics IO Math Resource TinyXML)
 finalize_exe ()
-
+

+ 6 - 5
Tools/OgreImporter/OgreImporter.cpp

@@ -132,7 +132,8 @@ void LoadSkeleton(const String& skeletonFileName)
     XMLElement skeletonRoot;
     File skeletonFileSource(context_);
     skeletonFileSource.Open(skeletonFileName);
-    skelFile_->Load(skeletonFileSource);
+    if (!skelFile_->Load(skeletonFileSource))
+        PrintLine("Failed to load skeleton " + skeletonFileName);
     skeletonRoot = skelFile_->GetRootElement();
     
     if (skeletonRoot)
@@ -414,12 +415,12 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
         subGeometryLodLevel.indexCount_ = indices;
         if (vertexStart + vertices > 65535)
             iBuf->indexSize_ = sizeof(unsigned);
-        
+        
+        XMLElement boneAssignments = subMesh.GetChildElement("boneassignments");
         if (bones_.Size())
         {
-            XMLElement boneAssignments = subMesh.GetChildElement("boneassignments");
             if (boneAssignments)
-            {
+            {
                 XMLElement boneAssignment = boneAssignments.GetChildElement("vertexboneassignment");
                 while (boneAssignment)
                 {
@@ -529,7 +530,7 @@ void LoadMesh(const String& inputFileName, bool generateTangents, bool splitSubM
                 }
             }
         }
-        else
+        else if (boneAssignments)
             PrintLine("No skeleton loaded, skipping skinning information");
         
         indexStart += indices;

+ 3 - 4
Urho3D/Urho3D.cpp

@@ -29,7 +29,6 @@
 #include "ProcessUtils.h"
 #include "ResourceCache.h"
 #include "ScriptFile.h"
-#include "Time.h"
 
 #include <stdexcept>
 
@@ -64,11 +63,11 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevInstance, PSTR cmdLine, in
 int main(int argc, char** argv)
 {
     String cmdLine;
-    for (int i = 0; i < argc; ++i)
+    for (int i = 1; i < argc; ++i)
     {
-        if (i)
+        if (i > 1)
             cmdLine += ' ';
-        cmdLine += argv[i];
+        cmdLine += String(argv[i]);
     }
     
     Run(cmdLine.CString());

+ 1 - 0
cmake_gcc.sh

@@ -0,0 +1 @@
+cmake -G "Unix Makefiles"

+ 0 - 0
cmake_gcc.bat → cmake_mingw.bat