From 88a2844bd29d1f7de1ffb2127bf7d0d972cf5be9 Mon Sep 17 00:00:00 2001 From: Scott McCreary Date: Tue, 26 Nov 2013 01:55:14 +0000 Subject: [PATCH] Missed adding patch for guitarmaster earlier, here it is. --- .../patches/guitarmaster-r20.patch | 212 ++++++++++++++++++ 1 file changed, 212 insertions(+) create mode 100644 haiku-games/guitarmaster/patches/guitarmaster-r20.patch diff --git a/haiku-games/guitarmaster/patches/guitarmaster-r20.patch b/haiku-games/guitarmaster/patches/guitarmaster-r20.patch new file mode 100644 index 000000000..de7e0da10 --- /dev/null +++ b/haiku-games/guitarmaster/patches/guitarmaster-r20.patch @@ -0,0 +1,212 @@ +From 4929c586441b40f7046487bc9b9a7dd887e3e605 Mon Sep 17 00:00:00 2001 +From: Luke +Date: Sun, 24 Nov 2013 07:51:48 +0000 +Subject: [PATCH] Search for songs directory + +--- + TApp.cpp | 5 +++-- + TApp.h | 4 +++- + TMainWindow.cpp | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- + TMainWindow.h | 4 +++- + main.cpp | 11 +++++++++- + 5 files changed, 79 insertions(+), 8 deletions(-) + +diff --git a/TApp.cpp b/TApp.cpp +index b38dbe1..a9d89ec 100644 +--- a/TApp.cpp ++++ b/TApp.cpp +@@ -10,10 +10,11 @@ using namespace org::toxic; + using namespace std; + + +-TApp::TApp():BApplication("application/x-vnd.guitar-master") ++TApp::TApp(BString * UserSpecifiedSongDir):BApplication("application/x-vnd.guitar-master") + { + cout<<"Guitar Master project"<UserSpecifiedSongDir = UserSpecifiedSongDir; + } + + +@@ -27,5 +28,5 @@ void TApp::ReadyToRun() + { + cout<<"ready!!"< + #include + #include "TMainWindow.h" + +@@ -16,9 +17,10 @@ namespace org + { + private: + TMainWindow * window; ++ BString * UserSpecifiedSongDir; + public: + +- TApp(); ++ TApp(BString * UserSpecifiedSongDir = NULL); + ~TApp(); + + virtual void ReadyToRun(); +diff --git a/TMainWindow.cpp b/TMainWindow.cpp +index d84cbd4..f16be1d 100644 +--- a/TMainWindow.cpp ++++ b/TMainWindow.cpp +@@ -11,12 +11,17 @@ + #include + #include + ++#include ++#include ++#include ++#include ++ + using namespace org::toxic; + using namespace org::toxic::resources; + using namespace std; + + +-TMainWindow::TMainWindow(BRect frame): BWindow(frame,"Guitar Master",B_TITLED_WINDOW,B_NOT_ZOOMABLE | B_NOT_RESIZABLE) ++TMainWindow::TMainWindow(BRect frame, BString * UserSpecifiedSongDir): BWindow(frame,"Guitar Master",B_TITLED_WINDOW,B_NOT_ZOOMABLE | B_NOT_RESIZABLE) + { + cout<<"Main window"<pw_dir; ++ } ++ ++ BString * songLocations[13]; ++ songLocations[0] = UserSpecifiedSongDir; ++ songLocations[1] = new BString("songs"); ++ songLocations[2] = new BString("/music/GuitarMaster"); ++ songLocations[2]->Prepend(homeDir); ++ songLocations[3] = new BString("/music/guitarmaster"); ++ songLocations[3]->Prepend(homeDir); ++ songLocations[4] = new BString("/music/Guitar Master"); ++ songLocations[4]->Prepend(homeDir); ++ songLocations[5] = new BString("/music/guitar master"); ++ songLocations[5]->Prepend(homeDir); ++ songLocations[6] = new BString("/Music/GuitarMaster"); ++ songLocations[6]->Prepend(homeDir); ++ songLocations[7] = new BString("/Music/guitarmaster"); ++ songLocations[7]->Prepend(homeDir); ++ songLocations[8] = new BString("/Music/Guitar Master"); ++ songLocations[8]->Prepend(homeDir); ++ songLocations[9] = new BString("/Music/guitar master"); ++ songLocations[9]->Prepend(homeDir); ++ songLocations[10] = new BString("/music"); ++ songLocations[10]->Prepend(homeDir); ++ songLocations[11] = new BString("/Music"); ++ songLocations[11]->Prepend(homeDir); ++ songLocations[12] = new BString(homeDir); ++ ++ cout<<"Searching for songs directory..."<String()<String()); ++ if(songs_dir_check->InitCheck() == B_OK) { ++ SongsDirLocation = new BString(*songLocations[i]); ++ delete songs_dir_check; ++ break; ++ } ++ delete songs_dir_check; ++ } ++ } ++ ++ for(int i=0; iString()); + BEntry entry; + char str[B_FILE_NAME_LENGTH]; + BMessage * message; +@@ -128,7 +185,7 @@ void TMainWindow::MessageReceived(BMessage * mesg) + case T_MSG_SELECT_SONG: + mesg->FindString("song",&str); + +- spath<<"songs/"<String()<<"/"< + #include ++#include + #include "TGameView.h" + + #define T_MSG_FRAME 0x00FF0011 +@@ -20,10 +21,11 @@ namespace org + + TGameView * gameview; + BMessageRunner * timer; ++ BString * SongsDirLocation; + + public: + +- TMainWindow(BRect frame); ++ TMainWindow(BRect frame, BString * songDirectory = NULL); + ~TMainWindow(); + + +diff --git a/main.cpp b/main.cpp +index 6e9a650..da8d16b 100644 +--- a/main.cpp ++++ b/main.cpp +@@ -3,13 +3,22 @@ + * Toxic Labs + */ + ++#include + #include "TApp.h" + + using namespace org::toxic; + + int main (int argc,char * argv[]) + { +- TApp app; ++ BString * UserSpecifiedSongDir; ++ UserSpecifiedSongDir = NULL; ++ // see if song directory was specified ++ if(argc > 1) ++ { ++ UserSpecifiedSongDir = new BString(argv[1]); ++ } ++ ++ TApp app(UserSpecifiedSongDir); + + app.Run(); + +-- +1.8.3.4 +