MCPcopy Create free account
hub / github.com/assaultcube/AC / loopi

Function loopi

source/src/editing.cpp:875–912  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

873 int x1 = FONTH/2 - (showeditingsettings == 1 ? deltax : 0), y1 = 3 * VIRTH/8, x2 = x1 + boxsize;
874 float prevlinew; glGetFloatv(GL_LINE_WIDTH, &prevlinew); glLineWidth(border);
875 loopi(MAXENTTYPES)
876 {
877 if(i>NOTUSED && i<=DUMMYENT)
878 {
879 y1 = 3 * VIRTH/8 + (i-1) * boxline;
880 int y2 = y1 + boxsize;
881 bool ishidden = (edithideentmask & (1 << (i - 1)));
882 // render text first – makes it slide in/out behind the boxes
883 if(showeditingsettings==3||keepshowingeditingsettingsfrom) // 3:all,always || ( 2:text,at first, 1:all,at first )
884 {
885 glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND);
886 defformatstring(entlabel)("\f%d%s", ishidden?4:5, entnames[i]);
887 draw_text(entlabel, x1 + boxline -(showeditingsettings == 2 ? deltax : 0), y1 );
888 glDisable(GL_TEXTURE_2D); glDisable(GL_BLEND);
889 }
890 // now the box
891 partcolour &pc = partcolours[i];
892 glColor3f(pc.r, pc.g, pc.b);
893 glBegin(GL_TRIANGLE_STRIP);
894 glVertex2d(x1, y1);
895 glVertex2d(x2, y1);
896 glVertex2d(x1, y2);
897 glVertex2d(x2, y2);
898 glEnd();
899 // and the border
900 box2d(x1-border, y1-border, x2+border, y2+border, ishidden?0:200);
901 // crossed-out like in menu
902 if(ishidden){
903 glColor3d(0,0,0);
904 glBegin(GL_LINES);
905 glVertex2d(x1, y1);
906 glVertex2d(x2, y2);
907 glVertex2d(x1, y2);
908 glVertex2d(x2, y1);
909 glEnd();
910 }
911 }
912 }
913 glLineWidth(prevlinew);
914 glEnable(GL_TEXTURE_2D);
915 glDepthMask(GL_TRUE);

Callers 9

storepositionFunction · 0.70
restorepositionFunction · 0.70
restoreeditundoFunction · 0.70
rlencodeundoFunction · 0.70
tofronttexFunction · 0.70
edittexturestackFunction · 0.70
renderhudtexturepreviewsFunction · 0.70
settexFunction · 0.70
transformclipentitiesFunction · 0.70

Calls 2

draw_textFunction · 0.85
box2dFunction · 0.85

Tested by

no test coverage detected