Browse Source

gameui: add console button to main menu

pull/51/head
nillerusr 2 years ago
parent
commit
c36cfccdf0
  1. 2
      engine/cmd.cpp
  2. 2
      game/shared/cstrike/achievements_cs.cpp
  3. 9
      gameui/BasePanel.cpp
  4. 1
      public/togles/linuxwin/glfuncs.h
  5. 8
      public/togles/linuxwin/glmgr.h
  6. 15
      togles/linuxwin/dx9asmtogl2.cpp
  7. 4
      togles/linuxwin/dxabstract.cpp

2
engine/cmd.cpp

@ -579,7 +579,7 @@ void Cmd_Exec_f( const CCommand &args ) @@ -579,7 +579,7 @@ void Cmd_Exec_f( const CCommand &args )
const char *szFile = args[1];
const char *pPathID = "MOD";
const char *pPathID = "*";
Q_snprintf( fileName, sizeof( fileName ), "//%s/cfg/%s", pPathID, szFile );
Q_DefaultExtension( fileName, ".cfg", sizeof( fileName ) );

2
game/shared/cstrike/achievements_cs.cpp

@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
// [dwenger] Necessary for sorting achievements by award time
#include <vgui/ISystem.h>
#include "../../src/public/vgui_controls/Controls.h"
#include "vgui_controls/Controls.h"
ConVar achievements_easymode( "achievement_easymode", "0", FCVAR_CLIENTDLL | FCVAR_DEVELOPMENTONLY,

9
gameui/BasePanel.cpp

@ -657,7 +657,7 @@ bool g_bIsCreatingNewGameMenuForPreFetching = false; @@ -657,7 +657,7 @@ bool g_bIsCreatingNewGameMenuForPreFetching = false;
// Purpose: Constructor
//-----------------------------------------------------------------------------
CBasePanel::CBasePanel() : Panel(NULL, "BaseGameUIPanel")
{
{
g_pBasePanel = this;
m_bLevelLoading = false;
m_eBackgroundState = BACKGROUND_INITIAL;
@ -863,6 +863,7 @@ CBasePanel::~CBasePanel() @@ -863,6 +863,7 @@ CBasePanel::~CBasePanel()
static const char *g_rgValidCommands[] =
{
"OpenGameMenu",
"OpenConsole",
"OpenPlayerListDialog",
"OpenNewGameDialog",
"OpenLoadGameDialog",
@ -1477,6 +1478,8 @@ CGameMenu *CBasePanel::RecursiveLoadGameMenu(KeyValues *datafile) @@ -1477,6 +1478,8 @@ CGameMenu *CBasePanel::RecursiveLoadGameMenu(KeyValues *datafile)
{
CGameMenu *menu = new CGameMenu(this, datafile->GetName());
menu->AddMenuItem("Console", "CONSOLE", "OpenConsole", this);
// loop through all the data adding items to the menu
for (KeyValues *dat = datafile->GetFirstSubKey(); dat != NULL; dat = dat->GetNextKey())
{
@ -1899,6 +1902,10 @@ void CBasePanel::RunMenuCommand(const char *command) @@ -1899,6 +1902,10 @@ void CBasePanel::RunMenuCommand(const char *command)
{
OnOpenNewGameDialog();
}
else if ( !Q_stricmp( command, "OpenConsole" ) )
{
GameConsole().Activate();
}
else if ( !Q_stricmp( command, "OpenLoadGameDialog" ) )
{
if ( !GameUI().IsConsoleUI() )

1
public/togles/linuxwin/glfuncs.h

@ -249,3 +249,4 @@ GL_FUNC_VOID(OpenGL,true,glSamplerParameterfv,(GLuint a, GLenum b, const GLfloat @@ -249,3 +249,4 @@ GL_FUNC_VOID(OpenGL,true,glSamplerParameterfv,(GLuint a, GLenum b, const GLfloat
GL_FUNC_VOID(GL_QCOM_alpha_test,false,glAlphaFuncQCOM,(GLenum a, GLfloat b),(a,b))
GL_FUNC_VOID(OpenGL,true,glClearDepthf,(GLfloat a),(a))
GL_FUNC_VOID(OpenGL,true,glDepthRangef,(GLfloat a,GLfloat b),(a,b))
GL_FUNC_VOID(OpenGL,true,glGetFramebufferAttachmentParameteriv,(GLenum a,GLenum b,GLenum c,GLint *d),(a,b,c,d))

8
public/togles/linuxwin/glmgr.h

@ -731,16 +731,16 @@ FORCEINLINE void GLContextSet( GLBlendEnableSRGB_t *src ) @@ -731,16 +731,16 @@ FORCEINLINE void GLContextSet( GLBlendEnableSRGB_t *src )
}
#endif
// this query is not useful unless you have the ARB_framebuffer_srgb ext.
//GLint encoding = 0;
//pfnglGetFramebufferAttachmentParameteriv( GL_DRAW_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, &encoding );
// GLint encoding = 0;
// gGL->glGetFramebufferAttachmentParameteriv( GL_DRAW_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, &encoding );
glSetEnable( GL_FRAMEBUFFER_SRGB_EXT, src->enable != 0 );
}
FORCEINLINE void GLContextGet( GLBlendEnableSRGB_t *dst )
{
dst->enable = gGL->glIsEnabled( GL_FRAMEBUFFER_SRGB_EXT );
// dst->enable = true; // wtf ?
// dst->enable = gGL->glIsEnabled( GL_FRAMEBUFFER_SRGB_EXT );
dst->enable = true; // wtf ?
}
FORCEINLINE void GLContextGetDefault( GLBlendEnableSRGB_t *dst )

15
togles/linuxwin/dx9asmtogl2.cpp

@ -3186,10 +3186,9 @@ int D3DToGL::TranslateShader( uint32* code, CUtlBuffer *pBufDisassembledCode, bo @@ -3186,10 +3186,9 @@ int D3DToGL::TranslateShader( uint32* code, CUtlBuffer *pBufDisassembledCode, bo
m_bPutHexCodesAfterLines = (options & D3DToGL_PutHexCommentsAfterLines) != 0;
m_bGeneratingDebugText = (options & D3DToGL_GeneratingDebugText) != 0;
m_bGenerateSRGBWriteSuffix = (options & D3DToGL_OptionSRGBWriteSuffix) != 0;
m_bGenerateSRGBWriteSuffix = false;
if( debugLabel && (V_strstr( debugLabel ,"vertexlit_and_unlit_generic_ps") || V_strstr( debugLabel ,"vertexlit_and_unlit_generic_bump_ps") ) )
m_bGenerateSRGBWriteSuffix = true;
/* if( debugLabel && (V_strstr( debugLabel ,"vertexlit_and_unlit_generic_ps") || V_strstr( debugLabel ,"vertexlit_and_unlit_generic_bump_ps") ) )
m_bGenerateSRGBWriteSuffix = true;*/
m_NumIndentTabs = 1; // start code indented one tab
m_nLoopDepth = 0;
@ -3921,11 +3920,11 @@ int D3DToGL::TranslateShader( uint32* code, CUtlBuffer *pBufDisassembledCode, bo @@ -3921,11 +3920,11 @@ int D3DToGL::TranslateShader( uint32* code, CUtlBuffer *pBufDisassembledCode, bo
// sRGB Write suffix
if ( m_bGenerateSRGBWriteSuffix )
{
// StrcatToALUCode( "vec3 sRGBFragData;\n" );
// StrcatToALUCode( "sRGBFragData.xyz = log( gl_FragData[0].xyz );\n" );
// StrcatToALUCode( "sRGBFragData.xyz = sRGBFragData.xyz * vec3( 0.754545f, 0.754545f, 0.754545f );\n" );
// StrcatToALUCode( "sRGBFragData.xyz = exp( sRGBFragData.xyz );\n" );
StrcatToALUCode( "gl_FragData[0].xyz = pow(gl_FragData[0].xyz, vec3(1.0/2.2));\n" );
StrcatToALUCode( "vec3 sRGBFragData;\n" );
StrcatToALUCode( "sRGBFragData.xyz = log( gl_FragData[0].xyz );\n" );
StrcatToALUCode( "sRGBFragData.xyz = sRGBFragData.xyz * vec3( 0.454545f, 0.454545f, 0.454545f );\n" );
StrcatToALUCode( "sRGBFragData.xyz = exp( sRGBFragData.xyz );\n" );
StrcatToALUCode( "gl_FragData[0].xyz = mix( gl_FragData[0].xyz, sRGBFragData, flSRGBWrite );\n" );
}
if( m_iFragDataCount && bVertexShader )

4
togles/linuxwin/dxabstract.cpp

@ -1201,8 +1201,8 @@ static void FillD3DCaps9( const GLMRendererInfoFields &glmRendererInfo, D3DCAPS9 @@ -1201,8 +1201,8 @@ static void FillD3DCaps9( const GLMRendererInfoFields &glmRendererInfo, D3DCAPS9
pCaps->MaxPixelShader30InstructionSlots = 0;
#if DX_TO_GL_ABSTRACTION
pCaps->FakeSRGBWrite = !glmRendererInfo.m_hasGammaWrites;
pCaps->CanDoSRGBReadFromRTs = !glmRendererInfo.m_cantAttachSRGB;
pCaps->FakeSRGBWrite = true;//!glmRendererInfo.m_hasGammaWrites;
pCaps->CanDoSRGBReadFromRTs = true;//!glmRendererInfo.m_cantAttachSRGB;
pCaps->MixedSizeTargets = glmRendererInfo.m_hasMixedAttachmentSizes;
#endif
}

Loading…
Cancel
Save