Fix point sprites.
Change-Id: Ic9438daaf25f3969a0dd5b634b7cceccbbbfb27b
This commit is contained in:
@@ -56,6 +56,11 @@ void ProgramFragment::setupGL(const Context *rsc, ProgramFragmentState *state)
|
|||||||
|
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
if (rsc->checkVersion1_1()) {
|
if (rsc->checkVersion1_1()) {
|
||||||
|
if (mPointSpriteEnable) {
|
||||||
|
glEnable(GL_POINT_SPRITE_OES);
|
||||||
|
} else {
|
||||||
|
glDisable(GL_POINT_SPRITE_OES);
|
||||||
|
}
|
||||||
glTexEnvi(GL_POINT_SPRITE_OES, GL_COORD_REPLACE_OES, mPointSpriteEnable);
|
glTexEnvi(GL_POINT_SPRITE_OES, GL_COORD_REPLACE_OES, mPointSpriteEnable);
|
||||||
}
|
}
|
||||||
glBindTexture(GL_TEXTURE_2D, mTextures[ct]->getTextureID());
|
glBindTexture(GL_TEXTURE_2D, mTextures[ct]->getTextureID());
|
||||||
|
|||||||
@@ -800,6 +800,12 @@ static void SC_shininess(float s)
|
|||||||
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, s);
|
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void SC_pointAttenuation(float a, float b, float c)
|
||||||
|
{
|
||||||
|
GLfloat params[] = { a, b, c };
|
||||||
|
glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION, params);
|
||||||
|
}
|
||||||
|
|
||||||
static void SC_hsbToRgb(float h, float s, float b, float* rgb)
|
static void SC_hsbToRgb(float h, float s, float b, float* rgb)
|
||||||
{
|
{
|
||||||
float red = 0.0f;
|
float red = 0.0f;
|
||||||
@@ -1185,6 +1191,8 @@ ScriptCState::SymbolTable_t ScriptCState::gSyms[] = {
|
|||||||
"void", "(float, float, float, float)" },
|
"void", "(float, float, float, float)" },
|
||||||
{ "shininess", (void *)&SC_shininess,
|
{ "shininess", (void *)&SC_shininess,
|
||||||
"void", "(float)" },
|
"void", "(float)" },
|
||||||
|
{ "pointAttenuation", (void *)&SC_pointAttenuation,
|
||||||
|
"void", "(float, float, float)" },
|
||||||
|
|
||||||
{ "uploadToTexture", (void *)&SC_uploadToTexture,
|
{ "uploadToTexture", (void *)&SC_uploadToTexture,
|
||||||
"void", "(int, int)" },
|
"void", "(int, int)" },
|
||||||
|
|||||||
Reference in New Issue
Block a user