From 1f95e45709e7a668a0d291dac2f29ded500c9c69 Mon Sep 17 00:00:00 2001 From: Alex Foster <123afoster@gmail.com> Date: Sun, 13 Nov 2022 13:00:00 -0800 Subject: [PATCH] make renderstate a class for #241 --- src/engine/render/renderva.cpp | 71 ++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/src/engine/render/renderva.cpp b/src/engine/render/renderva.cpp index e62957d91..a6e5194c2 100644 --- a/src/engine/render/renderva.cpp +++ b/src/engine/render/renderva.cpp @@ -623,41 +623,44 @@ namespace struct renderstate { - bool colormask, depthmask; - int alphaing; - GLuint vbuf; - bool vattribs, vquery; - vec colorscale; - float alphascale; - float refractscale; - vec refractcolor; - int globals, tmu; - GLuint textures[7]; - Slot *slot, *texgenslot; - VSlot *vslot, *texgenvslot; - vec2 texgenscroll; - int texgenorient, texgenmillis; - - void changebatchtmus(); - void disablevquery(); - void disablevbuf(); - void enablevquery(); - void cleanupgeom(); - void enablevattribs(bool all = true); - void disablevattribs(bool all = true); - void changetexgen(int orient, Slot &slot, VSlot &vslot); - - renderstate() : colormask(true), depthmask(true), alphaing(0), vbuf(0), vattribs(false), - vquery(false), colorscale(1, 1, 1), alphascale(0), refractscale(0), - refractcolor(1, 1, 1), globals(-1), tmu(-1), slot(nullptr), - texgenslot(nullptr), vslot(nullptr), texgenvslot(nullptr), - texgenscroll(0, 0), texgenorient(-1), texgenmillis(lastmillis) - { - for(int k = 0; k < 7; ++k) - { - textures[k] = 0; + public: + bool colormask, depthmask; + int alphaing; + GLuint vbuf; + bool vattribs, vquery; + vec colorscale; + float alphascale; + float refractscale; + vec refractcolor; + int globals, tmu; + GLuint textures[7]; + Slot *slot; + VSlot *vslot, *texgenvslot; + int texgenorient, texgenmillis; + + void changebatchtmus(); + void disablevquery(); + void disablevbuf(); + void enablevquery(); + void cleanupgeom(); + void enablevattribs(bool all = true); + void disablevattribs(bool all = true); + void changetexgen(int orient, Slot &slot, VSlot &vslot); + + renderstate() : colormask(true), depthmask(true), alphaing(0), vbuf(0), vattribs(false), + vquery(false), colorscale(1, 1, 1), alphascale(0), refractscale(0), + refractcolor(1, 1, 1), globals(-1), tmu(-1), slot(nullptr), + texgenslot(nullptr), vslot(nullptr), texgenvslot(nullptr), + texgenscroll(0, 0), texgenorient(-1), texgenmillis(lastmillis) + { + for(int k = 0; k < 7; ++k) + { + textures[k] = 0; + } } - } + private: + Slot *texgenslot; + vec2 texgenscroll; }; void renderstate::disablevbuf()