Skip to content

Commit

Permalink
Merge remote-tracking branch 'ioquake3/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
zturtleman committed Nov 23, 2023
2 parents 3ab6d8d + 972635e commit 52769f7
Show file tree
Hide file tree
Showing 10 changed files with 85 additions and 44 deletions.
2 changes: 1 addition & 1 deletion code/botlib/be_aas.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,5 +174,5 @@ typedef struct aas_predictroute_s
int endcontents; //contents at the end of movement prediction
int endtravelflags; //end travel flags
int numareas; //number of areas predicted ahead
int time; //time predicted ahead (in hundreth of a sec)
int time; //time predicted ahead (in hundredths of a sec)
} aas_predictroute_t;
2 changes: 1 addition & 1 deletion code/botlib/be_aas_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ void AAS_FileInfo(void)
aasworld.reachabilitysize * sizeof(aas_reachability_t) +
aasworld.numportals * sizeof(aas_portal_t) +
aasworld.numclusters * sizeof(aas_cluster_t);
botimport.Print(PRT_MESSAGE, "optimzed size %d KB\n", optimized >> 10);
botimport.Print(PRT_MESSAGE, "optimized size %d KB\n", optimized >> 10);
} //end of the function AAS_FileInfo
#endif //AASFILEDEBUG
//===========================================================================
Expand Down
47 changes: 22 additions & 25 deletions code/renderergl2/tr_backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,7 @@ void RB_BeginDrawingView (void) {
{
FBO_t *fbo = backEnd.viewParms.targetFbo;

// FIXME: HUGE HACK: render to the screen fbo if we've already postprocessed the frame and aren't drawing more world
// drawing more world check is in case of double renders, such as skyportals
if (fbo == NULL && !(backEnd.framePostProcessed && (backEnd.refdef.rdflags & RDF_NOWORLDMODEL)))
if (fbo == NULL && (!r_postProcess->integer || !(backEnd.refdef.rdflags & RDF_NOWORLDMODEL)))
fbo = tr.renderFbo;

if (tr.renderCubeFbo && fbo == tr.renderCubeFbo)
Expand Down Expand Up @@ -748,10 +746,9 @@ void RE_StretchRaw (int x, int y, int w, int h, int cols, int rows, const byte *
ri.Printf( PRINT_ALL, "qglTexSubImage2D %i, %i: %i msec\n", cols, rows, end - start );
}

// FIXME: HUGE hack
if (glRefConfig.framebufferObject)
{
FBO_Bind(backEnd.framePostProcessed ? NULL : tr.renderFbo);
FBO_Bind(r_postProcess->integer ? NULL : tr.renderFbo);
}

RB_SetGL2D();
Expand Down Expand Up @@ -835,9 +832,8 @@ const void *RB_StretchPic ( const void *data ) {

cmd = (const stretchPicCommand_t *)data;

// FIXME: HUGE hack
if (glRefConfig.framebufferObject)
FBO_Bind(backEnd.framePostProcessed ? NULL : tr.renderFbo);
FBO_Bind(r_postProcess->integer ? NULL : tr.renderFbo);

RB_SetGL2D();

Expand Down Expand Up @@ -918,9 +914,8 @@ const void* RB_Draw2dPolys( const void* data ) {

cmd = (const poly2dCommand_t* )data;

// FIXME: HUGE hack
if (glRefConfig.framebufferObject) {
FBO_Bind(backEnd.framePostProcessed ? NULL : tr.renderFbo);
FBO_Bind(r_postProcess->integer ? NULL : tr.renderFbo);
}

RB_SetGL2D();
Expand Down Expand Up @@ -978,9 +973,8 @@ const void *RB_RotatedPic( const void *data ) {

cmd = (const stretchPicCommand_t *)data;

// FIXME: HUGE hack
if (glRefConfig.framebufferObject) {
FBO_Bind(backEnd.framePostProcessed ? NULL : tr.renderFbo);
FBO_Bind(r_postProcess->integer ? NULL : tr.renderFbo);
}

RB_SetGL2D();
Expand Down Expand Up @@ -1066,9 +1060,8 @@ const void *RB_StretchPicGradient( const void *data ) {

cmd = (const stretchPicCommand_t *)data;

// FIXME: HUGE hack
if (glRefConfig.framebufferObject) {
FBO_Bind(backEnd.framePostProcessed ? NULL : tr.renderFbo);
FBO_Bind(r_postProcess->integer ? NULL : tr.renderFbo);
}

RB_SetGL2D();
Expand Down Expand Up @@ -1456,6 +1449,13 @@ const void *RB_DrawSurfs( const void *data ) {
qglGenerateTextureMipmapEXT(cubemap->image->texnum, GL_TEXTURE_CUBE_MAP);
}

// FIXME? backEnd.viewParms doesn't get properly initialized for 2D drawing.
// r_cubeMapping 1 generates cubemaps with R_RenderCubemapSide()
// and sets isMirror = qtrue. Clear it here to prevent it from leaking
// to 2D drawing and causing the loading screen to be culled.
backEnd.viewParms.isMirror = qfalse;
backEnd.viewParms.flags = 0;

return (const void *)(cmd + 1);
}

Expand Down Expand Up @@ -1484,6 +1484,13 @@ const void *RB_DrawBuffer( const void *data ) {
if ( r_clear->integer ) {
qglClearColor( 1, 0, 0.5, 1 );
qglClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );

if (glRefConfig.framebufferObject && tr.renderFbo) {
FBO_Bind(tr.renderFbo);

qglClearColor( 1, 0, 0.5, 1 );
qglClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
}
}

return (const void *)(cmd + 1);
Expand Down Expand Up @@ -1596,14 +1603,7 @@ const void *RB_ClearDepth(const void *data)

if (glRefConfig.framebufferObject)
{
if (!tr.renderFbo || backEnd.framePostProcessed)
{
FBO_Bind(NULL);
}
else
{
FBO_Bind(tr.renderFbo);
}
FBO_Bind(tr.renderFbo);
}

qglClear(GL_DEPTH_BUFFER_BIT);
Expand Down Expand Up @@ -1661,7 +1661,7 @@ const void *RB_SwapBuffers( const void *data ) {

if (glRefConfig.framebufferObject)
{
if (!backEnd.framePostProcessed)
if (!r_postProcess->integer)
{
if (tr.msaaResolveFbo && r_hdr->integer)
{
Expand All @@ -1684,7 +1684,6 @@ const void *RB_SwapBuffers( const void *data ) {

GLimp_EndFrame();

backEnd.framePostProcessed = qfalse;
backEnd.projection2D = qfalse;

return (const void *)(cmd + 1);
Expand Down Expand Up @@ -1938,8 +1937,6 @@ const void *RB_PostProcess(const void *data)
}
#endif

backEnd.framePostProcessed = qtrue;

return (const void *)(cmd + 1);
}

Expand Down
6 changes: 5 additions & 1 deletion code/renderergl2/tr_fbo.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,13 @@ void FBO_CreateBuffer(FBO_t *fbo, int format, int index, int multisample)
}

absent = *pRenderBuffer == 0;
if (absent)
if (absent) {
qglGenRenderbuffers(1, pRenderBuffer);

// workaround AMD Windows driver requiring bind to create renderbuffer
GL_BindRenderbuffer(*pRenderBuffer);
}

if (multisample && glRefConfig.framebufferMultisample)
qglNamedRenderbufferStorageMultisampleEXT(*pRenderBuffer, multisample, format, fbo->width, fbo->height);
else
Expand Down
1 change: 0 additions & 1 deletion code/renderergl2/tr_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -1650,7 +1650,6 @@ typedef struct {

FBO_t *last2DFBO;
qboolean colorMask[4];
qboolean framePostProcessed;
qboolean depthFill;
} backEndState_t;

Expand Down
9 changes: 9 additions & 0 deletions code/sys/sys_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,10 @@ void Sys_ListFilteredFiles( const char *basedir, char *subdirs, char *filter, ch
return;
}

if ( basedir[0] == '\0' ) {
return;
}

if (strlen(subdirs)) {
Com_sprintf( search, sizeof(search), "%s/%s", basedir, subdirs );
}
Expand Down Expand Up @@ -435,6 +439,11 @@ char **Sys_ListFiles( const char *directory, const char *extension, char *filter
return listCopy;
}

if ( directory[0] == '\0' ) {
*numfiles = 0;
return NULL;
}

if ( !extension)
extension = "";

Expand Down
9 changes: 9 additions & 0 deletions code/sys/sys_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,10 @@ void Sys_ListFilteredFiles( const char *basedir, char *subdirs, char *filter, ch
return;
}

if ( basedir[0] == '\0' ) {
return;
}

if (strlen(subdirs)) {
Com_sprintf( search, sizeof(search), "%s\\%s\\*", basedir, subdirs );
}
Expand Down Expand Up @@ -484,6 +488,11 @@ char **Sys_ListFiles( const char *directory, const char *extension, char *filter
return listCopy;
}

if ( directory[0] == '\0' ) {
*numfiles = 0;
return NULL;
}

if ( !extension) {
extension = "";
}
Expand Down
6 changes: 0 additions & 6 deletions misc/nsis/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ endif
ifndef USE_CURL_DLOPEN
USE_CURL_DLOPEN=0
endif
ifndef USE_INTERNAL_SPEEX
USE_INTERNAL_SPEEX=1
endif
ifndef USE_INTERNAL_ZLIB
USE_INTERNAL_ZLIB=1
endif
Expand Down Expand Up @@ -59,9 +56,6 @@ endif
ifeq ($(USE_CURL_DLOPEN),1)
DEFINES+= -DUSE_CURL_DLOPEN
endif
ifeq ($(USE_INTERNAL_SPEEX),1)
DEFINES+= -DUSE_INTERNAL_SPEEX
endif
ifeq ($(USE_INTERNAL_ZLIB),1)
DEFINES+= -DUSE_INTERNAL_ZLIB
endif
Expand Down
19 changes: 10 additions & 9 deletions misc/nsis/spearmint.nsi.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
!include "MUI2.nsh"
!define MUI_ICON "../spearmint.ico"

!include LogicLib.nsh

; The name of the installer
Name "${GAMENAME} ${VERSION}"

Expand Down Expand Up @@ -88,9 +90,6 @@ Section "${GAMENAME} ${VERSION}-${RELEASE} (required)" ioquake3
SetOutPath $INSTDIR

File "../../build/release-mingw32-x86/SDL2.dll"
!ifndef USE_INTERNAL_SPEEX
File "libspeex.dll"
!endif
!ifndef USE_INTERNAL_ZLIB
File "zlib1.dll"
!endif
Expand Down Expand Up @@ -139,7 +138,7 @@ SectionEnd
Section "Protocol Handler" ProtocolHandler

WriteRegStr SHCTX "Software\Classes\${PROTOCOL_HANDLER}" "CustomUrlApplication" "$INSTDIR\${CLIENT}"
WriteRegStr SHCTX "Software\Classes\${PROTOCOL_HANDLER}" "CustomUrlArguments" '"%1"'
WriteRegStr SHCTX "Software\Classes\${PROTOCOL_HANDLER}" "CustomUrlArguments" '--uri "%1"'
WriteRegStr SHCTX "Software\Classes\${PROTOCOL_HANDLER}" "URL Protocol" ""
WriteRegStr SHCTX "Software\Classes\${PROTOCOL_HANDLER}\DefaultIcon" "" "$INSTDIR\${CLIENT},0"
WriteRegStr SHCTX "Software\Classes\${PROTOCOL_HANDLER}\shell\open\command" "" '"$INSTDIR\${CLIENT}" --uri "%1"'
Expand Down Expand Up @@ -175,7 +174,12 @@ Section "Uninstall"
; Remove registry keys
DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${GAMEKEY}"
DeleteRegKey SHCTX "Software\${GAMEKEY}"

ReadRegStr $0 SHCTX "Software\Classes\${PROTOCOL_HANDLER}\shell\open\command" ""
${If} $0 == '"$INSTDIR\${CLIENT}" --uri "%1"'
DeleteRegKey SHCTX "Software\Classes\${PROTOCOL_HANDLER}"
${EndIf}


; Remove files and uninstaller
Delete $INSTDIR\${CLIENT}
Expand All @@ -191,9 +195,6 @@ Section "Uninstall"
Delete $INSTDIR\voip-readme.txt

Delete $INSTDIR\SDL2.dll
!ifndef USE_INTERNAL_SPEEX
Delete $INSTDIR\libspeex.dll
!endif
!ifndef USE_INTERNAL_ZLIB
Delete $INSTDIR\zlib1.dll
!endif
Expand Down Expand Up @@ -225,9 +226,9 @@ SectionEnd
!insertmacro MUI_DESCRIPTION_TEXT ${StartMenuShortcuts} "Create shortcuts in the start menu."
!insertmacro MUI_DESCRIPTION_TEXT ${ProtocolHandler} "The protocol handler lets you connect to a game by clicking a link in a web browser."
!ifdef USE_OPENAL_DLOPEN
!insertmacro MUI_DESCRIPTION_TEXT ${OpenAL} "OpenAL files."
!insertmacro MUI_DESCRIPTION_TEXT ${OpenAL} "Advanced audio mixer that supports surround sound."
!endif
!ifdef USE_CURL_DLOPEN
!insertmacro MUI_DESCRIPTION_TEXT ${libcurl} "libcurl files."
!insertmacro MUI_DESCRIPTION_TEXT ${libcurl} "Used for HTTP file downloads."
!endif
!insertmacro MUI_FUNCTION_DESCRIPTION_END
28 changes: 28 additions & 0 deletions misc/setup/org.ioquake3.ioquake3.metainfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>org.ioquake3.ioquake3</id>
<launchable type="desktop-id">ioquake3.desktop</launchable>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-2.0-or-later</project_license>
<name>ioquake3</name>
<summary>Free and open-source Quake 3 based engine</summary>
<description>
<p>
ioquake3 is a free and open-source software first person shooter engine based on the Quake 3: Arena and Quake 3: Team Arena source code.
</p>
<p>
The source code is licensed under the GPL version 2, and was first released under that license by id software on August 20th, 2005. Since then,
our dedicated team has been working hard to improve it, fixing bugs, and adding just the right new features to make the engine even better than before.
</p>
</description>
<url type="homepage">https://ioquake3.org</url>
<url type="bugtracker">https://github.com/ioquake/ioq3/issues</url>
<url type="vcs-browser">https://github.com/ioquake/ioq3</url>
<developer_name>The ioquake Group</developer_name>
<content_rating type="oars-1.1">
<content_attribute id="violence-realistic">intense</content_attribute>
<content_attribute id="violence-bloodshed">intense</content_attribute>
<content_attribute id="social-chat">intense</content_attribute>
<content_attribute id="social-audio">intense</content_attribute>
</content_rating>
</component>

0 comments on commit 52769f7

Please sign in to comment.