From c6acf6c0496eb95f9e3da4eb074fcbf6e92adf88 Mon Sep 17 00:00:00 2001 From: uruk Date: Tue, 17 Dec 2013 13:39:24 +0100 Subject: AVALANCHE: Implement drawing of stones in Nim. --- engines/avalanche/graphics.h | 2 -- engines/avalanche/nim.cpp | 11 +++++++---- engines/avalanche/nim.h | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h index 20f8176294..d54160229a 100644 --- a/engines/avalanche/graphics.h +++ b/engines/avalanche/graphics.h @@ -82,8 +82,6 @@ public: void drawRectangle(Common::Rect rect, Color color); void loadNim(); void drawNimStone(int x, int y); - // Maybe we'll be able to get rid of these two and squeeze them into loadNim() later - // since I am not sure that we'll need to redraw them any other times. void drawNimInitials(); void drawNimLogo(); diff --git a/engines/avalanche/nim.cpp b/engines/avalanche/nim.cpp index 7e63397179..a0c10a2e80 100644 --- a/engines/avalanche/nim.cpp +++ b/engines/avalanche/nim.cpp @@ -188,12 +188,15 @@ void Nim::setup() { _old[i] = 0; } -void Nim::plotStone(byte x,byte y) { - warning("STUB: Nim::plotStone()"); +void Nim::plotStone(byte x, byte y) { + _vm->_graphics->drawNimStone(64 + x * 7 * 8 + x * 8, 75 + y * 35); } void Nim::board() { - warning("STUB: Nim::board()"); + for (int i = 0; i < 3; i++) + for (int j = 0; j < _stones[i]; j++) + plotStone(j, i); + _vm->_graphics->refreshScreen(); } void Nim::startMove() { @@ -233,7 +236,7 @@ bool Nim::find(byte x) { return true; } -void Nim::findAp(byte start,byte stepsize) { +void Nim::findAp(byte start, byte stepsize) { warning("STUB: Nim::findAp()"); } diff --git a/engines/avalanche/nim.h b/engines/avalanche/nim.h index 41ecb0664d..d80445efef 100644 --- a/engines/avalanche/nim.h +++ b/engines/avalanche/nim.h @@ -56,7 +56,7 @@ private: void chalk(int x, int y, Common::String text); void setup(); - void plotStone(byte x,byte y); + void plotStone(byte x, byte y); void board(); void startMove(); void showChanges(); @@ -67,7 +67,7 @@ private: void endOfGame(); void dogFood(); bool find(byte x); - void findAp(byte start,byte stepsize); + void findAp(byte start, byte stepsize); }; } // End of namespace Avalanche -- cgit v1.2.3