[Scummvm-cvs-logs] scummvm master -> 6d38d25af3168c3b56f11179afa1f51ccaffeda1

urukgit urukgit at users.noreply.github.com
Fri Feb 14 13:31:48 CET 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
6d38d25af3 AVALANCHE: Add ShootEmUp's skeleton.


Commit: 6d38d25af3168c3b56f11179afa1f51ccaffeda1
    https://github.com/scummvm/scummvm/commit/6d38d25af3168c3b56f11179afa1f51ccaffeda1
Author: uruk (koppirnyo at gmail.com)
Date: 2014-02-14T04:31:08-08:00

Commit Message:
AVALANCHE: Add ShootEmUp's skeleton.

Changed paths:
  A engines/avalanche/shootemup.cpp
  A engines/avalanche/shootemup.h
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/module.mk
    engines/avalanche/timer.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index d04f2f8..073b9a9 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -57,6 +57,7 @@ AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription *
 	_nim = nullptr;
 	_ghostroom = nullptr;
 	_help = nullptr;
+	_shootemup = nullptr;
 
 	_platform = gd->desc.platform;
 	initVariables();
@@ -81,6 +82,7 @@ AvalancheEngine::~AvalancheEngine() {
 	delete _nim;
 	delete _ghostroom;
 	delete _help;
+	delete _shootemup;
 
 	for (int i = 0; i < 31; i++) {
 		for (int j = 0; j < 2; j++) {
@@ -165,6 +167,7 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_nim = new Nim(this);
 	_ghostroom = new GhostRoom(this);
 	_help = new Help(this);
+	_shootemup = new ShootEmUp(this);
 
 	_graphics->init();
 	_dialogs->init();
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 5e5bc34..d2e5678 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -44,6 +44,7 @@
 #include "avalanche/clock.h"
 #include "avalanche/ghostroom.h"
 #include "avalanche/help.h"
+#include "avalanche/shootemup.h"
 
 #include "common/serializer.h"
 
@@ -89,6 +90,7 @@ public:
 	Nim *_nim;
 	GhostRoom *_ghostroom;
 	Help *_help;
+	ShootEmUp *_shootemup;
 
 	OSystem *_system;
 
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index 3ee29dc..eb95e32 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -18,7 +18,8 @@ MODULE_OBJS = \
 	nim.o \
 	clock.o \
 	ghostroom.o \
-	help.o
+	help.o \
+	shootemup.o
 	
 # This module can be built as a plugin
 ifeq ($(ENABLE_AVALANCHE), DYNAMIC_PLUGIN)
diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp
new file mode 100644
index 0000000..01c5a19
--- /dev/null
+++ b/engines/avalanche/shootemup.cpp
@@ -0,0 +1,179 @@
+/* ScummVM - Graphic Adventure Engine
+*
+* ScummVM is the legal property of its developers, whose names
+* are too numerous to list here. Please refer to the COPYRIGHT
+* file distributed with this source distribution.
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*
+*/
+
+/*
+* This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+* Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+*/
+
+#include "avalanche/avalanche.h"
+#include "avalanche/shootemup.h"
+
+#include "common/random.h"
+
+namespace Avalanche {
+
+ShootEmUp::ShootEmUp(AvalancheEngine *vm) {
+	_vm = vm;
+
+	_time = 0;
+}
+
+void ShootEmUp::run() {
+	titles();
+	setup();
+	initRunner(20, 70, 48, 54, _vm->_rnd->getRandomNumber(4) + 1, _vm->_rnd->getRandomNumber(3) - 2);
+	initRunner(600, 70, 48, 54, _vm->_rnd->getRandomNumber(4) + 1, _vm->_rnd->getRandomNumber(3) - 2);
+	initRunner(600, 100, 61, 67, -(_vm->_rnd->getRandomNumber(4)) + 1, _vm->_rnd->getRandomNumber(3) - 2);
+	initRunner(20, 100, 61, 67, -(_vm->_rnd->getRandomNumber(4)) + 1, _vm->_rnd->getRandomNumber(3) - 2);
+	do {
+		blankIt();
+		hitPeople();
+		plotThem();
+		moveThem();
+		moveAvvy();
+		bumpFolk();
+		peopleRunning();
+		animate();
+		escapeCheck();
+		collisionCheck();
+		updateTime();
+		check321();
+		readKbd();
+	} while (_time != 0);
+}
+
+bool ShootEmUp::overlap(uint16 a1x, uint16 a1y, uint16 a2x, uint16 a2y, uint16 b1x, uint16 b1y, uint16 b2x, uint16 b2y) {
+	warning("STUB: ShootEmUp::overlap()");
+	return false;
+}
+
+byte ShootEmUp::getStockNumber(byte x) {
+	warning("STUB: ShootEmUp::getStockNumber()");
+	return 0;
+}
+
+void ShootEmUp::blankIt() {
+	warning("STUB: ShootEmUp::blankIt()");
+}
+
+void ShootEmUp::moveThem() {
+	warning("STUB: ShootEmUp::moveThem()");
+}
+
+void ShootEmUp::plotThem() {
+	warning("STUB: ShootEmUp::plotThem()");
+}
+
+void ShootEmUp::define(int16 xx, int16 yy, byte pp, int8 ixx, int8 iyy, int16 time, bool isAMissile, bool doWeWipe) {
+	warning("STUB: ShootEmUp::define()");
+}
+
+void ShootEmUp::defineCameo(int16 xx, int16 yy, byte pp, int16 time) {
+	warning("STUB: ShootEmUp::defineCameo()");
+}
+
+void ShootEmUp::showStock(byte x) {
+	warning("STUB: ShootEmUp::showStock()");
+}
+
+void ShootEmUp::showScore() {
+	warning("STUB: ShootEmUp::showScore()");
+}
+
+void ShootEmUp::showTime() {
+	warning("STUB: ShootEmUp::showTime()");
+}
+
+void ShootEmUp::gain(int8 howMuch) {
+	warning("STUB: ShootEmUp::gain()");
+}
+
+void ShootEmUp::newEscape() {
+	warning("STUB: ShootEmUp::newEscape()");
+}
+
+void ShootEmUp::nextPage() {
+	warning("STUB: ShootEmUp::nextPage()");
+}
+
+void ShootEmUp::instructions() {
+	warning("STUB: ShootEmUp::instructions()");
+}
+
+void ShootEmUp::setup() {
+	warning("STUB: ShootEmUp::setup()");
+}
+
+void ShootEmUp::initRunner(int16 xx, int16 yy, byte f1, byte f2, int8 ixx, int8 iyy) {
+	warning("STUB: ShootEmUp::initRunner()");
+}
+
+void ShootEmUp::titles() {
+	warning("STUB: ShootEmUp::titles()");
+}
+
+void ShootEmUp::moveAvvy() {
+	warning("STUB: ShootEmUp::moveAvvy()");
+}
+
+void ShootEmUp::readKbd() {
+	warning("STUB: ShootEmUp::readKbd()");
+}
+
+void ShootEmUp::animate() {
+	warning("STUB: ShootEmUp::animate()");
+}
+
+void ShootEmUp::collisionCheck() {
+	warning("STUB: ShootEmUp::collisionCheck()");
+}
+
+void ShootEmUp::turnAround(byte who, bool randomX) {
+	warning("STUB: ShootEmUp::turnAround()");
+}
+
+void ShootEmUp::bumpFolk() {
+	warning("STUB: ShootEmUp::bumpFolk()");
+}
+
+void ShootEmUp::peopleRunning() {
+	warning("STUB: ShootEmUp::peopleRunning()");
+}
+
+void ShootEmUp::updateTime() {
+	warning("STUB: ShootEmUp::updateTime()");
+}
+
+void ShootEmUp::hitPeople() {
+	warning("STUB: ShootEmUp::hitPeople()");
+}
+
+void ShootEmUp::escapeCheck() {
+	warning("STUB: ShootEmUp::escapeCheck()");
+}
+
+void ShootEmUp::check321() {
+	warning("STUB: ShootEmUp::check321()");
+}
+
+} // End of namespace Avalanche
diff --git a/engines/avalanche/shootemup.h b/engines/avalanche/shootemup.h
new file mode 100644
index 0000000..6a1f182
--- /dev/null
+++ b/engines/avalanche/shootemup.h
@@ -0,0 +1,77 @@
+/* ScummVM - Graphic Adventure Engine
+*
+* ScummVM is the legal property of its developers, whose names
+* are too numerous to list here. Please refer to the COPYRIGHT
+* file distributed with this source distribution.
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*
+*/
+
+/*
+* This code is based on the original source code of Lord Avalot d'Argent version 1.3.
+* Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+*/
+
+#ifndef AVALANCHE_SHOOTEMUP_H
+#define AVALANCHE_SHOOTEMUP_H
+
+namespace Avalanche {
+class AvalancheEngine;
+
+class ShootEmUp {
+public:
+	ShootEmUp(AvalancheEngine *vm);
+
+	void run();
+
+private:
+	AvalancheEngine *_vm;
+
+	byte _time;
+
+	bool overlap(uint16 a1x, uint16 a1y, uint16 a2x, uint16 a2y, uint16 b1x, uint16 b1y, uint16 b2x, uint16 b2y);
+	byte getStockNumber(byte x);
+	void blankIt();
+	void moveThem();
+	void plotThem();
+	void define(int16 xx, int16 yy, byte pp, int8 ixx, int8 iyy, int16 time, bool isAMissile, bool doWeWipe);
+	void defineCameo(int16 xx, int16 yy, byte pp, int16 time);
+	void showStock(byte x);
+	void showScore();
+	void showTime();
+	void gain(int8 howMuch);
+	void newEscape();
+	void nextPage(); // Internal function of 'instructions' in the original.
+	void instructions();
+	void setup();
+	void initRunner(int16 xx, int16 yy, byte f1, byte f2, int8 ixx, int8 iyy);
+	void titles();
+	void moveAvvy();
+	void readKbd();
+	void animate();
+	void collisionCheck();
+	void turnAround(byte who, bool randomX);
+	void bumpFolk();
+	void peopleRunning();
+	void updateTime();
+	void hitPeople();
+	void escapeCheck();
+	void check321();
+};
+
+} // End of namespace Avalanche
+
+#endif // AVALANCHE_SHOOTEMUP_H
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index f63098a..b7a8433 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -327,12 +327,11 @@ void Timer::hangAround2() {
 	_vm->_animation->_sprites[0]->remove();
 	spr->remove(); // Get rid of Robin Hood and Friar Tuck.
 
-	addTimer(1, kProcAfterTheShootemup, kReasonHangingAround);
-	// Immediately call the following proc (when you have a chance).
+	addTimer(1, kProcAfterTheShootemup, kReasonHangingAround); // Immediately call the following proc (when you have a chance).
 
 	_vm->_tiedUp = false;
 
-	// _vm->_enid->backToBootstrap(1); Call the shoot-'em-up. TODO: Replace it with proper ScummVM-friendly function(s)! Do not remove until then!
+	_vm->_shootemup->run();
 }
 
 void Timer::afterTheShootemup() {






More information about the Scummvm-git-logs mailing list