vk: add logs and notes about mod/spr load sequence

This commit is contained in:
Ivan Avdeev 2023-09-26 12:25:40 -04:00
parent 26224b4aca
commit b549ac76f6
6 changed files with 52 additions and 2 deletions

View File

@ -505,3 +505,42 @@ Questions:
- Should it apply the first found rule that matches a given geometry and stop?
Or should it apply updates to the material using all the rules that matched in their specified order? Doing the first rule and stopping is more readable and perofrmant, but also might be verbose in some cases.
- Should we do "automatic" materials? I.e. if there's no manually specified material for a texture named `"<TEX>"`, then we try to load `"<TEX>_basecolor.ktx"`, `"<TEX>_normalmap.ktx"`, etc automatically.
# 2023-09-26 E302
Map loading sequence
```
[2023:09:26|11:30:31] Couldn't open file overviews/c1a0d.txt. Using default values for overiew mode.
[2023:09:26|11:30:31] CL_SignonReply: 2
[2023:09:26|11:30:31] Signon network traffic: 10.380 Kb from server, 349 bytes to server
[2023:09:26|11:30:31] client connected at 0.07 sec
[2023:09:26|11:30:31] Error: SDL_GL_SetSwapInterval: No OpenGL context has been made current
[2023:09:26|11:30:31] vk: Mod_ProcessRenderData(sprites/640_pain.spr, create=1)
[2023:09:26|11:30:43] Loading game from save/autosave01.sav...
[2023:09:26|11:30:43] Spawn Server: c2a5
[2023:09:26|11:30:43] vk: Mod_ProcessRenderData(maps/c1a0d.bsp, create=0)
[2023:09:26|11:30:43] Warning: VK FIXME Trying to unload brush model maps/c1a0d.bsp
[2023:09:26|11:30:43] Error: VK NOT_IMPLEMENTED(x0): RT_KusochkiFree
[2023:09:26|11:30:43] loading maps/c2a5.bsp
[2023:09:26|11:30:43] Warning: FS_LoadImage: couldn't load "alpha_sky"
[2023:09:26|11:30:43] Warning: FS_LoadImage: couldn't load "solid_sky"
[2023:09:26|11:30:43] lighting: colored
[2023:09:26|11:30:43] Wad files required to run the map: "halflife.wad; liquids.wad; xeno.wad"
[2023:09:26|11:30:43] vk: Mod_ProcessRenderData(maps/c2a5.bsp, create=1)
[2023:09:26|11:30:43] Loading game from save/c2a5.HL1...
[2023:09:26|11:30:43]
GAME SKILL LEVEL:1
[2023:09:26|11:30:43] Loading CGraph in GRAPH_VERSION 16 compatibility mode
[2023:09:26|11:30:43] Loading CLink array in GRAPH_VERSION 16 compatibility mode
[2023:09:26|11:30:43]
*Graph Loaded!
[2023:09:26|11:30:43] **Graph Pointers Set!
[2023:09:26|11:30:43] loading sprites/flare1.spr
[2023:09:26|11:30:43] vk: Mod_ProcessRenderData(sprites/flare1.spr, create=1)
.. more Mod_ProcessRenderData
.. and only then R_NewMap
```

View File

@ -16,6 +16,8 @@ static const struct log_pair_t {
{"mat", LogModule_Material},
{"meat", LogModule_Meatpipe},
{"rt", LogModule_RT},
{"rmain", LogModule_RMain},
{"sprite", LogModule_Sprite},
};
void VK_LogsReadCvar(void) {

View File

@ -12,6 +12,8 @@ enum {
LogModule_Material = (1<<6),
LogModule_Meatpipe = (1<<7),
LogModule_RT = (1<<8),
LogModule_RMain = (1<<9),
LogModule_Sprite = (1<<10),
};
extern uint32_t g_log_debug_bits;

View File

@ -78,7 +78,7 @@ static void loadMaterialsFromFile( const char *filename, int depth ) {
string basecolor_map, normal_map, metal_map, roughness_map;
DEBUG("Loading materials from %s", filename);
DEBUG("Loading materials from %s (exists=%d)", filename, data != 0);
if ( !data )
return;

View File

@ -21,6 +21,8 @@
#include <memory.h>
#define LOG_MODULE LogModule_RMain
ref_api_t gEngine = {0};
ref_globals_t *gpGlobals = NULL;
@ -117,7 +119,7 @@ static qboolean Mod_ProcessRenderData( model_t *mod, qboolean create, const byte
{
qboolean loaded = true;
//gEngine.Con_Reportf("%s(%s, create=%d)\n", __FUNCTION__, mod->name, create);
DEBUG("%s(%s, create=%d)", __FUNCTION__, mod->name, create);
// TODO does this ever happen?
if (!create && mod->type == mod_brush)

View File

@ -6,6 +6,7 @@
#include "vk_scene.h"
#include "r_speeds.h"
#include "vk_math.h"
#include "vk_logs.h"
#include "sprite.h"
#include "xash3d_mathlib.h"
@ -16,6 +17,7 @@
#include <memory.h>
#define MODULE_NAME "sprite"
#define LOG_MODULE LogModule_Sprite
// it's a Valve default value for LoadMapSprite (probably must be power of two)
#define MAPSPRITE_SIZE 128
@ -404,6 +406,7 @@ Loading a bitmap image as sprite with multiple frames
as pieces of input image
====================
*/
// IS NOT CALLED BY ANYTHING?!
void Mod_LoadMapSprite( model_t *mod, const void *buffer, size_t size, qboolean *loaded )
{
byte *src, *dst;
@ -417,6 +420,8 @@ void Mod_LoadMapSprite( model_t *mod, const void *buffer, size_t size, qboolean
msprite_t *psprite;
SpriteLoadContext ctx = {0};
DEBUG("%s(%s, %p, %d, %d)", __FUNCTION__, mod->name, buffer, (int)size, (int)*loaded);
if( loaded ) *loaded = false;
Q_snprintf( texname, sizeof( texname ), "#%s", mod->name );
gEngine.Image_SetForceFlags( IL_OVERVIEW );