Fix but processing raster state pragma.
rename stateFragmentStore to stateStore
diff --git a/java/Film/res/raw/filmimage.c b/java/Film/res/raw/filmimage.c
index 3bd9496..d154c68 100644
--- a/java/Film/res/raw/filmimage.c
+++ b/java/Film/res/raw/filmimage.c
@@ -4,7 +4,7 @@
#pragma stateVertex(orthoWindow)
#pragma stateRaster(flat)
#pragma stateFragment(PgmFragBackground)
-#pragma stateFragmentStore(MyBlend)
+#pragma stateStore(MyBlend)
int main(void* con, int ft, int launchID) {
diff --git a/java/Film/res/raw/filmstrip.c b/java/Film/res/raw/filmstrip.c
index 8fbfee1..bf75675 100644
--- a/java/Film/res/raw/filmstrip.c
+++ b/java/Film/res/raw/filmstrip.c
@@ -3,7 +3,7 @@
#pragma version(1)
#pragma stateVertex(PVBackground)
#pragma stateFragment(PFBackground)
-#pragma stateFragmentStore(PSBackground)
+#pragma stateStore(PSBackground)
#define STATE_TRIANGLE_OFFSET_COUNT 0
#define STATE_LAST_FOCUS 1
@@ -33,7 +33,7 @@
drawSimpleMesh(NAMED_mesh);
// Start of images.
- bindProgramFragmentStore(NAMED_PSImages);
+ bindProgramStore(NAMED_PSImages);
bindProgramFragment(NAMED_PFImages);
bindProgramVertex(NAMED_PVImages);
diff --git a/java/Fountain/res/raw/fountain.c b/java/Fountain/res/raw/fountain.c
index 86f0f99..f218f9b 100644
--- a/java/Fountain/res/raw/fountain.c
+++ b/java/Fountain/res/raw/fountain.c
@@ -1,8 +1,5 @@
// Fountain test script
#pragma version(1)
-#pragma stateVertex(default)
-#pragma stateFragment(default)
-#pragma stateFragmentStore(default)
int newPart = 0;
diff --git a/java/Rollo/res/raw/rollo.c b/java/Rollo/res/raw/rollo.c
index 6376715..b31be81 100644
--- a/java/Rollo/res/raw/rollo.c
+++ b/java/Rollo/res/raw/rollo.c
@@ -1,7 +1,7 @@
#pragma version(1)
#pragma stateVertex(PV)
#pragma stateFragment(PF)
-#pragma stateFragmentStore(PFS)
+#pragma stateStore(PFS)
// Scratch buffer layout
#define SCRATCH_FADE 0
@@ -105,7 +105,7 @@
if ((zoom < 1.1f) && (zoom > 0.9f)) {
bindProgramVertex(NAMED_PVOrtho);
bindProgramFragment(NAMED_PFText);
- bindProgramFragmentStore(NAMED_PFSText);
+ bindProgramStore(NAMED_PFSText);
rot = drawRot * scale;
index = 0;
@@ -144,7 +144,7 @@
bindProgramVertex(NAMED_PV);
bindProgramFragment(NAMED_PF);
- bindProgramFragmentStore(NAMED_PFS);
+ bindProgramStore(NAMED_PFS);
}
// Draw the selected icon
diff --git a/java/Rollo/res/raw/rollo2.c b/java/Rollo/res/raw/rollo2.c
index 256fa3c..5b5cb2d 100644
--- a/java/Rollo/res/raw/rollo2.c
+++ b/java/Rollo/res/raw/rollo2.c
@@ -1,7 +1,7 @@
#pragma version(1)
#pragma stateVertex(PV)
#pragma stateFragment(PF)
-#pragma stateFragmentStore(PFS)
+#pragma stateStore(PFS)
// Scratch buffer layout
#define SCRATCH_FADE 0
diff --git a/rsContext.cpp b/rsContext.cpp
index 70add92..169d5d4 100644
--- a/rsContext.cpp
+++ b/rsContext.cpp
@@ -103,12 +103,14 @@
ObjectBaseRef<ProgramFragment> frag(mFragment);
ObjectBaseRef<ProgramVertex> vtx(mVertex);
ObjectBaseRef<ProgramFragmentStore> store(mFragmentStore);
+ ObjectBaseRef<ProgramRaster> raster(mRaster);
bool ret = s->run(this, launchID);
mFragment.set(frag);
mVertex.set(vtx);
mFragmentStore.set(store);
+ mRaster.set(raster);
return ret;
}
@@ -124,7 +126,6 @@
eglQuerySurface(mEGL.mDisplay, mEGL.mSurface, EGL_HEIGHT, &mEGL.mHeight);
glViewport(0, 0, mEGL.mWidth, mEGL.mHeight);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
- //glEnable(GL_POINT_SMOOTH);
glClearColor(mRootScript->mEnviroment.mClearColor[0],
mRootScript->mEnviroment.mClearColor[1],
diff --git a/rsScript.h b/rsScript.h
index 0067fc8..8aa4542 100644
--- a/rsScript.h
+++ b/rsScript.h
@@ -51,7 +51,7 @@
ObjectBaseRef<ProgramVertex> mVertex;
ObjectBaseRef<ProgramFragment> mFragment;
- //ObjectBaseRef<ProgramRaster> mRaster;
+ ObjectBaseRef<ProgramRaster> mRaster;
ObjectBaseRef<ProgramFragmentStore> mFragmentStore;
InvokeFunc_t mInvokables[MAX_SCRIPT_BANKS];
const char * mScriptText;
diff --git a/rsScriptC.cpp b/rsScriptC.cpp
index e63ed24..20088da 100644
--- a/rsScriptC.cpp
+++ b/rsScriptC.cpp
@@ -72,6 +72,9 @@
if (mEnviroment.mVertex.get()) {
rsc->setVertex(mEnviroment.mVertex.get());
}
+ if (mEnviroment.mRaster.get()) {
+ rsc->setRaster(mEnviroment.mRaster.get());
+ }
if (launchIndex == 0) {
mEnviroment.mStartTimeMillis
@@ -175,6 +178,7 @@
s->mEnviroment.mFragment.set(rsc->getDefaultProgramFragment());
s->mEnviroment.mVertex.set(rsc->getDefaultProgramVertex());
s->mEnviroment.mFragmentStore.set(rsc->getDefaultProgramFragmentStore());
+ s->mEnviroment.mRaster.set(rsc->getDefaultProgramRaster());
if (s->mProgram.mScript) {
const static int pragmaMax = 16;
@@ -204,6 +208,18 @@
}
if (!strcmp(str[ct], "stateRaster")) {
+ if (!strcmp(str[ct+1], "default")) {
+ continue;
+ }
+ if (!strcmp(str[ct+1], "parent")) {
+ s->mEnviroment.mRaster.clear();
+ continue;
+ }
+ ProgramRaster * pr = (ProgramRaster *)rsc->lookupName(str[ct+1]);
+ if (pr != NULL) {
+ s->mEnviroment.mRaster.set(pr);
+ continue;
+ }
LOGE("Unreconized value %s passed to stateRaster", str[ct+1]);
}
@@ -223,7 +239,7 @@
LOGE("Unreconized value %s passed to stateFragment", str[ct+1]);
}
- if (!strcmp(str[ct], "stateFragmentStore")) {
+ if (!strcmp(str[ct], "stateStore")) {
if (!strcmp(str[ct+1], "default")) {
continue;
}
@@ -237,7 +253,7 @@
s->mEnviroment.mFragmentStore.set(pfs);
continue;
}
- LOGE("Unreconized value %s passed to stateFragmentStore", str[ct+1]);
+ LOGE("Unreconized value %s passed to stateStore", str[ct+1]);
}
}
diff --git a/rsScriptC_Lib.cpp b/rsScriptC_Lib.cpp
index f5f182f..2f195a5 100644
--- a/rsScriptC_Lib.cpp
+++ b/rsScriptC_Lib.cpp
@@ -672,6 +672,23 @@
glDrawArrays(GL_LINES, 0, 2);
}
+static void SC_drawPoint(float x, float y, float z)
+{
+ GET_TLS();
+ rsc->setupCheck();
+
+ float vtx[] = { x, y, z };
+
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glVertexPointer(3, GL_FLOAT, 0, vtx);
+
+ glDisableClientState(GL_NORMAL_ARRAY);
+ glDisableClientState(GL_COLOR_ARRAY);
+
+ glDrawArrays(GL_POINTS, 0, 1);
+}
+
static void SC_drawQuadTexCoords(float x1, float y1, float z1,
float u1, float v1,
float x2, float y2, float z2,
@@ -1131,6 +1148,8 @@
"void", "(int)" },
{ "bindProgramFragmentStore", (void *)&SC_bindProgramFragmentStore,
"void", "(int)" },
+ { "bindProgramStore", (void *)&SC_bindProgramFragmentStore,
+ "void", "(int)" },
{ "bindProgramVertex", (void *)&SC_bindProgramVertex,
"void", "(int)" },
{ "bindSampler", (void *)&SC_bindSampler,
@@ -1155,6 +1174,8 @@
"void", "(float x1, float y1, float z1, float u1, float v1, float x2, float y2, float z2, float u2, float v2, float x3, float y3, float z3, float u3, float v3, float x4, float y4, float z4, float u4, float v4)" },
{ "drawLine", (void *)&SC_drawLine,
"void", "(float x1, float y1, float z1, float x2, float y2, float z2)" },
+ { "drawPoint", (void *)&SC_drawPoint,
+ "void", "(float x1, float y1, float z1)" },
{ "drawSimpleMesh", (void *)&SC_drawSimpleMesh,
"void", "(int ism)" },
{ "drawSimpleMeshRange", (void *)&SC_drawSimpleMeshRange,