X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fdraw.qc;h=2796c05706d0647662ebff6c4dafd88ac5c24b7b;hb=b24dabd36554f22b7b62525fe58c5022584461f5;hp=7596c0c3a1c47c3b3920303dd18136da131cc712;hpb=6c4f62990980e74d4a0963b7179c7c964f535398;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/draw.qc b/qcsrc/menu/draw.qc index 7596c0c3a..2796c0570 100644 --- a/qcsrc/menu/draw.qc +++ b/qcsrc/menu/draw.qc @@ -1,3 +1,7 @@ +#include "draw.qh" +#include "../common/util.qh" +#include "../common/constants.qh" + string draw_mousepointer; vector draw_mousepointer_offset; vector draw_mousepointer_size; @@ -77,7 +81,7 @@ string draw_PreloadPictureWithFlags(string pic, float f) void draw_Picture(vector theOrigin, string pic, vector theSize, vector theColor, float theAlpha) { - if(theSize_x == 0 || theSize.y <= 0) // no default sizing please + if(theSize.x == 0 || theSize.y <= 0) // no default sizing please return; pic = draw_UseSkinFor(pic); drawpic(boxToGlobal(theOrigin, draw_shift, draw_scale), pic, boxToGlobalSize(theSize, draw_scale), theColor, theAlpha * draw_alpha, 0); @@ -303,7 +307,7 @@ float draw_TextWidth(string theText, float ICanHasKallerz, vector SizeThxBye) vector v; v = '0 0 0'; //float r; - v_x = stringwidth(theText, ICanHasKallerz, globalToBoxSize(boxToGlobalSize(SizeThxBye, draw_scale), draw_fontscale)); + v.x = stringwidth(theText, ICanHasKallerz, globalToBoxSize(boxToGlobalSize(SizeThxBye, draw_scale), draw_fontscale)); v = globalToBoxSize(v, draw_scale); return v.x; } @@ -362,12 +366,12 @@ string draw_TextShortenToWidth(string theText, float maxWidth, float ICanHasKall float draw_TextWidth_WithColors(string s, vector theFontSize) { - return draw_TextWidth(s, TRUE, theFontSize); + return draw_TextWidth(s, true, theFontSize); } float draw_TextWidth_WithoutColors(string s, vector theFontSize) { - return draw_TextWidth(s, FALSE, theFontSize); + return draw_TextWidth(s, false, theFontSize); } float draw_TextLengthUpToWidth(string theText, float maxWidth, float allowColorCodes, vector theFontSize)