Sync comments with ReRelease and version bump

This commit is contained in:
Denis Pauk 2023-11-19 00:02:18 +02:00
parent f360fa740a
commit ba37a2b3ba
24 changed files with 502 additions and 440 deletions

View file

@ -133,3 +133,8 @@ are provided without any warranty of support. The simplest way to check
is renaming the mdl/dkm/fm format file to md2 and place instead the original
tris.md2 file. FM is rendered with all meshes without support of
filtering/selecting the exact part of the model.
### ReRelease Support
Use [Yamagi Quake II ReRelease](https://github.com/yquake2/yquake2remaster/releases)
version with 2023 Quake ReRelease version.

View file

@ -32,7 +32,7 @@
#include "shared_safe.h"
#include "crc.h"
#define VKVERSION "1.0.5"
#define VKVERSION "1.0.6"
#ifndef YQ2OSTYPE
#error YQ2OSTYPE should be defined by the build system

View file

@ -1,22 +1,29 @@
/*
Copyright (C) 1997-2001 Id Software, Inc.
Copyright (C) 2018-2019 Krzysztof Kondrak
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 the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
* Copyright (C) 1997-2001 Id Software, Inc.
* Copyright (C) 2018-2019 Krzysztof Kondrak
*
* 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 the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* =======================================================================
*
* Local header for the refresher.
*
* =======================================================================
*/
#ifndef __VK_LOCAL_H__
#define __VK_LOCAL_H__

View file

@ -173,19 +173,17 @@ typedef struct model_s
vec3_t origin; // for sounds or lights
} model_t;
//============================================================================
void Mod_Init(void);
const byte *Mod_ClusterPVS(int cluster, const model_t *model);
void Mod_Init (void);
const byte *Mod_ClusterPVS (int cluster, const model_t *model);
void Mod_Modellist_f(void);
void Mod_Modellist_f (void);
void *Hunk_Begin(int maxsize);
void *Hunk_Alloc(int size);
int Hunk_End(void);
void Hunk_Free(void *base);
void *Hunk_Begin (int maxsize);
void *Hunk_Alloc (int size);
int Hunk_End (void);
void Hunk_Free (void *base);
void Mod_FreeAll (void);
void Mod_FreeAll(void);
void Mod_FreeModelsKnown (void);
#endif

View file

@ -1,23 +1,25 @@
/*
Copyright (C) 1997-2001 Id Software, Inc.
Copyright (C) 2018-2019 Krzysztof Kondrak
* Copyright (C) 1997-2001 Id Software, Inc.
* Copyright (C) 2018-2019 Krzysztof Kondrak
*
* 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 the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
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 the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/*
** QVK.H
*/

View file

@ -1,22 +1,23 @@
/*
Copyright (C) 2018-2019 Krzysztof Kondrak
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 the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
* Copyright (C) 2018-2019 Krzysztof Kondrak
*
* 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 the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
//
// game shaders, compiled offline

View file

@ -1,21 +1,24 @@
/*
Copyright (C) 2018 Christoph Schied
Copyright (C) 2020 Denis Pauk
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 the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
* Copyright (C) 2018 Christoph Schied
* Copyright (C) 2020 Denis Pauk
*
* 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 the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#ifndef __VK_UTIL_H__
#define __VK_UTIL_H__

View file

@ -1,21 +1,23 @@
/*
Copyright (C) 2018-2019 Krzysztof Kondrak
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 the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
* Copyright (C) 2018-2019 Krzysztof Kondrak
*
* 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 the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#include "header/local.h"

View file

@ -1,22 +1,23 @@
/*
Copyright (C) 2018-2019 Krzysztof Kondrak
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 the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
* Copyright (C) 2018-2019 Krzysztof Kondrak
*
* 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 the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#include "header/local.h"

View file

@ -1,33 +1,36 @@
/*
Copyright (C) 1997-2001 Id Software, Inc.
Copyright (C) 2018-2019 Krzysztof Kondrak
* Copyright (C) 1997-2001 Id Software, Inc.
* Copyright (C) 2018-2019 Krzysztof Kondrak
*
* 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 the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* =======================================================================
*
* This file implements the operating system binding of Vk to QVk function
* pointers. When doing a port of Quake2 you must implement the following
* two functions:
*
* QVk_Init() - loads libraries, assigns function pointers, etc.
* QVk_Shutdown() - unloads libraries, NULLs function pointers
*
* =======================================================================
*
*/
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 the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/*
** VK_COMMON.C
**
** This file implements the operating system binding of Vk to QVk function
** pointers. When doing a port of Quake2 you must implement the following
** two functions:
**
** QVk_Init() - loads libraries, assigns function pointers, etc.
** QVk_Shutdown() - unloads libraries, NULLs function pointers
*/
#include <float.h>
#include "header/local.h"
@ -2668,7 +2671,10 @@ void QVk_DrawTexRect(const float *ubo, VkDeviceSize uboSize, qvktexture_t *textu
QVk_BindPipeline(&vk_drawTexQuadPipeline[vk_state.current_renderpass]);
VkDeviceSize offsets = 0;
VkDescriptorSet descriptorSets[] = { texture->descriptorSet, uboDescriptorSet };
VkDescriptorSet descriptorSets[] = {
texture->descriptorSet,
uboDescriptorSet
};
float gamma = 2.1F - vid_gamma->value;

View file

@ -1,26 +1,29 @@
/*
Copyright (C) 2018-2019 Krzysztof Kondrak
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 the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
* Copyright (C) 2018-2019 Krzysztof Kondrak
*
* 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 the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#include "header/local.h"
// internal helper
static qboolean deviceExtensionsSupported(const VkPhysicalDevice *physicalDevice, const char* extensionName)
static qboolean
deviceExtensionsSupported(const VkPhysicalDevice *physicalDevice, const char* extensionName)
{
uint32_t availableExtCount = 0;
qboolean vk_extension_available = false;

View file

@ -1,24 +1,24 @@
/*
Copyright (C) 1997-2001 Id Software, Inc.
Copyright (C) 2018-2019 Krzysztof Kondrak
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 the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// vk_draw.c
* Copyright (C) 1997-2001 Id Software, Inc.
* Copyright (C) 2018-2019 Krzysztof Kondrak
*
* 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 the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#include "header/local.h"
@ -32,6 +32,7 @@ Draw_InitLocal
void Draw_InitLocal (void)
{
draw_chars = R_FindPic ("conchars", (findimage_t)Vk_FindImage);
/* Daikatana */
if (!draw_chars)
{
ri.Sys_Error(ERR_FATAL, "%s: Couldn't load pics/conchars",

View file

@ -1,22 +1,24 @@
/*
Copyright (C) 1997-2001 Id Software, Inc.
Copyright (C) 2018-2019 Krzysztof Kondrak
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 the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
* Copyright (C) 1997-2001 Id Software, Inc.
* Copyright (C) 2018-2019 Krzysztof Kondrak
*
* 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 the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#include "header/local.h"

View file

@ -1,24 +1,29 @@
/*
Copyright (C) 1997-2001 Id Software, Inc.
Copyright (C) 2018-2019 Krzysztof Kondrak
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 the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// vk_rmain.c
* Copyright (C) 1997-2001 Id Software, Inc.
* Copyright (C) 2018-2019 Krzysztof Kondrak
*
* 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 the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* =======================================================================
*
* Refresher setup and main part of the frame generation
*
* =======================================================================
*/
#include "header/local.h"
@ -406,10 +411,6 @@ R_DrawEntitiesOnList (void)
}
}
/*
** Vk_DrawParticles
**
*/
static void
Vk_DrawParticles(int num_particles, const particle_t particles[], const unsigned *colortable)
{
@ -447,9 +448,13 @@ Vk_DrawParticles(int num_particles, const particle_t particles[], const unsigned
(p->origin[2] - r_origin[2]) * vpn[2];
if (scale < 20)
{
scale = 1;
}
else
{
scale = 1 + scale * 0.004;
}
*(int *)color = colortable[p->color];
@ -520,13 +525,8 @@ Vk_DrawParticles(int num_particles, const particle_t particles[], const unsigned
vkCmdDraw(vk_activeCmdbuffer, (currentvertex - visibleParticles), 1, 0, 0);
}
/*
===============
R_DrawParticles
===============
*/
static void
R_DrawParticles (void)
R_DrawParticles(void)
{
if (vk_custom_particles->value == 1)
{
@ -600,18 +600,18 @@ R_DrawParticles (void)
}
}
/*
============
R_PolyBlend
============
*/
static void
R_PolyBlend (void)
R_PolyBlend(void)
{
if (!r_polyblend->value)
{
return;
}
if (!v_blend[3])
{
return;
}
float polyTransform[] = { 0.f, 0.f, vid.width, vid.height, v_blend[0], v_blend[1], v_blend[2], v_blend[3] };
QVk_DrawColorRect(polyTransform, sizeof(polyTransform), RP_WORLD);
@ -1032,7 +1032,8 @@ qboolean RE_EndWorldRenderpass(void)
return true;
}
static void R_SetVulkan2D (const VkViewport* viewport, const VkRect2D* scissor)
static void
R_SetVulkan2D(const VkViewport* viewport, const VkRect2D* scissor)
{
// player configuration screen renders a model using the UI renderpass, so skip finishing RP_WORLD twice
if (!(r_newrefdef.rdflags & RDF_NOWORLDMODEL))
@ -1199,7 +1200,9 @@ R_Register( void )
ri.Cmd_AddCommand("modellist", Mod_Modellist_f);
}
/*
* Changes the video mode
*/
static int
Vkimp_SetMode(int *pwidth, int *pheight, int mode, int fullscreen)
{
@ -1233,13 +1236,8 @@ Vkimp_SetMode(int *pwidth, int *pheight, int mode, int fullscreen)
return rserr_ok;
}
/*
==================
R_SetMode
==================
*/
static qboolean
R_SetMode (void)
R_SetMode(void)
{
rserr_t err;
int fullscreen;
@ -1312,6 +1310,7 @@ static qboolean RE_Init( void )
R_Printf(PRINT_ALL, "%s() - could not R_SetMode()\n", __func__);
return false;
}
ri.Vid_MenuInit();
// print device information during startup
@ -1329,7 +1328,8 @@ static qboolean RE_Init( void )
** subsystem.
**
*/
static void RE_ShutdownContext( void )
static void
RE_ShutdownContext(void)
{
// Shutdown Vulkan subsystem
QVk_WaitAndShutdownAll();
@ -1360,13 +1360,8 @@ void RE_Shutdown (void)
s_blocklights_max = NULL;
}
/*
=====================
RE_BeginFrame
=====================
*/
static void
RE_BeginFrame( float camera_separation )
RE_BeginFrame(float camera_separation)
{
// world has not rendered yet
world_rendered = false;
@ -1430,7 +1425,7 @@ RE_EndFrame
=====================
*/
static void
RE_EndFrame( void )
RE_EndFrame(void)
{
QVk_EndFrame(false);
@ -1438,17 +1433,12 @@ RE_EndFrame( void )
world_rendered = false;
}
/*
=============
RE_SetPalette
=============
*/
unsigned r_rawpalette[256];
static void
RE_SetPalette (const unsigned char *palette)
RE_SetPalette(const unsigned char *palette)
{
int i;
int i;
byte *rp = (byte *)r_rawpalette;
@ -1474,19 +1464,17 @@ RE_SetPalette (const unsigned char *palette)
}
}
/*
** R_DrawBeam
*/
void R_DrawBeam( entity_t *currententity )
void
R_DrawBeam(entity_t *currententity )
{
#define NUM_BEAM_SEGS 6
int i;
int i;
float r, g, b;
vec3_t perpvec;
vec3_t direction, normalized_direction;
vec3_t start_points[NUM_BEAM_SEGS], end_points[NUM_BEAM_SEGS];
vec3_t start_points[NUM_BEAM_SEGS], end_points[NUM_BEAM_SEGS];
vec3_t oldorigin, origin;
oldorigin[0] = currententity->oldorigin[0];
@ -1502,7 +1490,9 @@ void R_DrawBeam( entity_t *currententity )
normalized_direction[2] = direction[2] = oldorigin[2] - origin[2];
if (VectorNormalize(normalized_direction) == 0)
{
return;
}
PerpendicularVector(perpvec, normalized_direction);
VectorScale(perpvec, currententity->frame / 2, perpvec);
@ -1751,16 +1741,15 @@ GetRefAPI(refimport_t imp)
refexport.EndWorldRenderpass = RE_EndWorldRenderpass;
refexport.EndFrame = RE_EndFrame;
// Tell the client that we're unsing the
// Tell the client that we're unsing the
// new renderer restart API.
ri.Vid_RequestRestart(RESTART_NO);
ri.Vid_RequestRestart(RESTART_NO);
Swap_Init ();
return refexport;
}
// this is only here so the functions in q_shared.c and q_shwin.c can link
void R_Printf(int level, const char* msg, ...)
{
va_list argptr;
@ -1769,21 +1758,25 @@ void R_Printf(int level, const char* msg, ...)
va_end(argptr);
}
/*
* this is only here so the functions in shared source files
* (shared.c, rand.c, flash.c, mem.c/hunk.c) can link
*/
void
Sys_Error (const char *error, ...)
Sys_Error(const char *error, ...)
{
va_list argptr;
char text[4096]; // MAXPRINTMSG == 4096
va_list argptr;
char text[4096]; // MAXPRINTMSG == 4096
va_start(argptr, error);
vsnprintf(text, sizeof(text), error, argptr);
va_end(argptr);
ri.Sys_Error (ERR_FATAL, "%s", text);
ri.Sys_Error(ERR_FATAL, "%s", text);
}
void
Com_Printf (const char *msg, ...)
Com_Printf(const char *msg, ...)
{
va_list argptr;
va_start(argptr, msg);

View file

@ -1,36 +1,33 @@
/*
Copyright (C) 1997-2001 Id Software, Inc.
Copyright (C) 2018-2019 Krzysztof Kondrak
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 the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// vk_mesh.c: triangle model functions
* Copyright (C) 1997-2001 Id Software, Inc.
* Copyright (C) 2018-2019 Krzysztof Kondrak
*
* 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 the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* =======================================================================
*
* Mesh handling
*
* =======================================================================
*/
#include "header/local.h"
/*
=============================================================
ALIAS MODELS
=============================================================
*/
#define NUMVERTEXNORMALS 162
#define NUMVERTEXNORMALS 162
static float r_avertexnormals[NUMVERTEXNORMALS][3] = {
#include "../constants/anorms.h"

View file

@ -1,24 +1,24 @@
/*
Copyright (C) 1997-2001 Id Software, Inc.
Copyright (C) 2018-2019 Krzysztof Kondrak
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 the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// vk_misc.c
* Copyright (C) 1997-2001 Id Software, Inc.
* Copyright (C) 2018-2019 Krzysztof Kondrak
*
* 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 the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#include "header/local.h"

View file

@ -111,8 +111,8 @@ Mod_Free(model_t *mod)
R_Printf(PRINT_ALL, "%s: Unload %s[%d]\n", __func__, mod->name, mod_loaded);
}
Hunk_Free (mod->extradata);
memset (mod, 0, sizeof(*mod));
Hunk_Free(mod->extradata);
memset(mod, 0, sizeof(*mod));
mod_loaded --;
if (mod_loaded < 0)
{
@ -133,7 +133,7 @@ Mod_FreeAll (void)
}
void
Mod_FreeModelsKnown (void)
Mod_FreeModelsKnown(void)
{
free(models_known);
models_known = NULL;

View file

@ -1,22 +1,23 @@
/*
Copyright (C) 2018-2019 Krzysztof Kondrak
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 the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
* Copyright (C) 2018-2019 Krzysztof Kondrak
*
* 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 the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#include "header/local.h"
@ -48,8 +49,10 @@ qvkshader_t QVk_CreateShader(const uint32_t *shaderSrc, size_t shaderCodeSize, V
return shader;
}
void QVk_CreatePipeline(const VkDescriptorSetLayout *descriptorLayout, const uint32_t descLayoutCount, const VkPipelineVertexInputStateCreateInfo *vertexInputInfo,
qvkpipeline_t *pipeline, const qvkrenderpass_t *renderpass, const qvkshader_t *shaders, uint32_t shaderCount)
void QVk_CreatePipeline(const VkDescriptorSetLayout *descriptorLayout,
const uint32_t descLayoutCount, const VkPipelineVertexInputStateCreateInfo *vertexInputInfo,
qvkpipeline_t *pipeline, const qvkrenderpass_t *renderpass,
const qvkshader_t *shaders, uint32_t shaderCount)
{
VkPipelineShaderStageCreateInfo *ssCreateInfos = (VkPipelineShaderStageCreateInfo *)malloc(shaderCount * sizeof(VkPipelineShaderStageCreateInfo));
for (int i = 0; i < shaderCount; i++)

View file

@ -1,22 +1,23 @@
/*
Copyright (C) 2018-2019 Krzysztof Kondrak
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 the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
* Copyright (C) 2018-2019 Krzysztof Kondrak
*
* 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 the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#include "header/shaders.h"

View file

@ -343,7 +343,8 @@ The BSP tree is waled front to back, so unwinding the chain
of alpha_surfaces will draw back to front, giving proper ordering.
================
*/
void R_DrawAlphaSurfaces (void)
void
R_DrawAlphaSurfaces(void)
{
msurface_t *s;
float intens;
@ -357,16 +358,26 @@ void R_DrawAlphaSurfaces (void)
{
c_brush_polys++;
if (s->texinfo->flags & SURF_TRANS33)
{
color[3] = 0.33f;
}
else if (s->texinfo->flags & SURF_TRANS66)
{
color[3] = 0.66f;
}
if (s->flags & SURF_DRAWTURB)
{
EmitWaterPolys(s, s->texinfo->image, NULL, color, false);
}
else if (s->texinfo->flags & SURF_FLOWING) // PGM 9/16/98
{
DrawVkFlowingPoly(s, s->texinfo->image, color); // PGM
}
else
{
DrawVkPoly(s->polys, s->texinfo->image, color);
}
}
r_alpha_surfaces = NULL;
@ -379,7 +390,8 @@ DrawTextureChains
Draw world surfaces (mostly solid with alpha == 1.f)
================
*/
static void DrawTextureChains (entity_t *currententity)
static void
DrawTextureChains(entity_t *currententity)
{
int i;
msurface_t *s;
@ -390,30 +402,45 @@ static void DrawTextureChains (entity_t *currententity)
for (i = 0, image = vktextures; i < numvktextures; i++, image++)
{
if (!image->registration_sequence)
{
continue;
}
if (!image->texturechain)
{
continue;
}
c_visible_textures++;
for (s = image->texturechain; s; s = s->texturechain)
{
if (!(s->flags & SURF_DRAWTURB))
{
R_RenderBrushPoly(s, NULL, 1.f, currententity);
}
}
}
for (i = 0, image = vktextures; i < numvktextures; i++, image++)
{
if (!image->registration_sequence)
{
continue;
}
s = image->texturechain;
if (!s)
{
continue;
}
for (; s; s = s->texturechain)
{
if (s->flags & SURF_DRAWTURB)
{
R_RenderBrushPoly(s, NULL, 1.f, currententity);
}
}
image->texturechain = NULL;
@ -1298,4 +1325,3 @@ void Vk_EndBuildingLightmaps (void)
{
LM_UploadBlock( false );
}

View file

@ -1,22 +1,23 @@
/*
Copyright (C) 2018-2019 Krzysztof Kondrak
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 the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
* Copyright (C) 2018-2019 Krzysztof Kondrak
*
* 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 the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#include "header/local.h"

View file

@ -1,21 +1,24 @@
/*
Copyright (C) 2018 Christoph Schied
Copyright (C) 2020 Denis Pauk
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 the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
* Copyright (C) 2018 Christoph Schied
* Copyright (C) 2020 Denis Pauk
*
* 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 the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#include "header/util.h"
#include "header/local.h"

View file

@ -1,22 +1,23 @@
/*
Copyright (C) 2018-2019 Krzysztof Kondrak
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 the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
* Copyright (C) 2018-2019 Krzysztof Kondrak
*
* 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 the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#include "header/local.h"

View file

@ -1,24 +1,30 @@
/*
Copyright (C) 1997-2001 Id Software, Inc.
Copyright (C) 2018-2019 Krzysztof Kondrak
* Copyright (C) 1997-2001 Id Software, Inc.
* Copyright (C) 2018-2019 Krzysztof Kondrak
*
* 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 the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* =======================================================================
*
* Warps. Used on water surfaces und for skybox rotation.
*
* =======================================================================
*/
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 the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// vk_warp.c -- sky and water polygons
#include "header/local.h"
static float skyrotate;