| 81 | } |
| 82 | |
| 83 | void HWViewpointBuffer::Set2D(FRenderState &di, int width, int height, int pll) |
| 84 | { |
| 85 | HWViewpointUniforms matrices; |
| 86 | |
| 87 | matrices.mViewMatrix.loadIdentity(); |
| 88 | matrices.mNormalViewMatrix.loadIdentity(); |
| 89 | matrices.mViewHeight = 0; |
| 90 | matrices.mGlobVis = 1.f; |
| 91 | matrices.mPalLightLevels = pll; |
| 92 | matrices.mClipLine.X = -10000000.0f; |
| 93 | matrices.mShadowmapFilter = gl_shadowmap_filter; |
| 94 | matrices.mLightBlendMode = 0; |
| 95 | |
| 96 | matrices.mProjectionMatrix.ortho(0, (float)width, (float)height, 0, -1.0f, 1.0f); |
| 97 | matrices.CalcDependencies(); |
| 98 | |
| 99 | CheckSize(); |
| 100 | mBuffer->Map(); |
| 101 | memcpy(((char*)mBuffer->Memory()) + mUploadIndex * mBlockAlign, &matrices, sizeof(matrices)); |
| 102 | mBuffer->Unmap(); |
| 103 | |
| 104 | mClipPlaneInfo.Push(0); |
| 105 | |
| 106 | Bind(di, mUploadIndex++); |
| 107 | } |
| 108 | |
| 109 | int HWViewpointBuffer::SetViewpoint(FRenderState &di, HWViewpointUniforms *vp) |
| 110 | { |
no test coverage detected