File: optional_cg.patch

package info (click to toggle)
funguloids 1.06-16
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 21,348 kB
  • sloc: cpp: 5,081; ansic: 3,285; python: 207; makefile: 154
file content (38 lines) | stat: -rw-r--r-- 1,151 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Author: Cristian Morales Vega <cmorve69@yahoo.es>
Origin: https://build.opensuse.org/package/view_file?file=funguloids-optional_cg.patch&package=funguloids&project=games
Description: make the Ogre Cg plugin optional
Bug-Debian: http://bugs.debian.org/578089
--- a/bin/plugins.cfg.in
+++ b/bin/plugins.cfg.in
@@ -7,6 +7,6 @@
 Plugin=RenderSystem_GL
 Plugin=Plugin_ParticleFX
 Plugin=Plugin_OctreeSceneManager
-Plugin=Plugin_CgProgramManager
+#Plugin=Plugin_CgProgramManager
 
 
--- a/src/ogreapp.cpp
+++ b/src/ogreapp.cpp
@@ -23,6 +23,7 @@
 //
 //***************************************************************************/
 
+#include <sys/stat.h>
 #include "ogreapp.h"
 #include "objectsystem.h"
 #include "effects.h"
@@ -71,6 +72,13 @@
 			OGRE_CONFIG_AND_LOG_PATH + "Ogre.log"
 			);
 
+	ConfigFile cfg;
+	cfg.load(String(OGRE_PLUGINS_AND_RESOURCES_PATH) + "plugins.cfg");
+	String pluginDir = cfg.getSetting("PluginFolder");
+	struct stat sb;
+	if (stat((pluginDir + "Plugin_CgProgramManager.so").c_str(), &sb) == 0)
+		mRoot->loadPlugin(pluginDir + "Plugin_CgProgramManager");
+
 	// Random seed
 	srand(time(NULL));