X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fcrosshairpreview.qc;h=f3c3fe24fa48ee237b2be4c277b5a0a912f1254f;hb=f5509437b7b847d2a130bfbb04d019abba846979;hp=90694ca8c3a607ade663a6afe1906cab796751ca;hpb=867ce0406b74601b6d74a4ac412ac30063490d88;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/crosshairpreview.qc b/qcsrc/menu/xonotic/crosshairpreview.qc index 90694ca8c..f3c3fe24f 100644 --- a/qcsrc/menu/xonotic/crosshairpreview.qc +++ b/qcsrc/menu/xonotic/crosshairpreview.qc @@ -1,18 +1,5 @@ -#ifndef CROSSHAIRPREVIEW_H -#define CROSSHAIRPREVIEW_H -#include "../item.qc" -CLASS(XonoticCrosshairPreview, Item) - METHOD(XonoticCrosshairPreview, configureXonoticCrosshairPreview, void(entity)); - METHOD(XonoticCrosshairPreview, draw, void(entity)); - ATTRIB(XonoticCrosshairPreview, src, string, string_null) - ATTRIB(XonoticCrosshairPreview, src2, string, string_null) - ATTRIB(XonoticCrosshairPreview, disabled, float, 0) - ATTRIB(XonoticCrosshairPreview, disabledAlpha, float, SKINALPHA_DISABLED) -ENDCLASS(XonoticCrosshairPreview) -entity makeXonoticCrosshairPreview(); -#endif - -#ifdef IMPLEMENTATION +#include "crosshairpreview.qh" + entity makeXonoticCrosshairPreview() { entity me; @@ -38,9 +25,7 @@ void XonoticCrosshairPreview_draw(entity me) float a; rgb = stov(cvar_string("crosshair_color")); a = cvar("crosshair_alpha"); - if(me.src) - strunzone(me.src); - me.src = strzone(strcat("/gfx/crosshair", cvar_string("crosshair"))); + strcpy(me.src, strcat("/gfx/crosshair", cvar_string("crosshair"))); sz = draw_PictureSize(me.src); sz = globalToBoxSize(sz, me.size); @@ -59,4 +44,3 @@ void XonoticCrosshairPreview_draw(entity me) SUPER(XonoticCrosshairPreview).draw(me); } -#endif