mirror of
https://github.com/ZDoom/Raze.git
synced 2025-05-31 01:11:15 +00:00
Fix palette mode for GLES
This commit is contained in:
parent
86c58649ba
commit
2a905e8026
4 changed files with 97 additions and 11 deletions
|
@ -35,6 +35,9 @@
|
|||
#include "gles_renderbuffers.h"
|
||||
#include "gles_hwtexture.h"
|
||||
#include "gles_buffers.h"
|
||||
#include "gles_renderer.h"
|
||||
#include "gles_samplers.h"
|
||||
|
||||
#include "hw_clock.h"
|
||||
#include "printf.h"
|
||||
|
||||
|
@ -479,6 +482,7 @@ void FGLRenderState::ApplyMaterial(FMaterial *mat, int clampmode, int translatio
|
|||
for (int i = 1; i < 3; i++)
|
||||
{
|
||||
auto systex = static_cast<FHardwareTexture*>(mat->GetLayer(i, translation, &layer));
|
||||
GLRenderer->mSamplerManager->Bind(i, CLAMP_NONE, 255);
|
||||
systex->Bind(i, false);
|
||||
maxbound = i;
|
||||
}
|
||||
|
|
|
@ -119,8 +119,26 @@ uint8_t FSamplerManager::Bind(int texunit, int num, int lastval)
|
|||
break;
|
||||
|
||||
case CLAMP_NOFILTER:
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
break;
|
||||
|
||||
case CLAMP_NOFILTER_X:
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
break;
|
||||
|
||||
case CLAMP_NOFILTER_Y:
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
break;
|
||||
|
||||
case CLAMP_NOFILTER_XY:
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue