TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: DANIAL GIBSON
from: JERRY COFFIN
date: 1997-04-20 01:54:00
subject: Video

On (11 Apr 97) Danial Gibson wrote to Eric Yale...
 EY> The following works well and is also fairly fast:
 EY> void Plot_Pixel(int x, int y, char color)
 EY> {
 EY>   // using the fact that 320*y = 256*y + 64*y = y<<8 +y<<6.
 EY>   video_buffer[((Y<<8) + (y<<6)) + x] = color;
 EY> }
 DG> You should actually #define a similar Plot_Pixel as this one has too
 DG> much overhead for some cpu's. (ie. a far jump, pushing and popping the
 DG> stack etc). The #define is usually a lot faster method.
Keeping in mind that this echo is devoted to C++, you might want to
simply use an inline function instead:
void inline Plot_Pixel(int x, int y, char color) // ...
also note that C++ is case sensitive, so you have to be careful of the
typos ('Y' vs. 'y' above...)
    Later,
    Jerry.
... The Universe is a figment of its own imagination.
--- PPoint 1.90
---------------
* Origin: Point Pointedly Pointless (1:128/166.5)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.