From 3a872aa0bd8a29ada492cda0d059f2eebe2528cc Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Tue, 27 Sep 2011 04:36:10 +0000 Subject: - Fix the game trying to save rendered tracks into system directory --- games/motogt/Makefile | 1 + games/motogt/files/patch-src-Circuito.cpp | 11 +++++++++++ games/motogt/files/patch-src-MakeData.cpp | 24 ++++++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 games/motogt/files/patch-src-Circuito.cpp create mode 100644 games/motogt/files/patch-src-MakeData.cpp diff --git a/games/motogt/Makefile b/games/motogt/Makefile index 42dc1f841fa8..480c599847c9 100644 --- a/games/motogt/Makefile +++ b/games/motogt/Makefile @@ -7,6 +7,7 @@ PORTNAME= motogt PORTVERSION= 20110505 +PORTREVISION= 1 CATEGORIES= games MASTER_SITES= SF/motogt/ DISTNAME= MotoGT-${PORTVERSION} diff --git a/games/motogt/files/patch-src-Circuito.cpp b/games/motogt/files/patch-src-Circuito.cpp new file mode 100644 index 000000000000..fb5ae7a7398f --- /dev/null +++ b/games/motogt/files/patch-src-Circuito.cpp @@ -0,0 +1,11 @@ +--- src/Circuito.cpp.orig 2011-01-12 20:20:23.000000000 +0300 ++++ src/Circuito.cpp 2011-09-26 23:13:03.000000000 +0400 +@@ -171,7 +171,7 @@ + if (!osd) {image=NULL; sprite=NULL; return; } + image = new Image*[image_c]; + sprite = new Sprite*[image_c]; +- string image_dir=data->tracks[track_index].dir+"t00.png"; ++ string image_dir=home_dir + data->tracks[track_index].dir + "t00.png"; + for (int i=0;i + #include ++#include + #include "global.h" + #include "Config.h" + #include "Confirm.h" +@@ -376,7 +377,12 @@ + } + fname[2]='0'+i; + fname[1]='0'+j; +- if (!f2->Save((dir+fname).c_str())) ++ size_t pos = 0; ++ do { ++ pos = dir.find('/', pos+1); ++ mkdir((home_dir+dir.substr(0, pos)).c_str(), 0755); ++ } while (pos != string::npos); ++ if (!f2->Save((home_dir+dir+fname).c_str())) + return false; + f2->width=ancho2; f2->height=ancho2; + } -- cgit v1.2.3