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
This commit is contained in:
parent
2bcb1b208a
commit
472e2c5acf
|
@ -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]);
|
||||
|
|
|
@ -45,6 +45,8 @@ void immAttrib4f(unsigned attrib_id, float x, float y, float z, float w);
|
|||
|
||||
void immAttrib2i(unsigned attrib_id, int x, int y);
|
||||
|
||||
void immAttrib2s(unsigned attrib_id, short x, short y);
|
||||
|
||||
void immAttrib3fv(unsigned attrib_id, const float data[3]);
|
||||
void immAttrib4fv(unsigned attrib_id, const float data[4]);
|
||||
|
||||
|
@ -66,6 +68,8 @@ void immVertex3f(unsigned attrib_id, float x, float y, float z);
|
|||
|
||||
void immVertex2i(unsigned attrib_id, int x, int y);
|
||||
|
||||
void immVertex2s(unsigned attrib_id, short x, short y);
|
||||
|
||||
void immVertex2fv(unsigned attrib_id, const float data[2]);
|
||||
void immVertex3fv(unsigned attrib_id, const float data[3]);
|
||||
|
||||
|
|
Loading…
Reference in New Issue