[Scummvm-cvs-logs] scummvm master -> 2d5493b599b8ea5410a0ba481b6cd12c05debf52
urukgit
urukgit at users.noreply.github.com
Wed Feb 19 19:11:16 CET 2014
This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
a3eea23624 AVALANCHE: Implement ShootEmUp::initRunner().
c498e910eb AVALANCHE: Implement ShootEmUp::plotThem() and connected functions.
546a3cea82 AVALANCHE: Implement ShootEmUp::moveThem().
5c841dab6d AVALANCHE: Implement ShootEmUp::moveAvvy().
2d5493b599 AVALANCHE: Implement ShootEmUp::bumpFolk() and ShootEmUp::turnAround().
Commit: a3eea23624df66a277802bc1bf828dbf773c5da1
https://github.com/scummvm/scummvm/commit/a3eea23624df66a277802bc1bf828dbf773c5da1
Author: uruk (koppirnyo at gmail.com)
Date: 2014-02-19T07:48:26-08:00
Commit Message:
AVALANCHE: Implement ShootEmUp::initRunner().
Changed paths:
engines/avalanche/shootemup.cpp
engines/avalanche/shootemup.h
diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp
index 4a4c10c..07a40a0 100644
--- a/engines/avalanche/shootemup.cpp
+++ b/engines/avalanche/shootemup.cpp
@@ -36,6 +36,7 @@ const byte ShootEmUp::kStocks = 27;
const byte ShootEmUp::kFacingRight = 87;
const byte ShootEmUp::kFacingLeft = 93;
const long int ShootEmUp::kFlag = -20047;
+const byte ShootEmUp::kFrameDelayMax = 2;
ShootEmUp::ShootEmUp(AvalancheEngine *vm) {
_vm = vm;
@@ -308,8 +309,22 @@ void ShootEmUp::setup() {
initRunner(20, 100, 61, 67, (-(int8)_vm->_rnd->getRandomNumber(4)) + 1, _vm->_rnd->getRandomNumber(3) - 2);
}
-void ShootEmUp::initRunner(int16 xx, int16 yy, byte f1, byte f2, int8 ixx, int8 iyy) {
- warning("STUB: ShootEmUp::initRunner()");
+void ShootEmUp::initRunner(int16 x, int16 y, byte f1, byte f2, int8 ix, int8 iy) {
+ for (int i = 0; i < 4; i++) {
+ if (_running[i]._x == kFlag) {
+ _running[i]._x = x;
+ _running[i]._y = y;
+ _running[i]._frame = f1;
+ _running[i]._tooHigh = f2;
+ _running[i]._lowest = f1;
+ _running[i]._ix = ix;
+ _running[i]._iy = iy;
+ if ((ix = 0) && (iy = 0))
+ _running[i]._ix = 2; // To stop them running on the spot!
+ _running[i]._frameDelay = kFrameDelayMax;
+ return;
+ }
+ }
}
void ShootEmUp::moveAvvy() {
diff --git a/engines/avalanche/shootemup.h b/engines/avalanche/shootemup.h
index 38f18b0..62d5580 100644
--- a/engines/avalanche/shootemup.h
+++ b/engines/avalanche/shootemup.h
@@ -62,6 +62,7 @@ private:
static const byte kFacingRight;
static const byte kFacingLeft;
static const long int kFlag;
+ static const byte kFrameDelayMax;
AvalancheEngine *_vm;
Commit: c498e910eb19bcc78fbd35dbf743a09e9a2e0ddb
https://github.com/scummvm/scummvm/commit/c498e910eb19bcc78fbd35dbf743a09e9a2e0ddb
Author: uruk (koppirnyo at gmail.com)
Date: 2014-02-19T08:55:32-08:00
Commit Message:
AVALANCHE: Implement ShootEmUp::plotThem() and connected functions.
Changed paths:
engines/avalanche/graphics.cpp
engines/avalanche/graphics.h
engines/avalanche/shootemup.cpp
engines/avalanche/shootemup.h
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index cde0f5d..3b4413a 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -755,6 +755,31 @@ void GraphicManager::seuDrawPicture(int x, int y, byte which) {
}
/**
+ * @remarks Originally called 'cameo_display'
+ */
+void GraphicManager::seuDrawCameo(int destX, int destY, byte w1, byte w2) {
+ // First we make the pixels of the previous sprite (cameo) blank:
+ uint16 maxX = _seuPictures[w2].w;
+ uint16 maxY = _seuPictures[w2].h;
+
+ if (destX + maxX > _surface.w)
+ maxX = _surface.w - destX;
+
+ if (destY + maxY > _surface.h)
+ maxY = _surface.h - destY;
+
+ for (uint16 y = 0; y < maxY; y++) {
+ for (uint16 x = 0; x < maxX; x++) {
+ if (*(const byte *)_seuPictures[w2].getBasePtr(x, y) != 0)
+ *(byte *)_surface.getBasePtr(x + destX, y + destY) = 0;
+ }
+ }
+
+ // Then we draw the desired sprite:
+ drawPicture(_surface, _seuPictures[w1], destX, destY);
+}
+
+/**
* This function is for skipping the difference between a stored 'size' value associated with a picture
* and the actual size of the pictures when reading them from files for Ghostroom and Shoot em' up.
* It's needed bacuse the original code loaded the pictures to arrays first and only used the useful parts
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 1da875b..553f993 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -115,6 +115,7 @@ public:
void seuLoad();
void seuFree();
void seuDrawPicture(int x, int y, byte which);
+ void seuDrawCameo(int destX, int destY, byte w1, byte w2);
void clearAlso();
void clearTextBar();
diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp
index 07a40a0..d7832a0 100644
--- a/engines/avalanche/shootemup.cpp
+++ b/engines/avalanche/shootemup.cpp
@@ -81,6 +81,7 @@ ShootEmUp::ShootEmUp(AvalancheEngine *vm) {
_escapeCount = 0;
_escaping = false;
_timeThisSecond = 0;
+ _cp = false;
}
void ShootEmUp::run() {
@@ -120,6 +121,8 @@ void ShootEmUp::run() {
check321();
readKbd();
+ _cp = !_cp;
+
_vm->_graphics->refreshScreen();
} while (_time != 0);
@@ -150,8 +153,32 @@ void ShootEmUp::moveThem() {
warning("STUB: ShootEmUp::moveThem()");
}
+void ShootEmUp::blank(Common::Rect rect) {
+ _rectangles[_rectNum++] = rect;
+}
+
void ShootEmUp::plotThem() {
- warning("STUB: ShootEmUp::plotThem()");
+ for (int i = 0; i < 99; i++) {
+ if (_sprites[i]._x != kFlag) {
+ if (_sprites[i]._cameo) {
+ _vm->_graphics->seuDrawCameo(_sprites[i]._x, _sprites[i]._y, _sprites[i]._p, _sprites[i]._cameoFrame);
+ if (!_cp) {
+ _sprites[i]._cameoFrame += 2;
+ _sprites[i]._p += 2;
+ }
+ } else
+ _vm->_graphics->seuDrawPicture(_sprites[i]._x, _sprites[i]._y, _sprites[i]._p);
+
+ if (_sprites[i]._wipe)
+ blank(Common::Rect(_sprites[i]._x, _sprites[i]._y, _sprites[i]._x + _rectangles[i].width(), _sprites[i]._y + _rectangles[i].height()));
+
+ if (_sprites[i]._timeout > 0) {
+ _sprites[i]._timeout--;
+ if (_sprites[i]._timeout == 0)
+ _sprites[i]._y = kFlag;
+ }
+ }
+ }
}
void ShootEmUp::define(int16 x, int16 y, byte p, int8 ix, int8 iy, int16 time, bool isAMissile, bool doWeWipe) {
@@ -276,6 +303,8 @@ void ShootEmUp::setup() {
showStock(i);
}
+ _cp = true;
+
_avvyWas = 320;
_avvyPos = 320;
_avvyAnim = 1;
diff --git a/engines/avalanche/shootemup.h b/engines/avalanche/shootemup.h
index 62d5580..6dfa3ba 100644
--- a/engines/avalanche/shootemup.h
+++ b/engines/avalanche/shootemup.h
@@ -86,11 +86,13 @@ private:
uint16 _escapeCount;
bool _escaping;
byte _timeThisSecond;
+ bool _cp;
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 blank(Common::Rect rect);
void plotThem();
void define(int16 x, int16 y, byte p, int8 ix, int8 iy, int16 time, bool isAMissile, bool doWeWipe);
void defineCameo(int16 xx, int16 yy, byte pp, int16 time);
Commit: 546a3cea826fca2e33f7472dd080d21d0e2ab54c
https://github.com/scummvm/scummvm/commit/546a3cea826fca2e33f7472dd080d21d0e2ab54c
Author: uruk (koppirnyo at gmail.com)
Date: 2014-02-19T08:56:16-08:00
Commit Message:
AVALANCHE: Implement ShootEmUp::moveThem().
Changed paths:
engines/avalanche/shootemup.cpp
diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp
index d7832a0..52dd1d4 100644
--- a/engines/avalanche/shootemup.cpp
+++ b/engines/avalanche/shootemup.cpp
@@ -150,7 +150,12 @@ void ShootEmUp::blankIt() {
}
void ShootEmUp::moveThem() {
- warning("STUB: ShootEmUp::moveThem()");
+ for (int i = 0; i < 99; i++) {
+ if (_sprites[i]._x != kFlag) {
+ _sprites[i]._x += _sprites[i]._ix;
+ _sprites[i]._y += _sprites[i]._iy;
+ }
+ }
}
void ShootEmUp::blank(Common::Rect rect) {
Commit: 5c841dab6dd03754e37b3c7a0849a865f850179b
https://github.com/scummvm/scummvm/commit/5c841dab6dd03754e37b3c7a0849a865f850179b
Author: uruk (koppirnyo at gmail.com)
Date: 2014-02-19T09:45:08-08:00
Commit Message:
AVALANCHE: Implement ShootEmUp::moveAvvy().
Changed paths:
engines/avalanche/shootemup.cpp
engines/avalanche/shootemup.h
diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp
index 52dd1d4..fde6fc3 100644
--- a/engines/avalanche/shootemup.cpp
+++ b/engines/avalanche/shootemup.cpp
@@ -33,10 +33,13 @@
namespace Avalanche {
const byte ShootEmUp::kStocks = 27;
+const byte ShootEmUp::kAvvyShoots = 86;
const byte ShootEmUp::kFacingRight = 87;
const byte ShootEmUp::kFacingLeft = 93;
const long int ShootEmUp::kFlag = -20047;
const byte ShootEmUp::kFrameDelayMax = 2;
+const byte ShootEmUp::kAvvyY = 150;
+const byte ShootEmUp::kShooting[7] = { 87, 80, 81, 82, 81, 80, 87 };
ShootEmUp::ShootEmUp(AvalancheEngine *vm) {
_vm = vm;
@@ -82,6 +85,7 @@ ShootEmUp::ShootEmUp(AvalancheEngine *vm) {
_escaping = false;
_timeThisSecond = 0;
_cp = false;
+ _wasFacing = 0;
}
void ShootEmUp::run() {
@@ -362,7 +366,36 @@ void ShootEmUp::initRunner(int16 x, int16 y, byte f1, byte f2, int8 ix, int8 iy)
}
void ShootEmUp::moveAvvy() {
- warning("STUB: ShootEmUp::moveAvvy()");
+ if (_avvyWas < _avvyPos)
+ _avvyFacing = kFacingRight;
+ else if (_avvyWas > _avvyPos)
+ _avvyFacing = kFacingLeft;
+
+ if (!_firing) {
+ if (_avvyWas == _avvyPos)
+ _avvyAnim = 1;
+ else {
+ _avvyAnim++;
+ if (_avvyAnim == 6)
+ _avvyAnim = 0;
+ }
+ }
+
+ if (_avvyFacing == kAvvyShoots)
+ define(_avvyPos, kAvvyY, kShooting[_avvyAnim], 0, 0, 1, false, true);
+ else
+ define(_avvyPos, kAvvyY, _avvyAnim + _avvyFacing, 0, 0, 1, false, true);
+
+ _avvyWas = _avvyPos;
+
+ if (_avvyFacing == kAvvyShoots) {
+ if (_avvyAnim == 6) {
+ _avvyFacing = _wasFacing;
+ _avvyAnim = 0;
+ _firing = false;
+ } else
+ _avvyAnim++;
+ }
}
void ShootEmUp::readKbd() {
diff --git a/engines/avalanche/shootemup.h b/engines/avalanche/shootemup.h
index 6dfa3ba..b3561ac 100644
--- a/engines/avalanche/shootemup.h
+++ b/engines/avalanche/shootemup.h
@@ -59,10 +59,13 @@ private:
};
static const byte kStocks;
+ static const byte kAvvyShoots;
static const byte kFacingRight;
static const byte kFacingLeft;
static const long int kFlag;
static const byte kFrameDelayMax;
+ static const byte kAvvyY;
+ static const byte kShooting[7];
AvalancheEngine *_vm;
@@ -87,6 +90,7 @@ private:
bool _escaping;
byte _timeThisSecond;
bool _cp;
+ byte _wasFacing;
bool overlap(uint16 a1x, uint16 a1y, uint16 a2x, uint16 a2y, uint16 b1x, uint16 b1y, uint16 b2x, uint16 b2y);
byte getStockNumber(byte x);
Commit: 2d5493b599b8ea5410a0ba481b6cd12c05debf52
https://github.com/scummvm/scummvm/commit/2d5493b599b8ea5410a0ba481b6cd12c05debf52
Author: uruk (koppirnyo at gmail.com)
Date: 2014-02-19T10:10:25-08:00
Commit Message:
AVALANCHE: Implement ShootEmUp::bumpFolk() and ShootEmUp::turnAround().
Changed paths:
engines/avalanche/shootemup.cpp
diff --git a/engines/avalanche/shootemup.cpp b/engines/avalanche/shootemup.cpp
index fde6fc3..5a49012 100644
--- a/engines/avalanche/shootemup.cpp
+++ b/engines/avalanche/shootemup.cpp
@@ -411,11 +411,31 @@ void ShootEmUp::collisionCheck() {
}
void ShootEmUp::turnAround(byte who, bool randomX) {
- warning("STUB: ShootEmUp::turnAround()");
+ if (randomX) {
+ int8 ix = (_vm->_rnd->getRandomNumber(4) + 1);
+ if (_running[who]._ix > 0)
+ _running[who]._ix = -(ix);
+ else
+ _running[who]._ix = ix;
+ } else
+ _running[who]._ix = -(_running[who]._ix);
+
+ _running[who]._iy = -(_running[who]._iy);
}
void ShootEmUp::bumpFolk() {
- warning("STUB: ShootEmUp::bumpFolk()");
+ for (int i = 0; i < 4; i++) {
+ if (_running[i]._x != kFlag) {
+ for (int j = i + 1; j < 4; j++) {
+ bool overlaps = overlap(_running[i]._x, _running[i]._y, _running[i]._x + 17, _running[i]._y + 24,
+ _running[j]._x, _running[j]._y, _running[j]._x + 17, _running[j]._y + 24);
+ if ((_running[i]._x != kFlag) && overlaps) {
+ turnAround(i, false); // Opp. directions.
+ turnAround(j, false);
+ }
+ }
+ }
+ }
}
void ShootEmUp::peopleRunning() {
More information about the Scummvm-git-logs
mailing list