1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-30 05:23:00 +00:00

CAP_TEXTURE can be off; right-size textures loaded without scaling; SPF_FULLSYM

This commit is contained in:
Zeno Rogue
2017-12-21 11:36:07 +01:00
parent d0a925a8ca
commit 57a5337b9f
9 changed files with 113 additions and 38 deletions

View File

@@ -253,6 +253,7 @@ void filledPolygonColorI(SDL_Surface *s, int* px, int *py, int polyi, int col) {
}
#endif
#if CAP_TEXTURE
void drawTexturedTriangle(SDL_Surface *s, int *px, int *py, GLfloat *tv, int col) {
transmatrix source = {{{ld(px[0]),ld(px[1]),ld(px[2])}, {ld(py[0]),ld(py[1]),ld(py[2])}, {1,1,1}}};
transmatrix target = {{{tv[0],tv[3],tv[6]}, {tv[1],tv[4],tv[7]}, {1,1,1}}};
@@ -279,6 +280,7 @@ void drawTexturedTriangle(SDL_Surface *s, int *px, int *py, GLfloat *tv, int col
}
}
}
#endif
#if CAP_GL
void glcolor2(int color) {
@@ -634,9 +636,11 @@ void drawpolyline(polytodraw& p) {
#elif CAP_SDLGFX==1
if(pp.tinf) {
#if CAP_TEXTURE
if(!(poly_flags & POLY_INVERSE))
for(int i=0; i<polyi; i += 3)
drawTexturedTriangle(s, polyx+i, polyy+i, &pp.tinf->tvertices[i*3], p.col);
#endif
}
else if(poly_flags & POLY_INVERSE) {
int i = polyi;