From: terencehill Date: Tue, 20 Feb 2018 17:52:11 +0000 (+0100) Subject: Make 2 macros less cryptic X-Git-Tag: xonotic-v0.8.5~2290 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3b540762f5a001f8e875a5e09edbc89ca2698aa7;p=xonotic%2Fxonotic-data.pk3dir.git Make 2 macros less cryptic --- diff --git a/qcsrc/menu/xonotic/scrollpanel.qc b/qcsrc/menu/xonotic/scrollpanel.qc index 874a0aff1..4543f0bc4 100644 --- a/qcsrc/menu/xonotic/scrollpanel.qc +++ b/qcsrc/menu/xonotic/scrollpanel.qc @@ -18,16 +18,16 @@ METHOD(XonoticScrollPanel, resizeNotify, void(XonoticScrollPanel this, vector re p.resizeNotify(p, relOrigin, relSize, absOrigin, absSize); } -#define X(x) \ -METHOD(XonoticScrollPanel, x, bool(XonoticScrollPanel this, vector pos)) \ +#define X(mouseFunc) \ +METHOD(XonoticScrollPanel, mouseFunc, bool(XonoticScrollPanel this, vector pos)) \ { \ - SUPER(XonoticScrollPanel).x(this, pos); \ + SUPER(XonoticScrollPanel).mouseFunc(this, pos); \ XonoticTab p = this.currentPanel; \ this.setFocus(this, p); \ \ vector o = -eY * this.scrollPos; \ vector s = eX * (1 - this.controlWidth) + eY * this.itemHeight; \ - return p.x(p, globalToBox(pos, o, s)); \ + return p.mouseFunc(p, globalToBox(pos, o, s)); \ } X(mouseMove) X(mousePress) @@ -35,11 +35,11 @@ X(mouseDrag) X(mouseRelease) #undef X -#define X(x) \ -METHOD(XonoticScrollPanel, x, bool(XonoticScrollPanel this, int key, int ascii, bool shift)) \ +#define X(keyFunc) \ +METHOD(XonoticScrollPanel, keyFunc, bool(XonoticScrollPanel this, int key, int ascii, bool shift)) \ { \ XonoticTab p = this.currentPanel; \ - return p.x(p, key, ascii, shift) || SUPER(XonoticScrollPanel).x(this, key, ascii, shift); \ + return p.keyFunc(p, key, ascii, shift) || SUPER(XonoticScrollPanel).keyFunc(this, key, ascii, shift); \ } X(keyDown) X(keyUp)