Index: ddraw/glRenderer.cpp |
— | — | @@ -3813,12 +3813,12 @@ |
3814 | 3814 | }
|
3815 | 3815 |
|
3816 | 3816 | void glRenderer__DrawPrimitives(glRenderer *This, RenderTarget *target, GLenum mode, DWORD fvf,
|
3817 | | - void *vertices, BOOL strided, DWORD count, LPWORD indices, DWORD indexcount, DWORD flags)
|
| 3817 | + BYTE *vertices, BOOL strided, DWORD count, LPWORD indices, DWORD indexcount, DWORD flags)
|
3818 | 3818 | {
|
3819 | 3819 | BOOL transformed;
|
3820 | 3820 | int i;
|
3821 | 3821 | glTexture *ztexture = NULL;
|
3822 | | - GLint zleve = 0;
|
| 3822 | + GLint zlevel = 0;
|
3823 | 3823 | if (!vertices)
|
3824 | 3824 | {
|
3825 | 3825 | This->outputs[0] = (void*)DDERR_INVALIDPARAMS;
|
— | — | @@ -3826,7 +3826,40 @@ |
3827 | 3827 | return;
|
3828 | 3828 | }
|
3829 | 3829 | if (fvf != This->last_fvf) glRenderer__UpdateFVF(This, fvf);
|
3830 | | -
|
| 3830 | + glRenderer__SetDepthComp(This);
|
| 3831 | + glUtil_DepthTest(This->util, This->renderstate[D3DRENDERSTATE_ZENABLE]);
|
| 3832 | + glUtil_DepthWrite(This->util, This->renderstate[D3DRENDERSTATE_ZWRITEENABLE]);
|
| 3833 | + _GENSHADER *prog = &This->shaders->gen3d->current_genshader->shader;
|
| 3834 | + switch (fvf & D3DFVF_POSITION_MASK)
|
| 3835 | + {
|
| 3836 | + case 0: // Missing vertex position
|
| 3837 | + This->outputs[0] = (void*)DDERR_INVALIDPARAMS;
|
| 3838 | + SetEvent(This->busy);
|
| 3839 | + return;
|
| 3840 | + case D3DFVF_XYZ:
|
| 3841 | + glUtil_EnableArray(This->util, prog->attribs[0], TRUE);
|
| 3842 | + This->ext->glVertexAttribPointer(prog->attribs[0], 3, GL_FLOAT, GL_FALSE, This->fvf_stride, vertices);
|
| 3843 | + break;
|
| 3844 | + case D3DFVF_XYZRHW:
|
| 3845 | + glUtil_EnableArray(This->util, prog->attribs[0], TRUE);
|
| 3846 | + This->ext->glVertexAttribPointer(prog->attribs[0], 3, GL_FLOAT, GL_FALSE, This->fvf_stride, vertices);
|
| 3847 | + if (prog->attribs[1] != -1)
|
| 3848 | + {
|
| 3849 | + glUtil_EnableArray(This->util, prog->attribs[1], TRUE);
|
| 3850 | + This->ext->glVertexAttribPointer(prog->attribs[1], 1, GL_FLOAT, GL_FALSE, This->fvf_stride, vertices+(3*sizeof(float)));
|
| 3851 | + }
|
| 3852 | + break;
|
| 3853 | + case D3DFVF_XYZB1:
|
| 3854 | + case D3DFVF_XYZB2:
|
| 3855 | + case D3DFVF_XYZB3:
|
| 3856 | + case D3DFVF_XYZB4:
|
| 3857 | + case D3DFVF_XYZB5:
|
| 3858 | + FIXME("glRenderer__DrawPrimitives: Blend weights not yet supported");
|
| 3859 | + This->outputs[0] = (void*)DDERR_INVALIDPARAMS;
|
| 3860 | + SetEvent(This->busy);
|
| 3861 | + return;
|
| 3862 | + break;
|
| 3863 | + }
|
3831 | 3864 | }
|
3832 | 3865 |
|
3833 | 3866 | void glRenderer__DrawPrimitivesOld(glRenderer *This, RenderTarget *target, GLenum mode, GLVERTEX *vertices, int *texformats, DWORD count, LPWORD indices,
|
— | — | @@ -3879,7 +3912,7 @@ |
3880 | 3913 | if(prog->attribs[1] != -1)
|
3881 | 3914 | {
|
3882 | 3915 | glUtil_EnableArray(This->util, prog->attribs[1], TRUE);
|
3883 | | - This->ext->glVertexAttribPointer(prog->attribs[1],4,GL_FLOAT,GL_FALSE,vertices[1].stride,vertices[1].data);
|
| 3916 | + This->ext->glVertexAttribPointer(prog->attribs[1],1,GL_FLOAT,GL_FALSE,vertices[1].stride,vertices[1].data);
|
3884 | 3917 | }
|
3885 | 3918 | }
|
3886 | 3919 | for(i = 0; i < 5; i++)
|
Index: ddraw/glRenderer.h |
— | — | @@ -157,6 +157,7 @@ |
158 | 158 | RenderState state;
|
159 | 159 | size_t scenesize, scenesizevertex, scenesizeindex;
|
160 | 160 | DWORD last_fvf;
|
| 161 | + GLsizei fvf_stride;
|
161 | 162 | BOOL mode_3d;
|
162 | 163 | } glRenderer;
|
163 | 164 |
|
— | — | @@ -211,7 +212,7 @@ |
212 | 213 | void glRenderer__Clear(glRenderer *This, ClearCommand *cmd);
|
213 | 214 | void glRenderer__UpdateFVF(glRenderer *This, DWORD fvf);
|
214 | 215 | void glRenderer__DrawPrimitives(glRenderer *This, RenderTarget *target, GLenum mode, DWORD fvf,
|
215 | | - void *vertices, BOOL strided, DWORD count, LPWORD indices, DWORD indexcount, DWORD flags);
|
| 216 | + BYTE *vertices, BOOL strided, DWORD count, LPWORD indices, DWORD indexcount, DWORD flags);
|
216 | 217 | void glRenderer__DrawPrimitivesOld(glRenderer *This, RenderTarget *target, GLenum mode, GLVERTEX *vertices, int *texcormats, DWORD count, LPWORD indices,
|
217 | 218 | DWORD indexcount, DWORD flags);
|
218 | 219 | void glRenderer__Flush(glRenderer *This);
|