[vulkan] Move Vulkan_NewScene into vulkan_scene

It probably should have been there all along, and with this
vulkan_main/qf_main goes away.
This commit is contained in:
Bill Currie 2023-08-08 11:52:31 +09:00
parent 9ede227da4
commit ff5d4d8de1
8 changed files with 23 additions and 128 deletions

View file

@ -209,7 +209,6 @@ include_qf_vulkan = \
include/QF/Vulkan/qf_iqm.h \
include/QF/Vulkan/qf_lighting.h \
include/QF/Vulkan/qf_lightmap.h \
include/QF/Vulkan/qf_main.h \
include/QF/Vulkan/qf_matrices.h \
include/QF/Vulkan/qf_model.h \
include/QF/Vulkan/qf_output.h \

View file

@ -1,37 +0,0 @@
/*
qf_main.h
Vulkan main stuff from the renderer.
Copyright (C) 2021 Bill Currie <bill@taniwha.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA
*/
#ifndef __QF_Vulkan_qf_main_h
#define __QF_Vulkan_qf_main_h
struct vulkan_ctx_s;
struct entqueue_s;
struct scene_s;
void Vulkan_NewScene (struct scene_s *scene, struct vulkan_ctx_s *ctx);
#endif//__QF_Vulkan_qf_main_h

View file

@ -77,4 +77,6 @@ VkDescriptorSet Vulkan_Scene_Descriptors (struct vulkan_ctx_s *ctx) __attribute_
int Vulkan_Scene_AddEntity (struct vulkan_ctx_s *ctx, struct entity_s entity);
void Vulkan_Scene_Flush (struct vulkan_ctx_s *ctx);
void Vulkan_NewScene (struct scene_s *scene, struct vulkan_ctx_s *ctx);
#endif//__QF_Vulkan_qf_scene_h

View file

@ -243,7 +243,6 @@ libs_video_renderer_librender_vulkan_la_SOURCES = \
libs/video/renderer/vulkan/vulkan_draw.c \
libs/video/renderer/vulkan/vulkan_iqm.c \
libs/video/renderer/vulkan/vulkan_lighting.c \
libs/video/renderer/vulkan/vulkan_main.c \
libs/video/renderer/vulkan/vulkan_matrices.c \
libs/video/renderer/vulkan/vulkan_output.c \
libs/video/renderer/vulkan/vulkan_palette.c \

View file

@ -48,7 +48,6 @@
#include "QF/Vulkan/qf_iqm.h"
#include "QF/Vulkan/qf_lighting.h"
#include "QF/Vulkan/qf_lightmap.h"
#include "QF/Vulkan/qf_main.h"
#include "QF/Vulkan/qf_matrices.h"
#include "QF/Vulkan/qf_output.h"
#include "QF/Vulkan/qf_palette.h"

View file

@ -1,87 +0,0 @@
/*
vulkan_main.c
Vulkan rendering
Copyright (C) 2021 Bill Currie <bill@taniwha.org>
Author: Bill Currie <bill@taniwha.org>
Date: 2021/1/19
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef HAVE_STRING_H
# include "string.h"
#endif
#ifdef HAVE_STRINGS_H
# include "strings.h"
#endif
#include "QF/cmd.h"
#include "QF/cvar.h"
#include "QF/image.h"
#include "QF/render.h"
#include "QF/screen.h"
#include "QF/sys.h"
#include "QF/scene/entity.h"
#include "QF/Vulkan/qf_alias.h"
#include "QF/Vulkan/qf_bsp.h"
#include "QF/Vulkan/qf_compose.h"
#include "QF/Vulkan/qf_iqm.h"
#include "QF/Vulkan/qf_lighting.h"
#include "QF/Vulkan/qf_lightmap.h"
#include "QF/Vulkan/qf_main.h"
#include "QF/Vulkan/qf_matrices.h"
#include "QF/Vulkan/qf_output.h"
#include "QF/Vulkan/qf_particles.h"
#include "QF/Vulkan/qf_scene.h"
#include "QF/Vulkan/qf_sprite.h"
#include "QF/Vulkan/qf_translucent.h"
#include "QF/Vulkan/qf_vid.h"
#include "QF/Vulkan/swapchain.h"
#include "mod_internal.h"
#include "r_internal.h"
#include "vid_vulkan.h"
void
Vulkan_NewScene (scene_t *scene, vulkan_ctx_t *ctx)
{
int i;
for (i = 0; i < 256; i++) {
d_lightstylevalue[i] = 264; // normal light value
}
r_refdef.worldmodel = scene->worldmodel;
EntQueue_Clear (r_ent_queue);
R_ClearParticles ();
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, ctx);
}

View file

@ -39,6 +39,8 @@
#include "QF/scene/entity.h"
#include "QF/Vulkan/qf_bsp.h"
#include "QF/Vulkan/qf_lighting.h"
#include "QF/Vulkan/qf_scene.h"
#include "QF/Vulkan/debug.h"
#include "QF/Vulkan/descriptor.h"
@ -263,3 +265,22 @@ Vulkan_Scene_Shutdown (vulkan_ctx_t *ctx)
free (sctx);
qfvPopDebug (ctx);
}
void
Vulkan_NewScene (scene_t *scene, vulkan_ctx_t *ctx)
{
int i;
for (i = 0; i < 256; i++) {
d_lightstylevalue[i] = 264; // normal light value
}
r_refdef.worldmodel = scene->worldmodel;
EntQueue_Clear (r_ent_queue);
R_ClearParticles ();
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, ctx);
}

View file

@ -52,7 +52,6 @@
#include "QF/Vulkan/swapchain.h"
#include "QF/Vulkan/qf_lighting.h"
#include "QF/Vulkan/qf_main.h"
#include "QF/Vulkan/qf_output.h"
#include "QF/Vulkan/qf_particles.h"
#include "QF/Vulkan/qf_translucent.h"