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       

[Tutorial] Multi-textured floors
Page 8 of 8 Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8
DieHard Wolfers Forum Index -> Code Tutorials 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
Codetech84
Code Master
Code Master


Joined: 12 Mar 2003
Last Visit: 15 Oct 2017

Topics: 22
Posts: 1281
Location: Rauma - Finland
finland.gif

PostPosted: Wed Oct 25, 2006 10:48 am
   Subject: Re: [Tutorial] Multi-textured floors
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

I'm working on something that might help this situation, but there's still a minor glitch to it.
I used an elaborate method to cache the last 4 calls to prevent useless PM_GetPage calls.

_________________
Click here to visit KFH Games website!
*UPDATED* Spear of Destiny Reloaded
KFH Games on Facebook
lwmxynedtodth
DieHard Officer
DieHard Officer


Joined: 28 May 2006
Last Visit: 22 Aug 2017

Topics: 38
Posts: 570
Location: Neverland
netherlands.gif

PostPosted: Wed Oct 25, 2006 11:55 am
   Subject: Re: [Tutorial] Multi-textured floors
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hmm, sounds great. Like a way of caching. I'm currently just getting my framerate higher, I think much pageloads
aren't needed, because after the load it is overwritten by another texture. The sad thing is, I'm pushing the engines to its limits, and I think it is going to end soon. And I even haven't programmed my dynamic lights!

- lwmxynedtodth

EDIT: If you want to, can you post or pm that pageload counter? I want to do some benchmarking.

_________________
lwmxynedtodth (portfolio, blog and more)
Killer-suit: Masterminds
On a MMORPG trip.
Codetech84
Code Master
Code Master


Joined: 12 Mar 2003
Last Visit: 15 Oct 2017

Topics: 22
Posts: 1281
Location: Rauma - Finland
finland.gif

PostPosted: Thu Nov 16, 2006 1:12 am
   Subject: Re: [Tutorial] Multi-textured floors
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

lwmxynedtodth wrote:
EDIT: If you want to, can you post or pm that pageload counter? I want to do some benchmarking.

Sure, my version uses an enhanced Console I had in Wolfenstein Reloaded, that can use parameters like %i, %s inside the message, I have no problem releasing it, but I would like to keep this simple. It can also be applied to score box (or any variable you can monitor), and I think I'll apply it there. First off, you need to PM me your DrawFlats routine, I'll modify it to display the benchmarks in the score variable (or any variable of your choice) and post it here. It should be done this way to save forum space and to avoid confusion of having two more DrawFlat routines here.

_________________
Click here to visit KFH Games website!
*UPDATED* Spear of Destiny Reloaded
KFH Games on Facebook
insurrectionman
DieHard Mutant
DieHard Mutant


Joined: 07 May 2005
Last Visit: 09 Dec 2017

Topics: 86
Posts: 752
Location: Wisconsin
usa.gif

PostPosted: Wed Jan 03, 2007 7:46 pm
   Subject: Re: [Tutorial] Multi-textured floors
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I have multi ceilings\floors in DOOMLOH, and I still have to use the USE_TEX function which is useless when using 3rd plane method. I was wondering how I can keep textured floors\ceilings active without the use of USE_TEX.

_________________
I'm back! I missed this community!
Youtube Channel: TreeSapThief

New Site: http://www.treesapthief.com
Twitter: @treesapthief
the_fish
Bring 'em On
Bring 'em On


Joined: 18 Nov 2006
Last Visit: 07 Nov 2008

Topics: 12
Posts: 133
Location: England
uk.gif

PostPosted: Fri Jan 05, 2007 1:56 pm
   Subject: [Tutorial] Multi-textured floors
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

If you're using the 3rd plane method for every level, you don't need to alter the array with USE_TEX in at all (can't remember what it's called - it might even be safe to delete it if you need the space, can't think what else it might be used for).

Look at the ThreeDRefresh function (in WL_DRAW) - I think there's an if/switch block that checks said array for the USE_TEX bit - just remove this block and make it always call DrawFlats() regardless of the level.

Unless you plan on having gaps in the texture flats where the ceiling/floor colour would peek through, you can probably comment out the VGAClearScreen call as well to increase your framerate, though if this causes problems then put it back.

the_fish
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

Topics: 153
Posts: 2256
Location: Ontario
canada.gif

PostPosted: Fri Jan 05, 2007 3:10 pm
   Subject: Re: [Tutorial] Multi-textured floors
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Do NOT remove the VGAClearScreen call.
It causes problems... Big Problems with the drawing effect of both the floor and ceiling tiles.
For using the 3rd plane to control the ceiling/floor textures, just enter or adjust the code as Adam has given in his tutorial and then use either WDC or ChaosEdit to edit your maps. In both cases you will have to create a whole new set of defines (like you have for walls and sprites) - Starting with 0 as the first id. Then, you can remove the USE_TEX defines, but make sure you still include the ceiliing colours array and at worst, make all the colours black. And if you use Adam's HighBit-LowBit tutorial, then you can define both values using the 3rd plane only. You may have to search for the information on enabling the 3rd plane (if it's not part of Adams tutorial - as I don't have it in front of me right now to check)... If it's missing, just click on the search link above that I have provided.

One trick that I don't think anyone has mentioned is that if you play with the DrawFlats routine you can actually use the "FF" or colour # 256 - the transparency to your advantage. What you can do is create textures with blank sections using the transparency and the colour painted with the VGAClearScreen will show through.

Greg
BrotherTank
insurrectionman
DieHard Mutant
DieHard Mutant


Joined: 07 May 2005
Last Visit: 09 Dec 2017

Topics: 86
Posts: 752
Location: Wisconsin
usa.gif

PostPosted: Fri Jan 05, 2007 5:35 pm
   Subject: Re: [Tutorial] Multi-textured floors
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hmm... Interesting BrotherTank, I unfortunately don't know of Adam's texture tutorials, I just probably just don't recognize them.

I see your transparent idea. Would that work for textured ceilings and make it look like a hole in the ceiling and you could possibly see the sky through it? It would make my next mod a little more atmospheric and realistic.

_________________
I'm back! I missed this community!
Youtube Channel: TreeSapThief

New Site: http://www.treesapthief.com
Twitter: @treesapthief
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 12 Dec 2017

Topics: 46
Posts: 2291
Location: USA
usa.gif

PostPosted: Fri Jan 05, 2007 5:36 pm
   Subject: Re: [Tutorial] Multi-textured floors
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Yeah VGAClearScreen is definitely a keeper there, especially if you want to give players the ability to turn off flat textures.
Just a minor correction: 0xff = color #255 (not 256)

_________________
Orb of Dilaaria now has a Facebook page
Star Wars: Bloodlines now has a Facebook page
insurrectionman
DieHard Mutant
DieHard Mutant


Joined: 07 May 2005
Last Visit: 09 Dec 2017

Topics: 86
Posts: 752
Location: Wisconsin
usa.gif

PostPosted: Fri Jan 05, 2007 5:49 pm
   Subject: Re: [Tutorial] Multi-textured floors
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

I do have that ability, and I have to put shading it the vgaclearscreen function because the vga color doesn't look good without shading. And I have to use the vgaCeiling array for the different colored floors, because grey doesn't match with green walls, or red walls. Adam, where are your tutorials located, I've never seen them before or probably never recognized them as yours.

_________________
I'm back! I missed this community!
Youtube Channel: TreeSapThief

New Site: http://www.treesapthief.com
Twitter: @treesapthief
BrotherTank
Forum Administrator
<B>Forum Administrator</B>


Joined: 01 Mar 2003
Last Visit: 13 Sep 2017

Topics: 153
Posts: 2256
Location: Ontario
canada.gif

PostPosted: Fri Jan 05, 2007 5:55 pm
   Subject: Re: [Tutorial] Multi-textured floors
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Click on either the coding section or the Tutorials section... look for the first post in the list of either... it lists the major tutorials that are working and available on the board - complete with links.

The other way is to search using the search button or click on the highlighted link text in my last post as i used the new [ search ] bbcode... it will search for all posts with the highlighted text in the posts.

Greg
Brother Tank Tank
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 12 Dec 2017

Topics: 46
Posts: 2291
Location: USA
usa.gif

PostPosted: Fri Jan 05, 2007 5:59 pm
   Subject: Re: [Tutorial] Multi-textured floors
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

If you don't find it, I believe it's also in the WDC help file.

_________________
Orb of Dilaaria now has a Facebook page
Star Wars: Bloodlines now has a Facebook page
the_fish
Bring 'em On
Bring 'em On


Joined: 18 Nov 2006
Last Visit: 07 Nov 2008

Topics: 12
Posts: 133
Location: England
uk.gif

PostPosted: Sat Jan 06, 2007 2:58 pm
   Subject: [Tutorial] Multi-textured floors
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Oops, removing VGAClearScreen works fine in my 4GW mod - guess it might have different effects with other versions of the source code.

If you're using 4GW as a base, removing VGAClearScreen works fine. Honestly. I've tested it. (Gives me an extra 10fps too.)
Anonymous
Guest



Last Visit:





PostPosted: Mon Jul 23, 2007 3:36 pm
   Subject: Re: [Tutorial] Multi-textured floors
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Yeah the floor works but the ceiling is all messed up (random colors) What do I do?

EDIT : THe PushWalls() part in my WL_ACT1 isnt there.
Rux
DieHard Guard
DieHard Guard


Joined: 17 Dec 2006
Last Visit: 15 Nov 2015

Topics: 34
Posts: 202
Location: Port Angeles, WA
usa.gif

PostPosted: Sat Apr 05, 2008 10:24 pm
   Subject: [Help] Multi-Textured Floors / Ceilings
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

OK, so I followed Adam Biser's kickass multi-textured floors and ceilings tutorial and it works great, save for two things.

1.) Anytime a textured ceiling created using the third plane enters the screen, the game crashes and closes without any errors. RAWR. I went back and made sure I followed the tutorial to the letter, so there must be some conflict in my DrawFlats routine... but I am unsure how to fix it.

2.) The edges of the floor tiles are buggy... The edges of another tile's texture stick out! There is a slight work around - I can draw plane 3 on top of the walls to cover up the edges, but I would be more happy with a code fix... (I think I have OCD, you see Mad) I can't explain it that well, so here are a couple screenshots...



This is one of the final major features I need in my mod, so I would be ecstatic if someone would shed some light on a fix for this Smile. Thanks in advance

ARC

P.S. - Before you post a pointless message telling me to use the Search here, or to go redo the tutorial, I'm telling you now that I did. For a long time, and more than twice, both searching, and running through the tutorial and every page in it.

_________________
Like Metroid? Like fangames? Like top-down games? Like FUN? Head over to www.metroidcoven.com and check out my game called Metroid: Coven.
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 12 Dec 2017

Topics: 46
Posts: 2291
Location: USA
usa.gif

PostPosted: Sun Apr 06, 2008 12:52 am
   Subject: Re: [Tutorial] Multi-textured floors
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

It was better, here, in my opinion, so I moved it here.

1) Definitely check over your code. Make sure your images are in the VSWAP, too.

2) Try using
::: CODE :::
dist=((heightnumerator/(y+1))<<5)
instead of
::: CODE :::
dist=(heightnumerator/y)<<5

Doesn't fix it, but makes it better, but not perfect, if I remember correctly. So adding the plane 3 values on the walls is the best way to eliminate the problem I think.

_________________
Orb of Dilaaria now has a Facebook page
Star Wars: Bloodlines now has a Facebook page
doomjedi
DieHard Wolfer
DieHard Wolfer


Joined: 21 Jul 2006
Last Visit: 13:42 ago.

Topics: 104
Posts: 2757
Location: Israel
israel.gif

PostPosted: Sun Apr 06, 2008 7:32 am
   Subject: Re: [Tutorial] Multi-textured floors
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Veeery nice idea for walls, especially for such a project theme...looks great. Smile Smile Smile

...I've thought of that idea too, but didn't want such walls to fit nightsky only, as I have 3 skies in Sonder...and making a variation for each sky is too messy. Also such fences very far less popular in concentration camps.

It's nice to have 2 mods with the same theme - but such different and unique visuals each.
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 12 Dec 2017

Topics: 46
Posts: 2291
Location: USA
usa.gif

PostPosted: Sun Apr 06, 2008 9:25 am
   Subject: Re: [Tutorial] Multi-textured floors
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

If you want more helpful suggestions for #1, you'll need to give us some more information. ie: How are you using plane 3? What value does it have when it should have a ceiling texture? Have you tried other plane 3 values to see if it makes a difference? And if all else fails, you could post your code here, too.

_________________
Orb of Dilaaria now has a Facebook page
Star Wars: Bloodlines now has a Facebook page
Rux
DieHard Guard
DieHard Guard


Joined: 17 Dec 2006
Last Visit: 15 Nov 2015

Topics: 34
Posts: 202
Location: Port Angeles, WA
usa.gif

PostPosted: Sun Apr 06, 2008 11:23 am
   Subject: [Tutorial] Multi-textured floors
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Well, I am using high bytes for ceiling and low bytes for floors. Yes I have tried other plane 3 values. Here is my DrawFlats routine. Also, I'm using shading so it may look a little different...

::: CODE :::
// ------------------------- * Textured flats * -------------------------
/*
** Draw Textured Floor/Ceiling
*/

void DrawFlats(unsigned tex_f, unsigned tex_c)
{
  int x, y, y0, halfheight, shade;
  unsigned top_offset0, bot_offset0, top_offset, bot_offset;
  unsigned top_add, bot_add;
  byte p, color;
  byte far *src_bot, far *src_top;
  fixed dist;            // distance to row projection
  fixed tex_step;        // global step per one screen pixel
  fixed gu, gv, du, dv; // global texture coordinates
  int u, v;              // local texture coordinates
  int floorx,floory;
  unsigned curfloortex, lastfloortex;

// ------ * prepare * --------

  halfheight=viewheight>>1;
  y0=min_wallheight>>3;      // starting y value
  if(y0>halfheight) return;  // view obscued by walls
  if(y0==0) y0=1;           // don't let division by zero
  top_offset0=80*(halfheight-y0-1);  // and will decrease by 80 each row
  bot_offset0=80*(halfheight+y0);  // and will increase by 80 each row

//src_bot=PM_GetPage(tex_f); // load floor texture
  lastfloortex=-1;
  if (!SkyState) src_top=PM_GetPage(tex_c); // load ceiling texture 

// draw horizontal lines

  for(p=0; p<4; p++)
  {
    asm mov ax,0x0102
    asm mov cl,[p]
    asm shl ah,cl
    asm mov dx,0x3c4
    asm out dx,ax

    for(y=y0, top_offset=top_offset0, bot_offset=bot_offset0; y<halfheight; y++, top_offset-=80, bot_offset+=80)
    {
      dist=(heightnumerator/y)<<5;
      gu= viewx+FixedByFrac(dist, viewcos);
      gv=-viewy+FixedByFrac(dist, viewsin);
      tex_step=(dist<<8)/viewwidth/175;
      du= FixedByFrac(tex_step, viewsin);
      dv=-FixedByFrac(tex_step, viewcos);
      gu-=((viewwidth>>1)-p)*du;
      gv-=((viewwidth>>1)-p)*dv; // starting point (leftmost)
      du<<=2; // 4pix step
      dv<<=2;

      shade=(y<<2)/((maxscaleshl2>>8)+1+LSHADE_flag);
      if(shade>32) shade=32;
      shade=32-shade;
 
      for(x=p, top_add=top_offset, bot_add=bot_offset; x<viewwidth; x+=4, top_add++, bot_add++)
      {
        if(wallheight[x]>>3<=y)
        {
     floorx = (gu>>TILESHIFT)&63;
          floory = (-(gv>>TILESHIFT)-1)&63;
     curfloortex=MAPSPOT(floorx,floory,2);
          if (curfloortex != lastfloortex)
          {   
             lastfloortex=curfloortex;
             src_bot=PM_GetPage(curfloortex);
          }

          u=(gu>>10)&63; v=(gv>>10)&63;
          color=shadetable[shade][*(src_top+((63-u)<<6)+(63-v))];

// Don't Draw Ceiling tile if SkyState - so we can have textures on floor with Sky

   if (!SkyState)   // added line for mod
   {                   // added line for mod
   
// draw top pixel using <color>

          asm mov es,[screenseg]
          asm mov di,[bufferofs]
          asm add di,[top_add]
          asm mov al,[color]
          asm mov es:[di],al
     }      // added line for mod

          color=shadetable[shade][*(src_bot+(u<<6)+(63-v))];
   
// draw bottom pixel using <color>

          asm mov es,[screenseg]
          asm mov di,[bufferofs]
          asm add di,[bot_add]
          asm mov al,[color]
          asm mov es:[di],al
        }
        gu+=du; gv+=dv;
      }
    }
  }
}


I know I need to change some things... my source code is pretty messy. But ideally what I want is in WDC, placing low bytes in plane 3 for floor textures, and high bytes for ceilings. I need it to work with outside atmosphere >.> I've seen this work in Wolf: Reloaded and the end result was enticing. Hope this helps... Thanks Adam!

ARC Beer

_________________
Like Metroid? Like fangames? Like top-down games? Like FUN? Head over to www.metroidcoven.com and check out my game called Metroid: Coven.
Adam Biser
Utility Developer
Utility Developer


Joined: 06 Jun 2003
Last Visit: 12 Dec 2017

Topics: 46
Posts: 2291
Location: USA
usa.gif

PostPosted: Sun Apr 06, 2008 11:46 am
   Subject: Re: [Tutorial] Multi-textured floors
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

You're shading code does look different than mine. You might also check over it, or even comment out the shading code to see if the problems still exists.

I notice this line:
::: CODE :::
if (!SkyState) src_top=PM_GetPage(tex_c); // load ceiling texture 
Which loads src_top only if SkyState is 0. But then you also have
::: CODE :::
color=shadetable[shade][*(src_top+((63-u)<<6)+(63-v))];
which gets used regardless of SkyState's value.

_________________
Orb of Dilaaria now has a Facebook page
Star Wars: Bloodlines now has a Facebook page
Rux
DieHard Guard
DieHard Guard


Joined: 17 Dec 2006
Last Visit: 15 Nov 2015

Topics: 34
Posts: 202
Location: Port Angeles, WA
usa.gif

PostPosted: Sun Apr 06, 2008 11:55 am
   Subject: Re: [Tutorial] Multi-textured floors
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

So what do I change? As far as the src_thing I mean?

ARC

_________________
Like Metroid? Like fangames? Like top-down games? Like FUN? Head over to www.metroidcoven.com and check out my game called Metroid: Coven.
Ripper
Code Master - Developer
Code Master - Developer


Joined: 15 Mar 2003
Last Visit: 30 Sep 2008

Topics: 21
Posts: 527
Location: Germany
blank.gif

PostPosted: Sun Apr 06, 2008 1:27 pm
   Subject: Re: [Tutorial] Multi-textured floors
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Move the "color=shadetable[shade][*(src_top+((63-u)<<6)+(63-v))];" line into the "if (!SkyState)". Otherwise you will access illegal memory.

You do know that your statement "I am using high bytes for ceiling and low bytes for floors" is not true, yet, don't you?
You use a full 16-bit value as a texture page number! If you already set some ceiling textures (i.e. non null values), PM_GetPage will probably crash at "src_bot=PM_GetPage(curfloortex);".
You should change "curfloortex=MAPSPOT(floorx,floory,2);" to "curfloortex=MAPSPOT(floorx,floory,2) & 0xff;", which really only takes the lower 8-bit of the tile.

_________________
Life is an awful game, but the graphics resolution rocks ;D
Rux
DieHard Guard
DieHard Guard


Joined: 17 Dec 2006
Last Visit: 15 Nov 2015

Topics: 34
Posts: 202
Location: Port Angeles, WA
usa.gif

PostPosted: Sun Apr 06, 2008 2:32 pm
   Subject: Re: [Tutorial] Multi-textured floors
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

EDIT: Alright, I finally got it to work on my own... For those of you that may need it, here is my routine. Includes support for outside atmosphere and shading and such.

::: CODE :::
/*
=============================
=
= Draw Textured Floor/Ceiling
=
=============================
*/

void DrawFlats(int tex_c, int tex_f)
{
   int x, y, y0, halfheight, shade;
   unsigned top_offset0, bot_offset0, top_offset, bot_offset;
   unsigned top_add, bot_add;
   byte p, color;
   byte far *src_bot, far *src_top;
   fixed dist;             // distance to row projection
   fixed tex_step;         // global step per one screen pixel
   fixed gu, gv, du, dv;   // global texture coordinates
   int u, v;               // local texture coordinates
   int floorx,floory;
   unsigned curfloortex, lastfloortex;

   // ------ * prepare * --------
   halfheight=viewheight>>1;
   y0=min_wallheight>>3;               // starting y value
   if(y0>halfheight) return;           // view obscued by walls
   if(y0==0) y0=1;                     // don't let division by zero
   top_offset0=80*(halfheight-y0-1);   // and will decrease by 80 each row
   bot_offset0=80*(halfheight+y0);     // and will increase by 80 each row
   //src_top=PM_GetPage(tex_c);        // multiple ceilings
   // draw horizontal lines

   lastfloortex=-1;
   for(p=0; p<4; p++)
   {
      asm mov ax,0x0102
      asm mov cl,[p]
      asm shl ah,cl
      asm mov dx,0x3c4
      asm out dx,ax

      for(y=y0, top_offset=top_offset0; y<halfheight; y++, top_offset-=80)
      {
    dist=(heightnumerator/y)<<5;
    gu= viewx+FixedByFrac(dist, viewcos);
    gv=-viewy+FixedByFrac(dist, viewsin);
    tex_step=(dist<<8)/viewwidth/175;
    du= FixedByFrac(tex_step, viewsin);
    dv=-FixedByFrac(tex_step, viewcos);
    gu-=((viewwidth>>1)-p)*du;
    gv-=((viewwidth>>1)-p)*dv; // starting point (leftmost)
    du<<=2;                    // 4pix step
    dv<<=2;

    shade=(y<<2)/((maxscaleshl2>>8)+1+LSHADE_flag);
    if(shade>32) shade = 32;
    else if(shade<1) shade = 1;
    shade = 32-shade;

    for(x=p, top_add=top_offset; x<viewwidth; x+=4, top_add++)
    {
       if(wallheight[x]>>3<=y)
       {
          floorx=(gu>>TILESHIFT)&63;
          floory=(-(gv>>TILESHIFT)-1)&63;
          curfloortex=MAPSPOT(floorx,floory,2)>>8; // ceiling

          if(curfloortex != lastfloortex)
          {
        lastfloortex=curfloortex;
        src_top=PM_GetPage(curfloortex);
          }
          u=(gu>>10)&63;
          v=(gv>>10)&63;
          color=shadetable[shade][*(src_top+((63-u)<<6)+(63-v))];

         // draw top pixel using <color>
         if(curfloortex != 0)
         {
          asm mov es,[screenseg]
          asm mov di,[bufferofs]
          asm add di,[top_add]
          asm mov al,[color]
          asm mov es:[di],al
         }
       }
       gu+=du;
       gv+=dv;
    }
      }
   }
   // src_bot=PM_GetPage(tex_f); // load floor texture
   lastfloortex=-1;
   for(p=0; p<4; p++)
   {
      asm mov ax,0x0102
      asm mov cl,[p]
      asm shl ah,cl
      asm mov dx,0x3c4
      asm out dx,ax

      for(y=y0, bot_offset=bot_offset0; y<halfheight; y++, bot_offset+=80)
      {
    dist=(heightnumerator/y)<<5;
    gu= viewx+FixedByFrac(dist, viewcos);
    gv=-viewy+FixedByFrac(dist, viewsin);
    tex_step=(dist<<8)/viewwidth/175;
    du= FixedByFrac(tex_step, viewsin);
    dv=-FixedByFrac(tex_step, viewcos);
    gu-=((viewwidth>>1)-p)*du;
    gv-=((viewwidth>>1)-p)*dv; // starting point (leftmost)
    du<<=2;                    // 4pix step
    dv<<=2;

    shade=(y<<2)/((maxscaleshl2>>8)+1+LSHADE_flag);
    if(shade>32) shade = 32;
    else if(shade<1) shade = 1;
    shade = 32-shade;

    for(x=p, bot_add=bot_offset; x<viewwidth; x+=4, bot_add++)
    {
       if(wallheight[x]>>3<=y)
       {
          floorx = (gu>>TILESHIFT)&63;
          floory = (-(gv>>TILESHIFT)-1)&63;
          curfloortex=MAPSPOT(floorx,floory,2)&0xff;

          if (curfloortex != lastfloortex)
          {
        lastfloortex=curfloortex;
        src_bot=PM_GetPage(curfloortex);
          }
          u=(gu>>10)&63;
          v=(gv>>10)&63;
          color=shadetable[shade][*(src_bot+(u<<6)+(63-v))];

          // draw bottom pixel using <color>

          asm mov es,[screenseg]
          asm mov di,[bufferofs]
          asm add di,[bot_add]
          asm mov al,[color]
          asm mov es:[di],al
       }
       gu+=du;
       gv+=dv;
    }
      }
   }
}


It is a little sloppy but its WLHack's Wink Thanks for all the help!

ARC

_________________
Like Metroid? Like fangames? Like top-down games? Like FUN? Head over to www.metroidcoven.com and check out my game called Metroid: Coven.
Rux
DieHard Guard
DieHard Guard


Joined: 17 Dec 2006
Last Visit: 15 Nov 2015

Topics: 34
Posts: 202
Location: Port Angeles, WA
usa.gif

PostPosted: Mon Apr 07, 2008 8:24 pm
   Subject: [Tutorial] Multi-textured floors
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Alright, so I have a new idea... I think I heard this somewhere else though too. Lets say we have an outside atmosphere level with ceiling textures applied to buildings in the level. Is it possible to have it so that snow will not fall inside buildings? By that I mean, ideally, when you open a door to a building, you can look inside and no snow will be falling, not have a switch in the door way or something.

Thanks,

ARC

_________________
Like Metroid? Like fangames? Like top-down games? Like FUN? Head over to www.metroidcoven.com and check out my game called Metroid: Coven.
Tricob
Moderator
<B>Moderator</B>


Joined: 14 Mar 2005
Last Visit: 3:20 ago.

Topics: 160
Posts: 8008
Location: Neo-traditions, Inc.
usa.gif

PostPosted: Tue Apr 08, 2008 7:41 pm
   Subject: Re: [Tutorial] Multi-textured floors
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Check the Code Crackers thread. Smile
Rux
DieHard Guard
DieHard Guard


Joined: 17 Dec 2006
Last Visit: 15 Nov 2015

Topics: 34
Posts: 202
Location: Port Angeles, WA
usa.gif

PostPosted: Tue Apr 08, 2008 7:46 pm
   Subject: Re: [Tutorial] Multi-textured floors
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Yeah, thanks, now that I've already posted... LOL!

ARC

_________________
Like Metroid? Like fangames? Like top-down games? Like FUN? Head over to www.metroidcoven.com and check out my game called Metroid: Coven.
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> Code Tutorials View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page TopView Next Topic
Page 8 of 8 Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts [Code] Add Text to Screen at Skill Level select - Chris
Author: Chris
3 2439 Tue Sep 28, 2010 6:59 pm
Tricob View latest post
No new posts [Code] Display Different Ammo Types on Statusbar-BrotherTank
Author: BrotherTank
1 2381 Fri Feb 11, 2005 9:18 pm
Zombie_Plan View latest post
No new posts [Code] Adding a Frames per Second Counter - Darkone
Author: BrotherTank
0 1703 Sat Mar 13, 2004 2:07 pm
BrotherTank View latest post
No new posts [Code] Changing an Enemies Attack Strength - BrotherTank
Author: BrotherTank
0 1969 Tue Jan 27, 2004 10:29 am
BrotherTank View latest post
No new posts [Code] Changing Weapons -CheckWeaponChange- BrotherTank
Author: BrotherTank
2 2700 Sun Oct 26, 2003 1:21 am
Guest 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