summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Asplund <peter.azp@gmail.com>2013-03-03 21:32:54 +0100
committerPeter Asplund <peter.azp@gmail.com>2013-03-03 21:32:54 +0100
commit3763ba220e1953bdab33616ef8f1e063d6ed8eaf (patch)
treedb23a03f9afdca741335904aeac0114b9a98d7ca
parentUpdate to newer version from bugzilla (diff)
downloadAzP-3763ba220e1953bdab33616ef8f1e063d6ed8eaf.tar.gz
AzP-3763ba220e1953bdab33616ef8f1e063d6ed8eaf.tar.bz2
AzP-3763ba220e1953bdab33616ef8f1e063d6ed8eaf.zip
Add ebuild for VDrift 20120722
Also add a patch for building it with SDL2.
-rw-r--r--games-sports/vdrift/ChangeLog90
-rw-r--r--games-sports/vdrift/Manifest6
-rw-r--r--games-sports/vdrift/files/vdrift-2012-07-22c.patch798
-rw-r--r--games-sports/vdrift/metadata.xml5
-rw-r--r--games-sports/vdrift/vdrift-20120722.ebuild64
5 files changed, 963 insertions, 0 deletions
diff --git a/games-sports/vdrift/ChangeLog b/games-sports/vdrift/ChangeLog
new file mode 100644
index 0000000..cdd2dad
--- /dev/null
+++ b/games-sports/vdrift/ChangeLog
@@ -0,0 +1,90 @@
+# ChangeLog for games-sports/vdrift
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/games-sports/vdrift/ChangeLog,v 1.20 2012/07/24 16:52:50 mr_bones_ Exp $
+
+ 03 Mar 2013; Peter Asplund <peterasplund@gentoo.se> vdrift-20120722.ebuild:
+ version bump with ebuild/patch
+
+ 24 Jul 2012; Michael Sterrett <mr_bones_@gentoo.org> vdrift-20111022.ebuild:
+ stable for x86
+
+ 19 Jun 2012; Michael Sterrett <mr_bones_@gentoo.org> vdrift-20111022.ebuild:
+ enforce single-precision for sci-physics/bullet (bug #402759)
+
+ 03 May 2012; Jeff Horelick <jdhore@gentoo.org> vdrift-20111022.ebuild:
+ dev-util/pkgconfig -> virtual/pkgconfig
+
+ 04 Feb 2012; Agostino Sarubbo <ago@gentoo.org> vdrift-20111022.ebuild:
+ Stable for amd64, wrt bug #401821
+
+*vdrift-20111022 (16 Dec 2011)
+
+ 16 Dec 2011; Michael Sterrett <mr_bones_@gentoo.org>
+ files/vdrift-20090615-ldflags.patch, +vdrift-20111022.ebuild,
+ +files/vdrift-20111022-build.patch:
+ version bump (bug #351409) with ebuild/patch from Michael (kensington)
+
+ 14 Oct 2010; Michael Sterrett <mr_bones_@gentoo.org>
+ vdrift-20090615.ebuild:
+ use scons-utils
+
+ 06 Oct 2010; Tupone Alfredo <tupone@gentoo.org> vdrift-20090615.ebuild,
+ +files/vdrift-20090615-ldflags.patch:
+ Respect LDFLAGS. Bug #339805 by flameeyes@gentoo.org
+
+ 20 Nov 2009; Markus Meier <maekke@gentoo.org> vdrift-20090615.ebuild:
+ amd64/x86 stable, bug #290955
+
+ 27 Sep 2009; Michael Sterrett <mr_bones_@gentoo.org>
+ vdrift-20090615.ebuild:
+ turn on force feedback support (bug #282032)
+
+*vdrift-20090615 (31 Jul 2009)
+
+ 31 Jul 2009; Michael Sterrett <mr_bones_@gentoo.org>
+ +vdrift-20090615.ebuild:
+ version bump
+
+ 01 Jun 2009; Markus Meier <maekke@gentoo.org> vdrift-20090215.ebuild:
+ amd64/x86 stable, bug #272048
+
+ 01 Jun 2009; Michael Sterrett <mr_bones_@gentoo.org>
+ vdrift-20090215.ebuild:
+ use just the -j part of MAKEOPTS; add more use-based deps (bug #271999)
+
+ 03 Apr 2009; Michael Sterrett <mr_bones_@gentoo.org>
+ vdrift-20090215.ebuild:
+ actually call src_prepare
+
+*vdrift-20090215 (27 Mar 2009)
+
+ 27 Mar 2009; Michael Sterrett <mr_bones_@gentoo.org>
+ +vdrift-20090215.ebuild:
+ version bump
+
+ 24 Feb 2009; Michael Sterrett <mr_bones_@gentoo.org>
+ vdrift-20080805.ebuild:
+ EAPI=2; pass -j from MAKEOPTS to scons
+
+*vdrift-20080805 (24 Aug 2008)
+
+ 24 Aug 2008; Michael Sterrett <mr_bones_@gentoo.org>
+ +vdrift-20080805.ebuild:
+ version bump
+
+ 22 Aug 2008; Markus Meier <maekke@gentoo.org> vdrift-20070323.ebuild:
+ amd64 stable, bug #232778
+
+ 24 Jul 2008; Raúl Porcel <armin76@gentoo.org> vdrift-20070323.ebuild:
+ x86 stable wrt #232778
+
+ 01 Aug 2007; Christoph Mende <angelos@gentoo.org> vdrift-20070323.ebuild:
+ Added ~amd64 for bug #186753
+
+*vdrift-20070323 (25 Jul 2007)
+
+ 25 Jul 2007; Tristan Heaven <nyhm@gentoo.org>
+ +files/vdrift-20070323-gcc42.patch, +metadata.xml,
+ +vdrift-20070323.ebuild:
+ Initial commit, bug #98094
+
diff --git a/games-sports/vdrift/Manifest b/games-sports/vdrift/Manifest
new file mode 100644
index 0000000..c157d64
--- /dev/null
+++ b/games-sports/vdrift/Manifest
@@ -0,0 +1,6 @@
+AUX vdrift-20111022-build.patch 1274 SHA256 fd443f5207c025ff5d89ff35596ecf7da8ae54eceb5a2fded2bb4f30eb68994e SHA512 c0a2fe15fd3df7f71e1d081befedec06f312c6dc72a19419e13d997ad4a69a902926116ba8fc252bb95b224ac9610b0542291bab64b9e9d1266432a4a7160023 WHIRLPOOL ed94bb22a643c8eb038e899be161f6e27cb1538b97dd982955bb989b2c8c728c9073ced8d5e0f21269fd33278c1e6a881237f45acbf2a1abd1054ff180fb57d3
+AUX vdrift-2012-07-22c.patch 21689 SHA256 3e669ac2ce6da04548bb53b63694d21fd83cd8971e3f268031d7ffd93b79ae22 SHA512 7b82ba53f3c19ccd01de9ea64e0b7e15224219c0c614a6505b2a3f552ce78565fdedf7781a198c58606d3e9b94e594dee79097d46687e7d4fc763868204b761d WHIRLPOOL f24a7acb58d711d6bf4cda04ff4be1990c241399effdc821ecc8330bfd04a9067a048a840db9be7cabd1c6ca1b7051b003d548b87b2a1bb7d5000afdeb4e0a03
+DIST vdrift-2012-07-22.tar.bz2 589288618 SHA256 5409feea1d9eb3d943f49ecc265b73f3283a00036e055038f5e5114dfc6113fb SHA512 eb6f243fd28e5fe46e856c37cb528c8ec903bdec91b6aa86681add79a333077a3a8874f694255913ae8492b965884f02057a95a98e37027ff67c082a8ca5527e WHIRLPOOL 7488cbc64b1fefca9d16267a623afd08b1fb2bd02af13b0c12cdbc9a2cc18f8965a796b2d8222e85826a277aaf17d8f9adda4e2b9621e6b7779fcb3546f140dd
+EBUILD vdrift-20120722.ebuild 1554 SHA256 e3e517ddde4f21a739309b5544aa827f4baed096879b82fc0c0bb9000be79488 SHA512 25f0f21ac222c1a6a348499e0c778b4ae4e45046c411d783e0a1fe17c2a3e1ec6a4b970d778dd2381cf33245b1dbd53937d4e96b239d07e0ea66f8cf4fee4486 WHIRLPOOL 2f1c67a95484a0949f4e1c12bd30acbc764d15f704833d3fde22409e8358a7dda55a4d1462a42660e01c5c416436c3cf646b8216eff903d1d87f0c8c8ac3b787
+MISC ChangeLog 2831 SHA256 00280a3b099be68e19c94d7907e65e9038422b322113ecb87ac266edef673520 SHA512 11621651606aa1b6be434b63c318eac5f46b3c8f9265726988e811f528815505c0f3c7b370992810da6b5580399449c27dc5c871d0170e391a47e6db3075fbd7 WHIRLPOOL ed3407b4e3b2e249cac88621bc0653bf165ca0170f711e5c1095123d23944003a57686b9ff27d4a61020a414f3e64df57c80903f6f38f56294e3a13357e64844
+MISC metadata.xml 158 SHA256 1423a4fdd4a79b1728a2056d9e300f7e1074253095d82726218d9e9b953888a3 SHA512 d954564236b67b6ab97846b73f74e715e8f1bec2dba6595e9a5046c2e8c3b93f4879c293f9d1d02d99a533bee56156dae3f31a485697128c51af14cdbfdada8a WHIRLPOOL d03e7293d09d794d61c095a423f945b3644355a247f270a73ca8d30b4dfe9c98244297536bfd1a4bd6c14794aa1152eca20fd83bfdf3e1e74d4f676152d35ada
diff --git a/games-sports/vdrift/files/vdrift-2012-07-22c.patch b/games-sports/vdrift/files/vdrift-2012-07-22c.patch
new file mode 100644
index 0000000..944eb3d
--- /dev/null
+++ b/games-sports/vdrift/files/vdrift-2012-07-22c.patch
@@ -0,0 +1,798 @@
+--- data/skins/simple/menus/AssignControl Mon Jan 19 23:26:36 1970
++++ data/skins/simple/menus/AssignControl Mon Jan 19 23:26:36 1970
+@@ -46,7 +46,7 @@
+ image = white.png
+ color = 0.172, 0.161, 0.169
+ alpha = 0.7
+-left = 0.2
+-right = 0.2
++left = 0.1
++right = 0.1
+ top = 0.48
+ height = 0.04
+--- data/skins/simple/menus/GuiControls Mon Jan 19 23:26:36 1970
++++ data/skins/simple/menus/GuiControls Mon Jan 19 23:26:36 1970
+@@ -82,7 +82,7 @@
+ onselect = controledit.string:gui_select:0
+ onmoveleft = widget-01d
+ onmoveright = widget-01c
+-onmoveup = widget-13b
++onmoveup = widget-08b
+ onmovedown = widget-02b
+ onfocus = widget-01b.sat:0.56
+ onblur = widget-01b.sat:0.0
+@@ -101,7 +101,7 @@
+ onselect = controledit.string:gui_select:1
+ onmoveleft = widget-01b
+ onmoveright = widget-01d
+-onmoveup = widget-13b
++onmoveup = widget-08b
+ onmovedown = widget-02c
+ onfocus = widget-01c.sat:0.56
+ onblur = widget-01c.sat:0.0
+@@ -120,7 +120,7 @@
+ onselect = controledit.string:gui_select:2
+ onmoveleft = widget-01c
+ onmoveright = widget-01b
+-onmoveup = widget-13b
++onmoveup = widget-08b
+ onmovedown = widget-02d
+ onfocus = widget-01d.sat:0.56
+ onblur = widget-01d.sat:0.0
+--- data/skins/simple/menus/InGameMain Mon Jan 19 23:26:36 1970
++++ data/skins/simple/menus/InGameMain Mon Jan 19 23:26:36 1970
+@@ -44,10 +44,10 @@
+
+
+ [ widget-01 ]
+-text = Return to Game
++text = Continue
+ fontsize = 0.035
+ align = left
+-tip = Leave the menu and unpause the game.
++tip = Leave the menu and continue the game.
+ onselect = ReturnToGame
+ onmoveup = widget-05
+ onmovedown = widget-02
+@@ -72,7 +72,7 @@
+
+
+ [ widget-02 ]
+-text = Restart Game
++text = Restart
+ fontsize = 0.035
+ align = left
+ tip = Restart this game using the same car and track settings.
+@@ -100,7 +100,7 @@
+
+
+ [ widget-03 ]
+-text = Leave Game
++text = Abort
+ fontsize = 0.035
+ align = left
+ tip = Leave game and return to the Main menu.
+--- data/skins/simple/menus/InputDevice Mon Jan 19 23:26:36 1970
++++ data/skins/simple/menus/InputDevice Mon Jan 19 23:26:36 1970
+@@ -82,7 +82,7 @@
+ onselect = joystick.type.prev
+ onmoveleft = joystick.type.prev
+ onmoveright = joystick.type.next
+-onmoveup = widget-13b
++onmoveup = widget-11b
+ onmovedown = widget-02b
+ onfocus = widget-01b.alpha:1 widget-01c.alpha:1 widget-01d.sat:0.56
+ onblur = widget-01b.alpha:0 widget-01c.alpha:0 widget-01d.sat:0.0
+@@ -102,7 +102,7 @@
+ onselect = joystick.type.next
+ onmoveleft = joystick.type.prev
+ onmoveright = joystick.type.next
+-onmoveup = widget-13b
++onmoveup = widget-11b
+ onmovedown = widget-02b
+ onfocus = widget-01b.alpha:1 widget-01c.alpha:1 widget-01d.sat:0.56
+ onblur = widget-01b.alpha:0 widget-01c.alpha:0 widget-01d.sat:0.0
+--- data/skins/simple/menus/SingleRace Mon Jan 19 23:26:36 1970
++++ data/skins/simple/menus/SingleRace Mon Jan 19 23:26:36 1970
+@@ -860,7 +860,7 @@
+ onmoveleft = game.vehicle_damage.prev
+ onmoveright = game.vehicle_damage.next
+ onmoveup = widget-14b
+-onmovedown = widget-16
++onmovedown = widget-16b
+ onfocus = widget-15b.alpha:1 widget-15c.alpha:1 widget-15d.sat:0.56
+ onblur = widget-15b.alpha:0 widget-15c.alpha:0 widget-15d.sat:0.0
+ focus = false
+--- src/camera.h Mon Jan 19 23:26:36 1970
++++ src/camera.h Mon Jan 19 23:26:36 1970
+@@ -16,7 +16,7 @@
+
+ const std::string & GetName() const { return name; }
+
+- void SetFOV(float value) { fov = std::max(40.0f, std::min(160.0f, value)); }
++ void SetFOV(float value) { fov = std::max(0.0f, std::min(120.0f, value)); }
+
+ float GetFOV() const { return fov; }
+
+--- src/carcontrolmap_local.cpp Mon Jan 19 23:26:36 1970
++++ src/carcontrolmap_local.cpp Mon Jan 19 23:26:36 1970
+@@ -830,16 +830,6 @@
+ keycodes["y"] = SDLK_y;
+ keycodes["z"] = SDLK_z;
+ keycodes["DELETE"] = SDLK_DELETE;
+- keycodes["KP0"] = SDLK_KP_0;
+- keycodes["KP1"] = SDLK_KP_1;
+- keycodes["KP2"] = SDLK_KP_2;
+- keycodes["KP3"] = SDLK_KP_3;
+- keycodes["KP4"] = SDLK_KP_4;
+- keycodes["KP5"] = SDLK_KP_5;
+- keycodes["KP6"] = SDLK_KP_6;
+- keycodes["KP7"] = SDLK_KP_7;
+- keycodes["KP8"] = SDLK_KP_8;
+- keycodes["KP9"] = SDLK_KP_9;
+ keycodes["KP_PERIOD"] = SDLK_KP_PERIOD;
+ keycodes["KP_DIVIDE"] = SDLK_KP_DIVIDE;
+ keycodes["KP_MULTIPLY"] = SDLK_KP_MULTIPLY;
+@@ -872,20 +862,50 @@
+ keycodes["F14"] = SDLK_F14;
+ keycodes["F15"] = SDLK_F15;
+ keycodes["MENU"] = SDLK_MENU;
+- keycodes["APPLICATION"] = SDLK_APPLICATION;
+- keycodes["NUMLOCK"] = SDLK_NUMLOCKCLEAR;
+ keycodes["CAPSLOCK"] = SDLK_CAPSLOCK;
+- keycodes["SCROLLLOCK"] = SDLK_SCROLLLOCK;
+ keycodes["RSHIFT"] = SDLK_RSHIFT;
+ keycodes["LSHIFT"] = SDLK_LSHIFT;
+ keycodes["RCTRL"] = SDLK_RCTRL;
+ keycodes["LCTRL"] = SDLK_LCTRL;
+ keycodes["RALT"] = SDLK_RALT;
+ keycodes["LALT"] = SDLK_LALT;
++#if SDL_VERSION_ATLEAST(2,0,0)
++ keycodes["KP0"] = SDLK_KP_0;
++ keycodes["KP1"] = SDLK_KP_1;
++ keycodes["KP2"] = SDLK_KP_2;
++ keycodes["KP3"] = SDLK_KP_3;
++ keycodes["KP4"] = SDLK_KP_4;
++ keycodes["KP5"] = SDLK_KP_5;
++ keycodes["KP6"] = SDLK_KP_6;
++ keycodes["KP7"] = SDLK_KP_7;
++ keycodes["KP8"] = SDLK_KP_8;
++ keycodes["KP9"] = SDLK_KP_9;
++ keycodes["COMPOSE"] = SDLK_APPLICATION;
++ keycodes["NUMLOCK"] = SDLK_NUMLOCKCLEAR;
++ keycodes["SCROLLLOCK"] = SDLK_SCROLLLOCK;
+ keycodes["RMETA"] = SDLK_RGUI;
+ keycodes["LMETA"] = SDLK_LGUI;
+ keycodes["LSUPER"] = SDLK_LGUI;
+ keycodes["RSUPER"] = SDLK_RGUI;
++#else
++ keycodes["KP0"] = SDLK_KP0;
++ keycodes["KP1"] = SDLK_KP1;
++ keycodes["KP2"] = SDLK_KP2;
++ keycodes["KP3"] = SDLK_KP3;
++ keycodes["KP4"] = SDLK_KP4;
++ keycodes["KP5"] = SDLK_KP5;
++ keycodes["KP6"] = SDLK_KP6;
++ keycodes["KP7"] = SDLK_KP7;
++ keycodes["KP8"] = SDLK_KP8;
++ keycodes["KP9"] = SDLK_KP9;
++ keycodes["COMPOSE"] = SDLK_COMPOSE;
++ keycodes["NUMLOCK"] = SDLK_NUMLOCK;
++ keycodes["SCROLLLOCK"] = SDLK_SCROLLOCK;
++ keycodes["LMETA"] = SDLK_LMETA;
++ keycodes["RMETA"] = SDLK_RMETA;
++ keycodes["LSUPER"] = SDLK_LSUPER;
++ keycodes["RSUPER"] = SDLK_RSUPER;
++#endif
+ return keycodes;
+ }
+
+--- src/game.cpp Mon Jan 19 23:26:36 1970
++++ src/game.cpp Mon Jan 19 23:26:36 1970
+@@ -324,10 +324,6 @@
+
+ info_output << "Shutting down..." << std::endl;
+
+- // Stop the sound thread.
+- if (sound.Enabled())
+- sound.Pause(true);
+-
+ LeaveGame();
+
+ // Save settings first incase later deinits cause crashes.
+@@ -499,16 +495,7 @@
+ }
+
+ // Connect game actions to gui options
+- set_car_name.connect(gui.GetOption("game.car").signal_val);
+- set_car_paint.connect(gui.GetOption("game.car_paint").signal_val);
+- set_car_color_hue.connect(gui.GetOption("game.car_color_hue").signal_val);
+- set_car_color_sat.connect(gui.GetOption("game.car_color_sat").signal_val);
+- set_car_color_val.connect(gui.GetOption("game.car_color_val").signal_val);
+- set_car_ai_type.connect(gui.GetOption("game.ai_type").signal_val);
+- set_car_ai_level.connect(gui.GetOption("game.ai_level").signal_val);
+- set_cars_num.connect(gui.GetOption("game.cars_num").signal_val);
+- set_track_image.connect(gui.GetOption("game.track").signal_val);
+- set_control.connect(gui.GetOption("controledit.string").signal_val);
++ BindActionsToGUI();
+
+ // Set options from game settings.
+ std::map<std::string, std::string> optionmap;
+@@ -531,7 +518,6 @@
+ if (sound.Init(2048, info_output, error_output))
+ {
+ sound.SetVolume(settings.GetSoundVolume());
+- //sound.Pause(false);
+ content.setSound(sound.GetDeviceInfo());
+ }
+ else
+@@ -932,22 +918,18 @@
+ if (sound.Enabled())
+ {
+ bool pause_sound = pause || gui.Active();
+- sound.Pause(pause_sound);
+- if (!pause_sound)
+- {
+- PROFILER.beginBlock("sound");
+- MATHVECTOR <float, 3> pos;
+- QUATERNION <float> rot;
+- if (active_camera)
+- {
+- pos = active_camera->GetPosition();
+- rot = active_camera->GetOrientation();
+- }
+- sound.SetListenerPosition(pos[0], pos[1], pos[2]);
+- sound.SetListenerRotation(rot[0], rot[1], rot[2], rot[3]);
+- sound.Update();
+- PROFILER.endBlock("sound");
+- }
++ PROFILER.beginBlock("sound");
++ MATHVECTOR <float, 3> pos;
++ QUATERNION <float> rot;
++ if (active_camera)
++ {
++ pos = active_camera->GetPosition();
++ rot = active_camera->GetOrientation();
++ }
++ sound.SetListenerPosition(pos[0], pos[1], pos[2]);
++ sound.SetListenerRotation(rot[0], rot[1], rot[2], rot[3]);
++ sound.Update(pause_sound);
++ PROFILER.endBlock("sound");
+ }
+
+ //PROFILER.beginBlock("force-feedback");
+@@ -1798,9 +1780,12 @@
+ // get car start position marker for camera setup
+ MATHVECTOR<float, 3> car_pos = track.GetStart(0).first;
+
+- // car setup
++ // clear previous car
+ cars.clear();
+
++ // remove previous car sounds
++ sound.Update(true);
++
+ if (LoadCar(
+ cars_name[car_edit_id],
+ cars_paint[car_edit_id],
+@@ -1808,14 +1793,13 @@
+ car_pos, track.GetStart(0).second,
+ true, false))
+ {
+- // update car
++ // set car
+ CAR & car = cars.back();
+ dynamics.update(timestep);
+ car.Update(timestep);
+
+- // process car sound sources
+- // should they be loaded for garage car in the first place?
+- sound.Update();
++ // add car sounds
++ sound.Update(true);
+
+ // use car shape center for camera setup
+ car_pos = car.GetPosition();
+@@ -1958,7 +1942,7 @@
+ }
+
+ if (numreplays == 0)
+- replaylist.push_back(std::make_pair("", "None"));
++ replaylist.push_back(std::make_pair("none", "None"));
+
+ settings.SetSelectedReplay(replaylist.begin()->first);
+ }
+@@ -2411,6 +2395,7 @@
+
+ track.Clear();
+ cars.clear();
++ sound.Update(true);
+ hud.SetVisible(false);
+ inputgraph.Hide();
+ trackmap.Unload();
+@@ -2419,7 +2404,6 @@
+ pause = false;
+ race_laps = 0;
+ tire_smoke.Clear();
+- sound.Update();
+ }
+
+ void GAME::StartPractice()
+@@ -2473,7 +2457,7 @@
+
+ void GAME::StartReplay()
+ {
+- if (!settings.GetSelectedReplay().empty() && !NewGame(true))
++ if (settings.GetSelectedReplay() != "none" && !NewGame(true))
+ {
+ gui.ActivatePage("ReplayStartError", 0.25, error_output);
+ }
+@@ -2855,6 +2839,19 @@
+ EditControl();
+ }
+
++void GAME::BindActionsToGUI()
++{
++ set_car_name.connect(gui.GetOption("game.car").signal_val);
++ set_car_paint.connect(gui.GetOption("game.car_paint").signal_val);
++ set_car_color_hue.connect(gui.GetOption("game.car_color_hue").signal_val);
++ set_car_color_sat.connect(gui.GetOption("game.car_color_sat").signal_val);
++ set_car_color_val.connect(gui.GetOption("game.car_color_val").signal_val);
++ set_car_ai_type.connect(gui.GetOption("game.ai_type").signal_val);
++ set_car_ai_level.connect(gui.GetOption("game.ai_level").signal_val);
++ set_cars_num.connect(gui.GetOption("game.cars_num").signal_val);
++ set_track_image.connect(gui.GetOption("game.track").signal_val);
++ set_control.connect(gui.GetOption("controledit.string").signal_val);
++}
+
+ void GAME::RegisterActions()
+ {
+--- src/game.h Mon Jan 19 23:26:36 1970
++++ src/game.h Mon Jan 19 23:26:36 1970
+@@ -201,6 +201,7 @@
+ void SetTrackImage(const std::string & value);
+ void SetControl(const std::string & value);
+
++ void BindActionsToGUI();
+ void RegisterActions();
+ void InitActionMap(std::map<std::string, Slot0*> & actionmap);
+
+--- src/sound.cpp Mon Jan 19 23:26:36 1970
++++ src/sound.cpp Mon Jan 19 23:26:36 1970
+@@ -30,17 +30,20 @@
+ }
+
+ SOUND::SOUND() :
++ log_error(0),
+ deviceinfo(0, 0, 0, 0),
++ sound_volume(0),
+ initdone(false),
+ disable(false),
+- paused(true),
+ sampler_lock(0),
+ source_lock(0),
++ set_pause(true),
+ max_active_sources(64),
+ sources_num(0),
+- samplers_num(0)
++ sources_pause(true),
++ samplers_num(0),
++ samplers_pause(true)
+ {
+- volume_filter.SetFilterOrder0(1.0);
+ sources.reserve(64);
+ samplers.reserve(64);
+ }
+@@ -115,11 +118,13 @@
+ }
+
+ deviceinfo = SOUNDINFO(samples, frequency, channels, bytespersample);
+-
++ log_error = &error_output;
+ initdone = true;
+-
+ SetVolume(1.0);
+
++ // enable sound, run callback
++ SDL_PauseAudio(false);
++
+ return true;
+ }
+
+@@ -138,46 +143,21 @@
+ disable = true;
+ }
+
+-void SOUND::Pause(bool value)
+-{
+- if (paused != value)
+- {
+- SDL_PauseAudio(value);
+- paused = value;
+- }
+-}
+-
+-void SOUND::Update()
++void SOUND::Update(bool pause)
+ {
+ if (disable) return;
+
++ set_pause = pause;
++
+ GetSourceChanges();
+
+ ProcessSourceStop();
+
+- ProcessSourceRemove();
+-
+ ProcessSources();
+
+- SetSamplerChanges();
+-
+- // short circuit if paused(sound thread blocked)
+- if (paused)
+- {
+- GetSamplerChanges();
+-
+- ProcessSamplerAdd();
+-
+- ProcessSamplerRemove();
+-
+- SetSourceChanges();
+-
+- GetSourceChanges();
+-
+- ProcessSourceStop();
++ ProcessSourceRemove();
+
+- ProcessSourceRemove();
+- }
++ SetSamplerChanges();
+ }
+
+ void SOUND::SetMaxActiveSources(size_t value)
+@@ -192,18 +172,24 @@
+ size_t id = item_num;
+ if (id < items.size())
+ {
++ // reuse free slot
+ size_t idn = items[id].id;
+ if (idn != id)
+ {
+- // swap back redirected item
++ // free slot is redirecting to other item
+ assert(idn < id);
++
++ // swap redirected item back
+ items[id] = items[idn];
++
++ // use now free slot
+ id = idn;
+ }
+ items[id] = item;
+ }
+ else
+ {
++ // add item to new slot
+ items.push_back(item);
+ }
+ items[id].id = id;
+@@ -217,9 +203,14 @@
+ inline void RemoveItem(size_t id, std::vector<T> & items, size_t & item_num)
+ {
+ assert(id < items.size());
++
++ // get item true id
+ size_t idn = items[id].id;
+ assert(idn < item_num);
++
++ // pop last item
+ --item_num;
++
+ // swap last item with current
+ size_t idl = items[item_num].id;
+ if (idl != item_num)
+@@ -270,14 +261,13 @@
+ ns.id = -1;
+ sampler_add.getFirst().push_back(ns);
+
+- //std::cout << "Add sound source: " << id << " " << buffer->GetName() << std::endl;
++ //*log_error << "Add sound source: " << id << " " << buffer->GetName() << std::endl;
+ return id;
+ }
+
+ void SOUND::RemoveSource(size_t id)
+ {
+- // notify sound thread, it will notify main thread to remove the source
+- //std::cout << "To be removed source: " << id << " " << sources[sources[id].id].buffer->GetName() << std::endl;
++ // notify sound and main thread to remove the source/sampler
+ sampler_remove.getFirst().push_back(id);
+ }
+
+@@ -343,14 +333,13 @@
+
+ void SOUND::SetVolume(float value)
+ {
+- volume_filter.SetFilterOrder0(clamp(value, 0.f, 1.f));
++ sound_volume = value;
+ }
+
+ void SOUND::GetSourceChanges()
+ {
+ Lock(source_lock);
+ source_stop.swapFirst();
+- source_remove.swapFirst();
+ Unlock(source_lock);
+ }
+
+@@ -368,17 +357,18 @@
+
+ void SOUND::ProcessSourceRemove()
+ {
+- std::vector<size_t> & sremove = source_remove.getFirst();
++ std::vector<size_t> & sremove = sampler_remove.getFirst();
+ for (size_t i = 0; i < sremove.size(); ++i)
+ {
+ size_t id = sremove[i];
+ assert(id < sources.size());
++
+ size_t idn = sources[id].id;
+ assert(idn < sources_num);
+- //std::cout << "Remove sound source: " << id << " " << sources[idn].buffer->GetName() << std::endl;
++ //*log_error << "Remove sound source: " << id << " " << sources[idn].buffer->GetName() << std::endl;
++
+ RemoveItem(id, sources, sources_num);
+ }
+- sremove.clear();
+ }
+
+ void SOUND::ProcessSources()
+@@ -436,8 +426,11 @@
+ }
+ }
+
+- supdate[i].gain1 = gain1 * Sampler::denom;
+- supdate[i].gain2 = gain2 * Sampler::denom;
++ // fade sound volume
++ float volume = set_pause ? 0 : sound_volume;
++
++ supdate[i].gain1 = volume * gain1 * Sampler::denom;
++ supdate[i].gain2 = volume * gain2 * Sampler::denom;
+ supdate[i].pitch = src.pitch * Sampler::denom;
+ }
+
+@@ -471,6 +464,7 @@
+ if (sampler_update.getFirst().size()) sampler_update.swapFirst();
+ if (sampler_add.getFirst().size()) sampler_add.swapFirst();
+ if (sampler_remove.getFirst().size()) sampler_remove.swapFirst();
++ sources_pause = set_pause;
+ Unlock(sampler_lock);
+ }
+
+@@ -478,33 +472,41 @@
+ {
+ Lock(sampler_lock);
+ sampler_update.swapLast();
+- sampler_remove.swapLast();
+ sampler_add.swapLast();
++ sampler_remove.swapLast();
++ samplers_fade = samplers_pause != sources_pause;
++ samplers_pause = sources_pause;
+ Unlock(sampler_lock);
+ }
+
+ void SOUND::ProcessSamplerUpdate()
+ {
+ std::vector<SamplerUpdate> & supdate = sampler_update.getLast();
+- if (samplers_num == supdate.size())
++ if (supdate.empty()) return;
++
++ assert(samplers_num == supdate.size());
++ for (size_t i = 0; i < samplers_num; ++i)
+ {
+- for (size_t i = 0; i < samplers_num; ++i)
+- {
+- samplers[i].gain1 = supdate[i].gain1;
+- samplers[i].gain2 = supdate[i].gain2;
+- samplers[i].pitch = supdate[i].pitch;
+- }
++ samplers[i].gain1 = supdate[i].gain1;
++ samplers[i].gain2 = supdate[i].gain2;
++ samplers[i].pitch = supdate[i].pitch;
+ }
+ supdate.clear();
+ }
+
+ void SOUND::ProcessSamplers(unsigned char *stream, int len)
+ {
+- // set buffers and clear stream
++ // clear stream
++ memset(stream, 0, len);
++
++ // pause sampling
++ if (samplers_pause && !samplers_fade)
++ return;
++
++ // init sampling buffers
+ int len4 = len / 4;
+ buffer1.resize(len4);
+ buffer2.resize(len4);
+- memset(stream, 0, len);
+
+ // run samplers
+ short * sstream = (short*)stream;
+@@ -519,13 +521,17 @@
+ {
+ SampleAndAdvanceWithPitch16bit(smp, &buffer1[0], &buffer2[0], len4);
+
+- volume_filter.Filter(&buffer1[0], &buffer2[0], len4);
+-
+ for (int n = 0; n < len4; ++n)
+ {
+ int pos = n * 2;
+- sstream[pos] = clamp(sstream[pos] + buffer1[n], -32768, 32767);
+- sstream[pos + 1] = clamp(sstream[pos + 1] + buffer2[n], -32768, 32767);
++ int val1 = sstream[pos] + buffer1[n];
++ int val2 = sstream[pos + 1] + buffer2[n];
++
++ val1 = clamp(val1, -32768, 32767);
++ val2 = clamp(val2, -32768, 32767);
++
++ sstream[pos] = val1;
++ sstream[pos + 1] = val2;
+ }
+ }
+ else
+@@ -541,17 +547,13 @@
+ void SOUND::ProcessSamplerRemove()
+ {
+ std::vector<size_t> & sremove = sampler_remove.getLast();
+- if (!sremove.empty())
++ for (size_t i = 0; i < sremove.size(); ++i)
+ {
+- for (size_t i = 0; i < sremove.size(); ++i)
+- {
+- size_t id = sremove[i];
+- assert(id < samplers.size());
+- RemoveItem(id, samplers, samplers_num);
+- }
+- source_remove.getLast() = sremove;
+- sremove.clear();
++ size_t id = sremove[i];
++ assert(id < samplers.size());
++ RemoveItem(id, samplers, samplers_num);
+ }
++ sremove.clear();
+ }
+
+ void SOUND::ProcessSamplerAdd()
+@@ -589,7 +591,6 @@
+ {
+ Lock(source_lock);
+ if (source_stop.getLast().size()) source_stop.swapLast();
+- if (source_remove.getLast().size()) source_remove.swapLast();
+ Unlock(source_lock);
+ }
+
+@@ -600,12 +601,12 @@
+
+ GetSamplerChanges();
+
++ ProcessSamplerAdd();
++
+ ProcessSamplerUpdate();
+
+ ProcessSamplers(stream, len);
+
+- ProcessSamplerAdd();
+-
+ ProcessSamplerRemove();
+
+ SetSourceChanges();
+@@ -622,9 +623,10 @@
+ assert(len > 0);
+ assert(sampler.buffer);
+
+- // if not playing, fill output buffers with silence, should not happen
++ // if not playing, fill output buffers with silence
+ if (!sampler.playing)
+ {
++ // should be dealt with before getting here
+ assert(0);
+ for (int i = 0; i < len; ++i)
+ {
+--- src/sound.h Mon Jan 19 23:26:36 1970
++++ src/sound.h Mon Jan 19 23:26:36 1970
+@@ -33,11 +33,8 @@
+ // disable sound
+ void Disable();
+
+- // pause sound
+- void Pause(bool value);
+-
+ // commit state changes
+- void Update();
++ void Update(bool pause);
+
+ // active sources limit can be adjusted at runtime
+ void SetMaxActiveSources(size_t value);
+@@ -69,14 +66,14 @@
+ void SetVolume(float value);
+
+ private:
++ std::ostream * log_error;
+ SOUNDINFO deviceinfo;
+- SOUNDFILTER volume_filter;
+ MATHVECTOR<float, 3> listener_pos;
+ MATHVECTOR<float, 3> listener_vel;
+ QUATERNION<float> listener_rot;
++ float sound_volume;
+ bool initdone;
+ bool disable;
+- bool paused;
+
+ // state structs
+ struct Source
+@@ -95,8 +92,8 @@
+
+ struct Sampler
+ {
+- static const int denom = 1 << 15;
+- static const int max_gain_delta = (denom * 100) / 44100;
++ static const int denom = 32768;
++ static const int max_gain_delta = (denom * 173) / 44100; // 256 samples from min to max gain
+ const SOUNDBUFFER * buffer;
+ int samples_per_channel;
+ int sample_pos;
+@@ -135,21 +132,24 @@
+ TrippleBuffer<SamplerUpdate> sampler_update;
+ TrippleBuffer<SamplerAdd> sampler_add;
+ TrippleBuffer<size_t> sampler_remove;
+- TrippleBuffer<size_t> source_remove;
+ TrippleBuffer<size_t> source_stop;
+ SDL_mutex * sampler_lock;
+ SDL_mutex * source_lock;
++ bool set_pause;
+
+ // sound sources state
+ std::vector<SourceActive> sources_active;
+ std::vector<Source> sources;
+ size_t max_active_sources;
+ size_t sources_num;
++ bool sources_pause;
+
+ // sound thread state
+ std::vector<int> buffer1, buffer2;
+ std::vector<Sampler> samplers;
+ size_t samplers_num;
++ bool samplers_pause;
++ bool samplers_fade;
+
+ // main thread methods
+ void GetSourceChanges();
+--- src/texture.cpp Mon Jan 19 23:26:36 1970
++++ src/texture.cpp Mon Jan 19 23:26:36 1970
+@@ -179,6 +179,7 @@
+ else
+ {
+ error << "Error loading texture file: " + path << std::endl;
++ error << IMG_GetError();
+ return false;
+ }
+
+@@ -303,6 +304,7 @@
+ else
+ {
+ error << "Error loading texture file: " + path + " (" + cubefiles[i] + ")" << std::endl;
++ error << IMG_GetError();
+ return false;
+ }
+
+@@ -477,6 +479,7 @@
+ if (!orig_surface)
+ {
+ error << "Error loading texture file: " << path << std::endl;
++ error << IMG_GetError();
+ return false;
+ }
+ }
diff --git a/games-sports/vdrift/metadata.xml b/games-sports/vdrift/metadata.xml
new file mode 100644
index 0000000..d3c2cc9
--- /dev/null
+++ b/games-sports/vdrift/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>games</herd>
+</pkgmetadata>
diff --git a/games-sports/vdrift/vdrift-20120722.ebuild b/games-sports/vdrift/vdrift-20120722.ebuild
new file mode 100644
index 0000000..00f593c
--- /dev/null
+++ b/games-sports/vdrift/vdrift-20120722.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/games-sports/vdrift/vdrift-20111022.ebuild,v 1.5 2012/07/24 16:52:50 mr_bones_ Exp $
+
+EAPI=4
+inherit eutils scons-utils games
+
+MY_P=${PN}-${PV:0:4}-${PV:4:2}-${PV:6:2}
+DESCRIPTION="A driving simulation made with drift racing in mind"
+HOMEPAGE="http://vdrift.net/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-3 ZLIB"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND=">=app-arch/libarchive-2.8.3
+ >=media-libs/glew-1.5.7
+ >=media-libs/libsdl-1.2.14[opengl,video]
+ >=media-libs/sdl-gfx-2.0.16
+ >=media-libs/sdl-image-1.2.10[png]
+ >=media-libs/libvorbis-1.2.0
+ >=net-misc/curl-7.21.6
+ >=sci-physics/bullet-2.78[-double-precision]
+ virtual/opengl
+ virtual/glu"
+DEPEND="${RDEPEND}
+ dev-cpp/asio
+ dev-libs/boost
+ virtual/pkgconfig"
+
+S=${WORKDIR}/"VDrift"
+
+src_prepare() {
+ epatch "${FILESDIR}/${MY_P}c.patch"
+}
+
+src_compile() {
+ escons \
+ force_feedback=1 \
+ extbullet=1 \
+ destdir="${D}" \
+ bindir="${GAMES_BINDIR}" \
+ datadir="${GAMES_DATADIR}"/${PN} \
+ prefix= \
+ use_binreloc=0 \
+ release=1 \
+ os_cc=1 \
+ os_cxx=1 \
+ os_cxxflags=1
+}
+
+src_install() {
+ dogamesbin build/vdrift || die
+ insinto "${GAMES_DATADIR}/${PN}"
+ doins -r data/* || die
+ newicon data/textures/icons/vdrift-64x64.png ${PN}.png
+ make_desktop_entry ${PN} VDrift
+ find "${D}" -name "SCon*" -exec rm \{\} +
+ cd "${D}"
+ keepdir $(find "${GAMES_DATADIR/\//}/${PN}" -type d -empty)
+ prepgamesdirs
+}