diff --git a/codemp/cgame/cg_view.c b/codemp/cgame/cg_view.c index 2e9fbf7a07..8e497df60f 100644 --- a/codemp/cgame/cg_view.c +++ b/codemp/cgame/cg_view.c @@ -393,7 +393,7 @@ static void CG_CalcIdealThirdPersonViewLocation(void) newThirdPersonRange = thirdPersonRange * thirdPersonRange / 176; else newThirdPersonRange = thirdPersonRange * thirdPersonRange / cg_zoomFov.integer; - } + } else { if (cg_zoomFov.integer < 1) @@ -410,7 +410,7 @@ static void CG_CalcIdealThirdPersonViewLocation(void) } else { newThirdPersonRange = thirdPersonRange; } - } + } //JAPRO - Clientside - Allow for +zoom - End if (cg.snap && cg.snap->ps.m_iVehicleNum) @@ -1095,18 +1095,18 @@ static void CG_OffsetFirstPersonView( void ) { { if (!(cgs.jcinfo & JAPRO_CINFO_SCREENSHAKE)) { - } + } else if ( cg.damageTime ) { ratio = cg.time - cg.damageTime; - if ( ratio < DAMAGE_DEFLECT_TIME ) + if ( ratio < DAMAGE_DEFLECT_TIME ) { ratio /= DAMAGE_DEFLECT_TIME; angles[PITCH] += ratio * cg.v_dmg_pitch; angles[ROLL] += ratio * cg.v_dmg_roll; - } else + } else { ratio = 1.0 - ( ratio - DAMAGE_DEFLECT_TIME ) / DAMAGE_RETURN_TIME; - if ( ratio > 0 ) + if ( ratio > 0 ) { angles[PITCH] += ratio * cg.v_dmg_pitch; angles[ROLL] += ratio * cg.v_dmg_roll; @@ -1390,7 +1390,7 @@ static qboolean CG_CalcFov( void ) { fov_x = 176; else fov_x = cg_zoomFov.integer; - } + } else { if (cg_zoomFov.integer < 1) @@ -2536,7 +2536,7 @@ static QINLINE void CG_DoAsync( void ) { //Need to decouple frames from kick i guess. //If we are on kick 1, check to see if our cvar for it is above frames. If so , kick and increment kickcount. - + //Increment if (cg.numFKFrames > cg_fkDuration.integer) { trap->SendConsoleCommand("-moveup\n"); @@ -3044,7 +3044,6 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView, qboolean demo if ( !cg.hyperspace ) { CG_AddPacketEntities(qfalse); // adter calcViewValues, so predicted player state is correct CG_AddMarks(); - CG_AddLocalEntities(); #if _NEWTRAILS if (cg.drawingStrafeTrails) { CG_AddAllStrafeTrails(); @@ -3064,6 +3063,11 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView, qboolean demo if ( cg.testModelEntity.hModel ) { CG_AddTestModel(); } + + if ( !cg.hyperspace ) { + CG_AddLocalEntities(); + } + cg.refdef.time = cg.time; memcpy( cg.refdef.areamask, cg.snap->areamask, sizeof( cg.refdef.areamask ) ); diff --git a/codemp/client/cl_console.cpp b/codemp/client/cl_console.cpp index 4284b0bdd7..14543c5c4a 100644 --- a/codemp/client/cl_console.cpp +++ b/codemp/client/cl_console.cpp @@ -43,6 +43,7 @@ cvar_t *con_autoclear; cvar_t *con_notifywords; cvar_t *con_notifyconnect; cvar_t *con_notifyvote; +cvar_t *con_height; #define DEFAULT_CONSOLE_WIDTH 78 #define TIMESTAMP_LENGTH 9 @@ -452,19 +453,19 @@ void Con_CheckResize (void) else { float scale = (con_scale && con_scale->value > 0.0f) ? con_scale->value : 1.0f; - + width = (cls.glconfig.vidWidth / (scale * SMALLCHAR_WIDTH)) - 2; - + if (width == con.linewidth) return; - + con.charWidth = scale * SMALLCHAR_WIDTH; con.charHeight = scale * SMALLCHAR_HEIGHT; - + g_consoleField.widthInChars = width; for (i = 0; i < COMMAND_HISTORY; i++) { historyEditLines[i].widthInChars = width; - + } // on wide screens, we will center the text @@ -542,6 +543,7 @@ void Con_Init (void) { con_notifywords = Cvar_Get("con_notifywords", "0", CVAR_ARCHIVE, "Notifies you when defined words are mentioned"); con_notifyconnect = Cvar_Get("con_notifyconnect", "0", CVAR_ARCHIVE, "Notifies you when someone connects to the server"); con_notifyvote = Cvar_Get("con_notifyvote", "1", CVAR_ARCHIVE, "Notifies you when someone calls a vote"); + con_height = Cvar_Get ("con_height", "0.5", CVAR_ARCHIVE_ND); Field_Clear( &g_consoleField ); g_consoleField.widthInChars = DEFAULT_CONSOLE_WIDTH; @@ -954,6 +956,8 @@ void Con_DrawSolidConsole( float frac ) { (lines-(con.charHeight*2+con.charHeight/2)) + padding, JK_VERSION[x] ); } + // draw the input prompt, user text, and cursor if desired + Con_DrawInput (); // Draw time and date time(&rawtime); @@ -968,9 +972,6 @@ void Con_DrawSolidConsole( float frac ) { SCR_DrawSmallChar(cls.glconfig.vidWidth - (i - x) * con.charWidth, lines - (con.charHeight + con.charHeight / 2) + padding, ts[x]); } - // draw the input prompt, user text, and cursor if desired - Con_DrawInput (); - // draw the text con.vislines = lines; rows = (lines-con.charWidth)/con.charWidth; // rows of text to draw @@ -1102,7 +1103,7 @@ Scroll it up or down void Con_RunConsole (void) { // decide on the destination height of the console if ( Key_GetCatcher( ) & KEYCATCH_CONSOLE ) - con.finalFrac = con.tempFrac; // visibility + con.finalFrac = (con_height->value != 0) ? con_height->value : con.tempFrac; else con.finalFrac = 0; // none visible diff --git a/codemp/client/cl_main.cpp b/codemp/client/cl_main.cpp index e40a986753..0124ad33b3 100644 --- a/codemp/client/cl_main.cpp +++ b/codemp/client/cl_main.cpp @@ -107,6 +107,7 @@ cvar_t *cl_autolodscale; cvar_t *cl_consoleKeys; cvar_t *cl_consoleUseScanCode; +cvar_t *cl_consoleShiftRequirement; cvar_t *cl_lanForcePackets; @@ -3368,6 +3369,7 @@ void CL_Init( void ) { // ~ and `, as keys and characters cl_consoleKeys = Cvar_Get( "cl_consoleKeys", "~ ` 0x7e 0x60 0xb2", CVAR_ARCHIVE, "Which keys are used to toggle the console"); cl_consoleUseScanCode = Cvar_Get( "cl_consoleUseScanCode", "1", CVAR_ARCHIVE, "Use native console key detection" ); + cl_consoleShiftRequirement = Cvar_Get( "cl_consoleShiftRequirement", "0", CVAR_ARCHIVE, "Require shift key to be pressed for native console key detection" ); cl_downloadName = Cvar_Get( "cl_downloadName", "", CVAR_INTERNAL ); cl_downloadPrompt = Cvar_Get( "cl_downloadPrompt", "1", CVAR_ARCHIVE, "Confirm pk3 downloads from the server" ); diff --git a/codemp/client/client.h b/codemp/client/client.h index 7753cc3829..e4a2654620 100644 --- a/codemp/client/client.h +++ b/codemp/client/client.h @@ -464,6 +464,7 @@ extern cvar_t *cl_inGameVideo; extern cvar_t *cl_consoleKeys; extern cvar_t *cl_consoleUseScanCode; +extern cvar_t *cl_consoleShiftRequirement; extern cvar_t *cl_lanForcePackets; diff --git a/codemp/rd-vulkan/tr_ghoul2.cpp b/codemp/rd-vulkan/tr_ghoul2.cpp index 6a6ba6af9b..a6ab3f33ee 100644 --- a/codemp/rd-vulkan/tr_ghoul2.cpp +++ b/codemp/rd-vulkan/tr_ghoul2.cpp @@ -905,9 +905,9 @@ static int G2_ComputeLOD( trRefEntity_t *ent, const model_t *currentModel, int l // model has only 1 LOD level, skip computations and bias #ifdef RF_NOLOD - if ( currentModel->numLods < 2 || ent->e.renderfx & RF_NOLOD ) + if ( currentModel->numLods < 2 || ent->e.renderfx & RF_NOLOD ) #else - if ( currentModel->numLods < 2 ) + if ( currentModel->numLods < 2 ) #endif return(0); @@ -923,7 +923,7 @@ static int G2_ComputeLOD( trRefEntity_t *ent, const model_t *currentModel, int l largestScale = ent->e.modelScale[2]; if (!largestScale) largestScale = 1; - + #if 0 float radius = Q_fabs(0.75 * largestScale * ent->e.radius); @@ -938,14 +938,14 @@ static int G2_ComputeLOD( trRefEntity_t *ent, const model_t *currentModel, int l projectedRadius = width / depth; - //if (projectedRadius > 1.0f) + //if (projectedRadius > 1.0f) // projectedRadius = 1.0f; if (projectedRadius != 0) { lodscale = (r_lodscale->value + r_autolodscalevalue->value); - if (lodscale > 20) + if (lodscale > 20) lodscale = 20; - else if (lodscale < 0) + else if (lodscale < 0) lodscale = 0; flod = 1.0f - projectedRadius * lodscale; @@ -963,12 +963,12 @@ static int G2_ComputeLOD( trRefEntity_t *ent, const model_t *currentModel, int l // we reduce the radius to make the LOD match other model types which use // the actual bound box size - if ( projectedRadius != 0 ) + if ( projectedRadius != 0 ) { lodscale = (r_lodscale->value+r_autolodscalevalue->value); - if ( lodscale > 20 ) + if ( lodscale > 20 ) { - lodscale = 20; + lodscale = 20; } else if ( lodscale < 0 ) { @@ -3508,9 +3508,9 @@ static inline float G2_GetVertBoneWeightNotSlow( const mdxmVertex_t *pVert, cons //This is a slightly mangled version of the same function from the sof2sp base. //It provides a pretty significant performance increase over the existing one. void RB_SurfaceGhoul(CRenderableSurface* surf) -{ +{ mdxmSurface_t *surface; - + #ifdef G2_PERFORMANCE_ANALYSIS G2PerformanceTimer_RB_SurfaceGhoul.Start(); #endif diff --git a/codemp/rd-vulkan/vk_frame.cpp b/codemp/rd-vulkan/vk_frame.cpp index 702f5bab72..c9d69e93a9 100644 --- a/codemp/rd-vulkan/vk_frame.cpp +++ b/codemp/rd-vulkan/vk_frame.cpp @@ -1017,9 +1017,9 @@ void vk_refraction_extract( void ) { VkImage srcImage; VkImage dstImage; VkImageLayout srcImageLayout; - VkAccessFlagBits srcImageAccess; + //VkAccessFlagBits srcImageAccess; - srcImageAccess = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT; + //srcImageAccess = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT; srcImageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; srcImage = vk.color_image; dstImage = vk.refraction_extract_image; diff --git a/shared/sdl/sdl_input.cpp b/shared/sdl/sdl_input.cpp index 943b808ad2..30c1ae6c9f 100644 --- a/shared/sdl/sdl_input.cpp +++ b/shared/sdl/sdl_input.cpp @@ -254,6 +254,23 @@ static void IN_TranslateNumpad( SDL_Keysym *keysym, fakeAscii_t *key ) } } +/* +=============== +IN_ModTogglesConsole +=============== +*/ +static qboolean IN_ModTogglesConsole( int mod ) { + switch (cl_consoleShiftRequirement->integer) { + case 0: + return qtrue; + case 2: + return (qboolean)!!(mod & KMOD_SHIFT); + case 1: + default: + return (qboolean)((mod & KMOD_SHIFT) || (Key_GetCatcher() & KEYCATCH_CONSOLE)); + } +} + /* =============== IN_TranslateSDLToJKKey @@ -379,11 +396,7 @@ static fakeAscii_t IN_TranslateSDLToJKKey( SDL_Keysym *keysym, qboolean down ) { { if ( keysym->scancode == SDL_SCANCODE_GRAVE ) { - SDL_Keycode translated = SDL_GetKeyFromScancode( SDL_SCANCODE_GRAVE ); - - if ( (translated != SDLK_CARET) || (translated == SDLK_CARET && (keysym->mod & KMOD_SHIFT)) ) - { - // Console keys can't be bound or generate characters + if ( IN_ModTogglesConsole(keysym->mod) ) { key = A_CONSOLE; } } @@ -866,7 +879,7 @@ static void IN_ProcessEvents( int eventTime ) uint32_t utf32 = ConvertUTF8ToUTF32( c, &c ); if( utf32 != 0 ) { - if( IN_IsConsoleKey( A_NULL, utf32 ) ) + if( IN_IsConsoleKey( A_NULL, utf32 ) && !cl_consoleUseScanCode->integer ) { Sys_QueEvent( eventTime, SE_KEY, A_CONSOLE, qtrue, 0, NULL ); Sys_QueEvent( eventTime, SE_KEY, A_CONSOLE, qfalse, 0, NULL );