X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fendgame.c;h=eabc91c81d0f3ad2a5e382014be667d69997bec2;hb=f8cf5ac7b2f53510f80a0eaf286a25298be17bfe;hp=857183bfb69f5b4ce56abae7eb8a87c5e69d3c41;hpb=6b1c86cf395f59389e4ece4ea8f4bea2c332745b;p=xscreensaver diff --git a/hacks/glx/endgame.c b/hacks/glx/endgame.c index 857183bf..eabc91c8 100644 --- a/hacks/glx/endgame.c +++ b/hacks/glx/endgame.c @@ -39,6 +39,13 @@ #undef countof #define countof(x) (sizeof((x))/sizeof((*x))) +#define DEF_ROTATE "True" +#define DEF_REFLECTIONS "True" +#define DEF_SHADOWS "True" +#define DEF_SMOOTH "True" +#define DEF_CLASSIC "False" + + static XrmOptionDescRec opts[] = { {"+rotate", ".chess.rotate", XrmoptionNoArg, "false" }, {"-rotate", ".chess.rotate", XrmoptionNoArg, "true" }, @@ -55,11 +62,11 @@ static XrmOptionDescRec opts[] = { static int rotate, reflections, smooth, shadows, classic; static argtype vars[] = { - {&rotate, "rotate", "Rotate", "True", t_Bool}, - {&reflections, "reflections", "Reflections", "True", t_Bool}, - {&shadows, "shadows", "Shadows", "True", t_Bool}, - {&smooth, "smooth", "Smooth", "True", t_Bool}, - {&classic, "classic", "Classic", "False", t_Bool}, + {&rotate, "rotate", "Rotate", DEF_ROTATE, t_Bool}, + {&reflections, "reflections", "Reflections", DEF_REFLECTIONS, t_Bool}, + {&shadows, "shadows", "Shadows", DEF_SHADOWS, t_Bool}, + {&smooth, "smooth", "Smooth", DEF_SMOOTH, t_Bool}, + {&classic, "classic", "Classic", DEF_CLASSIC, t_Bool}, }; ENTRYPOINT ModeSpecOpt chess_opts = {countof(opts), opts, countof(vars), vars, NULL}; @@ -302,6 +309,8 @@ static void drawMovingPiece(ModeInfo *mi, Chesscreen *cs, int shadow) { int piece = cs->mpiece % PIECES; + if (piece == NONE) return; + glPushMatrix(); if(shadow) glColor4fv(MaterialShadow); @@ -625,11 +634,15 @@ static void display(ModeInfo *mi, Chesscreen *cs) glMatrixMode(GL_MODELVIEW); glLoadIdentity(); + glRotatef(current_device_rotation(), 0, 0, 1); /** setup perspectiv */ glTranslatef(0.0, 0.0, -1.5*BOARDSIZE); glRotatef(30.0, 1.0, 0.0, 0.0); + glRotatef(-current_device_rotation(), 0, 0, 1); gltrackball_rotate (cs->trackball); + glRotatef(current_device_rotation(), 0, 0, 1); + glRotatef(cs->theta*100, 0.0, 1.0, 0.0); glTranslatef(-0.5*BOARDSIZE, 0.0, -0.5*BOARDSIZE); @@ -777,8 +790,6 @@ ENTRYPOINT void init_chess(ModeInfo *mi) else MI_CLEARWINDOW(mi); - glClearColor(0.0, 0.0, 0.0, 0.0); - if (!cs->wire) { glDepthFunc(GL_LEQUAL); glClearStencil(0);