1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-24 05:17:17 +00:00

fixed circle drawing

This commit is contained in:
Zeno Rogue 2019-05-09 16:58:42 +02:00
parent 87c436b8cb
commit 9946ceb877

View File

@ -1024,6 +1024,7 @@ void drawCircle(int x, int y, int size, color_t color, color_t fillcolor) {
glflush(); glflush();
glhr::be_nontextured(); glhr::be_nontextured();
glhr::id_modelview(); glhr::id_modelview();
dynamicval<eModel> em(pmodel, mdUnchanged);
glcoords.clear(); glcoords.clear();
x -= current_display->xcenter; y -= current_display->ycenter; x -= current_display->xcenter; y -= current_display->ycenter;
int pts = size * 4; int pts = size * 4;
@ -1033,6 +1034,7 @@ void drawCircle(int x, int y, int size, color_t color, color_t fillcolor) {
float rr = (M_PI * 2 * r) / pts; float rr = (M_PI * 2 * r) / pts;
glcoords.push_back(glhr::makevertex(x + size * sin(rr), y + size * vid.stretch * cos(rr), current_display->scrdist)); glcoords.push_back(glhr::makevertex(x + size * sin(rr), y + size * vid.stretch * cos(rr), current_display->scrdist));
} }
current_display->set_all(0);
glhr::vertices(glcoords); glhr::vertices(glcoords);
glhr::set_depthtest(false); glhr::set_depthtest(false);
if(fillcolor) { if(fillcolor) {