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

Function loadingscreen

source/src/renderhud.cpp:1178–1212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1176Texture *startscreen = NULL;
1177
1178void loadingscreen(const char *fmt, ...)
1179{
1180 if(!startscreen) startscreen = textureload("packages/misc/startscreen.png", 3);
1181
1182 glEnable(GL_TEXTURE_2D);
1183 glDisable(GL_DEPTH_TEST);
1184
1185 glMatrixMode(GL_PROJECTION);
1186 glLoadIdentity();
1187 glOrtho(0, VIRTW, VIRTH, 0, -1, 1);
1188
1189 glMatrixMode(GL_MODELVIEW);
1190 glLoadIdentity();
1191
1192 glClearColor(0, 0, 0, 1);
1193 glColor3f(1, 1, 1);
1194
1195 loopi(fmt ? 1 : 2)
1196 {
1197 glClear(GL_COLOR_BUFFER_BIT);
1198 quad(startscreen->id, (VIRTW-VIRTH)/2, 0, VIRTH, 0, 0, 1);
1199 if(fmt)
1200 {
1201 glEnable(GL_BLEND);
1202 defvformatstring(str, fmt, fmt);
1203 int w = text_width(str);
1204 draw_text(str, w>=VIRTW ? 0 : (VIRTW-w)/2, VIRTH*3/4);
1205 glDisable(GL_BLEND);
1206 }
1207 SDL_GL_SwapWindow(screen);
1208 }
1209
1210 glDisable(GL_TEXTURE_2D);
1211 glEnable(GL_DEPTH_TEST);
1212}
1213
1214static void bar(float bar, int o, float r, float g, float b)
1215{

Callers 4

load_worldFunction · 0.85
resetglFunction · 0.85
main.cppFile · 0.85

Calls 5

textureloadFunction · 0.85
quadFunction · 0.85
text_widthFunction · 0.85
draw_textFunction · 0.85
loopiFunction · 0.70

Tested by

no test coverage detected