Skip to content

Commit

Permalink
fixed compilation without CAP_EDIT and CAP_CONFIG
Browse files Browse the repository at this point in the history
  • Loading branch information
zenorogue committed Aug 31, 2018
1 parent 96175cd commit c08a6bf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ template<class T, class U, class V> void addsaver(T& i, U name, V dft) {

template<class T, class U> void addsaver(T& i, U name) {}
template<class T, class U> void addsaverenum(T& i, U name) {}
template<class T, class U> void addsaverenum(T& i, U name, T dft) {}
#endif

void addsaver(charstyle& cs, string s) {
Expand Down
13 changes: 9 additions & 4 deletions graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,11 @@ bool drawstar(cell *c) {
}

bool drawing_usershape_on(cell *c, mapeditor::eShapegroup sg) {
#if CAP_EDIT
return c && c == mapeditor::drawcell && mapeditor::drawcellShapeGroup() == sg;
#else
return false;
#endif
}

bool drawItemType(eItem it, cell *c, const transmatrix& V, int icol, int ticks, bool hidden) {
Expand Down Expand Up @@ -3772,8 +3776,10 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {

int flooralpha = 255;

#if CAP_EDIT
if((cmode & sm::DRAW) && mapeditor::drawcell && mapeditor::drawcellShapeGroup() == mapeditor::sgFloor)
flooralpha = 0xC0;
#endif

if(c->wall == waMagma) fd = 0;

Expand All @@ -3800,14 +3806,13 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {

// floor

#if CAP_EDIT
auto si = patterns::getpatterninfo0(c);
#endif

bool eoh = euclid || !BITRUNCATED;

#if CAP_EDIT
auto si = patterns::getpatterninfo0(c);
if(drawing_usershape_on(c, mapeditor::sgFloor))
mapeditor::drawtrans = V * applyPatterndir(c, si);
#endif

if(c->wall == waChasm) {
zcol = 0;
Expand Down

0 comments on commit c08a6bf

Please sign in to comment.