[renderer] Use scene_t to set the model data

This replaces *_NewMap with *_NewScene and adds SCR_NewScene to handle
loading a new map (for quake) in the renderer, and will eventually be
how any new scene is loaded.
This commit is contained in:
Bill Currie 2022-05-05 14:41:46 +09:00
parent e323fbbbed
commit e9ad7b748b
35 changed files with 134 additions and 92 deletions

View file

@ -45,8 +45,8 @@ void gl_R_RotateForEntity (struct entity_s *e);
struct model_s;
struct entqueue_s;
void gl_R_NewMap (struct model_s *worldmodel, struct model_s **models,
int num_models);
struct scene_s;
void gl_R_NewScene (struct scene_s *scene);
void gl_R_RenderView (void);
void gl_R_RenderEntities (struct entqueue_s *queue);
void gl_R_ClearState (void);

View file

@ -29,8 +29,9 @@
#define __QF_GLSL_qf_main_h
struct entqueue_s;
struct scene_s;
void glsl_R_NewMap (model_t *worldmodel, model_t **models, int num_models);
void glsl_R_NewScene (struct scene_s *scene);
void glsl_R_RenderEntities (struct entqueue_s *queue);
void glsl_R_RenderView (void);
void glsl_R_ClearState (void);

View file

@ -31,9 +31,9 @@
struct vulkan_ctx_s;
struct qfv_renderframe_s;
struct entqueue_s;
struct scene_s;
void Vulkan_NewMap (model_t *worldmodel, struct model_s **models,
int num_models, struct vulkan_ctx_s *ctx);
void Vulkan_NewScene (struct scene_s *scene, struct vulkan_ctx_s *ctx);
void Vulkan_RenderView (struct qfv_renderframe_s *rFrame);
void Vulkan_RenderEntities (struct entqueue_s *queue,
struct qfv_renderframe_s *rFrame);

View file

@ -35,6 +35,7 @@
struct plitem_s;
struct cvar_s;
struct scene_s;
struct skin_s;
struct mod_alias_ctx_s;
@ -105,7 +106,7 @@ typedef struct vid_render_funcs_s {
void (*R_Init) (void);
void (*R_ClearState) (void);
void (*R_LoadSkys) (const char *);
void (*R_NewMap) (model_t *worldmodel, model_t **models, int num_models);
void (*R_NewScene) (struct scene_s *scene);
void (*R_LineGraph) (int x, int y, int *h_vals, int count, int height);
void (*begin_frame) (void);

View file

@ -43,6 +43,9 @@
typedef struct scene_s {
struct scene_resources_s *const resources;
struct hierarchy_s *hierarchies;
struct model_s *worldmodel;
int num_models;
struct model_s **models;
} scene_t;
scene_t *Scene_NewScene (void);

View file

@ -29,6 +29,7 @@
#ifndef __QF_screen_h
#define __QF_screen_h
struct scene_s;
struct transform_s;
struct tex_s;
@ -47,6 +48,8 @@ void SCR_SetFOV (float fov);
void SCR_SetFullscreen (qboolean fullscreen);
void SCR_SetBottomMargin (int lines);
void SCR_NewScene (struct scene_s *scene);
extern int hud_fps;
extern int hud_time;
extern int r_timegraph;

View file

@ -43,7 +43,6 @@ typedef struct worldscene_s {
struct scene_s *scene;
struct plitem_s *edicts;
struct plitem_s *worldspawn;
struct model_s *worldmodel;
modelset_t models;
} worldscene_t;

View file

@ -45,7 +45,8 @@ struct psystem_s *glsl_ParticleSystem (void);
struct psystem_s *sw_ParticleSystem (void);
void R_RunParticles (float dT);
void R_NewMap (model_t *worldmodel, model_t **models, int num_models);
struct scene_s;
void R_NewScene (struct scene_s *scene);
// LordHavoc: relative bmodel lighting
void R_PushDlights (const vec3_t entorigin);

View file

@ -202,8 +202,6 @@ extern void R_RotateBmodel (struct transform_s *transform);
extern int c_faceclip;
extern int r_polycount;
extern model_t *cl_worldmodel;
extern int *pfrustum_indexes[4];
// !!! if this is changed, it must be changed in asm_draw.h too !!!

View file

@ -271,7 +271,7 @@ beam_setup (beam_t *b, qboolean transform, double time, TEntContext_t *ctx)
} else {
Transform_SetLocalPosition (tent->ent->transform, position);
}
R_AddEfrags (&cl_world.worldmodel->brush, tent->ent);
R_AddEfrags (&cl_world.scene->worldmodel->brush, tent->ent);
}
}
@ -632,7 +632,7 @@ CL_UpdateExplosions (double time, TEntContext_t *ctx)
ent->animation.frame = f;
if (!ent->visibility.efrag) {
R_AddEfrags (&cl_world.worldmodel->brush, ent);
R_AddEfrags (&cl_world.scene->worldmodel->brush, ent);
}
}
}
@ -721,7 +721,7 @@ CL_ParseProjectiles (qmsg_t *net_message, qboolean nail2, TEntContext_t *ctx)
angles[2] = 0;
CL_TransformEntity (tent->ent, 1, angles, position);
R_AddEfrags (&cl_world.worldmodel->brush, tent->ent);
R_AddEfrags (&cl_world.scene->worldmodel->brush, tent->ent);
}
*tail = cl_projectiles;

View file

@ -119,7 +119,7 @@ CL_ParseStatic (qmsg_t *msg, int version)
CL_TransformEntity (ent, es.scale / 16.0, es.angles, es.origin);
R_AddEfrags (&cl_world.worldmodel->brush, ent);
R_AddEfrags (&cl_world.scene->worldmodel->brush, ent);
}
static void
@ -205,9 +205,14 @@ CL_LoadSky (const char *name)
void
CL_World_NewMap (const char *mapname, const char *skyname)
{
model_t *worldmodel = cl_world.models.a[1];
cl_world.scene->worldmodel = worldmodel;
cl_static_entities.size = 0;
r_funcs->R_NewMap (cl_world.worldmodel,
cl_world.models.a, cl_world.models.size);
cl_world.scene->models = cl_world.models.a;
cl_world.scene->num_models = cl_world.models.size;
SCR_NewScene (cl_world.scene);
if (cl_world.models.a[1] && cl_world.models.a[1]->brush.entities) {
if (cl_world.edicts) {
PL_Free (cl_world.edicts);

View file

@ -66,6 +66,7 @@
#include "QF/GL/qf_vid.h"
#include "QF/scene/entity.h"
#include "QF/scene/scene.h"
#include "mod_internal.h"
#include "r_internal.h"
@ -152,7 +153,7 @@ register_textures (mod_brush_t *brush)
}
void
gl_R_NewMap (model_t *worldmodel, struct model_s **models, int num_models)
gl_R_NewScene (scene_t *scene)
{
texture_t *tex;
mod_brush_t *brush;
@ -160,8 +161,8 @@ gl_R_NewMap (model_t *worldmodel, struct model_s **models, int num_models)
for (int i = 0; i < 256; i++)
d_lightstylevalue[i] = 264; // normal light value
r_refdef.worldmodel = worldmodel;
brush = &worldmodel->brush;
r_refdef.worldmodel = scene->worldmodel;
brush = &scene->worldmodel->brush;
// clear out efrags in case the level hasn't been reloaded
for (unsigned i = 0; i < brush->modleafs; i++)
@ -173,7 +174,7 @@ gl_R_NewMap (model_t *worldmodel, struct model_s **models, int num_models)
R_ClearParticles ();
GL_BuildLightmaps (models, num_models);
GL_BuildLightmaps (scene->models, scene->num_models);
// identify sky texture
gl_R_ClearTextures ();
@ -189,13 +190,13 @@ gl_R_NewMap (model_t *worldmodel, struct model_s **models, int num_models)
gl_R_InitSurfaceChains (brush);
gl_R_AddTexture (r_notexture_mip);
register_textures (brush);
for (int i = 0; i < num_models; i++) {
if (!models[i])
for (int i = 0; i < scene->num_models; i++) {
if (!scene->models[i])
continue;
if (*models[i]->path == '*')
if (*scene->models[i]->path == '*')
continue;
if (models[i] != r_refdef.worldmodel
&& models[i]->type == mod_brush)
register_textures (&models[i]->brush);
if (scene->models[i] != r_refdef.worldmodel
&& scene->models[i]->type == mod_brush)
register_textures (&scene->models[i]->brush);
}
}

View file

@ -46,6 +46,7 @@
#include "QF/sys.h"
#include "QF/scene/entity.h"
#include "QF/scene/scene.h"
#include "QF/GLSL/defines.h"
#include "QF/GLSL/funcs.h"
@ -188,23 +189,23 @@ glsl_R_Init (void)
}
void
glsl_R_NewMap (model_t *worldmodel, struct model_s **models, int num_models)
glsl_R_NewScene (scene_t *scene)
{
int i;
for (i = 0; i < 256; i++)
d_lightstylevalue[i] = 264; // normal light value
r_refdef.worldmodel = worldmodel;
r_refdef.worldmodel = scene->worldmodel;
// Force a vis update
r_refdef.viewleaf = NULL;
R_MarkLeaves ();
R_ClearParticles ();
glsl_R_RegisterTextures (models, num_models);
glsl_R_BuildLightmaps (models, num_models);
glsl_R_BuildDisplayLists (models, num_models);
glsl_R_RegisterTextures (scene->models, scene->num_models);
glsl_R_BuildLightmaps (scene->models, scene->num_models);
glsl_R_BuildDisplayLists (scene->models, scene->num_models);
}
void

View file

@ -49,6 +49,7 @@
#include "QF/va.h"
#include "QF/scene/entity.h"
#include "QF/scene/scene.h"
#include "QF/scene/transform.h"
#include "QF/ui/view.h"
@ -71,6 +72,7 @@ static framebuffer_t *warp_buffer;
static float fov_x, fov_y;
static float tan_fov_x, tan_fov_y;
static scene_t *scr_scene;//FIXME don't want this here
static mat4f_t box_rotations[] = {
[BOX_FRONT] = {
@ -505,3 +507,15 @@ SCR_Init (void)
Cvar_AddListener (var, viewsize_listener, 0);
update_vrect ();
}
void
SCR_NewScene (scene_t *scene)
{
scr_scene = scene;
if (scene) {
r_funcs->set_fov (tan_fov_x, tan_fov_y);
r_funcs->R_NewScene (scene);
} else {
r_funcs->R_ClearState ();
}
}

View file

@ -49,6 +49,7 @@
#include "QF/sys.h"
#include "QF/scene/entity.h"
#include "QF/scene/scene.h"
#include "compat.h"
#include "mod_internal.h"
@ -151,8 +152,9 @@ sw_R_Init (void)
}
void
R_NewMap (model_t *worldmodel, struct model_s **models, int num_models)
R_NewScene (scene_t *scene)
{
model_t *worldmodel = scene->worldmodel;
mod_brush_t *brush = &worldmodel->brush;
r_refdef.worldmodel = worldmodel;

View file

@ -510,7 +510,7 @@ vid_render_funcs_t gl_vid_render_funcs = {
gl_R_Init,
gl_R_ClearState,
gl_R_LoadSkys,
gl_R_NewMap,
gl_R_NewScene,
gl_R_LineGraph,
gl_begin_frame,
gl_render_view,

View file

@ -454,7 +454,7 @@ vid_render_funcs_t glsl_vid_render_funcs = {
glsl_R_Init,
glsl_R_ClearState,
glsl_R_LoadSkys,
glsl_R_NewMap,
glsl_R_NewScene,
glsl_R_LineGraph,
glsl_begin_frame,
glsl_render_view,

View file

@ -474,7 +474,7 @@ vid_render_funcs_t sw_vid_render_funcs = {
sw_R_Init,
R_ClearState,
R_LoadSkys,
R_NewMap,
R_NewScene,
R_LineGraph,
sw_begin_frame,
sw_render_view,

View file

@ -64,6 +64,7 @@
#include "QF/ui/view.h"
#include "QF/scene/entity.h"
#include "QF/scene/scene.h"
#include "mod_internal.h"
#include "r_internal.h"
@ -118,9 +119,9 @@ vulkan_R_LoadSkys (const char *skyname)
}
static void
vulkan_R_NewMap (model_t *worldmodel, model_t **models, int num_models)
vulkan_R_NewScene (scene_t *scene)
{
Vulkan_NewMap (worldmodel, models, num_models, vulkan_ctx);
Vulkan_NewScene (scene, vulkan_ctx);
}
static void
@ -727,7 +728,7 @@ vid_render_funcs_t vulkan_vid_render_funcs = {
vulkan_R_Init,
vulkan_R_ClearState,
vulkan_R_LoadSkys,
vulkan_R_NewMap,
vulkan_R_NewScene,
vulkan_R_LineGraph,
vulkan_begin_frame,
vulkan_render_view,

View file

@ -46,6 +46,7 @@
#include "QF/sys.h"
#include "QF/scene/entity.h"
#include "QF/scene/scene.h"
#include "QF/Vulkan/qf_vid.h"
#include "QF/Vulkan/qf_alias.h"
@ -130,8 +131,7 @@ Vulkan_RenderView (qfv_renderframe_t *rFrame)
}
void
Vulkan_NewMap (model_t *worldmodel, struct model_s **models, int num_models,
vulkan_ctx_t *ctx)
Vulkan_NewScene (scene_t *scene, vulkan_ctx_t *ctx)
{
int i;
@ -139,17 +139,17 @@ Vulkan_NewMap (model_t *worldmodel, struct model_s **models, int num_models,
d_lightstylevalue[i] = 264; // normal light value
}
r_refdef.worldmodel = worldmodel;
r_refdef.worldmodel = scene->worldmodel;
// Force a vis update
r_refdef.viewleaf = NULL;
R_MarkLeaves ();
R_ClearParticles ();
Vulkan_RegisterTextures (models, num_models, ctx);
//Vulkan_BuildLightmaps (models, num_models, ctx);
Vulkan_BuildDisplayLists (models, num_models, ctx);
Vulkan_LoadLights (worldmodel, worldmodel->brush.entities, ctx);
Vulkan_RegisterTextures (scene->models, scene->num_models, ctx);
//Vulkan_BuildLightmaps (scene->models, scene->num_models, ctx);
Vulkan_BuildDisplayLists (scene->models, scene->num_models, ctx);
Vulkan_LoadLights (scene->worldmodel, scene->worldmodel->brush.entities, ctx);
}
/*void

View file

@ -46,6 +46,8 @@
#include "QF/sys.h"
#include "QF/va.h"
#include "QF/scene/scene.h"
#include "compat.h"
#include "client/world.h"
@ -375,7 +377,7 @@ demo_default_name (const char *argv1)
strftime (timestring, 19, "%Y-%m-%d-%H-%M", localtime (&tim));
// the leading path-name is to be removed from cl_world.worldmodel->name
mapname = QFS_SkipPath (cl_world.worldmodel->path);
mapname = QFS_SkipPath (cl_world.scene->worldmodel->path);
// the map name is cut off after any "." because this would prevent
// an extension being appended

View file

@ -263,7 +263,7 @@ CL_RelinkEntities (void)
if (ent->visibility.efrag) {
R_RemoveEfrags (ent);
}
R_AddEfrags (&cl_world.worldmodel->brush, ent);
R_AddEfrags (&cl_world.scene->worldmodel->brush, ent);
}
ent->old_origin = new->origin;
} else {
@ -299,10 +299,10 @@ CL_RelinkEntities (void)
= Transform_GetWorldPosition (ent->transform);
if (!VectorCompare (org, ent->old_origin)) {//FIXME
R_RemoveEfrags (ent);
R_AddEfrags (&cl_world.worldmodel->brush, ent);
R_AddEfrags (&cl_world.scene->worldmodel->brush, ent);
}
} else {
R_AddEfrags (&cl_world.worldmodel->brush, ent);
R_AddEfrags (&cl_world.scene->worldmodel->brush, ent);
}
}
}

View file

@ -295,7 +295,7 @@ CL_ClearState (void)
CL_ClearTEnts ();
r_funcs->R_ClearState ();
SCR_NewScene (0);
CL_ClearEnts ();
@ -354,7 +354,7 @@ CL_Disconnect (void)
Host_ShutdownServer (false);
}
cl_world.worldmodel = NULL;
cl_world.scene->worldmodel = NULL;
cl.intermission = 0;
cl.viewstate.intermission = 0;
}
@ -467,7 +467,7 @@ CL_NextDemo (void)
static void
pointfile_f (void)
{
CL_LoadPointFile (cl_world.worldmodel);
CL_LoadPointFile (cl_world.scene->worldmodel);
}
static void

View file

@ -252,10 +252,13 @@ CL_KeepaliveMessage (void)
static void
CL_NewMap (const char *mapname)
{
Con_NewMap ();
Hunk_Check (0); // make sure nothing is hurt
Sbar_CenterPrint (0);
CL_World_NewMap (mapname, 0);
cl.chasestate.worldmodel = cl_world.scene->worldmodel;
Con_NewMap ();
Sbar_CenterPrint (0);
Hunk_Check (0); // make sure nothing is hurt
}
static void
@ -349,9 +352,9 @@ CL_ParseServerInfo (void)
strcpy (sound_precache[cl.numsounds], str);
}
// now we try to load everything else until a cache allocation fails
CL_MapCfg (model_precache[1]);
// now we try to load everything else until a cache allocation fails
for (i = 1; i < nummodels; i++) {
DARRAY_APPEND (&cl_world.models,
Mod_ForName (model_precache[i], false));
@ -368,16 +371,12 @@ CL_ParseServerInfo (void)
}
// local state
cl_world.worldmodel = cl_world.models.a[1];
cl.chasestate.worldmodel = cl_world.worldmodel;
if (!centerprint)
centerprint = dstring_newstr ();
else
dstring_clearstr (centerprint);
CL_NewMap (model_precache[1]);
Hunk_Check (0); // make sure nothing is hurt
noclip_anglehack = false; // noclip is turned off at start
CL_ParticlesGravity (800); // Set up gravity for renderer effects
done:

View file

@ -46,6 +46,7 @@
#include "QF/plugin/vid_render.h"
#include "QF/scene/scene.h"
#include "QF/scene/transform.h"
#include "QF/ui/view.h"
@ -79,10 +80,10 @@ SCR_CShift (void)
mleaf_t *leaf;
int contents = CONTENTS_EMPTY;
if (cls.state == ca_active && cl_world.worldmodel) {
if (cls.state == ca_active && cl_world.scene->worldmodel) {
vec4f_t origin;
origin = Transform_GetWorldPosition (cl.viewstate.camera_transform);
leaf = Mod_PointInLeaf ((vec_t*)&origin, cl_world.worldmodel);//FIXME
leaf = Mod_PointInLeaf ((vec_t*)&origin, cl_world.scene->worldmodel);//FIXME
contents = leaf->contents;
}
V_SetContentsColor (&cl.viewstate, contents);

View file

@ -54,6 +54,7 @@
#include "QF/plugin/console.h"
#include "QF/plugin/vid_render.h"
#include "QF/scene/scene.h"
#include "QF/scene/transform.h"
#include "buildnum.h"
@ -740,7 +741,7 @@ Host_ClientFrame (void)
vec4f_t origin;
origin = Transform_GetWorldPosition (cl.viewstate.camera_transform);
l = Mod_PointInLeaf ((vec_t*)&origin, cl_world.worldmodel);//FIXME
l = Mod_PointInLeaf ((vec_t*)&origin, cl_world.scene->worldmodel);//FIXME
if (l)
asl = l->ambient_sound_level;
S_Update (cl.viewstate.camera_transform, asl);

View file

@ -54,6 +54,8 @@
#include "QF/sys.h"
#include "QF/va.h"
#include "QF/scene/scene.h"
#include "compat.h"
#include "client/world.h"
@ -669,8 +671,8 @@ demo_default_name (const char *argv1)
time (&tim);
strftime (timestring, 19, "%Y-%m-%d-%H-%M", localtime (&tim));
// the leading path-name is to be removed from cl_world.worldmodel->name
mapname = QFS_SkipPath (cl_world.worldmodel->path);
// the leading path-name is to be removed from worldmodel->name
mapname = QFS_SkipPath (cl_world.scene->worldmodel->path);
// the map name is cut off after any "." because this would prevent
// an extension being appended

View file

@ -41,6 +41,8 @@
#include "QF/skin.h"
#include "QF/sys.h"
#include "QF/scene/scene.h"
#include "compat.h"
#include "client/temp_entities.h"
@ -530,7 +532,7 @@ CL_SetSolidEntities (void)
frame_t *frame;
packet_entities_t *pak;
pmove.physents[0].model = cl_world.worldmodel;
pmove.physents[0].model = cl_world.scene->worldmodel;
VectorZero (pmove.physents[0].origin);
VectorZero (pmove.physents[0].angles);
pmove.physents[0].info = 0;

View file

@ -234,7 +234,7 @@ CL_LinkPacketEntities (void)
if (ent->visibility.efrag) {
R_RemoveEfrags (ent);
}
R_AddEfrags (&cl_world.worldmodel->brush, ent);
R_AddEfrags (&cl_world.scene->worldmodel->brush, ent);
}
} else {
vec4f_t delta = new->origin - old->origin;
@ -266,15 +266,15 @@ CL_LinkPacketEntities (void)
= Transform_GetWorldPosition (ent->transform);
if (!VectorCompare (org, ent->old_origin)) {//FIXME
R_RemoveEfrags (ent);
R_AddEfrags (&cl_world.worldmodel->brush, ent);
R_AddEfrags (&cl_world.scene->worldmodel->brush, ent);
}
} else {
R_AddEfrags (&cl_world.worldmodel->brush, ent);
R_AddEfrags (&cl_world.scene->worldmodel->brush, ent);
}
}
}
if (!ent->visibility.efrag) {
R_AddEfrags (&cl_world.worldmodel->brush, ent);
R_AddEfrags (&cl_world.scene->worldmodel->brush, ent);
}
// rotate binary objects locally
@ -510,10 +510,10 @@ CL_LinkPlayers (void)
}
// stuff entity in map
R_AddEfrags (&cl_world.worldmodel->brush, ent);
R_AddEfrags (&cl_world.scene->worldmodel->brush, ent);
if (player->flag_ent) {
CL_UpdateFlagModels (ent, j);
R_AddEfrags (&cl_world.worldmodel->brush, player->flag_ent);
R_AddEfrags (&cl_world.scene->worldmodel->brush, player->flag_ent);
}
}
}

View file

@ -501,7 +501,7 @@ CL_Quit_f (void)
static void
pointfile_f (void)
{
CL_LoadPointFile (cl_world.worldmodel);
CL_LoadPointFile (cl_world.scene->worldmodel);
}
static void
@ -794,7 +794,7 @@ CL_Disconnect (void)
Info_Destroy (cl.players[i].userinfo);
memset (&cl.players[i], 0, sizeof (cl.players[i]));
}
cl_world.worldmodel = NULL;
cl_world.scene->worldmodel = NULL;
cl.validsequence = 0;
}
@ -1965,7 +1965,7 @@ Host_Frame (float time)
vec4f_t origin;
origin = Transform_GetWorldPosition (cl.viewstate.camera_transform);
l = Mod_PointInLeaf ((vec_t*)&origin, cl_world.worldmodel);//FIXME
l = Mod_PointInLeaf ((vec_t*)&origin, cl_world.scene->worldmodel);//FIXME
if (l)
asl = l->ambient_sound_level;
S_Update (cl.viewstate.camera_transform, asl);

View file

@ -261,17 +261,19 @@ CL_CheckOrDownloadFile (const char *filename)
static void
CL_NewMap (const char *mapname)
{
Team_NewMap ();
Con_NewMap ();
Hunk_Check (0); // make sure nothing is hurt
Sbar_CenterPrint (0);
const char *skyname = 0;
// R_LoadSkys does the right thing with null pointers.
if (cl.serverinfo) {
skyname = Info_ValueForKey (cl.serverinfo, "sky");
}
CL_World_NewMap (mapname, skyname);
cl.chasestate.worldmodel = cl_world.scene->worldmodel;
Team_NewMap ();
Con_NewMap ();
Sbar_CenterPrint (0);
Hunk_Check (0); // make sure nothing is hurt
}
static void
@ -353,8 +355,6 @@ Model_NextDownload (void)
}
// all done
cl_world.worldmodel = cl_world.models.a[1];
cl.chasestate.worldmodel = cl_world.worldmodel;
CL_NewMap (cl.model_name[1]);
// done with modellist, request first of static signon messages
@ -362,7 +362,7 @@ Model_NextDownload (void)
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
MSG_WriteString (&cls.netchan.message,
va (0, prespawn_name, cl.servercount,
cl_world.worldmodel->brush.checksum2));
cl_world.scene->worldmodel->brush.checksum2));
}
}

View file

@ -44,6 +44,7 @@
#include "QF/pcx.h"
#include "QF/screen.h"
#include "QF/scene/scene.h"
#include "QF/scene/transform.h"
#include "QF/ui/view.h"
@ -78,10 +79,10 @@ SCR_CShift (void)
mleaf_t *leaf;
int contents = CONTENTS_EMPTY;
if (cls.state == ca_active && cl_world.worldmodel) {
if (cls.state == ca_active && cl_world.scene->worldmodel) {
vec4f_t origin;
origin = Transform_GetWorldPosition (cl.viewstate.camera_transform);
leaf = Mod_PointInLeaf ((vec_t*)&origin, cl_world.worldmodel);//FIXME
leaf = Mod_PointInLeaf ((vec_t*)&origin, cl_world.scene->worldmodel);//FIXME
contents = leaf->contents;
}
V_SetContentsColor (&cl.viewstate, contents);

View file

@ -53,6 +53,8 @@
#include "QF/plugin/console.h"
#include "QF/scene/scene.h"
#include "QF/ui/view.h"
#include "compat.h"
@ -1062,7 +1064,7 @@ Sbar_LogFrags (void)
Qwrite (file, t, strlen (t));
Qprintf (file, "%s\n%s %s\n", cls.servername->str,
cl_world.worldmodel->path, cl.levelname);
cl_world.scene->worldmodel->path, cl.levelname);
// scores
Sbar_SortFrags (true);

View file

@ -49,6 +49,8 @@
#include "QF/sys.h"
#include "QF/teamplay.h"
#include "QF/scene/scene.h"
#include "compat.h"
#include "client/locs.h"
@ -332,8 +334,8 @@ Team_NewMap (void)
died = false;
recorded_location = false;
mapname = strdup (cl_world.worldmodel->path);
t2 = malloc (sizeof (cl_world.worldmodel->path));
mapname = strdup (cl_world.scene->worldmodel->path);
t2 = malloc (sizeof (cl_world.scene->worldmodel->path));
if (!mapname || !t2)
Sys_Error ("Can't duplicate mapname!");
map_to_loc (mapname,t2);
@ -376,16 +378,16 @@ locs_loc (void)
"parameter\n");
return;
}
if (!cl_world.worldmodel) {
if (!cl_world.scene->worldmodel) {
Sys_Printf ("No map loaded. Unable to work with location markers.\n");
return;
}
if (Cmd_Argc () >= 3)
desc = Cmd_Args (2);
mapname = malloc (sizeof (cl_world.worldmodel->path));
mapname = malloc (sizeof (cl_world.scene->worldmodel->path));
if (!mapname)
Sys_Error ("Can't duplicate mapname!");
map_to_loc (cl_world.worldmodel->path, mapname);
map_to_loc (cl_world.scene->worldmodel->path, mapname);
snprintf (locfile, sizeof (locfile), "%s/%s",
qfs_gamedir->dir.def, mapname);
free (mapname);

View file

@ -233,5 +233,5 @@ BI_Graphics_Init (progs_t *pr)
if (mod_funcs->Mod_ProcessTexture) {
mod_funcs->Mod_ProcessTexture (&empty_world, 0);
}
r_funcs->R_NewMap (&empty_world, 0, 0);
//r_funcs->R_NewMap (&empty_world, 0, 0);
}