Wolf3d Haven Forum

Please log in or register. Smile

Join the forum, it's quick and easy

Wolf3d Haven Forum

Please log in or register. Smile

Wolf3d Haven Forum

Would you like to react to this message? Create an account in a few clicks or log in to continue.
Wolf3d Haven Forum

A friendly Wolfenstein 3D community, about Wolfenstein 3D, the game that gave birth to first person shooters...


    change of border color

    Dark_wizzie
    Dark_wizzie
    I am Death Incarnate!
    I am Death Incarnate!


    Female
    Number of posts : 5120
    Age : 30
    Location : California, USA
    Job : Investor
    Hobbie : Computers, chess, computer chess, fashion, and philosophy
    Message : I made this forum when I was 13 High on Drugs
    Registration date : 2007-03-24

    change of border color Empty change of border color

    Post by Dark_wizzie Sun Apr 29, 2007 1:48 pm

    dome




    Code Editing Tutorials
    Recoloring the Screen Border




    In this tutorial you're going to learn how to change the screen border color. I'd like to thank Brian Rowan for the basic tutorial of this. You could say that this is HIS tutorial, I only pointed out where to find the lines necessary. This tutorial is especially written for people who are creating new status bars(like me). Ready? GO!

    There are 4 different values that can be set independently: The screen background color on the "Get Psyched!" screen(defined in WL_INTER.C), the border color while you're playing(defined in WL_GAME.C and WL_MENU.H) and the Intermission border color(defined in WL_INTER.C).

    Since the colors of the VWB_Bar are not using the normal palette but a decimal palette index, use the following colors if you'd like(for the brighter ones, just enter the color you'd like to use, minus 1 or more) and try to be creative with this. Just make sure it fits with your status bar, that's really important!

    Dark grey 29
    Purple
    191
    Mustard
    78
    Light blue
    141
    Dark blue
    157
    Dark red
    45
    Dark brown 221
    Cyan
    127
    Green
    111
    Purplish blue 174
    Black
    0

    Step 1. Open up WL_GAME.C and do a search for "DrawPlayBorderSides". Now you’ll see this:



    /*

    ===================

    =

    = DrawPlayBorderSides

    =

    = To fix window overwrites

    =

    ===================

    */



    void DrawPlayBorderSides (void)

    {

    int xl,yl;



    xl = 160-viewwidth/2;

    yl = (200-STATUSLINES-viewheight)/2;



    VWB_Bar (0,0,xl-1,200-STATUSLINES,127);

    VWB_Bar (xl+viewwidth+1,0,xl-2,200-STATUSLINES,127);



    VWB_Vlin (yl-1,yl+viewheight,xl-1,0);

    VWB_Vlin (yl-1,yl+viewheight,xl+viewwidth,125);

    }





    Now, for example, to use a grey border, use this:



    /*

    ===================

    =

    = DrawPlayBorderSides

    =

    = To fix window overwrites

    =

    ===================

    */



    void DrawPlayBorderSides (void)

    {

    int xl,yl;



    xl = 160-viewwidth/2;

    yl = (200-STATUSLINES-viewheight)/2;



    VWB_Bar (0,0,xl-1,200-STATUSLINES,29);

    VWB_Bar (xl+viewwidth+1,0,xl-2,200-STATUSLINES,29);



    VWB_Vlin (yl-1,yl+viewheight,xl-1,0);

    VWB_Vlin (yl-1,yl+viewheight,xl+viewwidth,29);

    }



    Step 2. We now need to draw the play border itself. Do a search for "DrawPlayBorder". There you see:



    /*

    ===================

    =

    = DrawPlayBorder

    =

    ===================

    */



    void DrawPlayBorder (void)

    {

    int xl,yl;



    VWB_Bar (0,0,320,200-STATUSLINES,127);



    xl = 160-viewwidth/2;

    yl = (200-STATUSLINES-viewheight)/2;

    VWB_Bar (xl,yl,viewwidth,viewheight,0);



    VWB_Hlin (xl-1,xl+viewwidth,yl-1,0);

    VWB_Hlin (xl-1,xl+viewwidth,yl+viewheight,125);

    VWB_Vlin (yl-1,yl+viewheight,xl-1,0);

    VWB_Vlin (yl-1,yl+viewheight,xl+viewwidth,125);

    VWB_Plot (xl-1,yl+viewheight,124);

    }



    Now, for example, to use a grey border, use this:



    /*

    ===================

    =

    = DrawPlayBorder

    =

    ===================

    */



    void DrawPlayBorder (void)

    {

    int xl,yl;



    VWB_Bar (0,0,320,200-STATUSLINES,29);



    xl = 160-viewwidth/2;

    yl = (200-STATUSLINES-viewheight)/2;

    VWB_Bar (xl,yl,viewwidth,viewheight,0);



    VWB_Hlin (xl-1,xl+viewwidth,yl-1,28);

    VWB_Hlin (xl-1,xl+viewwidth,yl+viewheight,28);

    VWB_Vlin (yl-1,yl+viewheight,xl-1,28);

    VWB_Vlin (yl-1,yl+viewheight,xl+viewwidth,28);

    VWB_Plot (xl-1,yl+viewheight,28);

    }



    See? It's not that hard. Now, you can just experiment a bit with this. Now, compile WL_GAME.C and close it. It's time to change both the Intermission screen and the "Get Psyched!" screen in one blow, OK?



    Step 3. Open up WL_INTER.C and do a search for ,127. Each time you find this, you should see:



    VWB_Bar (0,0,320,200-STATUSLINES,127);



    Then simply change the 127 with another color. Make sure it matches the color you used in WL_GAME.C(or not, whatever you want)!



    Step 4. Save and compile WL_INTER.C .



    However, we still need to tell the menu that the bottom of the statusbar's space is also the color we had in WL_GAME.C.

    Step 5. Open up WL_MENU.H and do a search for VIEWCOLOR. then you should see:



    #define VIEWCOLOR 0x7d



    Step 6. Change that to the EXACT color you used in WL_GAME.C and save.

    Step 7. Compile all edited files and link it all up. Now you have:



    A re-colored border;

    A re-colored intermission screen;

    A re-colored "Get Psyched!" screen.



    Again, this tutorial isn't really mine. I just edited it so that you can find all stuff you need quickly. However, credits go mostly to Brian Rowan. Thanks a million Brian, without you I would never have found it. I mean it.




    Wolf3d Haven
    Minute Logic Blog

      Current date/time is Fri Apr 26, 2024 10:07 am