Hi,

I have programmed a small patch, which tries first to load AI-aircraft from Ai_crafts instead of Aircrafts. It works fine and can help us to save some memory. Which name for the alternative Aircraft directory would be good? (For simplification of the string operations it should have the same length as aircraft has). The patch is only a proof of concept (no comments, just one check for ...[2]=='r')...

Maik

Maik Justus schrieb:
Hi,

I was thinking about he memory usage of the aircrafts. As multiplayer mode becomes more and more popular, more aircrafts are loaded into memory. If any AI-aircraft is not loaded directly from the Aircraft folder, but first from an AI-Aircraft folder and only if the aircraft isn't found there, the aircraft is loaded from the Aircraft folder, the memory usage can be minimized. We only have to copy the aircrafts with huge memory usage to this folder and rescale the textures (and maybe replace the .ac files by lower polygon versions).

Maik

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel



Index: AIBase.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/AIModel/AIBase.cxx,v
retrieving revision 1.64
diff -u -p -r1.64 AIBase.cxx
--- AIBase.cxx  6 Oct 2006 17:36:32 -0000       1.64
+++ AIBase.cxx  12 Nov 2006 20:23:41 -0000
@@ -128,11 +128,32 @@ void FGAIBase::Transform() {
 bool FGAIBase::init() {
 
    if (!model_path.empty()) {
-     try {
-       model = load3DModel( globals->get_fg_root(), model_path, props,
+     if (model_path[2]=='r')
+     {
+       model_path[2]='_';
+       try {
+         model = load3DModel( globals->get_fg_root(), model_path, props,
                             globals->get_sim_time_sec() );
-     } catch (const sg_exception &e) {
-       model = NULL;
+       } catch (const sg_exception &e) {
+         model = NULL;
+       }
+       if (!model) 
+       {
+         model_path[2]='r';
+         try {
+           model = load3DModel( globals->get_fg_root(), model_path, props,
+                            globals->get_sim_time_sec() );
+         } catch (const sg_exception &e) {
+           model = NULL;
+         }
+       }
+     } else {
+       try {
+         model = load3DModel( globals->get_fg_root(), model_path, props,
+                            globals->get_sim_time_sec() );
+       } catch (const sg_exception &e) {
+         model = NULL;
+       }
      }
    }
    if (model) {
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to