DieHard Wolfers Forum Index DieHard Wolfers
A Wolfenstein 3d Fan Community


  Hosted by: MCS & Areyep.com - Designed by: BrotherTank

Original Yahoo Forum - Die Hard Archives

AReyeP HomepageAreyep Homepage DieHard Wolfenstein BunkerDieHard Wolfenstein Bunker Log inLog in RegisterRegister Banlist FAQFAQ Search ForumsSearch

  Username:    Password:      Remember me       

[help] different door sides in SDL
Page 1 of 1
DieHard Wolfers Forum Index -> SDL Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page BottomView Next Topic
Post new topicReply to topic
Author Message
Metalor
DieHard Mutant
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 10:27 ago.

Topics: 95
Posts: 913
Location: California
usa.gif

PostPosted: Sat Dec 13, 2008 4:55 pm
   Subject: [help] different door sides in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

How do you set up the different doorsides tutorial inside SDL? I tried using the original, but there were functions that wouldn't exactly agree with the SDL code.

I need this, because I added several doors that require different door sides than what is included with the original lot.

_________________
- Taking a hiatus from Wolfenstein for a while...

...But I'll be back, you can count on it!
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 13:30 ago.

Topics: 167
Posts: 8451
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Sat Dec 13, 2008 7:21 pm
   Subject: Re: [help] different door sides in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

You might try using the WolfDX code as a guide. I've fixed several bugs in it since then, but the door sides code will do what you need it to. Smile
Metalor
DieHard Mutant
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 10:27 ago.

Topics: 95
Posts: 913
Location: California
usa.gif

PostPosted: Sat Dec 13, 2008 9:40 pm
   Subject: Re: [help] different door sides in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Okay, I'll take a look post-haste!

_________________
- Taking a hiatus from Wolfenstein for a while...

...But I'll be back, you can count on it!
Metalor
DieHard Mutant
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 10:27 ago.

Topics: 95
Posts: 913
Location: California
usa.gif

PostPosted: Sat Dec 13, 2008 9:49 pm
   Subject: Re: [help] different door sides in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Just tried it, works like a charm! Much appreciated!

_________________
- Taking a hiatus from Wolfenstein for a while...

...But I'll be back, you can count on it!
ZuljinRaynor
DieHard Officer
DieHard Officer


Joined: 17 Jan 2004
Last Visit: 30 May 2018

Topics: 19
Posts: 559

usa.gif

PostPosted: Sat Aug 14, 2010 2:40 pm
   Subject: Re: [help] different door sides in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Once again, sorry for bumping old threads, but this is the last feature I need to port into my SDL code to get it and my DOS code to be the same. I looked at the WOLF DX code but I didn't see any differences between the default WL_DRAW.CPP and the WolfDX one in the HitVertWall and HitHorzWall parts of the code so I don't know what exactly is done.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 13:30 ago.

Topics: 167
Posts: 8451
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Sat Aug 14, 2010 6:31 pm
   Subject: Re: [help] different door sides in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

If I have the filename right, all the doorside settings are in WL_GAMESETTINGS.H. BrotherTank specifically had most everything set up from this file, such as settings for Tile Mirrors, Wall Patches, Guard Blocks, and so on. As for what exactly BT did in the code, I still haven't completely figured it out. But it has something to do with how TILEMAP is constructed in memory, stored, and read in the code. He uses a very different technique than the DOS-based 90 Walls Code we've seen in other user's tutorials. Confused
ZuljinRaynor
DieHard Officer
DieHard Officer


Joined: 17 Jan 2004
Last Visit: 30 May 2018

Topics: 19
Posts: 559

usa.gif

PostPosted: Sun Aug 15, 2010 11:44 am
   Subject: Re: [help] different door sides in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Then I must be looking at the wrong files. I was looking to the BunkerSDL code and couldn't find it and the Wolf DX code I got, which was from the Dome, doesn't have a WL_GAMESETTINGS.H file. Could you get me a link to the source? The one link I saw for the BunkerSDL code was a 404. Sad
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 13:30 ago.

Topics: 167
Posts: 8451
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Sun Aug 15, 2010 6:35 pm
   Subject: Re: [help] different door sides in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

You might try BT's MMC code.
ZuljinRaynor
DieHard Officer
DieHard Officer


Joined: 17 Jan 2004
Last Visit: 30 May 2018

Topics: 19
Posts: 559

usa.gif

PostPosted: Tue Aug 17, 2010 8:39 am
   Subject: Re: [help] different door sides in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

No luck. :/

Edit:

I figured it out. I only copied that huge block which had the switches and tile hits from the DOS version of the code and then defined byte tile; and it worked.

I'll post my code, just in case I might have made some mistake, and although it works, it could work better. Razz


::: CODE :::
/*
====================
=
= HitVertWall
=
= tilehit bit 7 is 0, because it's not a door tile
= if bit 6 is 1 and the adjacent tile is a door tile, use door side pic
=
====================
*/

void HitVertWall (void)
{
    int wallpic;
    int texture;
   byte tile;

    texture = ((yintercept+texdelta)>>TEXTUREFROMFIXEDSHIFT)&TEXTUREMASK;
    if (xtilestep == -1)
    {
        if(tilehit!=TRUCKTILE1 && tilehit!=TRUCKTILE2) texture = TEXTUREMASK-texture;
        xintercept += TILEGLOBAL;
    }

    if(lastside==1 && lastintercept==xtile && lasttilehit==tilehit && !(lasttilehit & 0x40))
    {
        if((pixx&3) && texture == lasttexture)
        {
            ScalePost();
            postx = pixx;
            wallheight[pixx] = wallheight[pixx-1];
            return;
        }
        ScalePost();
        wallheight[pixx] = CalcHeight();
        postsource+=texture-lasttexture;
        postwidth=1;
        postx=pixx;
        lasttexture=texture;
        return;
    }

    if(lastside!=-1) ScalePost();

    lastside=1;
    lastintercept=xtile;
    lasttilehit=tilehit;
    lasttexture=texture;
    wallheight[pixx] = CalcHeight();
    postx = pixx;
    postwidth = 1;

      if (tilehit & 0x40)
      {                        // check for adjacent doors
         ytile = yintercept>>TILESHIFT;
         tile = tilemap[xtile-xtilestep][ytile];
         if (tile & 0x80)
         {
            switch(doorobjlist[tile & 0x7f].lock)
            {
          case dr_rusted:
                  wallpic = DOORWALL+17;
                  break;
               case dr_wooden:
                  wallpic = DOORWALL+21;
                  break;
               case dr_normal:
               case dr_lock1:
               case dr_lock2:
               case dr_lock3:
               case dr_lock4:
               case dr_elevator: 
               default:
                  wallpic = DOORWALL+3;
                  break;
            }
         }
         else
            wallpic = vertwall[tilehit & ~0x40];
      }
      else
         wallpic = vertwall[tilehit];

    postsource = PM_GetTexture(wallpic) + texture;
}


/*
====================
=
= HitHorizWall
=
= tilehit bit 7 is 0, because it's not a door tile
= if bit 6 is 1 and the adjacent tile is a door tile, use door side pic
=
====================
*/

void HitHorizWall (void)
{
    int wallpic;
    int texture;
   byte tile;

    texture = ((xintercept+texdelta)>>TEXTUREFROMFIXEDSHIFT)&TEXTUREMASK;
    if (ytilestep == -1)
        yintercept += TILEGLOBAL;
    else if(tilehit!=TRUCKTILE1 && tilehit!=TRUCKTILE2)
        texture = TEXTUREMASK-texture;

    if(lastside==0 && lastintercept==ytile && lasttilehit==tilehit && !(lasttilehit & 0x40))
    {
        if((pixx&3) && texture == lasttexture)
        {
            ScalePost();
            postx=pixx;
            wallheight[pixx] = wallheight[pixx-1];
            return;
        }
        ScalePost();
        wallheight[pixx] = CalcHeight();
        postsource+=texture-lasttexture;
        postwidth=1;
        postx=pixx;
        lasttexture=texture;
        return;
    }

    if(lastside!=-1) ScalePost();

    lastside=0;
    lastintercept=ytile;
    lasttilehit=tilehit;
    lasttexture=texture;
    wallheight[pixx] = CalcHeight();
    postx = pixx;
    postwidth = 1;

      if (tilehit & 0x40)
      {                        // check for adjacent doors
         xtile = xintercept>>TILESHIFT;
         tile = tilemap[xtile][ytile-ytilestep];
         if(tile & 0x80)
         {
            switch(doorobjlist[tile & 0x7f].lock)
            {
          case dr_rusted:
                  wallpic = DOORWALL+16;
                  break;
               case dr_wooden:
                  wallpic = DOORWALL+20;
                  break;
               case dr_normal:
               case dr_lock1:
               case dr_lock2:
               case dr_lock3:
               case dr_lock4:
               case dr_elevator: 
               default:
                  wallpic = DOORWALL+2;
                  break;
            }
         }
         else
            wallpic = horizwall[tilehit & ~0x40];
      }
      else
         wallpic = horizwall[tilehit];


    postsource = PM_GetTexture(wallpic) + texture;
}
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 13:30 ago.

Topics: 167
Posts: 8451
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Tue Aug 17, 2010 7:20 pm
   Subject: Re: [help] different door sides in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

ZuljinRaynor, if you removed these lines:
::: CODE :::
case dr_normal:
               case dr_lock1:
               case dr_lock2:
               case dr_lock3:
               case dr_lock4:
               case dr_elevator:
from both routines, wouldn't you get the same result? Confused
ZuljinRaynor
DieHard Officer
DieHard Officer


Joined: 17 Jan 2004
Last Visit: 30 May 2018

Topics: 19
Posts: 559

usa.gif

PostPosted: Tue Aug 17, 2010 8:32 pm
   Subject: Re: [help] different door sides in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Yeah, but I like naming cases over just using default. :p
RichterBelmont12
DieHard Wolfer
DieHard Wolfer


Joined: 14 Aug 2004
Last Visit: 24 Sep 2019

Topics: 98
Posts: 1524
Location: New Jersey
usa.gif

PostPosted: Wed Aug 18, 2010 4:40 pm
   Subject: Re: [help] different door sides in SDL
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

I did This For Project: X I've Released The Source Code for it You can Take a look at it if you want too

_________________
http://www.youtube.com/RichterBelmont12

https://www.facebook.com/RichterBelmont123

https://twitter.com/Richterbelmont6
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> SDL Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page TopView Next Topic
Page 1 of 1
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts [help] Adding teleporters in wolf4sdl
Author: Mortimer
35 15139 Fri May 26, 2017 8:19 am
Military View latest post
No new posts [WOLF4SDL Help] Blake Stone Style doors
Author: Haasboy
3 3765 Sun Jul 20, 2008 7:56 am
Haasboy View latest post
No new posts [Help] Problem with Checkweaponchange function (wolf4sdl)
Author: Mortimer
4 4040 Sat May 17, 2008 11:26 am
Mortimer View latest post
No new posts [help] Wolf4sdl's implemented tutorials
Author: Mortimer
6 4316 Tue May 06, 2008 1:15 pm
Ripper View latest post
No new posts [SDL] Apply 2nd ScaleFactor to selected (hi-res) vga gfx
Author: Andy_Nonymous
9 5916 Sun Apr 27, 2008 2:30 am
AlumiuN View latest post
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
   You cannot delete your posts in this forum
You cannot vote in polls in this forum


Copyright ©2003-2008 DieHard Wolfers
A Modified subBunker Theme by BrotherTank
Powered by phpBB © 2001, 2005 phpBB Group