X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=gl_draw.c;h=0f0c3670f531c2407f4e3109a29448acc889934b;hb=dbc0ab84895b26254dd41c9b17cb16c77337e9a1;hp=581ef1a22dc8c5fce5df2fab1f86c17e934a08e1;hpb=93d7dc6abc91b90c5ee8787fc0f48eba37516d89;p=xonotic%2Fdarkplaces.git diff --git a/gl_draw.c b/gl_draw.c index 581ef1a2..0f0c3670 100644 --- a/gl_draw.c +++ b/gl_draw.c @@ -446,7 +446,7 @@ reload: // show up the right size in the menu even if they were replaced with // higher or lower resolution versions dpsnprintf(lmpname, sizeof(lmpname), "%s.lmp", pic->name); - if (!strncmp(pic->name, "gfx/", 4) && (lmpdata = FS_LoadFile(lmpname, tempmempool, false, &lmpsize))) + if ((!strncmp(pic->name, "gfx/", 4) || (gamemode == GAME_BLOODOMNICIDE && !strncmp(pic->name, "locale/", 6))) && (lmpdata = FS_LoadFile(lmpname, tempmempool, false, &lmpsize))) { if (developer_loading.integer) Con_Printf("loading lump \"%s\"\n", pic->name); @@ -1018,7 +1018,7 @@ static void gl_draw_start(void) LoadFont(false, va(vabuf, sizeof(vabuf), "gfx/font_%s", dp_fonts.f[i].title), &dp_fonts.f[i], 1, 0); // draw the loading screen so people have something to see in the newly opened window - SCR_UpdateLoadingScreen(true); + SCR_UpdateLoadingScreen(true, true); } static void gl_draw_shutdown(void) @@ -1387,7 +1387,8 @@ float DrawQ_TextWidth_UntilWidth_TrackColors_Scale(const char *text, size_t *max else width_of = fnt->width_of; - for (i = 0;((bytes_left = *maxlen - (text - text_start)) > 0) && *text;) + i = 0; + while (((bytes_left = *maxlen - (text - text_start)) > 0) && *text) { size_t i0 = i; nextch = ch = u8_getnchar(text, &text, bytes_left); @@ -1616,7 +1617,7 @@ float DrawQ_String_Scale(float startx, float starty, const char *text, size_t ma y += r_textshadow.value * vid.height / vid_conheight.value; } */ - for (i = 0;((bytes_left = maxlen - (text - text_start)) > 0) && *text;) + while (((bytes_left = maxlen - (text - text_start)) > 0) && *text) { nextch = ch = u8_getnchar(text, &text, bytes_left); i = text - text_start; @@ -1970,8 +1971,6 @@ void DrawQ_Mesh (drawqueuemesh_t *mesh, int flags, qboolean hasalpha) void DrawQ_LineLoop (drawqueuemesh_t *mesh, int flags) { - int num; - _DrawQ_SetupAndProcessDrawFlag(flags, NULL, 1); if(!r_draw2d.integer && !r_draw2d_force) return; @@ -1983,16 +1982,19 @@ void DrawQ_LineLoop (drawqueuemesh_t *mesh, int flags) case RENDERPATH_GL13: case RENDERPATH_GL20: #ifndef USE_GLES2 - CHECKGLERROR - qglBegin(GL_LINE_LOOP); - for (num = 0;num < mesh->num_vertices;num++) { - if (mesh->data_color4f) - GL_Color(mesh->data_color4f[num*4+0], mesh->data_color4f[num*4+1], mesh->data_color4f[num*4+2], mesh->data_color4f[num*4+3]); - qglVertex2f(mesh->data_vertex3f[num*3+0], mesh->data_vertex3f[num*3+1]); + int num; + CHECKGLERROR + qglBegin(GL_LINE_LOOP); + for (num = 0;num < mesh->num_vertices;num++) + { + if (mesh->data_color4f) + GL_Color(mesh->data_color4f[num*4+0], mesh->data_color4f[num*4+1], mesh->data_color4f[num*4+2], mesh->data_color4f[num*4+3]); + qglVertex2f(mesh->data_vertex3f[num*3+0], mesh->data_vertex3f[num*3+1]); + } + qglEnd(); + CHECKGLERROR } - qglEnd(); - CHECKGLERROR #endif break; case RENDERPATH_D3D9: @@ -2061,14 +2063,8 @@ void DrawQ_Line (float width, float x1, float y1, float x2, float y2, float r, f } } -void DrawQ_Lines (float width, int numlines, const float *vertex3f, const float *color4f, int flags) +void DrawQ_Lines (float width, int numlines, int flags, qboolean hasalpha) { - int i; - qboolean hasalpha = false; - for (i = 0;i < numlines*2;i++) - if (color4f[i*4+3] < 1.0f) - hasalpha = true; - _DrawQ_SetupAndProcessDrawFlag(flags, NULL, hasalpha ? 0.5f : 1.0f); if(!r_draw2d.integer && !r_draw2d_force) @@ -2086,7 +2082,6 @@ void DrawQ_Lines (float width, int numlines, const float *vertex3f, const float //qglLineWidth(width);CHECKGLERROR CHECKGLERROR - R_Mesh_PrepareVertices_Generic_Arrays(numlines*2, vertex3f, color4f, NULL); qglDrawArrays(GL_LINES, 0, numlines*2); CHECKGLERROR break;