summaryrefslogtreecommitdiffstats
path: root/src/native/d3d
diff options
context:
space:
mode:
authorAlessandro Borges <[email protected]>2005-12-26 05:12:35 +0000
committerAlessandro Borges <[email protected]>2005-12-26 05:12:35 +0000
commit5967750b8a668421328db3db5e27cf7aeffc0da2 (patch)
tree439faafd2588725a892dec7c6618f8a5b3a7a8f1 /src/native/d3d
parentb12e6ed6c1db2cf67c187fdc67cf85b33f08e516 (diff)
Fix for uncorrect Stencil size report.
git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@483 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src/native/d3d')
-rw-r--r--src/native/d3d/NativeConfigTemplate3D.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/native/d3d/NativeConfigTemplate3D.cpp b/src/native/d3d/NativeConfigTemplate3D.cpp
index db2dace..1cf2881 100644
--- a/src/native/d3d/NativeConfigTemplate3D.cpp
+++ b/src/native/d3d/NativeConfigTemplate3D.cpp
@@ -124,8 +124,14 @@ jint JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_choosePixelFormat(
(blue <= pDriver->blueDepth)&&
(stencilDepth)<= deviceInfo->maxStencilDepthSize)
{
- // first 0-7bits for depth,8-15 Stencil
- retValue = depth |(stencilDepth <<8);
+ // printf("\n[Java3D] NativeConfigTemplate3D.choosePixelFormat ZBuffer depth %d", deviceInfo->maxZBufferDepthSize);
+ // printf("\n[Java3D] NativeConfigTemplate3D.choosePixelFormat stencil depth %d", deviceInfo->maxStencilDepthSize);
+
+ // first 0-7bits for depth,8-15 Stencil
+ retValue = deviceInfo->maxZBufferDepthSize |(deviceInfo->maxStencilDepthSize <<8);
+ // set value for Canvas3D GraphicsConfigInfo
+ jlong *pfi_ptr = (jlong *) env->GetPrimitiveArrayCritical(offScreenPFArray, NULL);
+ pfi_ptr[0] = retValue;
}
}
}
@@ -156,10 +162,10 @@ jint JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_choosePixelFormat(
JNIEXPORT jint JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_getStencilSize
(JNIEnv *env, jobject obj, jlong pFormatInfo, jboolean offScreen)
{
- int stencilSize = (int)pFormatInfo;
-
- stencilSize = (stencilSize >> 8) & 0xff;
-
+ jlong stencilSize = pFormatInfo;
+ stencilSize &= 0x0000ff00 ; //clean
+ stencilSize = (stencilSize >> 8);
+
/** // next version pFormatInfo will be a D3DFORMAT value or index for
D3DFORMAT fmt = d3dCtx->deviceInfo->depthStencilFormat;
if (fmt == D3DFMT_D15S1) stencilSize = 1;
@@ -168,5 +174,5 @@ JNIEXPORT jint JNICALL Java_javax_media_j3d_NativeConfigTemplate3D_getStencilSiz
else
if(fmt == D3DFMT_D24S8)stencilSize = 8;
*/
- return stencilSize;
+ return (int)stencilSize;
}