Category : C Source Code
Archive   : DRWIN101.ZIP
Filename : TEXTSCR.CPP

 
Output of file : TEXTSCR.CPP contained in archive : DRWIN101.ZIP
#include

#include "textscr.hpp"
#include "scrutil.hpp"



TextScreen::TextScreen(WORD fill) //constructor
{
rows=cols=0; //initialize rows/columns
save=NULL; //initialize save pointer
video=(WORD far*)SCRSEG_COLOR; //pretend its a color monitor
if (!setscrseg()) return; //make sure text mode is ok
video=scrseg; //pointer to video RAM
rows=getsrows(); //rows available on screen
cols=getscols(); //columns available on screen
roco=rows*cols; //positions on screen
save=new WORD[roco]; //get room for screen
Save(); //save current screen
if (fill) Fill(fill); //they want to fill it
} //TextScreen::TextScreen


TextScreen::~TextScreen(void) //destructor
{
if (!save) return; //must have been graphics mode
Restore(); //restore screen
delete save; //clear the new'd thing
} //TextScreen::~TextScreen


void TextScreen::Fill(WORD fill) //fill screen with attr:char
{
for (int i=0;i } //TextScreen::Fill

void TextScreen::Save(void)
{
if (!save) return;
row=getcrow();
col=getccol();
siz=getcsiz();
for (int i=0;i } //TextScreen::Save(void)

void TextScreen::Restore(void) //restores the saved screen
{
if (!save) return; //must have been graphics mode
for (int i=0;i setcpos(row,col);
setcsiz(siz);
} //TextScreen::Restore



  3 Responses to “Category : C Source Code
Archive   : DRWIN101.ZIP
Filename : TEXTSCR.CPP

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/