Add more Display Resolutions
#1

Hello, I am trying add more resolutions to the game, I modified the following files without success...

 

In BackImageManager.h i change

#define DEF_CLIENT_SIZE_COUNT

 apparently there is nothing associated with this...

 

Add some res to eCLIENT_SIZE List

 

too add some res in BackImageManager.cpp inside

CBackImageManager::CBackImageManager()

 

And inside of

CBackImageManager::InIRead

 

And finally i add entries in Data/Etc/Settings.ini

But they do not appear in the system menu, i need change something else apart from what is already mentioned? like the Option_Game.xml or some other game file?

#2

// BackImageManager.h
enum eCLIENT_SIZE
{
eSIZE_800_600 = 0,
eSIZE_1024_768,
eSIZE_1152_864,
eSIZE_1280_720,
eSIZE_1280_800,
eSIZE_1280_960,
eSIZE_1280_1024,
eSIZE_1440_900,
eSIZE_1600_900,
eSIZE_1600_1200,
eSIZE_1680_1050,
eSIZE_1920_1200,
eSIZE_MAX
};

 

// Adapter.cpp (this is probably what you need)
static CResolution _areResolutions[] =
{
{ 640, 480 },
{ 800, 500 },
{ 800, 600 },
{ 1024, 768 },
{ 1152, 864 },
{ 1280, 720 },
{ 1280, 800 },
{ 1280, 960 },
{ 1280, 1024 }, // wide screen
{ 1440, 900 },
{ 1600, 900 },
{ 1600, 1200 },
{ 1680, 1050 }, // wide screen
{ 1920, 1200 }, // wide screen // [7/2/2010 rumist]
};

Pay attention, sometimes you may have problems during selection char if you change this ... be sure to make some tests! 

#3

But exemple if you add résolution 2560x1440 and if you screen are not adapted you cant see it 

#4


50 minutes ago, Scura said:





// BackImageManager.h
enum eCLIENT_SIZE
{
eSIZE_800_600 = 0,
eSIZE_1024_768,
eSIZE_1152_864,
eSIZE_1280_720,
eSIZE_1280_800,
eSIZE_1280_960,
eSIZE_1280_1024,
eSIZE_1440_900,
eSIZE_1600_900,
eSIZE_1600_1200,
eSIZE_1680_1050,
eSIZE_1920_1200,
eSIZE_MAX
};


 




// Adapter.cpp (this is probably what you need)
static CResolution _areResolutions[] =
{
{ 640, 480 },
{ 800, 500 },
{ 800, 600 },
{ 1024, 768 },
{ 1152, 864 },
{ 1280, 720 },
{ 1280, 800 },
{ 1280, 960 },
{ 1280, 1024 }, // wide screen
{ 1440, 900 },
{ 1600, 900 },
{ 1600, 1200 },
{ 1680, 1050 }, // wide screen
{ 1920, 1200 }, // wide screen // [7/2/2010 rumist]
};


Pay attention, sometimes you may have problems during selection char if you change this ... be sure to make some tests! 




Thank you very much! By the way, to fix problems with the character selection/creation scenario, you have to regulate the values of the Settings.ini file, and also define them in the source code, just in case, when I have the code finished, I'll share it on the forum^^

#5


15 minutes ago, nicolasg said:




Thank you very much! By the way, to fix problems with the character selection/creation scenario, you have to regulate the values of the Settings.ini file, and also define them in the source code, just in case, when I have the code finished, I'll share it on the forum^^




static CResolution _areResolutions[] =

Is probably what you were looking for! 

#6

Code to add some extra resolutions (My display is 1080 16:9, so i just add some ones below 1920x1080)

In nov source:

BackImageManager.h Lines 18~46

enum eCLIENT_SIZE
    {
        eSIZE_800_600  = 0,
        eSIZE_1024_768,
        eSIZE_1152_864,
        eSIZE_1280_720, 
        eSIZE_1280_800, 
        eSIZE_1280_960, 
        eSIZE_1280_1024, 
        // NICOLASG MARK (MORE RESOLUTIONS)
            eSIZE_1360_768,
            eSIZE_1366_768,
        // NICOLASG MARK (MORE RESOLUTIONS)
        eSIZE_1440_900,  
        eSIZE_1600_900,  
        // NICOLASG MARK (MORE RESOLUTIONS)
            eSIZE_1600_1024,
            eSIZE_1600_1050,
        // NICOLASG MARK (MORE RESOLUTIONS)
        eSIZE_1600_1200,   
        eSIZE_1680_1050,
        // NICOLASG MARK (MORE RESOLUTIONS)
            eSIZE_1768_992,
            eSIZE_1920_1080,
        // NICOLASG MARK (MORE RESOLUTIONS)
        eSIZE_1920_1200,

        eSIZE_MAX
    };

 

BackImageManager.cpp Lines 28~90

{
    m_stResolution[eSIZE_800_600].nWidth    = 800; 
    m_stResolution[eSIZE_800_600].nHeight    = 600;

    m_stResolution[eSIZE_1024_768].nWidth    = 1024;
    m_stResolution[eSIZE_1024_768].nHeight    = 768;
    
    m_stResolution[eSIZE_1152_864].nWidth    = 1152;
    m_stResolution[eSIZE_1152_864].nHeight    = 864; 
    
    m_stResolution[eSIZE_1280_720].nWidth    = 1280; 
    m_stResolution[eSIZE_1280_720].nHeight    = 720; 
    
    m_stResolution[eSIZE_1280_800].nWidth    = 1280; 
    m_stResolution[eSIZE_1280_800].nHeight    = 800; 
    
    m_stResolution[eSIZE_1280_960].nWidth    = 1280; 
    m_stResolution[eSIZE_1280_960].nHeight    = 960; 
    
    m_stResolution[eSIZE_1280_1024].nWidth  = 1280; 
    m_stResolution[eSIZE_1280_1024].nHeight = 1024; 

    // NICOLASG MARK (MORE RESOLUTIONS)
        m_stResolution[eSIZE_1360_768].nWidth  = 1360; 
        m_stResolution[eSIZE_1360_768].nHeight = 768;

        m_stResolution[eSIZE_1366_768].nWidth  = 1366; 
        m_stResolution[eSIZE_1366_768].nHeight = 768;
    // NICOLASG MARK (MORE RESOLUTIONS)
    
    m_stResolution[eSIZE_1440_900].nWidth    = 1440; 
    m_stResolution[eSIZE_1440_900].nHeight    = 900;  
    
    m_stResolution[eSIZE_1600_900].nWidth    = 1600; 
    m_stResolution[eSIZE_1600_900].nHeight    = 900;

    // NICOLASG MARK (MORE RESOLUTIONS)
        m_stResolution[eSIZE_1600_1024].nWidth    = 1600; 
        m_stResolution[eSIZE_1600_1024].nHeight    = 1024;

        m_stResolution[eSIZE_1600_1050].nWidth    = 1600; 
        m_stResolution[eSIZE_1600_1050].nHeight    = 1050;
    // NICOLASG MARK (MORE RESOLUTIONS)
    
    m_stResolution[eSIZE_1600_1200].nWidth  = 1600; 
    m_stResolution[eSIZE_1600_1200].nHeight = 1200; 
    
    m_stResolution[eSIZE_1680_1050].nWidth  = 1680; 
    m_stResolution[eSIZE_1680_1050].nHeight = 1050; 
    
    // NICOLASG MARK (MORE RESOLUTIONS)
        m_stResolution[eSIZE_1768_992].nWidth  = 1768; 
        m_stResolution[eSIZE_1768_992].nHeight = 992; 

        m_stResolution[eSIZE_1920_1080].nWidth  = 1920; 
        m_stResolution[eSIZE_1920_1080].nHeight = 1080; 
    // NICOLASG MARK (MORE RESOLUTIONS)
    
    m_stResolution[eSIZE_1920_1200].nWidth  = 1920; 
    m_stResolution[eSIZE_1920_1200].nHeight = 1200; 

    m_vecTexData.clear();
}

 

After Line 295 To 343

const int def_value[eSIZE_MAX][2] =
{
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
// NICOLASG MARK (MORE RESOLUTIONS)
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
{ 0, 0 },
// NICOLASG MARK (MORE RESOLUTIONS)
};

const char* def_value2[eSIZE_MAX][eSET_MAX] =
{
{ "18", "18", "18", "20", "3.4", "4" }, // 800x600
{ "18", "19", "18", "20", "3.4", "4" }, // 1024x768
{ "17", "19", "17", "20", "3.4", "4" }, // 1152x864
{ "17", "21", "17", "22", "3.4", "4" }, // 1280x720
{ "19", "22", "19", "22", "3.4", "4" }, // 1280x800
{ "17", "19", "17", "20", "3.4", "4" }, // 1280x960
{ "17", "18", "17", "19", "3.4", "4" }, // 1280x1024
// NICOLASG MARK (MORE RESOLUTIONS)
{ "18", "21", "18", "21", "3.4", "4" }, // 1360x768
{ "17", "18", "17", "19", "3.4", "4" }, // 1366x768
// NICOLASG MARK (MORE RESOLUTIONS)
{ "19", "21", "19", "22", "3.4", "4" }, // 1440x900
{ "19", "21", "19", "22", "3.4", "4" }, // 1600x900
// NICOLASG MARK (MORE RESOLUTIONS)
{ "17", "18", "17", "18", "3.4", "4" }, // 1600x1024
{ "17", "18", "17", "18", "3.4", "4" }, // 1600x1050 (Not shown in my display so i cannot confirm if its oks)
// NICOLASG MARK (MORE RESOLUTIONS)
{ "17", "19", "17", "19", "3.4", "4" }, // 1600x1200
{ "20", "21", "20", "22", "3.4", "4" }, // 1680x1050
// NICOLASG MARK (MORE RESOLUTIONS)
{ "19", "21", "19", "20", "3.4", "4" }, // 1768x992
{ "20", "21", "20", "20", "3.4", "4" }, // 1920x1080
// NICOLASG MARK (MORE RESOLUTIONS)
{ "20", "21", "20", "22", "3.4", "4" },
};

 

Adapter.cpp Lines 67~93

static CResolution _areResolutions[] =
{  
  /*{  640,  480 }, // NICOLASG MARK (MORE RESOLUTIONS)
  {  800,  500 },*/
  {  800,  600 },  
  { 1024,  768 },
  { 1152,  864 },
  { 1280,  720 },
  { 1280,  800 },
  { 1280,  960 },
  { 1280, 1024 },    // wide screen
  // NICOLASG MARK (MORE RESOLUTIONS)
    { 1360, 768},
    { 1366, 768},
  // NICOLASG MARK (MORE RESOLUTIONS)
  { 1440, 900  },
  { 1600, 900  },
  // NICOLASG MARK (MORE RESOLUTIONS)
    { 1600, 1024},
    { 1600, 1050},
  // NICOLASG MARK (MORE RESOLUTIONS)
  { 1600, 1200 },   
  { 1680, 1050  },    // wide screen
  // NICOLASG MARK (MORE RESOLUTIONS)
    { 1768, 992},
    { 1920, 1080},
  // NICOLASG MARK (MORE RESOLUTIONS)
  { 1920, 1200  },    // wide screen    //  [7/2/2010 rumist]
};

 

Data/Etc/Settings.ini

[GAP_1360_768]
x=0
y=0
create=18
select=21
mindis=18
maxdis=21
minheight=3.4
maxheight=4

[GAP_1366_768]
x=0
y=0
create=18
select=20.5
mindis=18
maxdis=21
minheight=3.4
maxheight=4

[GAP_1600_1024]
x=0
y=0
create=17
select=18
mindis=17
maxdis=18
minheight=3.4
maxheight=4

[GAP_1600_1050]
x=0
y=0
create=17
select=18
mindis=17
maxdis=18
minheight=3.4
maxheight=4

[GAP_1768_992]
x=0
y=0
create=19
select=21
mindis=19
maxdis=20
minheight=3.4
maxheight=4

[GAP_1920_1080]
x=0
y=0
create=20
select=21
mindis=20
maxdis=21
minheight=3.4
maxheight=4

 

By defining a resolution similar to the resolution of your monitor(On Fullscreen mode), probably the game changes resolution to lower one than your display on next startup. To solve this problem you can do the following:

 

Nksp.cpp Lines 112~136

static PIX _apixRes[][2] = {     
    /*640, 480, // NICOLASG MARK (MORE RESOLUTIONS)     
    800, 500,*/
    800, 600,     
    1024, 768,
    1152, 864,    
    1280, 800,
    1280, 960,    
    1280, 1024,
    // NICOLASG MARK (MORE RESOLUTIONS)
        1360, 768,
        1366, 768,
        1440, 900,
        1600, 900,
        1600, 1024,
        1600, 1050,
    // NICOLASG MARK (MORE RESOLUTIONS)
    1600, 1200,        
    // NICOLASG MARK (MORE RESOLUTIONS)
        1680, 1050,
        1768, 992,
        1920, 1080,
        1920, 1200,
    // NICOLASG MARK (MORE RESOLUTIONS)
};

 

And replace this function completely

void StartNewMode( enum GfxAPIType eGfxAPI, INDEX iAdapter, PIX pixSizeI, PIX pixSizeJ,
                                     enum DisplayDepth eColorDepth, BOOL bFullScreenMode)

With this other one

void StartNewMode( enum GfxAPIType eGfxAPI, INDEX iAdapter, PIX pixSizeI, PIX pixSizeJ,
                                     enum DisplayDepth eColorDepth, BOOL bFullScreenMode)
{
    CPrintF( TRANS("\n* START NEW DISPLAY MODE ...\n"));

    // clamp window size to screen size if in window mode

    // NICOLASG MARK (FIX MAX RES CHECK)
    PIX pixMaxSizeI;
    PIX pixMaxSizeJ;

    if (sam_bFullScreenActive == 1) // FullScreen
    {
        pixMaxSizeI = _pixDesktopWidth;
        pixMaxSizeJ = _pixDesktopHeight;
    }
    else // Window
    {
        pixMaxSizeI = _pixDesktopWidth - 1;
        pixMaxSizeJ = _pixDesktopHeight - 1;
    }

    /*PIX pixMaxSizeI = _pixDesktopWidth  - 1; // need 1st lower resolution than desktop    // NICOLASG MARK (FIX MAX RES CHECK)
    PIX pixMaxSizeJ = _pixDesktopHeight - 1;*/
    if( pixSizeI>pixMaxSizeI || pixSizeJ>pixMaxSizeJ) {
        extern void FindMaxResolution( PIX &pixSizeI, PIX &pixSizeJ);
        FindMaxResolution( pixMaxSizeI, pixMaxSizeJ);
        pixSizeI = pixMaxSizeI;
        pixSizeJ = pixMaxSizeJ;
    }

    // try to set the mode
    BOOL bSuccess = TryToSetDisplayMode( eGfxAPI, iAdapter, pixSizeI, pixSizeJ, eColorDepth, bFullScreenMode);

    // if failed
    if( !bSuccess)
    {
        // report failure and reset to default resolution
        _iDisplayModeChangeFlag = 2;  // failure
        CPrintF( TRANS("Requested display mode could not be set!\n"));
        pixSizeI = 640;
        pixSizeJ = 480;
        bFullScreenMode = TRUE;
        // try to revert to one of recovery modes
        for( INDEX iMode=0; iMode<ctDefaultModes; iMode++) {
            eColorDepth = (DisplayDepth)aDefaultModes[iMode][0];
            eGfxAPI     = (GfxAPIType)  aDefaultModes[iMode][1];
            iAdapter    =               aDefaultModes[iMode][2];
            CPrintF(TRANS("\nTrying recovery mode %d...\n"), iMode);
            bSuccess = TryToSetDisplayMode( eGfxAPI, iAdapter, pixSizeI, pixSizeJ, eColorDepth, bFullScreenMode);
            if( bSuccess) break;
        }
        // if all failed
        if( !bSuccess) {
            FatalError(TRANS(
                "Cannot set display mode!\n"
                "Last Chaos was unable to find display mode with hardware acceleration.\n"
                "Make sure you install proper drivers for your video card as recommended\n"
                "in documentation and set your desktop to 16 bit (65536 colors).\n"
                "Please see ReadMe file for troubleshooting information.\n"));
        }

    // if succeeded
    } else {
        _iDisplayModeChangeFlag = 1;  // all ok
    }

    SE_Get_UIManagerPtr()->InitPos(0, 0, pixSizeI, pixSizeJ);

    // apply 3D-acc settings
    ApplyGLSettings(FALSE);

    // remember time of mode setting
    _tmDisplayModeChanged = _pTimer->GetRealTimeTick();
}

 

#7

pratically this answer resolve at 80% my question :


Quote



/index.php?/topic/15245-character-does-not-show-after-login-in-char-selection/&do=embed" style="height:387px;max-width:502px;">


Thank you for starting this topic /index.php?/profile/14423-nicolasg/&do=hovercard" data-mentionid="14423" href="/index.php?/profile/14423-nicolasg/" rel="">@nicolasg !!

#8


9 hours ago, Andrein95 said:




pratically this answer resolve at 80% my question :



Thank you for starting this topic /index.php?/profile/14423-nicolasg/&do=hovercard" data-mentionid="14423" href="/index.php?/profile/14423-nicolasg/" rel="">@nicolasg !!




that was the error i was talking about before !

#9

Please tell me how you configured these values for each resolution? I tried to adjust my resolution and I had everything very crooked.

[GAP_1920_1080]
x=0
y=0
create=20
select=21
mindis=20
maxdis=21
minheight=3.4
maxheight=4

How do I calculate them correctly?

#10


8 hours ago, OberonPh said:




Please tell me how you configured these values for each resolution? I tried to adjust my resolution and I had everything very crooked.


[GAP_1920_1080]
x=0
y=0
create=20
select=21
mindis=20
maxdis=21
minheight=3.4
maxheight=4


How do I calculate them correctly?




You can get an idea based on the others, but I think I remember that there is a hardcoded part, so you will have to define Settings.ini and then manually verify that the character is not too far behind or too far ahead...

p.s: But your resolution is 1920x1080 16:9? or are you trying to create more resolutions?



Forum Jump:


Users browsing this thread: 1 Guest(s)