diff options
| -rw-r--r-- | engines/avalanche/avalanche.cpp | 1 | ||||
| -rw-r--r-- | engines/avalanche/avalanche.h | 2 | ||||
| -rw-r--r-- | engines/avalanche/celer2.cpp | 541 | ||||
| -rw-r--r-- | engines/avalanche/celer2.h | 70 | 
4 files changed, 317 insertions, 297 deletions
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp index f72c12c4fe..e17f1ee9bc 100644 --- a/engines/avalanche/avalanche.cpp +++ b/engines/avalanche/avalanche.cpp @@ -53,6 +53,7 @@ namespace Avalanche {  		_pingo.setParent(this);  		_scrolls.setParent(this);  		_visa.setParent(this); +		_lucerna.setParent(this);  	}  	AvalancheEngine::~AvalancheEngine() { diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h index 14d2f4e147..e0f544c73b 100644 --- a/engines/avalanche/avalanche.h +++ b/engines/avalanche/avalanche.h @@ -35,6 +35,7 @@  #include "avalanche/pingo2.h"  #include "avalanche/scrolls2.h"  #include "avalanche/visa2.h" +#include "avalanche/lucerna2.h"  #include "engines/engine.h"  #include "engines/advancedDetector.h" @@ -57,6 +58,7 @@ public:  	Pingo _pingo;  	Scrolls _scrolls;  	Visa _visa; +	Lucerna _lucerna;  	AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd); diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp index 6efabea041..2e6ce5a9ed 100644 --- a/engines/avalanche/celer2.cpp +++ b/engines/avalanche/celer2.cpp @@ -29,369 +29,368 @@  #include "avalanche/celer2.h"  #include "common/textconsole.h" -//#include "avalanche/trip6.h" +#include "avalanche/trip6.h"  #include "avalanche/lucerna2.h"  #include "avalanche/gyro2.h"  #include "avalanche/roomnums.h" +#include "avalanche/avalanche.h"  namespace Avalanche { -	namespace Celer { +const int16 Celer::on_disk = -1; -	//untyped_file f; /* Private variable- not accessible from elsewhere. */ -	const int16 on_disk = -1; /* Value of memos[fv].x when it's not in memory. */ +Celer::Celer() { +	num_chunks = 0; +} -	void pics_link() { -		byte xx; +void Celer::setParent(AvalancheEngine *vm) { +	_vm = vm; +} -		if (Gyro::ddmnow)  return; /* No animation when the menus are up. */ +void Celer::pics_link() { +	byte xx; -		{ -			Gyro::dnatype &with = Gyro::dna; -			switch (with.room) { +	if (_vm->_gyro.ddmnow)  return; /* No animation when the menus are up. */ -			case r__outsideargentpub: { -				if ((Gyro::roomtime % int32(12)) == 0) -					show_one(int32(1) + (Gyro::roomtime / int32(12)) % int32(4)); -			} -			break; +	{ +		switch (_vm->_gyro.dna.room) { -			case r__brummieroad: -				if ((Gyro::roomtime % int32(2)) == 0) -					show_one(int32(1) + (Gyro::roomtime / int32(2)) % int32(4)); -				break; +		case r__outsideargentpub: { +			if ((_vm->_gyro.roomtime % int32(12)) == 0) +				show_one(int32(1) + (_vm->_gyro.roomtime / int32(12)) % int32(4)); +		} +		break; -			case r__bridge: -				if ((Gyro::roomtime % int32(2)) == 0) -					show_one(int32(4) + (Gyro::roomtime / int32(2)) % int32(4)); -				break; +		case r__brummieroad: +			if ((_vm->_gyro.roomtime % int32(2)) == 0) +				show_one(int32(1) + (_vm->_gyro.roomtime / int32(2)) % int32(4)); +			break; -			case r__yours: -				if ((! with.avvy_is_awake) && ((Gyro::roomtime % int32(4)) == 0)) -					show_one(int32(1) + (Gyro::roomtime / int32(12)) % int32(2)); -				break; +		case r__bridge: +			if ((_vm->_gyro.roomtime % int32(2)) == 0) +				show_one(int32(4) + (_vm->_gyro.roomtime / int32(2)) % int32(4)); +			break; -			case r__argentpub: { -				if (((Gyro::roomtime % int32(7)) == 1) && (Gyro::dna.malagauche != 177)) { -					/* Malagauche cycle */ -					Gyro::dna.malagauche += 1; -					switch (Gyro::dna.malagauche) { -					case 1: -					case 11: -					case 21: -						show_one(12); -						break; /* Looks forwards. */ -					case 8: -					case 18: -					case 28: -					case 32: -						show_one(11); -						break; /* Looks at you. */ -					case 30: -						show_one(13); -						break; /* Winks. */ -					case 33: -						Gyro::dna.malagauche = 0; -						break; -					} -				} +		case r__yours: +			if ((! _vm->_gyro.dna.avvy_is_awake) && ((_vm->_gyro.roomtime % int32(4)) == 0)) +				show_one(int32(1) + (_vm->_gyro.roomtime / int32(12)) % int32(2)); +			break; -				switch (Gyro::roomtime % 200) { -				case 179: -				case 197: -					show_one(5); -					break; /* Dogfood's drinking cycle */ -				case 182: -				case 194: -					show_one(6); -					break; -				case 185: -					show_one(7); +		case r__argentpub: { +			if (((_vm->_gyro.roomtime % int32(7)) == 1) && (_vm->_gyro.dna.malagauche != 177)) { +				/* Malagauche cycle */ +				_vm->_gyro.dna.malagauche += 1; +				switch (_vm->_gyro.dna.malagauche) { +				case 1: +				case 11: +				case 21: +					show_one(12); +					break; /* Looks forwards. */ +				case 8: +				case 18: +				case 28: +				case 32: +					show_one(11); +					break; /* Looks at you. */ +				case 30: +					show_one(13); +					break; /* Winks. */ +				case 33: +					_vm->_gyro.dna.malagauche = 0;  					break; -				case 199: -					Gyro::dna.dogfoodpos = 177; -					break; /* Impossible value for this. */  				} - -				if ((Gyro::roomtime % 200 >= 0) && (Gyro::roomtime % 200 <= 178)) { /* Normally. */ -					if (((Lucerna::bearing(2) >= 1) && (Lucerna::bearing(2) <= 90)) || ((Lucerna::bearing(2) >= 358) && (Lucerna::bearing(2) <= 360))) -						xx = 3; -					else if ((Lucerna::bearing(2) >= 293) && (Lucerna::bearing(2) <= 357)) -						xx = 2; -					else if ((Lucerna::bearing(2) >= 271) && (Lucerna::bearing(2) <= 292)) -						xx = 4; - -					if (xx != Gyro::dna.dogfoodpos) { /* Only if it's changed.*/ -						show_one(xx); -						Gyro::dna.dogfoodpos = xx; -					} -				} -				  			} -			break; -			case r__westhall: -				if ((Gyro::roomtime % int32(3)) == 0) -					switch ((Gyro::roomtime / int32(3)) % int32(6)) { -					case 4: -						show_one(1); -						break; -					case 1: -					case 3: -					case 5: -						show_one(2); -						break; -					case 0: -					case 2: -						show_one(3); -						break; -					} +			switch (_vm->_gyro.roomtime % 200) { +			case 179: +			case 197: +				show_one(5); +				break; /* Dogfood's drinking cycle */ +			case 182: +			case 194: +				show_one(6);  				break; - -			case r__lustiesroom: -				if (!(Gyro::dna.lustie_is_asleep))  { -					if ((Gyro::roomtime % int32(45)) > 42) -						xx = 4; /* du Lustie blinks */ - -					/* Bearing of Avvy from du Lustie. */ -					else if (((Lucerna::bearing(2) >= 0) && (Lucerna::bearing(2) <= 45)) || ((Lucerna::bearing(2) >= 315) && (Lucerna::bearing(2) <= 360))) -							xx = 1; /* Middle. */ -					else if ((Lucerna::bearing(2) >= 45) && (Lucerna::bearing(2) <= 180)) -							xx = 2; /* Left. */ -					else if ((Lucerna::bearing(2) >= 181) && (Lucerna::bearing(2) <= 314)) -						xx = 3; /* Right. */ - -					if (xx != Gyro::dna.dogfoodpos) { /* Only if it's changed.*/ -						show_one(xx); -						Gyro::dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */ -					} -				} +			case 185: +				show_one(7);  				break; +			case 199: +				_vm->_gyro.dna.dogfoodpos = 177; +				break; /* Impossible value for this. */ +			} + +			if ((_vm->_gyro.roomtime % 200 >= 0) && (_vm->_gyro.roomtime % 200 <= 178)) { /* Normally. */ +				if (((_vm->_lucerna.bearing(2) >= 1) && (_vm->_lucerna.bearing(2) <= 90)) || ((_vm->_lucerna.bearing(2) >= 358) && (_vm->_lucerna.bearing(2) <= 360))) +					xx = 3; +				else if ((_vm->_lucerna.bearing(2) >= 293) && (_vm->_lucerna.bearing(2) <= 357)) +					xx = 2; +				else if ((_vm->_lucerna.bearing(2) >= 271) && (_vm->_lucerna.bearing(2) <= 292)) +					xx = 4; -			case r__aylesoffice: -				if ((! Gyro::dna.ayles_is_awake) && (Gyro::roomtime % int32(14) == 0)) { -					switch ((Gyro::roomtime / int32(14)) % int32(2)) { -					case 0: -						show_one(1); -						break; /* Frame 2: EGA. */ -					case 1: -						show_one(3); -						break; /* Frame 1: Natural. */ -					} +				if (xx != _vm->_gyro.dna.dogfoodpos) { /* Only if it's changed.*/ +					show_one(xx); +					_vm->_gyro.dna.dogfoodpos = xx;  				} -				break; +			} +				 +		} +		break; -			case r__robins: -				if (Gyro::dna.tied_up) -					switch (Gyro::roomtime % int32(54)) { -					case 20: -						show_one(4); -						break; /* Frame 4: Avalot blinks. */ -					case 23: -						show_one(2); -						break; /* Frame 1: Back to normal. */ -					} -				break; +		case r__westhall: +			if ((_vm->_gyro.roomtime % int32(3)) == 0) +				switch ((_vm->_gyro.roomtime / int32(3)) % int32(6)) { +				case 4: +					show_one(1); +					break; +				case 1: +				case 3: +				case 5: +					show_one(2); +					break; +				case 0: +				case 2: +					show_one(3); +					break; +				} +			break; -			case r__nottspub: { -				/* Bearing of Avvy from Port. */ -				if (((Lucerna::bearing(5) >= 0) && (Lucerna::bearing(5) <= 45)) || ((Lucerna::bearing(5) >= 315) && (Lucerna::bearing(5) <= 360))) -					xx = 2; /* Middle. */ -				else if ((Lucerna::bearing(5) >= 45) && (Lucerna::bearing(5) <= 180)) -					xx = 6; /* Left. */ -				else if ((Lucerna::bearing(5) >= 181) && (Lucerna::bearing(5) <= 314)) -					xx = 8; /* Right. */ +		case r__lustiesroom: +			if (!(_vm->_gyro.dna.lustie_is_asleep))  { +				if ((_vm->_gyro.roomtime % int32(45)) > 42) +					xx = 4; /* du Lustie blinks */ -				if ((Gyro::roomtime % int32(60)) > 57)  xx--; /* Blinks */ +				/* Bearing of Avvy from du Lustie. */ +				else if (((_vm->_lucerna.bearing(2) >= 0) && (_vm->_lucerna.bearing(2) <= 45)) || ((_vm->_lucerna.bearing(2) >= 315) && (_vm->_lucerna.bearing(2) <= 360))) +						xx = 1; /* Middle. */ +				else if ((_vm->_lucerna.bearing(2) >= 45) && (_vm->_lucerna.bearing(2) <= 180)) +						xx = 2; /* Left. */ +				else if ((_vm->_lucerna.bearing(2) >= 181) && (_vm->_lucerna.bearing(2) <= 314)) +					xx = 3; /* Right. */ -				if (xx != Gyro::dna.dogfoodpos) { /* Only if it's changed.*/ +				if (xx != _vm->_gyro.dna.dogfoodpos) { /* Only if it's changed.*/  					show_one(xx); -					Gyro::dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */ +					_vm->_gyro.dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */  				} +			} +			break; -				switch (Gyro::roomtime % 50) { -				case 45 : -					show_one(9); -					break; /* Spurge blinks */ -				case 49 : -					show_one(10); -					break; +		case r__aylesoffice: +			if ((! _vm->_gyro.dna.ayles_is_awake) && (_vm->_gyro.roomtime % int32(14) == 0)) { +				switch ((_vm->_gyro.roomtime / int32(14)) % int32(2)) { +				case 0: +					show_one(1); +					break; /* Frame 2: EGA. */ +				case 1: +					show_one(3); +					break; /* Frame 1: Natural. */  				}  			}  			break; -			case r__ducks: { -				if ((Gyro::roomtime % 3) == 0) /* The fire flickers */ -					show_one(1 + (Gyro::roomtime / 3) % 3); +		case r__robins: +			if (_vm->_gyro.dna.tied_up) +				switch (_vm->_gyro.roomtime % int32(54)) { +				case 20: +					show_one(4); +					break; /* Frame 4: Avalot blinks. */ +				case 23: +					show_one(2); +					break; /* Frame 1: Back to normal. */ +				} +			break; -				{/* Lucerna::bearing of Avvy from Duck. */ -				if (((Lucerna::bearing(2) >= 0) && (Lucerna::bearing(2) <= 45)) || ((Lucerna::bearing(2) >= 315) && (Lucerna::bearing(2) <= 360))) -					xx = 4; /* Middle. */ -				else if ((Lucerna::bearing(2) >= 45) && (Lucerna::bearing(2) <= 180)) -					xx = 6; /* Left. */ -				else if ((Lucerna::bearing(2) >= 181) && (Lucerna::bearing(2) <= 314)) -					xx = 8; /* Right. */ +		case r__nottspub: { +			/* Bearing of Avvy from Port. */ +			if (((_vm->_lucerna.bearing(5) >= 0) && (_vm->_lucerna.bearing(5) <= 45)) || ((_vm->_lucerna.bearing(5) >= 315) && (_vm->_lucerna.bearing(5) <= 360))) +				xx = 2; /* Middle. */ +			else if ((_vm->_lucerna.bearing(5) >= 45) && (_vm->_lucerna.bearing(5) <= 180)) +				xx = 6; /* Left. */ +			else if ((_vm->_lucerna.bearing(5) >= 181) && (_vm->_lucerna.bearing(5) <= 314)) +				xx = 8; /* Right. */ -				if ((Gyro::roomtime % int32(45)) > 42)  xx += 1; /* Duck blinks */ +			if ((_vm->_gyro.roomtime % int32(60)) > 57)  xx--; /* Blinks */ -				if (xx != Gyro::dna.dogfoodpos) { /* Only if it's changed.*/ -					show_one(xx); -					Gyro::dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */ -				} +			if (xx != _vm->_gyro.dna.dogfoodpos) { /* Only if it's changed.*/ +				show_one(xx); +				_vm->_gyro.dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */  			} -			break; +			switch (_vm->_gyro.roomtime % 50) { +			case 45 : +				show_one(9); +				break; /* Spurge blinks */ +			case 49 : +				show_one(10); +				break;  			}  		} +		break; -		if ((Gyro::dna.ringing_bells) && (Gyro::flagset('B'))) -			/* They're ringing the bells. */ -			switch (Gyro::roomtime % int32(4)) { -			case 1: { -				Gyro::dnatype &with = Gyro::dna; +		case r__ducks: { +			if ((_vm->_gyro.roomtime % 3) == 0) /* The fire flickers */ +				show_one(1 + (_vm->_gyro.roomtime / 3) % 3); -				if (with.nextbell < 5)  with.nextbell = 12; -				with.nextbell -= 1; -				Gyro::note(Gyro::notes[with.nextbell]); -			} -			break; -			case 2: -				//nosound; -				warning("STUB: Celer::pics_link()"); -				break; +			{/* _vm->_lucerna.bearing of Avvy from Duck. */ +			if (((_vm->_lucerna.bearing(2) >= 0) && (_vm->_lucerna.bearing(2) <= 45)) || ((_vm->_lucerna.bearing(2) >= 315) && (_vm->_lucerna.bearing(2) <= 360))) +				xx = 4; /* Middle. */ +			else if ((_vm->_lucerna.bearing(2) >= 45) && (_vm->_lucerna.bearing(2) <= 180)) +				xx = 6; /* Left. */ +			else if ((_vm->_lucerna.bearing(2) >= 181) && (_vm->_lucerna.bearing(2) <= 314)) +				xx = 8; /* Right. */ + +			if ((_vm->_gyro.roomtime % int32(45)) > 42)  xx += 1; /* Duck blinks */ + +			if (xx != _vm->_gyro.dna.dogfoodpos) { /* Only if it's changed.*/ +				show_one(xx); +				_vm->_gyro.dna.dogfoodpos = xx; /* We use DogfoodPos here too- why not? */  			}  		} -	} +		break; -	void load_chunks(Common::String xx) { -		warning("STUB: Celer::load_chunks()"); +		}  	} -	void forget_chunks() { -		warning("STUB: Celer::forget_chunks()"); +	if ((_vm->_gyro.dna.ringing_bells) && (_vm->_gyro.flagset('B'))) +		/* They're ringing the bells. */ +		switch (_vm->_gyro.roomtime % int32(4)) { +		case 1: { +			if (_vm->_gyro.dna.nextbell < 5)  _vm->_gyro.dna.nextbell = 12; +			_vm->_gyro.dna.nextbell -= 1; +			_vm->_gyro.note(_vm->_gyro.notes[_vm->_gyro.dna.nextbell]); +		} +		break; +		case 2: +			//nosound; +			warning("STUB: Celer::pics_link()"); +			break; +		}  	} +} -	void mdrop(int16 x, int16 y, int16 xl, int16 yl, void *p) /* assembler; -	asm -	  push ds;      { Strictly speaking, we shouldn't modify DS, so we'll save it.} -	  push bp;      { Nor BP! } - +void Celer::load_chunks(Common::String xx) { +	warning("STUB: Celer::load_chunks()"); +} -	  { DI holds the offset on this page. It starts at the top left-hand corner. } -	  { (It should equal ch.y*80+ch.x. } +void Celer::forget_chunks() { +	warning("STUB: Celer::forget_chunks()"); +} -	  mov ax,y; -	  mov dl,80; -	  mul dl; { Line offset now calculated. } -	  mov di,ax; { Move it into DI. } -	  mov ax,x; -	  add di,ax; { Full offset now calculated. } +void Celer::mdrop(int16 x, int16 y, int16 xl, int16 yl, void *p) { /* assembler; +asm +	push ds;      { Strictly speaking, we shouldn't modify DS, so we'll save it.} +	push bp;      { Nor BP! } -	  mov bx,yl; { No. of times to repeat lineloop. } -	  inc bx;        { "loop" doesn't execute the zeroth time. } -	  mov bh,bl;     { Put it into BH. } -	  { BP holds the length of the Common::String to copy. It's equal to ch.xl.} +	{ DI holds the offset on this page. It starts at the top left-hand corner. } +	{ (It should equal ch.y*80+ch.x. } -	  mov ax,uint16(p);   { Data is held at DS:SI. } -	  mov si,ax; -	  mov ax,uint16(p+2); { This will be moved over into ds in just a tick... } +	mov ax,y; +	mov dl,80; +	mul dl; { Line offset now calculated. } +	mov di,ax; { Move it into DI. } +	mov ax,x; +	add di,ax; { Full offset now calculated. } -	  mov bp,xl; +	mov bx,yl; { No. of times to repeat lineloop. } +	inc bx;        { "loop" doesn't execute the zeroth time. } +	mov bh,bl;     { Put it into BH. } -	  mov ds,ax; +	{ BP holds the length of the Common::String to copy. It's equal to ch.xl.} +	mov ax,uint16(p);   { Data is held at DS:SI. } +	mov si,ax; +	mov ax,uint16(p+2); { This will be moved over into ds in just a tick... } -	  cld;          { We're allowed to hack around with the flags! } +	mov bp,xl; -	  mov ax,$AC00; { Top of the first EGA page. } -	  mov es,ax;    { Offset on this page is calculated below... } +	mov ds,ax; -	{    port[$3c4]:=2; port[$3ce]:=4; } +	cld;          { We're allowed to hack around with the flags! } -	  mov dx,$3c4; -	  mov al,2; -	  out dx,al; -	  mov dx,$3ce; -	  mov al,4; -	  out dx,al; +	mov ax,$AC00; { Top of the first EGA page. } +	mov es,ax;    { Offset on this page is calculated below... } -	  mov cx,4;  { This loop executes for 3, 2, 1, and 0. } -	  mov bl,0; +{    port[$3c4]:=2; port[$3ce]:=4; } -	 @mainloop: +	mov dx,$3c4; +	mov al,2; +	out dx,al; +	mov dx,$3ce; +	mov al,4; +	out dx,al; -		push di; -		push cx; +	mov cx,4;  { This loop executes for 3, 2, 1, and 0. } +	mov bl,0; -	{    port[$3C5]:=1 shl bit; } -		mov dx,$3C5; -		mov al,1; -		mov cl,bl; { BL = bit. } -		shl al,cl; -		out dx,al; -	{     port[$3CF]:=bit; } -		mov dx,$3CF; -		mov al,bl; { BL = bit. } -		out dx,al; -		xor ch,ch; -		mov cl,bh; { BH = ch.yl. } +	@mainloop: -	   @lineloop: +	push di; +	push cx; -		 push cx; +{    port[$3C5]:=1 shl bit; } +	mov dx,$3C5; +	mov al,1; +	mov cl,bl; { BL = bit. } +	shl al,cl; +	out dx,al; +{     port[$3CF]:=bit; } +	mov dx,$3CF; +	mov al,bl; { BL = bit. } +	out dx,al; -		 mov cx,bp; +	xor ch,ch; +	mov cl,bh; { BH = ch.yl. } -		 repz movsb; { Copy the data. } +	@lineloop: -		 sub di,bp; -		 add di,80; +		push cx; -		 pop cx; +		mov cx,bp; -	   loop @lineloop; +		repz movsb; { Copy the data. } -		inc bl; { One more on BL. } +		sub di,bp; +		add di,80;  		pop cx; -		pop di; -	 loop @mainloop; +	loop @lineloop; -	  pop bp; -	  pop ds;       { Get DS back again. } -	*/ -	{ -	} +	inc bl; { One more on BL. } -	void show_one(byte which); +	pop cx; +	pop di; -	void display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour, void *p) { -		warning("STUB: Celer::display_it()"); -	} +	loop @mainloop; -	void show_one(byte which) { -		warning("STUB: Celer::show_one()"); -	} +	pop bp; +	pop ds;       { Get DS back again. } +*/ +} -	void show_one_at(byte which, int16 xxx, int16 yyy); +void Celer::display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour, void *p) { +	warning("STUB: Celer::display_it()"); +} -	static void display_it1(int16 xl, int16 yl, flavourtype flavour, void *p, int16 &xxx, int16 &yyy) { -		warning("STUB: Celer::display_it1()"); -	} +void Celer::show_one(byte which) { +	warning("STUB: Celer::show_one()"); +} -	void show_one_at(byte which, int16 xxx, int16 yyy) { -		warning("STUB: Celer::show_one_at()"); -	} -	} // End of namespace Celer. +void Celer::display_it1(int16 xl, int16 yl, flavourtype flavour, void *p, int16 &xxx, int16 &yyy) { +	warning("STUB: Celer::display_it1()"); +} + +void Celer::show_one_at(byte which, int16 xxx, int16 yyy) { +	warning("STUB: Celer::show_one_at()"); +} + +  } // End of namespace Avalanche. diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h index 466ed8d9d0..263d717ab9 100644 --- a/engines/avalanche/celer2.h +++ b/engines/avalanche/celer2.h @@ -30,50 +30,68 @@  #ifndef CELER2_H  #define CELER2_H + +  #include "common/scummsys.h"  #include "common/str.h"  namespace Avalanche { +class AvalancheEngine; + +class Celer { +public: +	enum flavourtype {ch_ega, ch_bgi, last_flavourtype}; + +	struct chunkblocktype { +		flavourtype flavour; +		int16 x, y; +		int16 xl, yl; +		int32 size; +		bool natural; + +		bool memorise; /* Hold it in memory? */ +	}; + +	struct memotype { +		int16 x, y; +		int16 xl, yl; +		flavourtype flavour; +		uint16 size; +	}; + +	int32 offsets[40]; +	byte num_chunks; +	memotype memos[40]; +	void *memory[40]; -	namespace Celer { -		enum flavourtype {ch_ega, ch_bgi, last_flavourtype}; +	Celer(); -		struct chunkblocktype { -			flavourtype flavour; -			int16 x, y; -			int16 xl, yl; -			int32 size; -			bool natural; +	void setParent(AvalancheEngine *vm); -			bool memorise; /* Hold it in memory? */ -		}; +	void pics_link(); -		struct memotype { -			int16 x, y; -			int16 xl, yl; -			flavourtype flavour; -			uint16 size; -		}; +	void load_chunks(Common::String xx); -		int32 offsets[40]; -		byte num_chunks = 0; -		memotype memos[40]; -		void *memory[40]; +	void forget_chunks(); +	void show_one(byte which); +	void show_one_at(byte which, int16 xxx, int16 yyy); -		void pics_link(); +private: +	AvalancheEngine *_vm; -		void load_chunks(Common::String xx); +	//untyped_file f; /* Private variable- not accessible from elsewhere. */ -		void forget_chunks(); +	static const int16 on_disk; /* Value of memos[fv].x when it's not in memory. */ -		void show_one(byte which); +	void mdrop(int16 x, int16 y, int16 xl, int16 yl, void *p); -		void show_one_at(byte which, int16 xxx, int16 yyy); +	void display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour, void *p); -	} // End of namespace Celer. +	void display_it1(int16 xl, int16 yl, flavourtype flavour, void *p, int16 &xxx, int16 &yyy); +};  } // End of namespace Avalanche.  | 
