Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions BMPUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class CBMP
data = newData;
}

void RemapLogo( int stripes, const byte *rgb )
void RemapLogo( int stripes, const byte *rgb, bool horizontal = false )
{
// palette is always right after header
rgbquad_t *palette = GetPaletteData();
Expand Down Expand Up @@ -203,19 +203,19 @@ class CBMP
return;

const bmp_t *hdr = GetBitmapHdr();
double lines_per_stripe = hdr->height / (double)stripes;
const double cells_per_stripe = ( horizontal ? hdr->width : hdr->height ) / (double)stripes;
byte *data = GetTextureData();

for( int i = 0; i < hdr->height; i++ )
{
int stripe = (int)(( hdr->height - i - 1 ) / lines_per_stripe );

for( int j = 0; j < hdr->width; j++ )
{
byte c = data[i * hdr->width + j];
if( c == 0 )
continue;

int stripe = horizontal ? j / cells_per_stripe : ( hdr->height - i - 1 ) / cells_per_stripe;

// remap to the palette
int idx = ( c / 256.0f ) * max_palette_slots; // remap to limited palette
idx = (int)((double)( idx ) / stripes) * stripes; // now remap per palette
Expand Down
2 changes: 2 additions & 0 deletions BaseMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ cvar_t *ui_show_window_stack;
cvar_t *ui_borderclip;
cvar_t *ui_prefer_won_background;
cvar_t *ui_background_stretch;
cvar_t *ui_logohorizontal;

uiStatic_t uiStatic;
static CMenuEntry *s_pEntries = NULL;
Expand Down Expand Up @@ -1157,6 +1158,7 @@ void UI_Init( void )
ui_borderclip = EngFuncs::CvarRegister( "ui_borderclip", "0", FCVAR_ARCHIVE );
ui_prefer_won_background = EngFuncs::CvarRegister( "ui_prefer_won_background", "0", FCVAR_ARCHIVE );
ui_background_stretch = EngFuncs::CvarRegister( "ui_background_stretch", "0", FCVAR_ARCHIVE );
ui_logohorizontal = EngFuncs::CvarRegister( "ui_logohorizontal", "0", FCVAR_ARCHIVE );

// show cl_predict dialog
EngFuncs::CvarRegister( "menu_mp_firsttime2", "1", FCVAR_ARCHIVE );
Expand Down
1 change: 1 addition & 0 deletions BaseMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ extern cvar_t *ui_show_window_stack;
extern cvar_t *ui_borderclip;
extern cvar_t *ui_prefer_won_background;
extern cvar_t *ui_background_stretch;
extern cvar_t *ui_logohorizontal;

enum EUISounds
{
Expand Down
4 changes: 2 additions & 2 deletions controls/ColorPicker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ void CMenuColorPicker::VidInit()
{
CMenuBaseItem::VidInit();

const int hueW = 20;
const int gap = 6;
const int hueW = 20 * uiStatic.scaleX;
const int gap = 6 * uiStatic.scaleX;

int side = Q_min( m_scSize.w - hueW - gap, m_scSize.h );

Expand Down
1 change: 1 addition & 0 deletions controls/Field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ bool CMenuField::KeyDown( int key )
if( iCursor > len )
iCursor = len;
}
else handled = false;
}
else handled = false;
}
Expand Down
2 changes: 1 addition & 1 deletion dictgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def process_file(name):
trans = []

# TODO: dumb! It can't find multilines
with open(name, "r") as f:
with open(name, "r", encoding='utf-8') as f:
for line in f.readlines():
trans += re.findall(TRANSLATABLE_PATTERN, line)

Expand Down
Loading