From: Andy D. <kha...@us...> - 2004-11-25 18:11:37
|
Update of /cvsroot/planeshift/planeshift/src/common/psbehave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24534/src/common/psbehave Modified Files: psworld.cpp Log Message: The server and npcclient no longer call Prepare() and PrecacheDraw() when loading regions since they will never render anything anyway. Index: psworld.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/common/psbehave/psworld.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** psworld.cpp 14 Nov 2004 00:19:57 -0000 1.45 --- psworld.cpp 25 Nov 2004 18:11:26 -0000 1.46 *************** *** 327,332 **** --- 327,342 ---- return true; + bool using3D; + csRef<iEngine> engine = CS_QUERY_REGISTRY (object_reg, iEngine); + // Find out if we are ever going to render 3D + csRef<iGraphics3D> g3d = CS_QUERY_REGISTRY(object_reg, iGraphics3D); + csRef<iFactory> factory = + SCF_QUERY_INTERFACE(g3d, iFactory); + + const char* g3Dname = factory->QueryClassID(); + using3D = strcmp("crystalspace.graphics3d.null", g3Dname); + // Save the old region to restore it if this load doesn't work *************** *** 345,348 **** --- 355,360 ---- engine->SetCacheManager(NULL); + + printf ("Before LoadMapFile of %s: time=%d\n", worlddir.GetData(), csGetTicks ()); //!!!!! *************** *** 358,369 **** // Successfully loaded. Now get textures ready, etc. and return. ! cur_region->Prepare (); world->MoveToSharedRegion(cur_region); ! printf ("After cur_region->Prepare: time=%d\n", csGetTicks ()); ! ! engine->PrecacheDraw (cur_region); ! printf ("After Precache: time=%d\n", csGetTicks ()); SetupWorldColliders(engine,cur_region); --- 370,386 ---- // Successfully loaded. Now get textures ready, etc. and return. ! if (using3D) ! { ! cur_region->Prepare (); ! printf ("After cur_region->Prepare: time=%d\n", csGetTicks ()); ! } world->MoveToSharedRegion(cur_region); ! if (using3D) ! { ! engine->PrecacheDraw (cur_region); ! printf ("After Precache: time=%d\n", csGetTicks ()); ! } SetupWorldColliders(engine,cur_region); |