diff --git a/COMPILE-linux.txt b/COMPILE-linux.txt index a6af2cd07..af2436e55 100644 --- a/COMPILE-linux.txt +++ b/COMPILE-linux.txt @@ -74,7 +74,7 @@ OpenAL: http://openal.org/ Linux source: http://kcat.strangesoft.net/openal.html OIS: http://sourceforge.net/projects/wgois/ FFmpeg: http://ffmpeg.mplayerhq.hu/download.html -Bullet: (fill in here) +Bullet: http://bulletphysics.com/ Setting up Bullet ----------------- diff --git a/COMPILE-win32.txt b/COMPILE-win32.txt index bd1da4b66..2ea334629 100644 --- a/COMPILE-win32.txt +++ b/COMPILE-win32.txt @@ -77,17 +77,41 @@ OGRE: http://ogre3d.org OIS: Comes with the Ogre SDK OpenAL: http://openal.org/ FFmpeg: http://ffmpeg.mplayerhq.hu/ -Bullet: (fill in here) +Bullet: http://bulletphysics.com/ The biggest problem is the lack of a prebuilt SDKs for FFmpeg and Bullet. You must build these yourself. -FFmpeg must build it under Mingw (not Cygwin!). I found the following +FFmpeg: + +FFmpeg must be built under Mingw (not Cygwin!). I found the following link helpful (read the comments as well, not just the post itself): http://www.gooli.org/blog/building-ffmpeg-for-windows-with-msys-and-mingw/ -Bullet: (not written yet) +After building, place the dll files in the openmw "root" (same place +as build_openmw.bat) and the include files in includes/ffmpeg. Refer +to build_openmw.bat for the exact names and locations of expected files. +Bullet: + +Bullet must also be built with Mingw. I used the MSYS shell for this, +and the following commands: + +cmake -G "MinGW Makefiles" +make + +There might be errors building the demos, but as long as the library +files are built, this is OK. Use the command "find -iname *.a" to +locate the libraries. The files you need are libLibBulletDynamics.a, +libLibBulletCollision.a and libLibLinearMath.a. Copy these to the +"root" openmw directory and rename them to: +libbulletdynamics.a +libbulletcollision.a +libbulletmath.a + +Move or copy the entire src/ folder to openmw/includes/ and rename it +to bullet/. Only the .h files are needed, you can delete everything +else if you want. Building diff --git a/build_openmw.bat b/build_openmw.bat index 0169abeca..8c4f8f2d8 100755 --- a/build_openmw.bat +++ b/build_openmw.bat @@ -5,6 +5,7 @@ rem See COMPILE-win32.txt for instructions. echo Compiling C++ files g++ -c sound\cpp_avcodec.cpp -I.\includes\ffmpeg\ g++ -c ogre\cpp_ogre.cpp -I.\includes\ogre\ +g++ -c bullet\cpp_bullet.cpp -I.\includes\bullet\ echo Compiling main program (openmw.exe) -gdc -Wall -g openmw.d bsa\*.d core\*.d esm\*.d input\*.d nif\*.d ogre\*.d scene\*.d sound\*.d util\*.d cpp_ogre.o cpp_avcodec.o monster\util\*.d avcodec-51.dll avformat-52.dll avdevice-52.dll avutil-49.dll openal32.dll ogremain_d.dll OIS_d.dll -lstdc++ -o openmw.exe +gdc -Wall -g openmw.d bsa\*.d core\*.d esm\*.d input\*.d nif\*.d ogre\*.d scene\*.d sound\*.d util\*.d bullet\*.d cpp_ogre.o cpp_avcodec.o cpp_bullet.o libbulletdynamics.a libbulletcollision.a libbulletmath.a monster\util\*.d avcodec-51.dll avformat-52.dll avdevice-52.dll avutil-49.dll openal32.dll ogremain_d.dll OIS_d.dll -lstdc++ -o openmw.exe diff --git a/build_openmw.sh b/build_openmw.sh deleted file mode 100755 index ac7d64369..000000000 --- a/build_openmw.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -# See COMPILE-linux.txt for instructions - -make || exit 1 - -gdc -Wall -g -fversion=Posix -o openmw openmw.d core/*.d ogre/*.d nif/*.d util/*.d bsa/*.d monster/util/*.d input/*.d sound/*.d scene/*.d esm/*.d cpp_ogre.o cpp_avcodec.o -lopenal -lm -lOgreMain -lOIS -lavcodec -lavformat -lstdc++ - -gdc -Wall -g -fversion=Posix -o esmtool esmtool.d core/*.d ogre/*.d nif/*.d util/*.d bsa/*.d monster/util/*.d input/*.d sound/*.d scene/*.d esm/*.d cpp_ogre.o cpp_avcodec.o -lopenal -lm -lOgreMain -lOIS -lavcodec -lavformat -lstdc++ diff --git a/input/events.d b/input/events.d index 19d1ac088..ded0f6a7c 100644 --- a/input/events.d +++ b/input/events.d @@ -239,7 +239,7 @@ extern(C) void d_handleKey(KC keycode, dchar text = 0) const float sndRefresh = 0.17; // Refresh rate for music fadeing, seconds. -const float musRefresh = 0.2; +const float musRefresh = 0.05; float sndCumTime = 0; float musCumTime = 0; diff --git a/nif/data.d b/nif/data.d index 2701591e2..208eab227 100644 --- a/nif/data.d +++ b/nif/data.d @@ -153,7 +153,7 @@ class ShapeData : Record if(uvs > 0b111111) { nifFile.warn("UV count contains (unknown) flags"); - uvs = uvs & 0b111111; + uvs = cast(short)(uvs & 0b111111); } uvlist = nifFile.getArraySize!(float)(uvs*verts*2); diff --git a/nif/niffile.d b/nif/niffile.d index e05f4e766..79f44c1dd 100644 --- a/nif/niffile.d +++ b/nif/niffile.d @@ -302,16 +302,13 @@ struct NIFFile } // Set the size of the provided array to 'count', and fill it. - template getArraySize(T) + T[] getArraySize(T)(int count) { - T[] getArraySize(int count) - { - T[] arr; - fitArray(count, T.sizeof); - arr = cast(T[])nifRegion.allocate(count * T.sizeof); - getArrayLen!(T)(arr); - return arr; - } + T[] arr; + fitArray(count, T.sizeof); + arr = cast(T[])nifRegion.allocate(count * T.sizeof); + getArrayLen!(T)(arr); + return arr; } // Get an array of Ts preceded by an array length of type Index