X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fdraw.qc;h=df93daa6e0bcd3cacaf8fbf57d3ffdbdb0d5ba35;hb=f8d89c06e0b40ce3d7ec536868d24059f0505096;hp=a33cac91633ea8016b622d148b6840f6a1673a86;hpb=1e492eabdcef368aba446eaca34dd3b8d54a63a7;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/draw.qc b/qcsrc/menu/draw.qc index a33cac916..df93daa6e 100644 --- a/qcsrc/menu/draw.qc +++ b/qcsrc/menu/draw.qc @@ -2,14 +2,6 @@ string draw_mousepointer; vector draw_mousepointer_offset; vector draw_mousepointer_size; -string draw_UseSkinFor(string pic) -{ - if(substring(pic, 0, 1) == "/") - return substring(pic, 1, strlen(pic)-1); - else - return strcat(draw_currentSkin, "/", pic); -} - void draw_setMousePointer(string pic, vector theSize, vector theOffset) { draw_mousepointer = strzone(draw_UseSkinFor(pic)); @@ -24,11 +16,21 @@ void draw_drawMousePointer(vector where) void draw_reset(float cw, float ch, float ox, float oy) { - drawfont = FONT_USER+0; draw_shift = '1 0 0' * ox + '0 1 0' * oy; draw_scale = '1 0 0' * cw + '0 1 0' * ch; draw_alpha = 1; draw_fontscale = '1 1 0'; + draw_endBoldFont(); +} + +void draw_beginBoldFont() +{ + drawfont = FONT_USER+3; +} + +void draw_endBoldFont() +{ + drawfont = FONT_USER+0; } vector globalToBox(vector v, vector theOrigin, vector theScale) @@ -61,10 +63,16 @@ vector boxToGlobalSize(vector v, vector theScale) return v; } -void draw_PreloadPicture(string pic) +string draw_PreloadPicture(string pic) { pic = draw_UseSkinFor(pic); - precache_pic(pic); + return precache_pic(pic); +} + +string draw_PreloadPictureWithFlags(string pic, float f) +{ + pic = draw_UseSkinFor(pic); + return precache_pic(pic, f); } void draw_Picture(vector theOrigin, string pic, vector theSize, vector theColor, float theAlpha) @@ -268,8 +276,10 @@ void draw_BorderPicture(vector theOrigin, string pic, vector theSize, vector the } void draw_Text(vector theOrigin, string theText, vector theSize, vector theColor, float theAlpha, float ICanHasKallerz) { - if(theSize_x <= 0 || theSize_y <= 0) - error("Drawing zero size text?\n"); + if(theSize_x <= 0 || theSize_y <= 0) { + dprint("Drawing zero size text?\n"); + return; + } //float wi; //wi = draw_TextWidth(theText, ICanHasKallerz, theSize); @@ -282,14 +292,14 @@ void draw_Text(vector theOrigin, string theText, vector theSize, vector theColor } void draw_CenterText(vector theOrigin, string theText, vector theSize, vector theColor, float theAlpha, float ICanHasKallerz) { - //print(strcat("orig = ", vtos(theOrigin) ," tx = ", ftos(draw_TextWidth(theText, ICanHasKallerz, theSize)), "\n")); + //dprint(strcat("orig = ", vtos(theOrigin) ," tx = ", ftos(draw_TextWidth(theText, ICanHasKallerz, theSize)), "\n")); draw_Text(theOrigin - eX * 0.5 * draw_TextWidth(theText, ICanHasKallerz, theSize), theText, theSize, theColor, theAlpha, ICanHasKallerz); } float draw_TextWidth(string theText, float ICanHasKallerz, vector SizeThxBye) { //return strlen(theText); - //print("draw_TextWidth \"", theText, "\"\n"); + //dprint("draw_TextWidth \"", theText, "\"\n"); vector v; v = '0 0 0'; //float r;