Fixed Windows building. Compiles and runs on XP.

git-svn-id: https://openmw.svn.sourceforge.net/svnroot/openmw/trunk@58 ea6a568a-9f4f-0410-981a-c910a81bb256
pull/7/head
nkorslund 16 years ago
parent 9f1a247312
commit d5709fa5f3

@ -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
-----------------

@ -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

@ -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

@ -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++

@ -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;

@ -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);

@ -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

Loading…
Cancel
Save