}
}
+static void Mod_JKBSP_LoadLightarray(lump_t *l)
+{
+ int i, count;
+ short *in;
+ jkdlightgrid_t **out;
+
+ in = ( void * )( mod_base + l->fileofs );
+ if( l->filelen % sizeof( *in ) )
+ Host_Error("Mod_JKBSP_LoadLightarray: funny lump size in %s", loadmodel->name );
+ Con_Printf("lightarray = %d\n", l->filelen);
+ count = l->filelen / sizeof( *in );
+ out = Mem_Alloc(loadmodel->mempool, count * sizeof( *out ) );
+
+ loadmodel->brushjk.data_lightarray = &out;
+ loadmodel->brushjk.num_lightarray = count;
+
+ for( i = 0; i < count; i++, in++, out++ )
+ *out = loadmodel->brushjk.data_lightgrid + LittleShort( *in );
+}
+
static void Mod_JKBSP_LoadPVS(lump_t *l)
{
jkdpvs_t *in;
Mod_JKBSP_LoadNodes(&header->lumps[JKLUMP_NODES]);
Mod_JKBSP_LoadLightGrid(&header->lumps[JKLUMP_LIGHTGRID]);
Mod_JKBSP_LoadPVS(&header->lumps[JKLUMP_PVS]);
+ Mod_JKBSP_LoadLightarray(&header->lumps[JKLUMP_LIGHTARRAY]);
loadmodel->brush.numsubmodels = loadmodel->brushjk.num_models;
// the MakePortals code works fine on the q3bsp data as well
#define JKLUMP_LIGHTMAPS 14 // lightmap textures (used by faces)
#define JKLUMP_LIGHTGRID 15 // lighting as a voxel grid (used by rendering)
#define JKLUMP_PVS 16 // potentially visible set; bit[clusters][clusters] (used by rendering)
-#define JKHEADER_LUMPS 17
+#define JKLUMP_LIGHTARRAY 17
+#define JKHEADER_LUMPS 18
typedef struct jkdheader_s
{
// voxel light data with directional shading
int num_lightgrid;
jkdlightgrid_t *data_lightgrid;
+ int num_lightarray;
+ jkdlightgrid_t *data_lightarray;
// size of each cell (may vary by map, typically 64 64 128)
float num_lightgrid_cellsize[3];
// 1.0 / num_lightgrid_cellsize