diff options
author | Mike Erwin <significant.bit@gmail.com> | 2016-11-16 19:52:02 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2016-11-16 19:53:41 +0300 |
commit | 472e2c5acf286dd419ef29981c080e5ba8ec5dee (patch) | |
tree | f00b68cb0f2a2e2e06c5cdec1594ec0482e78507 /source/blender/gpu/gawain/immediate.c | |
parent | 2bcb1b208a4193fb28f1e0c4408b733f5ee2c028 (diff) |
Blender 2.8: Added immVertex2s() and immAttrib2s()
Just as mentioned in title. Need new functions for calls found in `transform.c`
T49043
Reviewers: merwin
Tags: #bf_blender_2.8
Differential Revision: https://developer.blender.org/D2358
Diffstat (limited to 'source/blender/gpu/gawain/immediate.c')
-rw-r--r-- | source/blender/gpu/gawain/immediate.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/gpu/gawain/immediate.c b/source/blender/gpu/gawain/immediate.c index 7c3edc20d42..80b1557468b 100644 --- a/source/blender/gpu/gawain/immediate.c +++ b/source/blender/gpu/gawain/immediate.c @@ -539,6 +539,26 @@ void immAttrib2i(unsigned attrib_id, int x, int y) data[1] = y; } +void immAttrib2s(unsigned attrib_id, short x, short y) + { + Attrib* attrib = imm.vertex_format.attribs + attrib_id; + +#if TRUST_NO_ONE + assert(attrib_id < imm.vertex_format.attrib_ct); + assert(attrib->comp_type == GL_SHORT); + assert(attrib->comp_ct == 2); + assert(imm.vertex_idx < imm.vertex_ct); + assert(imm.primitive != PRIM_NONE); // make sure we're between a Begin/End pair +#endif + + setAttribValueBit(attrib_id); + + short* data = (short*)(imm.vertex_data + attrib->offset); + + data[0] = x; + data[1] = y; + } + void immAttrib3fv(unsigned attrib_id, const float data[3]) { immAttrib3f(attrib_id, data[0], data[1], data[2]); @@ -668,6 +688,12 @@ void immVertex2i(unsigned attrib_id, int x, int y) immEndVertex(); } +void immVertex2s(unsigned attrib_id, short x, short y) + { + immAttrib2s(attrib_id, x, y); + immEndVertex(); + } + void immVertex2fv(unsigned attrib_id, const float data[2]) { immAttrib2f(attrib_id, data[0], data[1]); |