Adding back rigs of rods.

The result is similar to master "3868f02b173f44c735d9b904c687cdf4b8fdc64e".
Should be equivalent.
This commit is contained in:
Lluís Batlle i Rossell 2016-04-18 14:18:30 +02:00
commit 62c6f988e5
6 changed files with 159 additions and 0 deletions

View File

@ -0,0 +1,44 @@
{stdenv, fetchurl, unzip}:
let
s = # Generated upstream information
rec {
baseName="angelscript";
version = "2.22.2";
name="${baseName}-${version}";
url="http://www.angelcode.com/angelscript/sdk/files/angelscript_${version}.zip";
sha256 = "1pp853lbnz383ilp9wbgc3wv1dn7lpx3idz8dmzda94rckl7sd43";
};
buildInputs = [
unzip
];
in
stdenv.mkDerivation {
inherit (s) name version;
inherit buildInputs;
src = fetchurl {
inherit (s) url sha256;
};
preConfigure = ''
cd angelscript/projects/gnuc
sed -i makefile -e "s@LOCAL = .*@LOCAL = $out@"
export SHARED=1
export VERSION="${s.version}"
mkdir -p "$out/lib" "$out/bin" "$out/share" "$out/include"
'';
postBuild = ''
rm ../../lib/*
'';
postInstall = ''
mkdir -p "$out/share/docs/angelscript"
cp -r ../../../docs/* "$out/share/docs/angelscript"
'';
meta = {
inherit (s) version;
description = "Light-weight scripting library";
license = stdenv.lib.licenses.zlib ;
maintainers = [stdenv.lib.maintainers.raskin];
platforms = stdenv.lib.platforms.linux;
downloadPage = "http://www.angelcode.com/angelscript/downloads.html";
homepage="http://www.angelcode.com/angelscript/";
};
}

View File

@ -13,6 +13,8 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
NIX_LDFLAGS = "-rpath-link ${boost.lib}/lib";
buildInputs = [ libX11 unzip ogre cmake ois freetype libuuid boost pkgconfig ];
meta = {

View File

@ -32,6 +32,8 @@ stdenv.mkDerivation {
nvidia_cg_toolkit
];
patches = [ ./gcc5.patch ];
meta = {
description = "A 3D engine";
homepage = http://www.ogre3d.org/;

View File

@ -0,0 +1,65 @@
https://559472.bugs.gentoo.org/attachment.cgi?id=410902
--- a/OgreMain/include/OgreProgressiveMeshGenerator.h 2015-09-03 04:58:34.119585218 +0200
+++ b/OgreMain/include/OgreProgressiveMeshGenerator.h 2015-09-03 04:58:39.342585320 +0200
@@ -215,7 +215,40 @@
void tuneContainerSize();
void addVertexData(VertexData* vertexData, bool useSharedVertexLookup);
template<typename IndexType>
- void addIndexDataImpl(IndexType* iPos, const IndexType* iEnd, VertexLookupList& lookup, unsigned short submeshID);
+ void addIndexDataImpl(IndexType* iPos, const IndexType* iEnd, VertexLookupList& lookup, unsigned short submeshID)
+ {
+
+ // Loop through all triangles and connect them to the vertices.
+ for (; iPos < iEnd; iPos += 3) {
+ // It should never reallocate or every pointer will be invalid.
+ OgreAssert(mTriangleList.capacity() > mTriangleList.size(), "");
+ mTriangleList.push_back(PMTriangle());
+ PMTriangle* tri = &mTriangleList.back();
+ tri->isRemoved = false;
+ tri->submeshID = submeshID;
+ for (int i = 0; i < 3; i++) {
+ // Invalid index: Index is bigger then vertex buffer size.
+ OgreAssert(iPos[i] < lookup.size(), "");
+ tri->vertexID[i] = iPos[i];
+ tri->vertex[i] = lookup[iPos[i]];
+ }
+ if (tri->isMalformed()) {
+#if OGRE_DEBUG_MODE
+ stringstream str;
+ str << "In " << mMeshName << " malformed triangle found with ID: " << getTriangleID(tri) << ". " <<
+ std::endl;
+ printTriangle(tri, str);
+ str << "It will be excluded from LOD level calculations.";
+ LogManager::getSingleton().stream() << str.str();
+#endif
+ tri->isRemoved = true;
+ mIndexBufferInfoList[tri->submeshID].indexCount -= 3;
+ continue;
+ }
+ tri->computeNormal();
+ addTriangleToEdges(tri);
+ }
+ }
void addIndexData(IndexData* indexData, bool useSharedVertexLookup, unsigned short submeshID);
void computeCosts();
--- a/OgreMain/src/OgreProgressiveMeshGenerator.cpp 2015-09-03 04:58:34.879585233 +0200
+++ b/OgreMain/src/OgreProgressiveMeshGenerator.cpp 2015-09-03 04:58:43.944585409 +0200
@@ -219,6 +219,8 @@
}
vbuf->unlock();
}
+/// Called from OgreQueuedProgressiveMeshGenerator.cpp, so it can not be defined in here.
+#if 0
template<typename IndexType>
void ProgressiveMeshGenerator::addIndexDataImpl(IndexType* iPos, const IndexType* iEnd,
VertexLookupList& lookup,
@@ -256,6 +258,7 @@
addTriangleToEdges(tri);
}
}
+#endif // 0
void ProgressiveMeshGenerator::addIndexData(IndexData* indexData, bool useSharedVertexLookup, unsigned short submeshID)
{

View File

@ -0,0 +1,40 @@
{ fetchurl, fetchFromGitHub, stdenv, wxGTK30, freeimage, cmake, zziplib, mesa, boost,
pkgconfig, libuuid, openal, ogre, ois, curl, gtk, pixman, mygui, unzip,
angelscript, ogrepaged, mysocketw, libxcb
}:
stdenv.mkDerivation rec {
version = "git-20160412";
name = "rigsofrods-${version}";
src = fetchFromGitHub {
owner = "RigsOfRods";
repo = "rigs-of-rods";
rev = "1ebd359dbd467b4c3171dd6d054e7d8ec39f78ba";
sha256 = "0h71nrgq5r5cnh20c7wl8jzyaf50dj1b5jdrwihnklpsfyfvjlw4";
};
enableParallelBuilding = true;
installPhase = ''
sed -e "s@/usr/local/lib/OGRE@${ogre}/lib/OGRE@" -i ../tools/linux/binaries/plugins.cfg
mkdir -p $out/share/rigsofrods
cp -r bin/* $out/share/rigsofrods
cp ../tools/linux/binaries/plugins.cfg $out/share/rigsofrods
mkdir -p $out/bin
ln -s $out/share/rigsofrods/{RoR,RoRConfig} $out/bin
'';
buildInputs = [ wxGTK30 freeimage cmake zziplib mesa boost pkgconfig
libuuid openal ogre ois curl gtk mygui unzip angelscript
ogrepaged mysocketw libxcb ];
meta = {
description = "3D simulator game where you can drive, fly and sail various vehicles";
homepage = http://rigsofrods.sourceforge.net/;
license = stdenv.lib.licenses.gpl3;
maintainers = with stdenv.lib.maintainers; [viric raskin];
platforms = stdenv.lib.platforms.linux;
hydraPlatforms = [];
};
}

View File

@ -5284,6 +5284,8 @@ let
angelscript = callPackage ../development/interpreters/angelscript {};
angelscript_2_22 = callPackage ../development/interpreters/angelscript/2.22.nix {};
chibi = callPackage ../development/interpreters/chibi { };
ceptre = callPackage ../development/interpreters/ceptre { };
@ -14736,6 +14738,10 @@ let
openglSupport = mesaSupported;
};
rigsofrods = callPackage ../games/rigsofrods {
angelscript = angelscript_2_22;
};
rili = callPackage ../games/rili { };
rogue = callPackage ../games/rogue { };