+ R_Mesh_PrepareVertices_Generic_Arrays(4, floats, floats + 20, floats + 12);
+ R_Mesh_Draw(0, 4, 0, 2, polygonelement3i, NULL, 0, polygonelement3s, NULL, 0);
+}
+
+void DrawQ_RotPic(float x, float y, cachepic_t *pic, float width, float height, float org_x, float org_y, float angle, float red, float green, float blue, float alpha, int flags)
+{
+ float floats[36];
+ float af = DEG2RAD(-angle); // forward
+ float ar = DEG2RAD(-angle + 90); // right
+ float sinaf = sin(af);
+ float cosaf = cos(af);
+ float sinar = sin(ar);
+ float cosar = cos(ar);
+
+ _DrawQ_ProcessDrawFlag(flags);
+
+ R_Mesh_ResetTextureState();
+ if (pic)
+ {
+ if (width == 0)
+ width = pic->width;
+ if (height == 0)
+ height = pic->height;
+ R_SetupShader_Generic(Draw_GetPicTexture(pic), NULL, GL_MODULATE, 1);
+ }
+ else
+ R_SetupShader_Generic(NULL, NULL, GL_MODULATE, 1);
+
+ floats[2] = floats[5] = floats[8] = floats[11] = 0;
+
+// top left
+ floats[0] = x - cosaf*org_x - cosar*org_y;
+ floats[1] = y - sinaf*org_x - sinar*org_y;
+
+// top right
+ floats[3] = x + cosaf*(width-org_x) - cosar*org_y;
+ floats[4] = y + sinaf*(width-org_x) - sinar*org_y;
+
+// bottom right
+ floats[6] = x + cosaf*(width-org_x) + cosar*(height-org_y);
+ floats[7] = y + sinaf*(width-org_x) + sinar*(height-org_y);
+
+// bottom left
+ floats[9] = x - cosaf*org_x + cosar*(height-org_y);
+ floats[10] = y - sinaf*org_x + sinar*(height-org_y);
+
+ floats[12] = 0.0f;floats[13] = 0.0f;
+ floats[14] = 1.0f;floats[15] = 0.0f;
+ floats[16] = 1.0f;floats[17] = 1.0f;
+ floats[18] = 0.0f;floats[19] = 1.0f;
+ floats[20] = floats[24] = floats[28] = floats[32] = red;
+ floats[21] = floats[25] = floats[29] = floats[33] = green;
+ floats[22] = floats[26] = floats[30] = floats[34] = blue;
+ floats[23] = floats[27] = floats[31] = floats[35] = alpha;
+
+ R_Mesh_PrepareVertices_Generic_Arrays(4, floats, floats + 20, floats + 12);
+ R_Mesh_Draw(0, 4, 0, 2, polygonelement3i, NULL, 0, polygonelement3s, NULL, 0);