From 90d477d3dc542330c9bfcefc019bbc83f77299d7 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 10 Feb 2018 18:21:46 +0100 Subject: [PATCH] CAP_BITFIELD can be disabled -- this helps with Emscripten --- hyper.h | 13 +++++++++++++ init.cpp | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/hyper.h b/hyper.h index 015a9867..7a414453 100644 --- a/hyper.h +++ b/hyper.h @@ -65,6 +65,7 @@ extern int cellcount, heptacount; struct gcell { +#if CAP_BITFIELD // main fields eLand land : 8; eWall wall : 8; @@ -87,6 +88,18 @@ struct gcell { hitpoints : 4; // hitpoints left (for Palace Guards, also reused as cpid for mirrors) unsigned landflags : 8; // extra flags for land +#else + eLand land; + eWall wall; + eMonster monst; + eItem item; + eLand barleft, barright; + bool ligon; + unsigned char pathdist, cpdist, mpdist; + + unsigned char mondir, bardir, stuntime, hitpoints; + unsigned char landflags; +#endif // 'landparam' is used for: // heat in Icy/Cocytus; diff --git a/init.cpp b/init.cpp index cd6085b7..6bee1522 100644 --- a/init.cpp +++ b/init.cpp @@ -226,6 +226,10 @@ #define CAP_ACHIEVE 1 #endif +#ifndef CAP_BITFIELD +#define CAP_BITFIELD (!ISWEB) +#endif + #ifndef CAP_ACHIEVE #define CAP_ACHIEVE 0 #endif