r_shadow: work around a realtime world light crash Fudges a bit more memory to support edge cases, prints a warn instead of crashing if it's not enough. see https://github.com/DarkPlacesEngine/darkplaces/issues/119 and 46964b3848eb7471d2f0e2284ae389b4b53337c1 Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
render: Refactor R_CullBox to simplify it. Use bitwise comparisons instead of the previous switch. Skip the nearclip plane on the view frustum. From divVerent. Cleaned up further by Cloudwalk. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13108 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: Fix r_lockpvs behaving like r_lockvisibility. Minor refactoring git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13064 d7cf8633-e32d-0410-b094-e92efae38249
Refactored lightmap update handling and added cvars to replace gl_nopartialtextureupdates cvar with finer-grained control: * r_q1bsp_lightmap_updates_enabled (default 1 - shouldn't turn this off) * r_q1bsp_lightmap_updates_combine (default 2 - upload full lightmap texture) * r_q1bsp_lightmap_updates_hidden_surfaces (default 0 - if turned on it may improve fps when the view is moving/turning by only uploading lightmaps on certain frames) Previously there was a bug that made hidden surfaces get lightmap updates, which was never intended, but a cvar was added to allow the behavior to be toggled in case it has some use. Overall this change performs better on AMD drivers for Windows, and is expected to perform a lot better on all Mesa drivers for Linux as they have even worse performance with partial texture update locking, it may reduce performance on NVIDIA drivers for Windows as they have always had good handling of thousands of small partial texture updates. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13056 d7cf8633-e32d-0410-b094-e92efae38249
gl_rsurf: Actually use the model pointer git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13032 d7cf8633-e32d-0410-b094-e92efae38249
gl_rsurf: Whitespace git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13029 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
Unify the command and cvar flags, under the CF_ prefix. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12923 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
gl_rsurf: Check r_lockvisibility only once git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12833 d7cf8633-e32d-0410-b094-e92efae38249
gl_rsurf: Don't cull geometry that leaves the view frustum with r_lockvisibility git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12832 d7cf8633-e32d-0410-b094-e92efae38249
gl_rsurf: Set default of r_useportalculling to 1 git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12831 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
Organize system and host globals into structs. Implement host state tracking git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12691 d7cf8633-e32d-0410-b094-e92efae38249
Initial implementation of command flag system This should reduce code duplication and allows other cool things. This is part of the solution to a bug where "stuffcmds" stopped working because of changes to the initialization order in Host_Init. More work needs to be done but this should be fine for now. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12668 d7cf8633-e32d-0410-b094-e92efae38249
Fix (workaround?) crashes with quake15 mod git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12653 d7cf8633-e32d-0410-b094-e92efae38249
Fix compile warning with bitwise operation git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12609 d7cf8633-e32d-0410-b094-e92efae38249
cvars are now instanced in &cvars_all as a tracking mechanism, there is also &cvars_null if one wishes for no expansion to occur (e.g. client commands received on the server are very untrusted). cvars now have CVAR_CLIENT and CVAR_SERVER flags, dedicated server can only see CVAR_SERVER variables whereas client can see both because it could start a server. cvars created via VMs will have the corresponding flag set (client vm and menu vm can see both CVAR_CLIENT and CVAR_SERVER, server vm can only see CVAR_SERVER - may cause issues with singleplayer mods, we'll see). git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12501 d7cf8633-e32d-0410-b094-e92efae38249