diff --git a/.gitignore b/.gitignore index 4717a8d..cb59829 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ vdrift-2009-06-15-src.tar.bz2 /vdrift-2011-10-22.tar.bz2 /vdrift-2012-07-22.tar.bz2 /vdrift-2014-10-20.tar.bz2 +/vdrift-5ae309f.tar.gz +/vdrift-data-20210211.tar.xz diff --git a/sources b/sources index f6538b7..42561eb 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -524751fab341b36f59d0747ea52f0c41 vdrift-2014-10-20.tar.bz2 +SHA512 (vdrift-5ae309f.tar.gz) = 54f578e70ef6a9b8d8697ad842b803adfff77230a392bb4e069469422f472571f2b47a6a87aecb46bf17f3d2cafce2a3989857fda43030ad67e5b6d9a8c13953 +SHA512 (vdrift-data-20210211.tar.xz) = d7beece201129b7be8cdca4d1d4e84c9656f2d6a03650f6576dad29d8231367402e7d32d4e24df22cbce2af842c930b8ed9492e4a1e7e480fe7569acdd992cf5 diff --git a/vdrift-20090615-dsolink.patch b/vdrift-20090615-dsolink.patch deleted file mode 100644 index b82afb7..0000000 --- a/vdrift-20090615-dsolink.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- SConstruct~ 2010-07-01 16:07:10.000000000 -0500 -+++ SConstruct 2010-07-01 16:15:43.529291853 -0500 -@@ -138,7 +138,7 @@ - CPPPATH = ['#include', '#bullet'], - CCFLAGS = ['-Wall', '-Wextra', '-Wno-unused-parameter', '-pthread'], - LIBPATH = ['.', '#lib'], -- LINKFLAGS = ['-pthread'], -+ LINKFLAGS = ['-pthread','-lGLU','-lGL'], - CC = 'gcc', CXX = 'g++', - options = opts) - check_headers = ['asio.hpp', 'boost/bind.hpp', 'GL/gl.h', 'GL/glu.h', 'SDL/SDL.h', 'SDL/SDL_image.h', 'SDL/SDL_rotozoom.h', 'vorbis/vorbisfile.h', 'GL/glew.h'] diff --git a/vdrift-2010-06-30-unbundle.patch b/vdrift-2010-06-30-unbundle.patch deleted file mode 100644 index 38a32ab..0000000 --- a/vdrift-2010-06-30-unbundle.patch +++ /dev/null @@ -1,34 +0,0 @@ -Index: include/cardynamics.h -=================================================================== ---- include/cardynamics.h -+++ include/cardynamics.h 2011-02-19 15:58:42.924055598 +0100 -@@ -20,6 +20,7 @@ - #include "collision_contact.h" - #include "cartelemetry.h" - #include "BulletDynamics/Dynamics/btActionInterface.h" -+#include "BulletDynamics/Dynamics/btRigidBody.h" - - class MODEL; - class CONFIGFILE; ---- src/SConscript.orig 2011-02-19 17:32:57.927061608 +0100 -+++ src/SConscript 2011-02-19 17:33:41.211055956 +0100 -@@ -233,7 +233,7 @@ - #--------------------------# - appdir = "" - vdrift_install = None --common_libs = ['SDL_image', 'SDL_gfx', 'vorbisfile', 'vdriftbullet'] -+common_libs = ['SDL_image', 'SDL_gfx', 'vorbisfile'] - - if (sys.platform == 'freebsd6') or (sys.platform == 'freebsd7') or (sys.platform == 'freebsd8'): - common_libs.append('libbulletcollision') -@@ -305,9 +305,8 @@ - # Compile Executable # - #--------------------# - #vdrift = local_env.Program(target='%s${EXECUTABLE_NAME}' % appdir, source=[src, vamosobjs, guiobjs]) --vdriftbullet = local_env.Library('vdriftbullet', bullet_src); -+local_env.ParseConfig('pkg-config bullet --libs --cflags') - vdrift = local_env.Program(target='%s${EXECUTABLE_NAME}' % appdir, source=src) --Depends(vdrift, vdriftbullet) - Default(Alias('vdrift', vdrift)) - - #---------# diff --git a/vdrift-20111022-constfix.patch b/vdrift-20111022-constfix.patch deleted file mode 100644 index 4ddafd4..0000000 --- a/vdrift-20111022-constfix.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up ./src/dynamicsworld.cpp.bullet281 ./src/dynamicsworld.cpp ---- ./src/dynamicsworld.cpp.bullet281 2012-10-13 14:18:39.646677972 -0400 -+++ ./src/dynamicsworld.cpp 2012-10-13 14:18:52.874174967 -0400 -@@ -101,7 +101,7 @@ bool DynamicsWorld::castRay( - int patch_id = -1; - const BEZIER * b = 0; - const TRACKSURFACE * s = TRACKSURFACE::None(); -- btCollisionObject * c = 0; -+ const btCollisionObject * c = 0; - - MyRayResultCallback ray(origin, p, caster); - rayTest(origin, p, ray); diff --git a/vdrift-2012-07-22c_bullet281_patch.patch b/vdrift-2012-07-22c_bullet281_patch.patch deleted file mode 100644 index 1f8a9ed..0000000 --- a/vdrift-2012-07-22c_bullet281_patch.patch +++ /dev/null @@ -1,889 +0,0 @@ ---- 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 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 pos; -- QUATERNION 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 pos; -+ QUATERNION 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 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 & 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 & 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 & sremove = source_remove.getFirst(); -+ std::vector & 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 & 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 & 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 listener_pos; - MATHVECTOR listener_vel; - QUATERNION 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 sampler_update; - TrippleBuffer sampler_add; - TrippleBuffer sampler_remove; -- TrippleBuffer source_remove; - TrippleBuffer source_stop; - SDL_mutex * sampler_lock; - SDL_mutex * source_lock; -+ bool set_pause; - - // sound sources state - std::vector sources_active; - std::vector sources; - size_t max_active_sources; - size_t sources_num; -+ bool sources_pause; - - // sound thread state - std::vector buffer1, buffer2; - std::vector 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; - } - } ---- src/cardynamics.cpp Mon Jan 19 23:26:36 1970 -+++ src/cardynamics.cpp Mon Jan 19 23:26:36 1970 -@@ -1791,23 +1791,29 @@ - - bool CARDYNAMICS::WheelContactCallback( - btManifoldPoint& cp, -- const btCollisionObject* colObj0, -- int partId0, -+ const btCollisionObjectWrapper* col0, -+ int part0, - int index0, -- const btCollisionObject* colObj1, -- int partId1, -+ const btCollisionObjectWrapper* col1, -+ int part1, - int index1) - { -- // cars are fracture bodies, wheel is a cylinder shape -- const btCollisionShape* shape = colObj0->getCollisionShape(); -- if ((colObj0->getInternalType() & CO_FRACTURE_TYPE) && -+#if (BT_BULLET_VERSION < 281) -+ const btCollisionObject* obj = col0; -+ const btCollisionShape* shape = obj->getCollisionShape(); -+ const btCollisionShape* rootshape = obj->getRootCollisionShape(); -+#else -+ const btCollisionObject* obj = col0->getCollisionObject(); -+ const btCollisionShape* shape = col0->getCollisionShape(); -+ const btCollisionShape* rootshape = obj->getCollisionShape(); -+#endif -+ if ((obj->getInternalType() & CO_FRACTURE_TYPE) && - (shape->getShapeType() == CYLINDER_SHAPE_PROXYTYPE)) - { -- // is contact within contact patch? -- const btCompoundShape* car = static_cast(colObj0->getRootCollisionShape()); -- const btCylinderShapeX* wheel = static_cast(shape); -- btVector3 contactPoint = cp.m_localPointA - car->getChildTransform(cp.m_index0).getOrigin(); -- if (-direction::up.dot(contactPoint) > 0.5 * wheel->getRadius()) -+ const btCompoundShape* carshape = static_cast(rootshape); -+ const btCylinderShapeX* wheelshape = static_cast(shape); -+ btVector3 contactPoint = cp.m_localPointA - carshape->getChildTransform(cp.m_index0).getOrigin(); -+ if (-direction::up.dot(contactPoint) > 0.5 * wheelshape->getRadius()) - { - // break contact (hack) - cp.m_normalWorldOnB = btVector3(0, 0, 0); ---- src/cardynamics.h Mon Jan 19 23:26:36 1970 -+++ src/cardynamics.h Mon Jan 19 23:26:36 1970 -@@ -25,6 +25,12 @@ - class FractureBody; - class PTree; - -+#if (BT_BULLET_VERSION < 281) -+#define btCollisionObjectWrapper btCollisionObject -+#else -+struct btCollisionObjectWrapper; -+#endif -+ - class CARDYNAMICS : public btActionInterface - { - friend class PERFORMANCE_TESTING; -@@ -151,11 +157,11 @@ - - static bool WheelContactCallback( - btManifoldPoint& cp, -- const btCollisionObject* colObj0, -- int partId0, -+ const btCollisionObjectWrapper* col0, -+ int part0, - int index0, -- const btCollisionObject* colObj1, -- int partId1, -+ const btCollisionObjectWrapper* col1, -+ int part1, - int index1); - - protected: ---- src/dynamicsworld.cpp Mon Jan 19 23:26:36 1970 -+++ src/dynamicsworld.cpp Mon Jan 19 23:26:36 1970 -@@ -221,6 +221,7 @@ - - void DynamicsWorld::fractureCallback() - { -+#if (BT_BULLET_VERSION < 281) - m_activeConnections.resize(0); - - int numManifolds = getDispatcher()->getNumManifolds(); -@@ -268,4 +269,5 @@ - btRigidBody* child = body->updateConnection(con_id); - if (child) addRigidBody(child); - } -+#endif - } diff --git a/vdrift-20141020-gcc6.patch b/vdrift-20141020-gcc6.patch deleted file mode 100644 index 0c846fd..0000000 --- a/vdrift-20141020-gcc6.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up ./src/graphics/model_obj.cpp.gcc6 ./src/graphics/model_obj.cpp ---- ./src/graphics/model_obj.cpp.gcc6 2016-02-09 19:02:50.282554264 -0500 -+++ ./src/graphics/model_obj.cpp 2016-02-09 19:03:10.566308088 -0500 -@@ -221,7 +221,7 @@ bool ModelObj::Save(const std::string & - std::ofstream f(strFileName.c_str()); - if (!f) - { -- error_output << "Error opening file for writing: " << error_output << endl; -+ error_output << "Error opening file for writing: " << strFileName << endl; - return false; - } - diff --git a/vdrift-SConstruct.patch b/vdrift-SConstruct.patch deleted file mode 100644 index 30ef37a..0000000 --- a/vdrift-SConstruct.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- SConstruct~ 2011-09-01 04:22:58.000000000 -0500 -+++ SConstruct 2012-01-18 14:40:08.535239681 -0600 -@@ -507,8 +507,8 @@ - # Subdirectories # - #----------------# - Export(['env', 'version', 'src_dir', 'bin_dir']) --if 'install' in COMMAND_LINE_TARGETS: -- SConscript('data/SConscript') -+#if 'install' in COMMAND_LINE_TARGETS: -+# SConscript('data/SConscript') - - if 'src-package' in COMMAND_LINE_TARGETS: - SConscript('tools/SConscript') diff --git a/vdrift.spec b/vdrift.spec index e7d7692..fa6efb3 100644 --- a/vdrift.spec +++ b/vdrift.spec @@ -1,41 +1,29 @@ +%global commit 5ae309f1048c863f4745cd50c8cd81f98340b1d4 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) + Name: vdrift Version: 20141020 -Release: 10%{?dist} +Release: 36.git%{shortcommit}%{?dist} Summary: Driving/drift racing simulation -Group: Amusements/Games -License: GPLv3+ +License: GPL-3.0-or-later URL: http://vdrift.net -#Source0: %{name}-2010-06-30.tar.bz2 -Source0: http://downloads.sourceforge.net/%{name}/%{name}-2014-10-20.tar.bz2 -#Original upstream: -#Source0: http://downloads.sourceforge.net/%{name}/%{name}-2009-06-15-src.tar.bz2 -# Modified: -# cd docs -# rm SConscript INSTALL -# cd .. -# rm -rf tools/win - +Source0: https://github.com/VDrift/vdrift/archive/%{commit}/%{name}-%{shortcommit}.tar.gz Source1: vdrift.desktop Source2: vdrift.png -#Patch0: vdrift-SConstruct.patch +# Data +# svn checkout https://svn.code.sf.net/p/vdrift/code/ vdrift-code +# mv vdrift-code/vdrift-data data +# tar cvfJ vdrift-data-20210211.tar.xz data +Source3: vdrift-data-20210211.tar.xz + Patch1: vdrift-20071226-paths.patch Patch4: vdrift-20090215-joepack-includes.patch -#Patch5: vdrift-20090615-dsolink.patch -# patch to unbundle bullet, not upstreamable -#Patch6: vdrift-2010-06-30-unbundle.patch -#Patch7: vdrift-2011-09-09-curl.patch -#Patch8: vdrift-20111022-constfix.patch -#Patch9: vdrift-2012-07-22c_bullet281_patch.patch -# Fix bug where ostream was being written instead of filename to ostream -# Not submitted upstream -Patch10: vdrift-20141020-gcc6.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root%(%{__id_u} -n) +BuildRequires: mesa-libGL-devel BuildRequires: SDL2-devel BuildRequires: SDL2_image-devel BuildRequires: SDL_gfx-devel -BuildRequires: scons -BuildRequires: libGL-devel +BuildRequires: python3-scons BuildRequires: libvorbis-devel BuildRequires: desktop-file-utils BuildRequires: glew-devel @@ -44,11 +32,11 @@ BuildRequires: asio-devel BuildRequires: bullet-devel BuildRequires: libarchive-devel BuildRequires: libcurl-devel +BuildRequires: python3-devel +BuildRequires: gcc-c++ +BuildRequires: subversion Requires: vdrift-data = %{version} -#Obsoletes: vdrift-data <= 20071226 -#Provides: vdrift-data = %{version}-%{release} - %description VDrift is a cross-platform, open source driving simulation made with drift @@ -58,7 +46,6 @@ available for Linux, FreeBSD, Mac OS X and Windows (Cygwin). %package data Summary: Driving/drift racing simulation data -Group: Amusements/Games Requires: vdrift = %{version} BuildArch: noarch @@ -72,7 +59,7 @@ These are the data files. %prep -%setup -qn vdrift +%setup -qn vdrift-%{commit} -a 3 # unbundling rm -rf bullet @@ -80,31 +67,16 @@ rm -rf bullet sed -i 's/linuxx86/linuxppc/' src/SConscript %endif -#%patch0 -p0 -%patch1 -p0 -%patch4 -p0 -#%patch5 -p0 -#%patch6 -p0 -#%patch7 -p0 -#%patch8 -p0 -#%patch9 -p0 -%patch10 -p0 -b .gcc6 +%patch -P 1 -p0 +%patch -P 4 -p0 +%py3_shebang_fix . -#/bin/chmod -x src/gamestate.cpp -#/bin/chmod -x src/logo.cpp -#/bin/chmod -x src/objects.cpp /bin/chmod -x src/main.cpp /bin/chmod -x src/game.cpp %build -CC="gcc" CXX="g++" CXXFLAGS="%{optflags}" \ - scons \ - bin=/bin prefix=/usr use_binreloc=0 \ - release=1 os_cc=1 os_cxx=1 os_cxxflags=1 \ - NLS=0 \ - verbose=1 \ - %{?_smp_mflags} +scons %{?_smp_mflags} %install # As described in the README scons install is broken so DIY @@ -160,21 +132,9 @@ SentUpstream: 2014-09-25 EOF -%post -touch --no-create %{_datadir}/icons/hicolor || : -if [ -x %{_bindir}/gtk-update-icon-cache ]; then - %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : -fi - -%postun -touch --no-create %{_datadir}/icons/hicolor || : -if [ -x %{_bindir}/gtk-update-icon-cache ]; then - %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : -fi - - %files -%doc README.md LICENSE +%license LICENSE +%doc README.md %{_bindir}/vdrift %{_datadir}/appdata/%{name}.appdata.xml %{_datadir}/applications/vdrift.desktop @@ -184,6 +144,83 @@ fi %{_datadir}/vdrift %changelog +* Fri Jul 17 2026 Fedora Release Engineering - 20141020-36.git5ae309f +- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild + +* Sat Jan 17 2026 Fedora Release Engineering - 20141020-35.git5ae309f +- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild + +* Fri Jul 25 2025 Fedora Release Engineering - 20141020-34.git5ae309f +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Sun Jan 19 2025 Fedora Release Engineering - 20141020-33.git5ae309f +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Sat Jul 20 2024 Fedora Release Engineering - 20141020-32.git5ae309f +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Sat Jan 27 2024 Fedora Release Engineering - 20141020-31.git5ae309f +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sat Jul 22 2023 Fedora Release Engineering - 20141020-30.git5ae309f +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Sat Mar 04 2023 Gwyn Ciesla - 20141020-29.git5ae309f +- migrated to SPDX license + +* Sat Jan 21 2023 Fedora Release Engineering - 20141020-28.git5ae309f +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Sat Jul 23 2022 Fedora Release Engineering - 20141020-27.git5ae309f +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Sat Jan 22 2022 Fedora Release Engineering - 20141020-26.git5ae309f +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Jul 23 2021 Fedora Release Engineering - 20141020-25.git5ae309f +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Thu Feb 11 2021 Tom Callaway - 20141020-24.git5ae309f +- update code to latest git +- update data from latest svn + +* Wed Jan 27 2021 Fedora Release Engineering - 20141020-23 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering - 20141020-22 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Mon Mar 23 2020 Gwyn Ciesla - 2014-1020-21 +- Change build options to fix crash. + +* Fri Jan 31 2020 Fedora Release Engineering - 20141020-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Aug 02 2019 Gwyn Ciesla - 20141020-18 +- Fix FTBFS. + +* Sat Jul 27 2019 Fedora Release Engineering - 20141020-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sun Feb 03 2019 Fedora Release Engineering - 20141020-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Mon Sep 10 2018 Gwyn Ciesla - 20171020-15 +- Fix shebang. + +* Sat Jul 14 2018 Fedora Release Engineering - 20141020-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Fri Feb 09 2018 Fedora Release Engineering - 20141020-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Jan 18 2018 Igor Gnatenko - 20141020-12 +- Remove obsolete scriptlets + +* Mon Dec 18 2017 Rich Mattes - 20141020-11 +- Rebuild for bullet-2.87 +- Force scons to run with python 2 + * Thu Aug 03 2017 Fedora Release Engineering - 20141020-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild