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       

Changing the ceiling color after teleportation
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
ronwolf1705
Moderator
<B>Moderator</B>


Joined: 31 Jul 2006
Last Visit: 0:05 ago.

Topics: 73
Posts: 3771

blank.gif

PostPosted: Sat Aug 16, 2014 6:58 am
   Subject: Changing the ceiling color after teleportation
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

For the original source code, MCS create this piece of code to change the floor color after teleportation:

::: CODE :::
In WL_DEF.H, search for

   int      difficulty;
   
add this line below:

   boolean      warped;
   
In WL_AGENT.C, add the following line at the end of the WarpPlayer() function:

   gamestate.warped ^= 1;
   
In WL_DRAW.C, locate this line:

asm   mov   ax,0x1919

replace with:

if (gamestate.warped)
   asm   mov   ax,0x0000 (alter this to your liking)
else
   asm   mov   ax,0x1919


Of course the asm move bit is obsolete in the 4SDL code, but apart from that it all works. But what does one need to do in order to change the ceiling color after teleportating? I tried stuff like adding ceiling =0 in there, but that just gives me weird results. Can anyone help me out?
Andy_Nonymous
Moderator
<B>Moderator</B>


Joined: 02 Apr 2003
Last Visit: 17 Feb 2015

Topics: 99
Posts: 589
Location: New Jersey, USA
usa.gif

PostPosted: Sat Aug 16, 2014 9:52 am
   Subject: Changing the ceiling color after teleportation
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

In WL_DRAW.CPP this worked in Spear Resurrection SDL:

::: CODE :::
//MCS: the alternate ceiling colors are for teleporting areas

byte priVgaCeiling[]=
{
 0x0000,0x4f4f,0x6f6f,0xdfdf,0xbfbf,0xafaf,0x2d2d,0xdede,0x1e1e,0xdddd,
 0xa0a0,0x9f9f,0xe5e5,0x7f7f,0x2e2e,0xeeee,0x7f7f,0x1d1d,0x6f6f,0x2f2f,
 0x1d1d,0xdcdc,0xa0a0
};

byte altVgaCeiling[]=
{
 0x0000,0x4f4f,0x6f6f,0xdfdf,0xbfbf,0xafaf,0x2d2d,0xdede,0x1e1e,0xdddd,
 0x0000,0x9f9f,0xe5e5,0x0000,0x2e2e,0xdede,0x1d1d,0x1d1d,0x6f6f,0x2f2f,
 0x0000,0x8585,0x0000
};

/*
=====================
=
= VGAClearScreen
=
=====================
*/

void VGAClearScreen (void)
{
    byte priceiling=priVgaCeiling[mapon];
    byte altceiling=altVgaCeiling[mapon];

    int y;
    byte *ptr = vbuf;
    for(y = 0; y < viewheight / 2; y++, ptr += vbufPitch)
    {
        if (!gamestate.warped)
           memset(ptr, priceiling, viewwidth);
        else
           memset(ptr, altceiling, viewwidth);
    }     
    for(; y < viewheight; y++, ptr += vbufPitch)
    {
        switch (gamestate.mapon)   //MCS: enter different or alternate floor colors here
           {
           case 0:
                memset(ptr, 0x0, viewwidth);
              break;
           case 10:
           case 13:
           case 22:
              if (!gamestate.warped)
                    memset(ptr, 0x19, viewwidth);
              else
                    memset(ptr, 0x0, viewwidth);
              break;   
           default:
              memset(ptr, 0x19, viewwidth);   //MCS: floor color = 2x Wolf palette hex index number
            }
    }
}
ronwolf1705
Moderator
<B>Moderator</B>


Joined: 31 Jul 2006
Last Visit: 0:05 ago.

Topics: 73
Posts: 3771

blank.gif

PostPosted: Sat Aug 16, 2014 10:10 am
   Subject: Re: Changing the ceiling color after teleportation
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

Thanks Andy! I'll probably rework the floor color code to make them case-based, as right now it has the form of:

::: CODE :::
if (gamestate.mapon == 2 && gamestate.episode == 2)
          memset (ptr, 0xdf, viewwidth);
      else
          etc.


Might be a bit convoluted. Laughing
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 11726 Fri May 26, 2017 8:19 am
Military View latest post
No new posts [WOLF4SDL Help] Blake Stone Style doors
Author: Haasboy
3 3165 Sun Jul 20, 2008 7:56 am
Haasboy View latest post
No new posts [Wolf4SDL Help] Inserting a second palette (like in SoD)
Author: Andy_Nonymous
10 3534 Mon Jun 02, 2008 3:59 pm
Adam Biser View latest post
No new posts [Help] Problem with Checkweaponchange function (wolf4sdl)
Author: Mortimer
4 3375 Sat May 17, 2008 11:26 am
Mortimer View latest post
No new posts [help] Wolf4sdl's implemented tutorials
Author: Mortimer
6 3494 Tue May 06, 2008 1:15 pm
Ripper 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