aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNipun Garg2019-07-11 00:50:59 +0530
committerEugene Sandulenko2019-09-03 17:17:16 +0200
commit4c20c8be129a2e720341802783109dec6a07c944 (patch)
tree9621e182b227e60fd6882da29e1a574557709b74
parent0ae4cb1ea7907c7d558cb89ad101f762a0d64c8c (diff)
downloadscummvm-rg350-4c20c8be129a2e720341802783109dec6a07c944.tar.gz
scummvm-rg350-4c20c8be129a2e720341802783109dec6a07c944.tar.bz2
scummvm-rg350-4c20c8be129a2e720341802783109dec6a07c944.zip
HDB: Add Sine and Cosine table
-rw-r--r--engines/hdb/gfx.cpp4
-rw-r--r--engines/hdb/gfx.h11
-rw-r--r--engines/hdb/hdb.h2
3 files changed, 17 insertions, 0 deletions
diff --git a/engines/hdb/gfx.cpp b/engines/hdb/gfx.cpp
index 3303a5bed1..ddee59fcb9 100644
--- a/engines/hdb/gfx.cpp
+++ b/engines/hdb/gfx.cpp
@@ -29,11 +29,15 @@ Gfx::Gfx() {
_gfxCache = new Common::Array<GfxCache *>;
_globalSurface.create(kScreenWidth, kScreenHeight, g_hdb->_format);
_pointerDisplayable = 1;
+ _sines = new Common::SineTable(360);
+ _cosines = new Common::CosineTable(360);
_systemInit = false;
}
Gfx::~Gfx() {
delete _gfxCache;
+ delete _sines;
+ delete _cosines;
_globalSurface.free();
}
diff --git a/engines/hdb/gfx.h b/engines/hdb/gfx.h
index e49b0c56bf..d057caeca7 100644
--- a/engines/hdb/gfx.h
+++ b/engines/hdb/gfx.h
@@ -151,6 +151,15 @@ public:
void setCursor(int x, int y);
void getCursor(int *x, int *y);
+ // Trig Functions
+
+ double getSin(int index) {
+ return _sines->at(index);
+ }
+ double getCos(int index) {
+ return _cosines->at(index);
+ }
+
private:
int _numTiles;
TileLookup *_tLookupArray;
@@ -211,6 +220,8 @@ private:
bool _systemInit;
+ Common::SineTable *_sines;
+ Common::CosineTable *_cosines;
};
class Picture {
diff --git a/engines/hdb/hdb.h b/engines/hdb/hdb.h
index a690be2400..c6ea5182d1 100644
--- a/engines/hdb/hdb.h
+++ b/engines/hdb/hdb.h
@@ -31,6 +31,8 @@
#include "common/str.h"
#include "common/random.h"
#include "common/savefile.h"
+#include "common/sinetables.h"
+#include "common/cosinetables.h"
#include "common/config-manager.h"
#include "graphics/surface.h"
#include "graphics/thumbnail.h"