Some not THAT memory demanding limits extension;
authorrpolzer <rpolzer@61c419a2-8eb2-4b30-bcec-8cead039b335>
Thu, 20 Nov 2008 14:25:50 +0000 (14:25 +0000)
committerrpolzer <rpolzer@61c419a2-8eb2-4b30-bcec-8cead039b335>
Thu, 20 Nov 2008 14:25:50 +0000 (14:25 +0000)
use right file name when looking for .mtl

git-svn-id: svn://svn.icculus.org/netradiant/trunk@129 61c419a2-8eb2-4b30-bcec-8cead039b335

libs/picomodel.h
libs/picomodel/picomodel.c
plugins/model/model.cpp
tools/quake3/q3map2/q3map2.h

index f7ac8a3..bb47be0 100644 (file)
@@ -220,7 +220,7 @@ const picoModule_t                  **PicoModuleList( int *numModules );
 picoModel_t                                    *PicoLoadModel( char *name, int frameNum );
 
 typedef size_t (*PicoInputStreamReadFunc)(void* inputStream, unsigned char* buffer, size_t length);
-picoModel_t* PicoModuleLoadModelStream( const picoModule_t* module, void* inputStream, PicoInputStreamReadFunc inputStreamRead, size_t streamLength, int frameNum );
+picoModel_t* PicoModuleLoadModelStream( const picoModule_t* module, void* inputStream, PicoInputStreamReadFunc inputStreamRead, size_t streamLength, int frameNum, const char *fileName );
 
 /* model functions */
 picoModel_t                                    *PicoNewModel( void );
index 240d729..078dce3 100644 (file)
@@ -259,7 +259,7 @@ picoModel_t *PicoLoadModel( char *fileName, int frameNum )
        return model;
 }
 
-picoModel_t    *PicoModuleLoadModelStream( const picoModule_t* module, void* inputStream, PicoInputStreamReadFunc inputStreamRead, size_t streamLength, int frameNum )
+picoModel_t    *PicoModuleLoadModelStream( const picoModule_t* module, void* inputStream, PicoInputStreamReadFunc inputStreamRead, size_t streamLength, int frameNum, const char *fileName )
 {
        picoModel_t                     *model;
        picoByte_t                      *buffer;
@@ -286,14 +286,7 @@ picoModel_t        *PicoModuleLoadModelStream( const picoModule_t* module, void* inputS
        bufSize = (int)inputStreamRead(inputStream, buffer, streamLength);
        buffer[bufSize] = '\0';
 
-       {
-               // dummy filename
-               char fileName[128];
-               fileName[0] = '.';
-               strncpy(fileName + 1, module->defaultExts[0], 126);
-               fileName[127] = '\0';
-               model = PicoModuleLoadModel(module, fileName, buffer, bufSize, frameNum);
-       }
+       model = PicoModuleLoadModel(module, fileName, buffer, bufSize, frameNum);
        
   if(model != 0)
   {
index 4758974..fb8139c 100644 (file)
@@ -1041,7 +1041,7 @@ size_t picoInputStreamReam(void* inputStream, unsigned char* buffer, size_t leng
 
 scene::Node& loadPicoModel(const picoModule_t* module, ArchiveFile& file)
 {
-  picoModel_t* model = PicoModuleLoadModelStream(module, &file.getInputStream(), picoInputStreamReam, file.size(), 0);
+  picoModel_t* model = PicoModuleLoadModelStream(module, &file.getInputStream(), picoInputStreamReam, file.size(), 0, file.getName());
   PicoModelNode* modelNode = new PicoModelNode(model);
   PicoFreeModel(model);
   return modelNode->node();
index 045b758..96a8799 100644 (file)
@@ -303,14 +303,14 @@ abstracted bsp file
 
 /* ok to increase these at the expense of more memory */
 #define        MAX_MAP_MODELS                  0x400
-#define        MAX_MAP_BRUSHES                 0x8000
+#define        MAX_MAP_BRUSHES                 0x10000
 #define        MAX_MAP_ENTITIES                0x1000          //%     0x800   /* ydnar */
 #define        MAX_MAP_ENTSTRING               0x80000         //%     0x40000 /* ydnar */
 #define        MAX_MAP_SHADERS                 0x800           //%     0x400   /* ydnar */
 
 #define        MAX_MAP_AREAS                   0x100           /* MAX_MAP_AREA_BYTES in q_shared must match! */
 #define        MAX_MAP_FOGS                    30                      //& 0x100       /* RBSP (32 - world fog - goggles) */
-#define        MAX_MAP_PLANES                  0x100000        //%     0x20000 /* ydnar for md */
+#define        MAX_MAP_PLANES                  0x200000        //%     0x20000 /* ydnar for md */
 #define        MAX_MAP_NODES                   0x20000
 #define        MAX_MAP_BRUSHSIDES              0x100000        //%     0x20000 /* ydnar */
 #define        MAX_MAP_LEAFS                   0x20000