Fix signed int overflows and tidy nearby documentation Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
model_shared: Avoid using R_FrameData_Alloc when building sorted surfaces list Works around an issue where the r_framedatasize cvar would grow to a ridiculous size over time. To be investigated further...
Revert "gl_draw, model_shared: Refactor vertex adding. Add faster codepath that skips hash function for drawing lines. Modest improvement in netgraph performance." This reverts commit 5ad6c0e8577478422c10d7ae79fb61b88ac5ae85. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13130 d7cf8633-e32d-0410-b094-e92efae38249
model_brush: Very early implementation of VBSP loader. It crashes git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13087 d7cf8633-e32d-0410-b094-e92efae38249
model: Recognize Valve BSP format. Add file format headers. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13080 d7cf8633-e32d-0410-b094-e92efae38249
Fix crash in q3bsp loading on submodels where it was adding the submodelsurfaces_start and shouldn't (reported by Cloudwalk - thanks). Fix missing submodels in q3bsp loading where it was allocating a separate modelsurfaces_sorted for each submodel which was probably coming out uninitialized. Simplified Mod_MakeSortedSurfaces a little by sorting each submodel separately - no need to worry about sorting by submodel this way, they're going to stay in the same ranges. Refactored away the many duplicates of the mod->DrawSky and mod->DrawAddWaterPlanes setting code into Mod_SetDrawSkyAndWater function which is called after loader (and in submodel creation), this also means it checks for NULL texture pointer consistently whereas that varied a bit in the past by loader. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13079 d7cf8633-e32d-0410-b094-e92efae38249
Replaced some model fields and changed their purpose slightly to simplify a lot of code: model->firstmodelsurface : model->submodelsurfaces_start model->nummodelsurfaces : replaced with model->submodelsurfaces_end model->sortedmodelsurfaces : replaced with model->modelsurfaces_sorted (which starts at surface 0, not firstmodelsurface). Changed the implementation of MakeSortedSurfaces so that it now sorts by effect, texture, lightmap, previously it didn't care about lightmap or effect. No behavior changes. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13072 d7cf8633-e32d-0410-b094-e92efae38249
gl_draw, model_shared: Refactor vertex adding. Add faster codepath that skips hash function for drawing lines. Modest improvement in netgraph performance. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13044 d7cf8633-e32d-0410-b094-e92efae38249
model_shared: Rename dp_model_t to model_t, to avoid confusion with the dpm format git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12984 d7cf8633-e32d-0410-b094-e92efae38249
model_shared: Move skinframe struct to r_textures.h git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12983 d7cf8633-e32d-0410-b094-e92efae38249
Remove unneeded #includes in some headers. Make some headers standalone. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12981 d7cf8633-e32d-0410-b094-e92efae38249
model: Split up headers. Introduce headers for each BSP format. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12980 d7cf8633-e32d-0410-b094-e92efae38249
quakedef: Add darkplaces.h and include it in as many files as I can. Split up and clean up quakedef.h A client and server agnostic master definitions file is nice to have and this may speed up compile times and make refactoring easier later on. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12972 d7cf8633-e32d-0410-b094-e92efae38249
Rename qboolean to qbool git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12920 d7cf8633-e32d-0410-b094-e92efae38249
Fix compile warnings from gcc and g++ git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12845 d7cf8633-e32d-0410-b094-e92efae38249
Refactor the model loading code to use an array of structs for each format Allows to cleanly and explicitly define a model and what the loader should look for. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12793 d7cf8633-e32d-0410-b094-e92efae38249
Rename model functions to make them more generic and obvious what they're for git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12792 d7cf8633-e32d-0410-b094-e92efae38249
Rename q3shaderinfo_t to shader_t, to be in line with other engines git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12781 d7cf8633-e32d-0410-b094-e92efae38249
Rename render_modellight_lightdir to render_modellight_lightdir_world and add a _local variant, which is transformed into entity space, so that rotating entities are lit correctly. Thanks to kristus for persistently reporting this bug until it was understood. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12749 d7cf8633-e32d-0410-b094-e92efae38249
Don't lerp nailgun and super nailgun. Trades smoothness for better muzzle flash Added a cvar to define models that should not be lerped. Taken from Quakespasm. Todo: Use a proper EF_ flag git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12724 d7cf8633-e32d-0410-b094-e92efae38249