diff --git a/glide3x/h5/glide3/src/distrip.c b/glide3x/h5/glide3/src/distrip.c index e2112a5..f322802 100644 --- a/glide3x/h5/glide3/src/distrip.c +++ b/glide3x/h5/glide3/src/distrip.c @@ -553,8 +553,10 @@ GR_DIENTRY(grDrawVertexArrayContiguous, void , (FxU32 mode, FxU32 Count, void *p void *b_ptr, *c_ptr; while ((int)Count >= 3) { b_ptr = (void *)((FxU32)pointers + stride); - c_ptr = (void *)((FxU32)pointers + stride*2); - TRISETUP(pointers, b_ptr, c_ptr); + c_ptr = (void *)((FxU32)b_ptr + stride); + /*TRISETUP(pointers, b_ptr, c_ptr);*/ + /* Do extra context checking. Fixes GLExcess (Spaceship chase) crash with Mesa. */ + grDrawTriangle(pointers, b_ptr, c_ptr); pointers = (void *)((FxU32)c_ptr + stride); Count -= 3; } diff --git a/glide3x/h5/glide3/src/gdraw.c b/glide3x/h5/glide3/src/gdraw.c index 6dabfa5..148e5aa 100644 --- a/glide3x/h5/glide3/src/gdraw.c +++ b/glide3x/h5/glide3/src/gdraw.c @@ -355,7 +355,7 @@ GR_ENTRY(grDrawTriangle, void, (const void *a, const void *b, const void *c)) test edx, edx; je lostContext; mov eax, [edx + kLostContextOffset]; - test eax, eax + test eax, eax; je lostContext; mov eax, [eax]; test eax, 1; @@ -365,13 +365,13 @@ GR_ENTRY(grDrawTriangle, void, (const void *a, const void *b, const void *c)) } #else __asm { - mov eax, DWORD PTR fs:[WNT_TEB_PTR] ; + mov eax, DWORD PTR fs:[WNT_TEB_PTR]; add eax, DWORD PTR _GlideRoot.tlsOffset; mov edx, [eax]; test edx, edx; je lostContext; mov eax, [edx + kLostContextOffset]; - test eax, eax + test eax, eax; je lostContext; mov eax, [eax]; test eax, 1;