• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Included in Build Improved Moon

Look for the definition of the variable showWindow.width which is used in battleinterface.c

Hook
you, sir, are a scholar and a gentleman! xD

look at the upper left corner!
ENGINE 2017-12-01 18-23-51.jpg
 
The showWindow variable is defined and set in the LogInterface.c file. (It took me a while to find my Code::Blocks for the PotC code.)

In one version of the game I had to set tvused manually to get the compass round. Probably in COAS.

Hook
 
Code:
string widescreen = "";
    float screen_x = stf(showWindow.width);
    float screen_y = stf(showWindow.height);
    float screen_ratio = screen_x/screen_y;
    if(screen_ratio > 1.4){ widescreen = "\widescreen";}
    string moonpic = "weather\sun\glow" + widescreen + "\moonglowfull.tga";   //default in case moon state is not known
    switch (getMoonStateName(getMoonState())){
        case FULL_MOON:
            moonpic = "weather\sun\glow" + widescreen + "\moonglowfull.tga";
        break;
        case NEW_MOON:
            moonpic = "weather\sun\glow" + widescreen + "\moonglownew.tga";
        break;
        case QUARTER_ONE:
            moonpic = "weather\sun\glow" + widescreen + "\moonglowwaxc.tga";
        break;
        case QUARTER_TWO:
            moonpic = "weather\sun\glow" + widescreen + "\moonglowwax.tga";
        break;
        case QUARTER_THREE:
            moonpic = "weather\sun\glow" + widescreen + "\moonglowwan.tga";
        break;
        case QUARTER_FOUR:
            moonpic = "weather\sun\glow" + widescreen + "\moonglowwanc.tga";
        break;
    }
it works! xD so elegant :cool:
 
The showWindow variable is defined and set in the LogInterface.c file. (It took me a while to find my Code::Blocks for the PotC code.)

In one version of the game I had to set tvused manually to get the compass round. Probably in COAS.

Hook

Ha! Another good find. I took a moment to check where that comes from and see that the SetWindowSize event gets sent the width and height, which through another call, will set those showWindow.width/.height attributes. That event is kicked off in the engine, found the source for it, and sure enough, it passes the .Width and .Height of the DirectX viewport dimensions.

Nice work, this passes the exact same information as what would be found in the Render.screen_x, Render.screen_y attributes found in the later engine.
 
@Grey Roger, not only can I also confirm the moon texture switch works; I got it functioning for the spyglass too:
Code:
void setTelescopeInitParameters(ref rTelescope, aref arItmScope)
{
    string texName = "telescope.tga";
    float fZoom = 5.5;
    int nShowItm = 7;
    int activateTime = 500;
    int updateTime = 150; //KB spyglasses - orig 150. 

    if (CheckAttribute(arItmScope, "scope.texture")) texName = arItmScope.scope.texture;
    if (CheckAttribute(arItmScope, "scope.zoom")) fZoom = stf(arItmScope.scope.zoom);
    if (CheckAttribute(arItmScope, "scope.time_activate")) activateTime = sti(arItmScope.scope.time_activate);
    if (CheckAttribute(arItmScope, "scope.time_update")) updateTime = sti(arItmScope.scope.time_update);
    
    // ChezJfrey & PB: Automatic Switch -->
    string widescreen = "";
    float screen_x = stf(showWindow.width);
    float screen_y = stf(showWindow.height);
    float screen_ratio = screen_x/screen_y;
    if(screen_ratio > 1.4){ widescreen = "\\battle_interface\\widescreen\\";}
    texName = widescreen + texName;
    // ChezJfrey & PB: Automatic Switch <--

    SendMessage(rTelescope, "lsflll", MSG_TELESCOPE_SET_TYPE, texName, fZoom, nShowItm, activateTime, updateTime);
}
Was pretty easy in the end.

So might as well put that into the next update; and don't bother regular players with a superfluous question in the Installer EXE.
 
Are those the only textures affected by the switch between wide screen and normal? Or do any other textures change if you pick wide screen?

Don't forget that if the check on wide screen is now being handled like that, you'll also need to provide the extra texture files. This, of course, also means that everyone is installing twice as many texture files for spyglass and moon as they actually need.
 
Are those the only textures affected by the switch between wide screen and normal? Or do any other textures change if you pick wide screen?
Just those two.

Don't forget that if the check on wide screen is now being handled like that, you'll also need to provide the extra texture files. This, of course, also means that everyone is installing twice as many texture files for spyglass and moon as they actually need.
Technically true.
It's only 30 MB though.
 
Does anyone have a widescreen-adapted "SUNGLOW.TGA.tx" file; similar to the moon ones?
It seems I made an error in my modded install so that it does look for one, but it doesn't exist, making for horrid graphic glitches.
As far as I suspect, this issue may actually affect this release too:

Not good! :shock


From PROGRAM\Weather\Init\WhrInitValues.c :
Code:
    if (sti(Weathers.Sun.Glow.Enable) == true)
    {
        string widescreen = "";
        float screen_x = stf(showWindow.width);
        float screen_y = stf(showWindow.height);
        float screen_ratio = screen_x/screen_y;
        if(screen_ratio > 1.4){ widescreen = "\widescreen";}
        
        Weathers.Sun.Glow.Dist = 3500.0;
        Weathers.Sun.Glow.Size = 1250.0;
        Weathers.Sun.Glow.RotateSpeed = 1.0;
        Weathers.Sun.Glow.Texture = "weather\sun\glow" + widescreen + "\sunglow.tga";  // <-- was it a mistake to put this here...?
        Weathers.Sun.Glow.DecayTime = 8.0;
        Weathers.Sun.Glow.TechniqueNoZ = "sunglow_noz";
        Weathers.Sun.Glow.TechniqueZ = "sunglow_z";
        Weathers.Sun.Glow.Color = argb(0,255,255,255);
    }
 
Back
Top