From b8926362a5ab89c582bb71ee05543ac1244649b5 Mon Sep 17 00:00:00 2001 From: g-cont Date: Thu, 25 Oct 2018 00:00:00 +0300 Subject: [PATCH] 25 Oct 2018 --- engine/client/gl_image.c | 10 ++++++++-- engine/client/gl_studio.c | 2 +- engine/server/sv_client.c | 3 +++ mainui/basemenu.cpp | 14 ++++++++++++-- mainui/basemenu.h | 3 +++ mainui/menu_customgame.cpp | 2 +- mainui/menu_loadgame.cpp | 4 ++-- mainui/menu_savegame.cpp | 4 ++-- mainui/utils.cpp | 5 ++--- mainui/utils.h | 1 - 10 files changed, 34 insertions(+), 14 deletions(-) diff --git a/engine/client/gl_image.c b/engine/client/gl_image.c index 1e278e77..a97b2cd9 100644 --- a/engine/client/gl_image.c +++ b/engine/client/gl_image.c @@ -684,8 +684,8 @@ static void GL_SetTextureFormat( gl_texture_t *tex, pixformat_t format, int chan else if( haveAlpha ) { if( FBitSet( tex->flags, TF_ARB_16BIT ) || glw_state.desktopBitsPixel == 16 ) - tex->format = GL_LUMINANCE_ALPHA16F_ARB; - else tex->format = GL_LUMINANCE_ALPHA32F_ARB; + tex->format = GL_RG16F; + else tex->format = GL_RG32F; } else { @@ -2083,6 +2083,12 @@ void R_TextureList_f( void ) case GL_LUMINANCE_ALPHA32F_ARB: Con_Printf( "LA32F " ); break; + case GL_RG16F: + Con_Printf( "RG16F " ); + break; + case GL_RG32F: + Con_Printf( "RG32F " ); + break; case GL_RGB16F_ARB: Con_Printf( "RGB16F" ); break; diff --git a/engine/client/gl_studio.c b/engine/client/gl_studio.c index 703fdaa2..3ec7057d 100644 --- a/engine/client/gl_studio.c +++ b/engine/client/gl_studio.c @@ -1680,7 +1680,7 @@ void R_StudioDynamicLight( cl_entity_t *ent, alight_t *plight ) } } - if(( light.r + light.g + light.b ) < 32 ) // TESTTEST + if(( light.r + light.g + light.b ) < 16 ) // TESTTEST { colorVec gcolor; float grad[4]; diff --git a/engine/server/sv_client.c b/engine/server/sv_client.c index 19904253..68c20ade 100644 --- a/engine/server/sv_client.c +++ b/engine/server/sv_client.c @@ -1731,6 +1731,9 @@ static qboolean SV_Godmode_f( sv_client_t *cl ) return true; pEntity->v.flags = pEntity->v.flags ^ FL_GODMODE; + if( pEntity->v.takedamage == DAMAGE_AIM ) + pEntity->v.takedamage = DAMAGE_NO; + else pEntity->v.takedamage = DAMAGE_AIM; if( !FBitSet( pEntity->v.flags, FL_GODMODE )) SV_ClientPrintf( cl, "godmode OFF\n" ); diff --git a/mainui/basemenu.cpp b/mainui/basemenu.cpp index 735575d5..d7da1ac1 100644 --- a/mainui/basemenu.cpp +++ b/mainui/basemenu.cpp @@ -58,9 +58,10 @@ int uiColorWhite = 0xFFFFFFFF; // 255, 255, 255, 255 // useful for bitmaps int uiColorDkGrey = 0xFF404040; // 64, 64, 64, 255 // shadow and grayed items int uiColorBlack = 0xFF000000; // 0, 0, 0, 255 // some controls background int uiColorConsole = 0xFFF0B418; // just for reference +int uiColorSelect = 0xFF503818; // 80, 56, 24, 255 // color presets (this is nasty hack to allow color presets to part of text) -const int g_iColorTable[8] = +int g_iColorTable[8] = { 0xFF000000, // black 0xFFFF0000, // red @@ -68,7 +69,7 @@ const int g_iColorTable[8] = 0xFFFFFF00, // yellow 0xFF0000FF, // blue 0xFF00FFFF, // cyan -0xFFF0B418, // dialog or button letters color +0xFFF0B418, // INPUT_TEXT_COLOR 0xFFFFFFFF, // white }; @@ -1424,6 +1425,10 @@ void UI_ApplyCustomColors( void ) { UI_ParseColor( pfile, &uiColorConsole ); } + else if( !stricmp( token, "SELECT_TEXT_COLOR" )) + { + UI_ParseColor( pfile, &uiColorSelect ); + } } int r, g, b; @@ -1431,6 +1436,11 @@ void UI_ApplyCustomColors( void ) UnpackRGB( r, g, b, uiColorConsole ); ConsoleSetColor( r, g, b ); + // replace some colors in table (key controls) + g_iColorTable[3] = uiPromptFocusColor; + g_iColorTable[6] = uiInputTextColor; + + FREE_FILE( afile ); } diff --git a/mainui/basemenu.h b/mainui/basemenu.h index e653249c..4730fe6b 100644 --- a/mainui/basemenu.h +++ b/mainui/basemenu.h @@ -94,6 +94,8 @@ GNU General Public License for more details. #define ID_BACKGROUND 0 // catch warning on change this +#define EMPTY_SAVE_PIC "gfx\\lambda32" + // Generic types typedef enum { @@ -398,6 +400,7 @@ extern int uiPromptFocusColor; extern int uiInputTextColor; extern int uiInputBgColor; extern int uiInputFgColor; +extern int uiColorSelect; extern int uiColorWhite; extern int uiColorDkGrey; diff --git a/mainui/menu_customgame.cpp b/mainui/menu_customgame.cpp index 94c1d947..67907713 100644 --- a/mainui/menu_customgame.cpp +++ b/mainui/menu_customgame.cpp @@ -43,7 +43,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define TYPE_LENGTH 16 #define NAME_SPACE 4 #define NAME_LENGTH 32+TYPE_LENGTH -#define VER_LENGTH 6+NAME_LENGTH +#define VER_LENGTH 8+NAME_LENGTH #define SIZE_LENGTH 10+VER_LENGTH typedef struct diff --git a/mainui/menu_loadgame.cpp b/mainui/menu_loadgame.cpp index 323441df..75ad4696 100644 --- a/mainui/menu_loadgame.cpp +++ b/mainui/menu_loadgame.cpp @@ -279,10 +279,10 @@ static void UI_LoadGame_Ownerdraw( void *self ) sprintf( saveshot, "save/%s.bmp", uiLoadGame.saveName[uiLoadGame.savesList.curItem] ); if( !g_engfuncs.pfnFileExists( saveshot, TRUE )) - UI_DrawPicAdditive( x, y, w, h, uiColorWhite, "{GRAF001" ); + UI_DrawPicAdditive( x, y, w, h, uiColorWhite, EMPTY_SAVE_PIC ); else UI_DrawPic( x, y, w, h, uiColorWhite, saveshot ); } - else UI_DrawPicAdditive( x, y, w, h, uiColorWhite, "{GRAF001" ); + else UI_DrawPicAdditive( x, y, w, h, uiColorWhite, EMPTY_SAVE_PIC ); // draw the rectangle UI_DrawRectangle( item->x, item->y, item->width, item->height, uiInputFgColor ); diff --git a/mainui/menu_savegame.cpp b/mainui/menu_savegame.cpp index d329a0db..1fc3b24d 100644 --- a/mainui/menu_savegame.cpp +++ b/mainui/menu_savegame.cpp @@ -299,10 +299,10 @@ static void UI_SaveGame_Ownerdraw( void *self ) sprintf( saveshot, "save/%s.bmp", uiSaveGame.saveName[uiSaveGame.savesList.curItem] ); if( !g_engfuncs.pfnFileExists( saveshot, TRUE )) - UI_DrawPicAdditive( x, y, w, h, uiColorWhite, "{GRAF001" ); + UI_DrawPicAdditive( x, y, w, h, uiColorWhite, EMPTY_SAVE_PIC ); else UI_DrawPic( x, y, w, h, uiColorWhite, saveshot ); } - else UI_DrawPicAdditive( x, y, w, h, uiColorWhite, "{GRAF001" ); + else UI_DrawPicAdditive( x, y, w, h, uiColorWhite, EMPTY_SAVE_PIC ); // draw the rectangle UI_DrawRectangle( item->x, item->y, item->width, item->height, uiInputFgColor ); diff --git a/mainui/utils.cpp b/mainui/utils.cpp index 774b95e3..5f04b563 100644 --- a/mainui/utils.cpp +++ b/mainui/utils.cpp @@ -550,7 +550,6 @@ void UI_ScrollList_Draw( menuScrollList_s *sl ) int justify; int shadow; int i, x, y, w, h; - int selColor = 0xFF503818; // Red 80, Green 56, Blue 24, Alpha 255 int arrowWidth, arrowHeight, upX, upY, downX, downY; int upFocus, downFocus, scrollbarFocus; @@ -591,7 +590,7 @@ void UI_ScrollList_Draw( menuScrollList_s *sl ) if( i == sl->curItem ) { - UI_FillRect( sl->generic.x, y, sl->generic.width - arrowWidth, sl->generic.charHeight, selColor ); + UI_FillRect( sl->generic.x, y, sl->generic.width - arrowWidth, sl->generic.charHeight, uiColorSelect ); break; } } @@ -2172,7 +2171,7 @@ void UI_PicButton_Draw( menuPicButton_s *item ) if( item->generic.bPressed ) state = BUTTON_PRESSED; - if( item->generic.statusText && item->generic.flags & QMF_NOTIFY ) + if( item->generic.statusText && item->generic.flags & QMF_NOTIFY && !FBitSet( gMenu.m_gameinfo.flags, GFL_NOSKILLS )) { int charW, charH; int x, w; diff --git a/mainui/utils.h b/mainui/utils.h index e8275680..5c43a228 100644 --- a/mainui/utils.h +++ b/mainui/utils.h @@ -112,7 +112,6 @@ inline float RemapVal( float val, float A, float B, float C, float D) extern int ColorStrlen( const char *str ); // returns string length without color symbols extern int ColorPrexfixCount( const char *str ); -extern const int g_iColorTable[8]; extern void COM_FileBase( const char *in, char *out ); // ripped out from hlsdk 2.3 extern int UI_FadeAlpha( int starttime, int endtime ); extern void StringConcat( char *dst, const char *src, size_t size ); // strncat safe prototype