# HG changeset patch # User John Tsiombikas # Date 1434591145 -10800 # Node ID 3d082c566b53a4481cca9e4f1a88c3918013af03 # Parent a460b1e5af4a5a943b99bd8c80bf7aa8b5235501 fixed all the bugs, pc version works diff -r a460b1e5af4a -r 3d082c566b53 libs/drawtext/font.c --- a/libs/drawtext/font.c Thu Jun 18 03:55:05 2015 +0300 +++ b/libs/drawtext/font.c Thu Jun 18 04:32:25 2015 +0300 @@ -472,9 +472,9 @@ } for(i=0; ipixels[i] = 255 * c / max_pixval; diff -r a460b1e5af4a -r 3d082c566b53 sdr/color.p.glsl --- a/sdr/color.p.glsl Thu Jun 18 03:55:05 2015 +0300 +++ b/sdr/color.p.glsl Thu Jun 18 04:32:25 2015 +0300 @@ -1,4 +1,6 @@ -precision mediump float; +#ifdef GL_ES +precision lowp float; +#endif uniform vec4 color; diff -r a460b1e5af4a -r 3d082c566b53 sdr/font.p.glsl --- a/sdr/font.p.glsl Thu Jun 18 03:55:05 2015 +0300 +++ b/sdr/font.p.glsl Thu Jun 18 04:32:25 2015 +0300 @@ -1,4 +1,6 @@ -precision mediump float; +#ifdef GL_ES +precision lowp float; +#endif uniform sampler2D tex; uniform vec4 color; diff -r a460b1e5af4a -r 3d082c566b53 sdr/normvis.p.glsl --- a/sdr/normvis.p.glsl Thu Jun 18 03:55:05 2015 +0300 +++ b/sdr/normvis.p.glsl Thu Jun 18 04:32:25 2015 +0300 @@ -1,10 +1,12 @@ +#ifdef GL_ES precision mediump float; +#endif varying vec3 normal; void main() { - vec3 ncol = normal * 0.5 + 0.5; + vec3 ncol = normalize(normal) * 0.5 + 0.5; gl_FragColor.rgb = ncol; gl_FragColor.a = 1.0; } diff -r a460b1e5af4a -r 3d082c566b53 sdr/tex.p.glsl --- a/sdr/tex.p.glsl Thu Jun 18 03:55:05 2015 +0300 +++ b/sdr/tex.p.glsl Thu Jun 18 04:32:25 2015 +0300 @@ -1,4 +1,6 @@ -precision mediump float; +#ifdef GL_ES +precision lowp float; +#endif uniform sampler2D tex; diff -r a460b1e5af4a -r 3d082c566b53 src/assman.c --- a/src/assman.c Thu Jun 18 03:55:05 2015 +0300 +++ b/src/assman.c Thu Jun 18 04:32:25 2015 +0300 @@ -1,13 +1,14 @@ +#include #include "assman.h" int ass_fgetc(ass_file *fp) { - char c; + unsigned char c; if(ass_fread(&c, 1, 1, fp) < 1) { return -1; } - return c; + return (int)c; } char *ass_fgets(char *s, int size, ass_file *fp) diff -r a460b1e5af4a -r 3d082c566b53 src/game.cc --- a/src/game.cc Thu Jun 18 03:55:05 2015 +0300 +++ b/src/game.cc Thu Jun 18 04:32:25 2015 +0300 @@ -37,8 +37,8 @@ extern "C" int game_init(void) { - //glEnable(GL_DEPTH_TEST); - //glEnable(GL_CULL_FACE); + glEnable(GL_DEPTH_TEST); + glEnable(GL_CULL_FACE); glClearColor(0.4, 0.4, 0.4, 1); @@ -89,6 +89,8 @@ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glDisable(GL_DEPTH_TEST); + // draw video preview frame gl_matrix_mode(GL_PROJECTION); gl_push_matrix(); @@ -112,6 +114,7 @@ gl_pop_matrix(); // done drawing preview + glEnable(GL_DEPTH_TEST); gl_matrix_mode(GL_MODELVIEW); gl_load_identity(); diff -r a460b1e5af4a -r 3d082c566b53 src/pc/camera.c --- a/src/pc/camera.c Thu Jun 18 03:55:05 2015 +0300 +++ b/src/pc/camera.c Thu Jun 18 04:32:25 2015 +0300 @@ -28,9 +28,9 @@ float wave = cos(len * 4.0 * M_PI); int band = wave >= 0 ? 0 : 1; - *pptr++ = pal[band][chess][0]; - *pptr++ = pal[band][chess][1]; - *pptr++ = pal[band][chess][2]; + *pptr++ = pal[band][chess][0] / 2; + *pptr++ = pal[band][chess][1] / 2; + *pptr++ = pal[band][chess][2] / 2; } } diff -r a460b1e5af4a -r 3d082c566b53 src/pc/main.c --- a/src/pc/main.c Thu Jun 18 03:55:05 2015 +0300 +++ b/src/pc/main.c Thu Jun 18 04:32:25 2015 +0300 @@ -21,7 +21,7 @@ int main(int argc, char **argv) { glutInit(&argc, argv); - glutInitWindowSize(800, 600); + glutInitWindowSize(1280, 800); glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE); glutCreateWindow("3dphotoshoot (PC)");