D
dev_15
HI, Lookin at this code of mine i feel it could be better structured
as i seem to be checking
for Hi-res display twice. First i check for a square display, then
check for high res and load the appropriate image. If its not a square
display i again check for hi-res and load the appropriate images. Can
i reduce the number of if-else statements here or reorder it better
somehow.
if ( SQUARE == ortn ) {
if ( g_HIDPI_LogPixelsX >= 192 ) {
SetSquareLogo( IDR_SQUARE_HI );
}
else {
SetSquareLogo( IDR_SQUARE );
}
}
else {
if ( g_HIDPI_LogPixelsX >= 192 ) {
SetPortraitLogo( IDR_PORTRAIT_HI );
SetLandscapeLogo( IDR_LAND_HI );
}
else {
SetPortraitLogo( IDR_PORTRAIT );
SetLandscapeLogo( IDR_LAND );
}
}
as i seem to be checking
for Hi-res display twice. First i check for a square display, then
check for high res and load the appropriate image. If its not a square
display i again check for hi-res and load the appropriate images. Can
i reduce the number of if-else statements here or reorder it better
somehow.
if ( SQUARE == ortn ) {
if ( g_HIDPI_LogPixelsX >= 192 ) {
SetSquareLogo( IDR_SQUARE_HI );
}
else {
SetSquareLogo( IDR_SQUARE );
}
}
else {
if ( g_HIDPI_LogPixelsX >= 192 ) {
SetPortraitLogo( IDR_PORTRAIT_HI );
SetLandscapeLogo( IDR_LAND_HI );
}
else {
SetPortraitLogo( IDR_PORTRAIT );
SetLandscapeLogo( IDR_LAND );
}
}