home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C++ Games Programming
/
CPPGAMES.ISO
/
thx
/
source
/
theatrix
/
scenedir.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1995-05-08
|
1KB
|
67 lines
// ------------- scenedir.cpp
#include "scenedir.h"
#include "ascii.h"
SceneDirector *SceneDirector::thisscene;
SceneDirector::SceneDirector(char *scfile, short int trans) :
SceneryDirector(scfile, trans)
{
thisscene = this;
snapshot = 0;
}
void SceneDirector::display()
{
SceneryDirector::display();
Player *pl = plist.FirstEntry();
while (pl) {
pl->ticker = pl->interval;
pl = plist.NextEntry();
}
request_timer_cue(CLOCKTICKS, (callback)&SceneDirector::on_timer);
}
void SceneDirector::hide()
{
stop_timer_cue(CLOCKTICKS, (callback)&SceneDirector::on_timer);
SceneryDirector::hide();
}
void SceneDirector::addplayer(Player& pl)
{
plist.AppendEntry(&pl);
}
void SceneDirector::scanframes()
{
Player *pl = plist.FirstEntry();
while (pl) {
pl->displayframe();
pl = plist.NextEntry();
}
if (mouseinuse)
fg_mousevis(0);
swap_video_pages();
if (snapshot) {
snapshot = 0;
VideoDirector::on_s();
}
if (mouseinuse)
fg_mousevis(1);
synch_patches(0);
}
void SceneDirector::on_s(int)
{
snapshot = 1;
}
void SceneDirector::on_timer()
{
pre_timer_tick();
scanframes();
post_timer_tick();
}