diff options
| author | uruk | 2013-07-05 12:31:12 +0200 | 
|---|---|---|
| committer | uruk | 2013-07-05 12:31:12 +0200 | 
| commit | 617898d42c996380d7f0253e9c7cf52cd50688ea (patch) | |
| tree | 1fe1aef755c10765c21fb6754fa9d441be7b7ec9 | |
| parent | 9a6684b37c5efe2e0c96be8bdcead9a51ca30ded (diff) | |
| download | scummvm-rg350-617898d42c996380d7f0253e9c7cf52cd50688ea.tar.gz scummvm-rg350-617898d42c996380d7f0253e9c7cf52cd50688ea.tar.bz2 scummvm-rg350-617898d42c996380d7f0253e9c7cf52cd50688ea.zip | |
AVALANCHE: Celer: implement show_one().
| -rw-r--r-- | engines/avalanche/celer2.cpp | 43 | ||||
| -rw-r--r-- | engines/avalanche/celer2.h | 10 | 
2 files changed, 47 insertions, 6 deletions
| diff --git a/engines/avalanche/celer2.cpp b/engines/avalanche/celer2.cpp index a106ce5e2a..20413ff7d5 100644 --- a/engines/avalanche/celer2.cpp +++ b/engines/avalanche/celer2.cpp @@ -272,7 +272,6 @@ void Celer::load_chunks(char *xx) {  	chunkblocktype ch;  	byte fv; -	Common::String filename;  	filename = filename.format("chunk%s.avd", xx);  	if (!f.open(filename)) {  		warning("AVALANCHE: Celer: File not found: %s", filename.c_str()); @@ -433,7 +432,49 @@ void Celer::display_it(int16 x, int16 y, int16 xl, int16 yl, flavourtype flavour  }  void Celer::show_one(byte which) { +	chunkblocktype ch; +	byte *p; +	 +	//setactivepage(3); +	warning("STUB: Celer::show_one()"); + +	if (memos[which].x > on_disk) +		display_it(memos[which].x, memos[which].y, memos[which].xl, memos[which].yl, memos[which].flavour, memory[which]); +	else { +		if (!f.open(filename)) { /* Filename was set in load_chunks() */ +			warning("AVALANCHE: Celer: File not found: %s", filename.c_str()); +			return; +		} + +		f.seek(offsets[which]); + +		ch.flavour = flavourtype(f.readByte()); +		ch.x = f.readSint16LE(); +		ch.y = f.readSint16LE(); +		ch.xl = f.readSint16LE(); +		ch.yl = f.readSint16LE(); +		ch.size = f.readSint32LE(); +		ch.natural = f.readByte(); +		ch.memorise = f.readByte(); + + +		p = new byte[ch.size]; + +		for (int32 i = 0; i < ch.size; i++) +			p[i] = f.readByte(); + +		display_it(ch.x, ch.y, ch.xl, ch.yl, ch.flavour, p); + +		delete[] p; + +		f.close(); +	} + +	//setactivepage(1 - cp);  	warning("STUB: Celer::show_one()"); + +	for (byte fv = 0; fv < 2; fv ++) +		_vm->_trip.getset[fv].remember(r);  } diff --git a/engines/avalanche/celer2.h b/engines/avalanche/celer2.h index 444a5aa94d..a70c814d7a 100644 --- a/engines/avalanche/celer2.h +++ b/engines/avalanche/celer2.h @@ -62,11 +62,9 @@ public:  	byte num_chunks;  	memotype memos[40];  	byte *memory[40]; +	bytefield r; -	Common::File f; - - - +	  	Celer();  	void setParent(AvalancheEngine *vm); @@ -84,7 +82,9 @@ public:  private:  	AvalancheEngine *_vm; -	//untyped_file f; /* Private variable- not accessible from elsewhere. */ +	Common::String filename; + +	Common::File f;  	static const int16 on_disk; /* Value of memos[fv].x when it's not in memory. */ | 
