[Fix] *Mutters something about macro hell.*
This commit is contained in:
parent
6552fc2cf2
commit
2034a02f74
14
src/opengl.c
14
src/opengl.c
@ -365,8 +365,8 @@ void gl_blitSprite(const glTexture* sprite, const double bx, const double by,
|
|||||||
|
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
|
|
||||||
x = bx - (double)SCREEN_W/2.;
|
x = bx - VX(*gl_camera) - sprite->sw/2. + gui_xoff;
|
||||||
y = by - (double)SCREEN_H/2.;
|
y = by - VY(*gl_camera) - sprite->sh/2. + gui_yoff;
|
||||||
|
|
||||||
tx = sprite->sw * (double)(sx)/sprite->rw;
|
tx = sprite->sw * (double)(sx)/sprite->rw;
|
||||||
ty = sprite->sh * (sprite->sy-(double)sy-1)/sprite->rh;
|
ty = sprite->sh * (sprite->sy-(double)sy-1)/sprite->rh;
|
||||||
@ -402,8 +402,8 @@ void gl_blitStatic(const glTexture* texture, const double bx, const double by,
|
|||||||
double x, y;
|
double x, y;
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
|
|
||||||
x = bx - (double)gl_screen.w/2.;
|
x = bx - (double)SCREEN_W/2.;
|
||||||
y = by - (double)gl_screen.h/2.;
|
y = by - (double)SCREEN_H/2.;
|
||||||
|
|
||||||
// Actual blitting..
|
// Actual blitting..
|
||||||
glBindTexture(GL_TEXTURE_2D, texture->texture);
|
glBindTexture(GL_TEXTURE_2D, texture->texture);
|
||||||
@ -579,8 +579,9 @@ static GLboolean gl_hasExt(char* name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check and report if there's been an error.
|
// Check and report if there's been an error.
|
||||||
#ifndef gl_checkErr // I know, I know, it's a little hackish.
|
//#ifndef gl_checkErr // I know, I know, it's a little hackish.
|
||||||
void gl_checkErr(void) {
|
void gl_checkErr(void) {
|
||||||
|
#ifdef DEBUG
|
||||||
GLenum err;
|
GLenum err;
|
||||||
char* errstr;
|
char* errstr;
|
||||||
|
|
||||||
@ -615,8 +616,9 @@ void gl_checkErr(void) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
WARN("OpenGL error: %s", errstr);
|
WARN("OpenGL error: %s", errstr);
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
//#endif
|
||||||
|
|
||||||
// Initialize SDL/OpenGL etc.
|
// Initialize SDL/OpenGL etc.
|
||||||
int gl_init(void) {
|
int gl_init(void) {
|
||||||
|
@ -80,9 +80,9 @@ void gl_exit(void);
|
|||||||
int gl_isTrans(const glTexture* t, const int x, const int y);
|
int gl_isTrans(const glTexture* t, const int x, const int y);
|
||||||
void gl_getSpriteFromDir(int* x, int* y, const glTexture* t, const double dir);
|
void gl_getSpriteFromDir(int* x, int* y, const glTexture* t, const double dir);
|
||||||
void gl_screenshot(const char* filename);
|
void gl_screenshot(const char* filename);
|
||||||
#if DEBUG == 1
|
//#if DEBUG == 1
|
||||||
void gl_checkErr(void);
|
void gl_checkErr(void);
|
||||||
#else
|
//#else
|
||||||
#define gl_checkErr()
|
//#define gl_checkErr()
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user