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       

[Info] Black & White Effect - Tutorial
Page 1 of 1
DieHard Wolfers Forum Index -> 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
Guest




Last Visit:





PostPosted: Mon Jun 30, 2003 7:47 am
   Subject: [Info] Black & White Effect - Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

Here's how to make the game black and white!
Place these in id_vl.c, overwriting the existing functions.
Please leave the attribution intact.

::: CODE :::

/* This variation by Steve "Usotsuki" Nickolas 2003.0629: auto-grayscale */
void VL_FillPalette (int r, int g, int b)
{
  int i;

  outportb (PEL_WRITE_ADR,0);
  for (i=0;i<256;i++)
  {
    unsigned long c;

    c=(r*6+g*7+b*3)/16; /* compute approximate logical grayscale */

    /* and blit to the VGA */
    outportb (PEL_DATA,c);
    outportb (PEL_DATA,c);
    outportb (PEL_DATA,c);
  }
}
::: CODE :::

/* This variation by Steve "Usotsuki" Nickolas 2003.0629: auto-grayscale */
void VL_SetColor (int a,int r,int g,int b)
{
  unsigned long c;

  c=(r*6+g*7+b*3)/16; /* compute approximate logical grayscale */
 
  /* and blit to the VGA */
  outportb (PEL_WRITE_ADR,a);
  outportb (PEL_DATA,c);
  outportb (PEL_DATA,c);
  outportb (PEL_DATA,c);
}
::: CODE :::

/* This variation by Steve "Usotsuki" Nickolas 2003.0627: auto-grayscale */
void VL_SetPalette (byte far *palette)
{
  int i;

  /* 256 colors */
  for (i=0;i<256;i++)
  {
    unsigned char r,g,b;
    unsigned int x;
    unsigned long c;

    x=i*3; /* current position in the array */

    /* take the color values */
    r=palette[x];
    g=palette[x+1];
    b=palette[x+2];

    c=(r*6+g*7+b*3)/16; /* compute approximate logical grayscale */

    /* and blit to the VGA */
    outportb(PEL_WRITE_ADR,i);
    outportb(PEL_DATA,(char)c); /* r */
    outportb(PEL_DATA,(char)c); /* g */
    outportb(PEL_DATA,(char)c); /* b */
  }
}


By WSJ!
Martin
I am Death Incarnate
I am Death Incarnate


Joined: 13 Mar 2003
Last Visit: 09 Sep 2014

Topics: 8
Posts: 152
Location: Wroclaw
poland.gif

PostPosted: Mon Jun 30, 2003 9:52 am
   Subject: Re: Black and white effect - how to
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Man, this one looks nice.

Could you give some screenies?

_________________
Martin
Codetech84
Code Master
Code Master


Joined: 12 Mar 2003
Last Visit: 01 Apr 2018

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

PostPosted: Mon Jun 30, 2003 1:25 pm
   Subject: Re: Black and white effect - how to
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Cool. One modification would be required, setting the palette back to normal. -> The old palette would be saved and restored when called for

_________________
Click here to visit KFH Games website!
*UPDATED* Spear of Destiny Reloaded
KFH Games on Facebook
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: Mon Jun 30, 2003 3:21 pm
   Subject: Re: Black and white effect - how to
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hmmm, this feature would be cool, if you're showing some "history" scenes in an intro Mr Green
Or perhaps the intro shows a scene in a monochrome camera's point of view. Or ingame monochrome cameras!
Woah, and there are so many other ideas running so fast through my mind, that I forgot all others Mr Green *runningfastaroundthenextcorner*
Codetech84
Code Master
Code Master


Joined: 12 Mar 2003
Last Visit: 01 Apr 2018

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

PostPosted: Mon Jul 14, 2003 11:42 am
   Subject: Re: Black and white effect - how to
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

That's what I had in mind.

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




Last Visit:





PostPosted: Wed Feb 09, 2005 5:54 am
   Subject: Re: [Info] Black & White Effect - Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Hey i`d like to use this tutorial but how can i make it so that it switches on and off inside the game.

Then do you have to modify it if you have texture floor/ceiling and shading?

Please answer
Zombie_Plan
DieHard Wolfer
DieHard Wolfer


Joined: 12 Oct 2004
Last Visit: 07 Jun 2016

Topics: 101
Posts: 1614
Location: A hole in the wall
australia.gif

PostPosted: Tue Mar 15, 2005 1:31 am
   Subject: Re: [Info] Black & White Effect - Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

flamer, did you work out the switch thing? I really want that Razz . Please post here!

_________________
Zombieskittles

Welcome to 2016, where DHW still thinks it is okay to ban the world's most popular email service provider, and I can't have an avatar over 10kb
Guest




Last Visit:





PostPosted: Tue Mar 15, 2005 5:39 am
   Subject: Re: [Info] Black & White Effect - Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

No i didn`t deathshead. Actually i forgot about this tutorial.

Maybe i`l talk a look at it in some dais
TexZK
DieHard SS
DieHard SS


Joined: 07 Feb 2004
Last Visit: 17 Oct 2016

Topics: 19
Posts: 370
Location: Northern Italy
italy.gif

PostPosted: Thu Mar 17, 2005 12:23 pm
   Subject: Re: [Info] Black & White Effect - Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Cool! I've never thought using a B/W palette!
WSJ
DieHard Officer
DieHard Officer


Joined: 17 Apr 2004
Last Visit: 08 May 2017

Topics: 24
Posts: 521

blank.gif

PostPosted: Thu Mar 17, 2005 6:15 pm
   Subject: Re: [Info] Black & White Effect - Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Guest wrote:
By WSJ!


What in the blazes... ??!? What? Question I didn't write this feature! I'm pretty sure Usotsuki did.

I wish I'd caught that before...

WSJ.
Dugtrio17
Code Master
Code Master


Joined: 11 Mar 2003
Last Visit: 03 Oct 2013

Topics: 49
Posts: 903
Location: Seattle
usa.gif

PostPosted: Thu Mar 17, 2005 6:24 pm
   Subject: Re: [Info] Black & White Effect - Tutorial
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

You know, I saw that too... I didn't think you did it, especially because he wants you to leave the comments in your code, and the comments specifically say he did it.
Oh, if only we knew where Usotsuki went...

_________________
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> 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 Sticky: [Info] Help for newbie coders! C++ Tutorial
Author: Dugtrio17
20 8507 Sun Jan 10, 2010 12:26 pm
Fragstein3D View latest post
No new posts [Info] Tricks - Dogs that shoot - Modifying Behaviour
Author: Guest
19 288 Sat Mar 20, 2004 7:31 am
Dugtrio17 View latest post
No new posts [Info] Alarm Sounding in game?? WSJ...??
Author: Guest
7 309 Tue Jun 17, 2003 10:04 pm
Reivax44 View latest post
No new posts [Info] Silent Gun? - Adding a Silencer
Author: Guest
4 194 Fri Apr 18, 2003 8:34 am
BrotherTank View latest post
No new posts [Info] Adding Locked Doors
Author: Guest
3 243 Thu Apr 17, 2003 6:30 am
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