rpms/fbg/devel fbg-fixes.patch, NONE, 1.1 fbg.desktop, NONE, 1.1 fbg.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Hans de Goede (jwrdegoede) fedora-extras-commits at redhat.com
Sat Oct 14 11:39:38 UTC 2006


Author: jwrdegoede

Update of /cvs/extras/rpms/fbg/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16695/devel

Modified Files:
	.cvsignore sources 
Added Files:
	fbg-fixes.patch fbg.desktop fbg.spec 
Log Message:
auto-import fbg-0.9-2.fc6 on branch devel from fbg-0.9-2.fc6.src.rpm

fbg-fixes.patch:

--- NEW FILE fbg-fixes.patch ---
diff -ur fbg-0.9/configure fbg-0.9.new/configure
--- fbg-0.9/configure	2002-12-27 05:42:50.000000000 +0100
+++ fbg-0.9.new/configure	2006-10-11 21:51:32.000000000 +0200
@@ -6761,13 +6761,13 @@
 test "$prefix" = "NONE" && prefix=/usr/local
 test "$exec_prefix" = "NONE" && exec_prefix=$prefix
 
-eval FBGDATADIR="$prefix/games/$PACKAGE"
+eval FBGDATADIR="$prefix/share/$PACKAGE"
 cat >>confdefs.h <<_ACEOF
 #define FBGDATADIR "$FBGDATADIR"
 _ACEOF
 
 
-datadir="\$(prefix)/games"
+datadir="\$(prefix)/share"
 
 
           ac_config_files="$ac_config_files Makefile"
diff -ur fbg-0.9/configure.in fbg-0.9.new/configure.in
--- fbg-0.9/configure.in	2002-12-27 05:42:44.000000000 +0100
+++ fbg-0.9.new/configure.in	2006-10-11 21:51:32.000000000 +0200
@@ -125,11 +125,11 @@
 test "$prefix" = "NONE" && prefix=/usr/local
 test "$exec_prefix" = "NONE" && exec_prefix=$prefix
 
-eval FBGDATADIR="$prefix/games/$PACKAGE"
+eval FBGDATADIR="$prefix/share/$PACKAGE"
 AC_DEFINE_UNQUOTED(FBGDATADIR, "$FBGDATADIR")
 
-dnl Put data in $(prefix)/games/
-AC_SUBST(datadir, "\$(prefix)/games")
+dnl Put data in $(prefix)/share/
+AC_SUBST(datadir, "\$(prefix)/share")
 
 dnl Output Makefiles
 AC_OUTPUT(Makefile)
diff -ur fbg-0.9/src/fbgGame.cc fbg-0.9.new/src/fbgGame.cc
--- fbg-0.9/src/fbgGame.cc	2002-12-23 23:50:38.000000000 +0100
+++ fbg-0.9.new/src/fbgGame.cc	2006-10-13 15:33:21.000000000 +0200
@@ -217,8 +217,8 @@
 	else {
 		lastLine = SDL_GetTicks();
 		setPaused(true);
-		SDL_CreateThread(&fbgGame::removeLineGain, NULL);
-		if (light) SDL_CreateThread(&fbgGame::lightLineGainRedraw, NULL);
+		removeLineGainID = SDL_CreateThread(&fbgGame::removeLineGain, NULL);
+		if (light) lightLineGainRedrawID = SDL_CreateThread(&fbgGame::lightLineGainRedraw, NULL);
 	}
 
 	// Check for Game Over
@@ -381,6 +381,8 @@
 						setWantsToMove(false);
 					}
 				break;
+				default:
+				break;
 			}
 		break;
 		case SDL_KEYDOWN:
@@ -431,6 +433,8 @@
 						fbgGame::issue(EVT_REDRAW);
 					}
 				break;
+				default:
+				break;
 			}
 		break;
 		case SDL_QUIT:
@@ -438,6 +442,64 @@
 		break;
 		}
 	break;
+	case GAMEOVER:
+		switch (event.type) {
+		case SDL_USEREVENT:
+			switch (event.user.code) {
+			case EVT_REDRAW:
+				if (light) renderer.draw();	// Draw Scene (only necessary with the light renderer)
+			break;
+			}
+		break;
+		case SDL_KEYUP:
+			switch (event.key.keysym.sym) {
+				case SDLK_ESCAPE:
+					setState(QUIT);
+				break;
+				case SDLK_SPACE:
+				case SDLK_RETURN:
+					// restart the game on a key press
+					if (removeLineGainID) {
+						SDL_WaitThread(removeLineGainID, NULL);
+						removeLineGainID = NULL;
+					}
+					if (lightLineGainRedrawID) {
+						SDL_WaitThread(lightLineGainRedrawID, NULL);
+						lightLineGainRedrawID = NULL;
+					}
+
+					nextBlockIndex = rand()%blockSet.size();
+					cycleBlocks();
+
+					downHeld = false;leftHeld = false;rightHeld = false;
+					wantsToMove = false;
+
+					downStart = -1;lines = 0;level = 1; /*startLevel*/;score = 0;
+					curBlockAdjust = 40.0f;
+					setState(GAMEPLAY);
+
+					if (btype >= 0) lines = 25;
+					for (int row=0; row < 18; row++) {
+						for (int col=0; col < 10; col++)  {
+							if (btype >= 0 && row >= 18-btype*2) matrix[row][col] = rand()%2 ? 0 : rand()%(blockSet.size());
+							else matrix[row][col] = 0;
+						}
+					}
+					setLastDrop(SDL_GetTicks());
+					renderer.draw();
+				break;
+				default:
+				break;
+			}
+		break;
+		case SDL_VIDEOEXPOSE:
+			renderer.draw();
+		break;
+		case SDL_QUIT:
+			setState(QUIT);
+		break;
+		}
+	break;
 	default:
 		switch (event.type) {
 		case SDL_USEREVENT:
@@ -452,6 +514,8 @@
 			case SDLK_ESCAPE:
 				setState(QUIT);
 			break;
+			default:
+			break;
 			}
 		break;
 		case SDL_VIDEOEXPOSE:
@@ -489,6 +553,7 @@
 			while (SDL_PollEvent(&event)) {
 				processEvent(event);
 			}
+			SDL_Delay(1);
 		}
 	}
 }
diff -ur fbg-0.9/src/fbgMain.cc fbg-0.9.new/src/fbgMain.cc
--- fbg-0.9/src/fbgMain.cc	2002-12-23 23:50:38.000000000 +0100
+++ fbg-0.9.new/src/fbgMain.cc	2006-10-13 15:40:50.000000000 +0200
@@ -139,10 +139,11 @@
 	bool quit=false;
 	// Wait for a key press to start the game
 	bool keyPressed=false;
-	game.setLastDrop(SDL_GetTicks());
-	game.setState(BEGINWAIT);
+	// We want to begin straight away
+	//game.setState(BEGINWAIT);
 	game.getRenderer()->draw();
 	game.getRenderer()->draw();	// Draw twice for double buffering
+	game.setLastDrop(SDL_GetTicks());
 	
 	game.gameplayLoop();
 }
diff -ur fbg-0.9/src/fbgOpenGLRenderer.cc fbg-0.9.new/src/fbgOpenGLRenderer.cc
--- fbg-0.9/src/fbgOpenGLRenderer.cc	2002-12-23 23:50:38.000000000 +0100
+++ fbg-0.9.new/src/fbgOpenGLRenderer.cc	2006-10-13 12:20:45.000000000 +0200
@@ -645,18 +645,18 @@
 	glDisable(GL_LIGHTING);
 	glBindTexture(GL_TEXTURE_2D, gameover[0].getID());
 		glBegin(GL_TRIANGLE_STRIP);
-			glTexCoord2f(0.0f, 1.0f); glVertex3f(0.0f, -256.0f, 0.0f);
-			glTexCoord2f(0.0f, 0.0f); glVertex3f(0.0f, -512.0f, 0.0f);
-			glTexCoord2f(1.0f, 1.0f); glVertex3f(256.0f, -256.0f, 0.0f);
-			glTexCoord2f(1.0f, 0.0f); glVertex3f(256.0f, -512.0f, 0.0f);
-		glEnd();
-	glBindTexture(GL_TEXTURE_2D, gameover[1].getID());
-		glBegin(GL_TRIANGLE_STRIP);
 			glTexCoord2f(0.0f, 1.0f); glVertex3f(256.0f, -256.0f, 0.0f);
 			glTexCoord2f(0.0f, 0.0f); glVertex3f(256.0f, -512.0f, 0.0f);
 			glTexCoord2f(1.0f, 1.0f); glVertex3f(512.0f, -256.0f, 0.0f);
 			glTexCoord2f(1.0f, 0.0f); glVertex3f(512.0f, -512.0f, 0.0f);
 		glEnd();
+	glBindTexture(GL_TEXTURE_2D, gameover[1].getID());
+		glBegin(GL_TRIANGLE_STRIP);
+			glTexCoord2f(0.0f, 1.0f); glVertex3f(512.0f, -256.0f, 0.0f);
+			glTexCoord2f(0.0f, 0.0f); glVertex3f(512.0f, -512.0f, 0.0f);
+			glTexCoord2f(1.0f, 1.0f); glVertex3f(768.0f, -256.0f, 0.0f);
+			glTexCoord2f(1.0f, 0.0f); glVertex3f(768.0f, -512.0f, 0.0f);
+		glEnd();
 }
 void fbgOpenGLRenderer::drawGameplay() {
 	// Draw Matrix
diff -ur fbg-0.9/startfbg/startfbg.cc fbg-0.9.new/startfbg/startfbg.cc
--- fbg-0.9/startfbg/startfbg.cc	2002-12-23 23:50:38.000000000 +0100
+++ fbg-0.9.new/startfbg/startfbg.cc	2006-10-13 15:32:49.000000000 +0200
@@ -36,16 +36,23 @@
 
 IMPLEMENT_APP(fbglaunch)
 
-fbglaunchFrame::fbglaunchFrame(const char* argv0, const fbglaunch* newParent, const wxString& title, int w, int h) : wxFrame(NULL, -1, title, wxDefaultPosition, wxSize(w,h), wxSYSTEM_MENU | wxMINIMIZE_BOX | wxCAPTION) {
+static char *strconcat(const char *str1, const char *str2)
+{
+	static char buf[512];
+	snprintf(buf, sizeof(buf), "%s%s", str1, str2);
+	return buf;
+}
+
+fbglaunchFrame::fbglaunchFrame(const char* argv0, const fbglaunch* newParent, const wxString& title, int w, int h) : wxFrame(NULL, -1, title, wxDefaultPosition, wxSize(w,h), wxSYSTEM_MENU | wxCLOSE_BOX | wxMINIMIZE_BOX | wxCAPTION) {
 	// Set up PhysicsFS
 	PHYSFS_init(argv0);
 #ifdef WIN32
 	PHYSFS_addToSearchPath((wxString(PHYSFS_getBaseDir())+"data\\").c_str(), 1);
 	PHYSFS_addToSearchPath((wxString(PHYSFS_getUserDir())+"fbg\\data\\").c_str(), 1);
 #else
-	PHYSFS_addToSearchPath((wxString(PHYSFS_getUserDir())+".fbg/data/").c_str(), 1);
+	PHYSFS_addToSearchPath(strconcat(PHYSFS_getUserDir(), ".fbg/data/"), 1);
 	PHYSFS_addToSearchPath(FBGDATADIR "/data/", 1);
-	PHYSFS_addToSearchPath((wxString(PHYSFS_getBaseDir())+"data/").c_str(), 1);
+	PHYSFS_addToSearchPath(strconcat(PHYSFS_getBaseDir(), "data/"), 1);
 	PHYSFS_addToSearchPath("/usr/local/games/fbg/data/", 1);
 	PHYSFS_addToSearchPath("/usr/games/fbg/data/", 1);
 #endif
@@ -56,7 +63,7 @@
 		int end;
 		for (end=0; pk3list[i][end] != '\0'; end++);
 		if (pk3list[i][end-1] == '3' && pk3list[i][end-2] == 'k' && pk3list[i][end-3] == 'p' && pk3list[i][end-4] == '.') {
-			PHYSFS_addToSearchPath((wxString(PHYSFS_getRealDir(pk3list[i]))+pk3list[i]).c_str(), 1);
+			PHYSFS_addToSearchPath(strconcat(PHYSFS_getRealDir(pk3list[i]), pk3list[i]), 1);
 		}
 	}
 	PHYSFS_freeList(pk3list);
@@ -67,46 +74,46 @@
 	wxPanel* pan = new wxPanel(this, -1);
 	wxBoxSizer* top = new wxBoxSizer(wxVERTICAL);
 
-	wxStaticBoxSizer* graphBox = new wxStaticBoxSizer(new wxStaticBox(pan, -1, "Graphics Options"), wxVERTICAL);
+	wxStaticBoxSizer* graphBox = new wxStaticBoxSizer(new wxStaticBox(pan, -1, wxT("Graphics Options")), wxVERTICAL);
 		wxBoxSizer* themeBox = new wxBoxSizer(wxHORIZONTAL);
-			themeBox->Add(new wxStaticText(pan, ID_RES, "Theme:"), 1, wxEXPAND|wxALIGN_CENTER_VERTICAL);
+			themeBox->Add(new wxStaticText(pan, ID_RES, wxT("Theme:")), 1, wxEXPAND|wxALIGN_CENTER_VERTICAL);
 				int themeCount = 0;
 				int defaultThemeIndex = 0;
 				char** list = PHYSFS_enumerateFiles("themes");
 				for (int i=0; list[i] != NULL; i++) {
-					if (PHYSFS_isDirectory(wxString("themes/")+list[i])) themeCount++;
-					if (wxString(list[i]) == wxT("default")) defaultThemeIndex = themeCount-1;
+					if (PHYSFS_isDirectory(strconcat("themes/", list[i]))) themeCount++;
+					if (wxString(list[i], wxConvUTF8) == wxT("default")) defaultThemeIndex = themeCount-1;
 				}
-				wxString* themeChoices;
+				wxString* themeChoices = NULL;
 				if (themeCount > 0) {
 					themeChoices = new wxString[themeCount];
 					int currentTheme = 0;
 					for (int i=0; list[i] != NULL; i++) {
-						if (PHYSFS_isDirectory(wxString("themes/")+list[i])) themeChoices[currentTheme++] = wxString(list[i]);
+						if (PHYSFS_isDirectory(strconcat("themes/", list[i]))) themeChoices[currentTheme++] = wxString(list[i], wxConvUTF8);
 					}
 				}
 				PHYSFS_freeList(list);
 			themeMenu = new wxChoice(pan, ID_THEME, wxDefaultPosition, wxDefaultSize, themeCount, themeChoices);
-			delete themeChoices;
+			delete[] themeChoices;
 			themeMenu->SetSelection(defaultThemeIndex);
 			themeBox->Add(themeMenu, 0, wxALIGN_RIGHT);
 #ifdef ENABLE_SOUND
 		wxBoxSizer* musicBox = new wxBoxSizer(wxHORIZONTAL);
-			musicCheck = new wxCheckBox(pan, ID_MUSIC_CHECK, "Music");
+			musicCheck = new wxCheckBox(pan, ID_MUSIC_CHECK, wxT("Music"));
 			musicBox->Add(musicCheck, 1, wxALIGN_LEFT);
-			musicBox->Add(new wxStaticText(pan, -1, "File: ", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT), 1, wxALIGN_CENTER_VERTICAL);
+			musicBox->Add(new wxStaticText(pan, -1, wxT("File: "), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT), 1, wxALIGN_CENTER_VERTICAL);
 			int musicCount = 0;
 			int defaultMusicIndex = 0;
 			char** mList = PHYSFS_enumerateFiles("music");
 			for (int i=0; mList[i] != NULL; i++) {
 				musicCount++;
-				if (wxString(mList[i]) == wxT("typea.it")) defaultMusicIndex = musicCount-1;
+				if (wxString(mList[i], wxConvUTF8) == wxT("typea.it")) defaultMusicIndex = musicCount-1;
 			}
 			wxString* musicChoices;
 			if (musicCount > 0) {
 				musicChoices = new wxString[musicCount];
 				int currentMusic = 0;
-				for (int i=0; mList[i] != NULL; i++) musicChoices[currentMusic] = wxString(mList[i]);
+				for (int i=0; mList[i] != NULL; i++) musicChoices[currentMusic] = wxString(mList[i], wxConvUTF8);
 			}
 			PHYSFS_freeList(mList);
 			musicMenu = new wxChoice(pan, ID_MUSIC, wxDefaultPosition, wxDefaultSize, musicCount, musicChoices);
@@ -115,19 +122,19 @@
 			musicBox->Add(musicMenu, 0, wxALIGN_RIGHT);
 #endif
 		wxBoxSizer* resBox = new wxBoxSizer(wxHORIZONTAL);
-			resBox->Add(new wxStaticText(pan, ID_RES, "Resolution:"), 1, wxEXPAND|wxALIGN_CENTER_VERTICAL);
-			wxString resChoices[4] = {"320x240", "640x480", "800x600", "1024x768"};
+			resBox->Add(new wxStaticText(pan, ID_RES, wxT("Resolution:")), 1, wxEXPAND|wxALIGN_CENTER_VERTICAL);
+			wxString resChoices[4] = { wxT("320x240"), wxT("640x480"), wxT("800x600"), wxT("1024x768")};
 			resMenu = new wxChoice(pan, ID_RES, wxDefaultPosition, wxDefaultSize, 4, resChoices);
 			resMenu->SetSelection(1);
 			resBox->Add(resMenu, 0, wxALIGN_RIGHT);
 		wxBoxSizer* bppBox = new wxBoxSizer(wxHORIZONTAL);
-			bppBox->Add(new wxStaticText(pan, ID_BPP, "Color Depth:"), 1, wxEXPAND|wxALIGN_CENTER_VERTICAL);
-			wxString bppChoices[3] = {"16", "24", "32"};
+			bppBox->Add(new wxStaticText(pan, ID_BPP, wxT("Color Depth:")), 1, wxEXPAND|wxALIGN_CENTER_VERTICAL);
+			wxString bppChoices[3] = {wxT("16"), wxT("24"), wxT("32")};
 			bppMenu = new wxChoice(pan, ID_BPP, wxDefaultPosition, wxDefaultSize, 3, bppChoices);
 			bppMenu->SetSelection(2);
 			bppBox->Add(bppMenu, 0, wxALIGN_RIGHT);
 		wxBoxSizer* fsBox = new wxBoxSizer(wxHORIZONTAL);
-			fsCheck = new wxCheckBox(pan, ID_FS, "Run Fullscreen");
+			fsCheck = new wxCheckBox(pan, ID_FS, wxT("Run Fullscreen"));
 			fsBox->Add(fsCheck, 0, wxALIGN_LEFT);
 #ifdef WIN32
 			fsCheck->SetValue(true);
@@ -135,7 +142,7 @@
 			fsCheck->SetValue(false);
 #endif
 		wxBoxSizer* lightBox = new wxBoxSizer(wxHORIZONTAL);
-			lightCheck = new wxCheckBox(pan, ID_LIGHT, "\"Light\" Mode (uses less CPU)");
+			lightCheck = new wxCheckBox(pan, ID_LIGHT, wxT("\"Light\" Mode (uses less CPU)"));
 			lightBox->Add(lightCheck, 0, wxALIGN_LEFT);
 		graphBox->Add(themeBox, 0, wxEXPAND);
 #ifdef ENABLE_SOUND
@@ -145,19 +152,19 @@
 		graphBox->Add(bppBox, 0, wxEXPAND);
 		graphBox->Add(fsBox, 0, wxALIGN_LEFT);
 		graphBox->Add(lightBox, 0, wxALIGN_LEFT);
-	wxStaticBoxSizer* gameBox = new wxStaticBoxSizer(new wxStaticBox(pan, -1, "Gameplay Options"), wxVERTICAL);
+	wxStaticBoxSizer* gameBox = new wxStaticBoxSizer(new wxStaticBox(pan, -1, wxT("Gameplay Options")), wxVERTICAL);
 		wxBoxSizer* levelBox = new wxBoxSizer(wxHORIZONTAL);
-			levelBox->Add(new wxStaticText(pan, -1, "Starting Level:"), 1, wxEXPAND|wxALIGN_CENTER_VERTICAL);
-			wxString levelChoices[10] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
+			levelBox->Add(new wxStaticText(pan, -1, wxT("Starting Level:")), 1, wxEXPAND|wxALIGN_CENTER_VERTICAL);
+			wxString levelChoices[10] = {wxT("0"), wxT("1"), wxT("2"), wxT("3"), wxT("4"), wxT("5"), wxT("6"), wxT("7"), wxT("8"), wxT("9")};
 			levelMenu = new wxChoice(pan, ID_LEVEL, wxDefaultPosition, wxDefaultSize, 10, levelChoices);
 			levelMenu->SetSelection(0);
 			levelBox->Add(levelMenu, 0, wxALIGN_RIGHT);
 		gameBox->Add(levelBox, 0, wxEXPAND);
 		wxBoxSizer* btypeBox = new wxBoxSizer(wxHORIZONTAL);
-			btypeCheck = new wxCheckBox(pan, ID_BTYPE_CHECK, "B-Type");
+			btypeCheck = new wxCheckBox(pan, ID_BTYPE_CHECK, wxT("B-Type"));
 			btypeBox->Add(btypeCheck, 1, wxALIGN_LEFT);
-			btypeBox->Add(new wxStaticText(pan, -1, "Height: ", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT), 1, wxALIGN_CENTER_VERTICAL);
-			wxString btypeChoices[9] = {"0", "1", "2", "3", "4", "5"};
+			btypeBox->Add(new wxStaticText(pan, -1, wxT("Height: "), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT), 1, wxALIGN_CENTER_VERTICAL);
+			wxString btypeChoices[9] = {wxT("0"), wxT("1"), wxT("2"), wxT("3"), wxT("4"), wxT("5")};
 			btypeMenu = new wxChoice(pan, ID_BTYPE, wxDefaultPosition, wxDefaultSize, 6, btypeChoices);
 			btypeMenu->Enable(false);
 			btypeMenu->SetSelection(0);
@@ -171,7 +178,7 @@
 #endif
 	top->Add(graphBox, 0, wxEXPAND|wxALL, 2);
 	top->Add(gameBox, 0, wxEXPAND|wxALL, 2);
-		playButton = new wxButton(pan, ID_PLAY, "Play Falling Block Game");
+		playButton = new wxButton(pan, ID_PLAY, wxT("Play Falling Block Game"));
 		pan->SetDefaultItem(playButton);
 	top->Add(playButton, 0, wxEXPAND|wxALL, 1);
 	pan->SetAutoLayout(true);
@@ -195,16 +202,16 @@
 END_EVENT_TABLE()
 
 bool fbglaunch::OnInit() {
-	frame = new fbglaunchFrame(argv[0], this, "Falling Block Game"/* " v" VERSION*/, 400, 400);
+	frame = new fbglaunchFrame((const char *)argv[0], this, wxT("Falling Block Game")/* " v" VERSION*/, 400, 400);
 	frame->Show(true);
 	SetTopWindow(frame);
 	return true;
 }
 
 void fbglaunchFrame::clickPlay(wxCommandEvent& evt) {
-	parent->launchFBG(wxString(PHYSFS_getBaseDir())+"fbg" FBG_EXTENSION, fsCheck->GetValue(), lightCheck->GetValue(), themeMenu->GetStringSelection(),
+	parent->launchFBG(wxT("fbg" FBG_EXTENSION), fsCheck->GetValue(), lightCheck->GetValue(), themeMenu->GetStringSelection(),
 #ifdef ENABLE_SOUND
-		(musicCheck->GetValue() ? musicMenu->GetStringSelection() : wxString("")),
+		(musicCheck->GetValue() ? musicMenu->GetStringSelection() : wxString(wxT(""))),
 #endif
 		bppMenu->GetStringSelection(), resMenu->GetStringSelection(), levelMenu->GetStringSelection(), (btypeMenu->IsEnabled() ? btypeMenu->GetStringSelection() : wxString(wxT("-1"))));
 }
@@ -223,19 +230,27 @@
 const wxString& music,
 #endif
 const wxString& bpp, const wxString& res, const wxString& level, const wxString& btype) const {
-	wxString cmd = "\""+fbgBin+"\"";
-	cmd += (fs ? " -f" : " -w");
-	if (light) cmd += " --light";
-	cmd += " -t " + theme;
-#ifdef ENABLE_SOUND
-	if (music != "") cmd += " -m " + music;
-	else cmd += " --no-music ";
-#endif
-	cmd += " -d " + bpp;
-	cmd += " -r " + res;
-	cmd += " -l " + level;
-	if (btype != "-1") cmd += " -b " + btype;
-	system(cmd);
+	const char *argv[16];
+	int argc = 0;
+	argv[argc++] = strdup(fbgBin.mb_str(wxConvUTF8));
+	argv[argc++] = fs ? "-f" : "-w";
+	if (light) argv[argc++] = "--light";
+	argv[argc++] = "-t"; argv[argc++] = strdup(theme.mb_str(wxConvUTF8));
+#ifdef ENABLE_SOUND
+	if (music != wxT("")) {
+		argv[argc++] = "-m"; argv[argc++] = strdup(music.mb_str(wxConvUTF8));
+	} else argv[argc++] = "--no-music";
+#endif
+	argv[argc++] = "-d"; argv[argc++] = strdup(bpp.mb_str(wxConvUTF8));
+	argv[argc++] = "-r"; argv[argc++] = strdup(res.mb_str(wxConvUTF8));
+	argv[argc++] = "-l"; argv[argc++] = strdup(level.mb_str(wxConvUTF8));
+	if (btype != wxT("-1")) {
+		argv[argc++] = "-b";
+		argv[argc++] = strdup(btype.mb_str(wxConvUTF8));
+	}
+	argv[argc++] = NULL; 
+	  
+	execvp(argv[0], (char * const*)argv);
 }
 
 int fbglaunch::OnExit() {


--- NEW FILE fbg.desktop ---
[Desktop Entry]
Encoding=UTF-8
Name=Falling Block Game
Comment=Move falling blocks to make them form a complete row
Exec=fbglaunch
Icon=fbg.png
Terminal=false
StartupNotify=false
Type=Application
Categories=Application;Game;BlocksGame;


--- NEW FILE fbg.spec ---
Name:           fbg
Version:        0.9
Release:        2%{?dist}
Summary:        Falling Block Game
Group:          Amusements/Games
License:        GPL
URL:            http://fbg.sourceforge.net/
Source0:        http://dl.sf.net/sourceforge/%{name}/%{name}-%{version}.tar.gz
Source1:        %{name}.desktop
Patch0:         fbg-fixes.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  SDL-devel physfs-devel mikmod-devel wxGTK-devel
BuildRequires:  desktop-file-utils ImageMagick
Requires:       hicolor-icon-theme

%description
Move and rotate variously shaped falling blocks to make them form a complete
row. Once a complete row has formed it will disappear. If you make incomplete
rows the screen will fill up and when it reaches the top the game is over.


%prep
%setup -q
%patch0 -p1 -z .fix
# sigh stop autoxxx from rerunning because of our patches above.
touch aclocal.m4
touch configure
touch `find -name Makefile.in`


%build
%configure
make %{?_smp_mflags}
convert startfbg/icon.xpm %{name}.png


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
# rm make install installed docs as we install them with %doc
rm $RPM_BUILD_ROOT/usr/doc/fbg/COPYING $RPM_BUILD_ROOT/usr/doc/fbg/README

# below is the desktop file and icon stuff.
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
desktop-file-install --vendor fedora            \
  --dir $RPM_BUILD_ROOT%{_datadir}/applications \
  --add-category X-Fedora                       \
  %{SOURCE1}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps
install -p -m 644 %{name}.png \
  $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps


%clean
rm -rf $RPM_BUILD_ROOT


%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
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING README TODO
%{_bindir}/%{name}*
%{_datadir}/%{name}
%{_mandir}/man6/%{name}*
%{_datadir}/applications/fedora-%{name}.desktop
%{_datadir}/icons/hicolor/32x32/apps/%{name}.png


%changelog
* Sat Oct 14 2006 Hans de Goede <j.w.r.degoede at hhs.nl> 0.9-2
- Correct license from LGPL to GPL

* Fri Oct 13 2006 Hans de Goede <j.w.r.degoede at hhs.nl> 0.9-1
- Initial Fedora Extras package


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/fbg/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	14 Oct 2006 11:38:24 -0000	1.1
+++ .cvsignore	14 Oct 2006 11:39:38 -0000	1.2
@@ -0,0 +1 @@
+fbg-0.9.tar.gz


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/fbg/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	14 Oct 2006 11:38:24 -0000	1.1
+++ sources	14 Oct 2006 11:39:38 -0000	1.2
@@ -0,0 +1 @@
+82db64d84b6172f5676fcff69d533881  fbg-0.9.tar.gz




More information about the fedora-extras-commits mailing list