diff options
Diffstat (limited to 'libs/rs')
-rw-r--r-- | libs/rs/rsContext.cpp | 4 | ||||
-rw-r--r-- | libs/rs/rsScriptC_Lib.cpp | 14 |
2 files changed, 16 insertions, 2 deletions
diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp index 04f6e07..3e4c9af 100644 --- a/libs/rs/rsContext.cpp +++ b/libs/rs/rsContext.cpp @@ -112,8 +112,8 @@ bool Context::runRootScript() #endif rsAssert(mRootScript->mEnviroment.mIsRoot); - //glColor4f(1,1,1,1); - //glEnable(GL_LIGHT0); + eglQuerySurface(mEGL.mDisplay, mEGL.mSurface, EGL_WIDTH, &mEGL.mWidth); + 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); diff --git a/libs/rs/rsScriptC_Lib.cpp b/libs/rs/rsScriptC_Lib.cpp index d10076b..6dc3e8b 100644 --- a/libs/rs/rsScriptC_Lib.cpp +++ b/libs/rs/rsScriptC_Lib.cpp @@ -321,6 +321,16 @@ static int SC_sqr(int v) return v * v; } +static float SC_fracf(float v) +{ + return v - floorf(v); +} + +static float SC_roundf(float v) +{ + return floorf(v + 0.4999999999); +} + static float SC_distf2(float x1, float y1, float x2, float y2) { float x = x2 - x1; @@ -1014,8 +1024,12 @@ ScriptCState::SymbolTable_t ScriptCState::gSyms[] = { "float", "(float, float)" }, { "floorf", (void *)&floorf, "float", "(float)" }, + { "fracf", (void *)&SC_fracf, + "float", "(float)" }, { "ceilf", (void *)&ceilf, "float", "(float)" }, + { "roundf", (void *)&SC_roundf, + "float", "(float)" }, { "expf", (void *)&expf, "float", "(float)" }, { "logf", (void *)&logf, |