X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fchessmodels.c;h=d47895aaaa896b953705aa03d37d059f3c45a26c;hp=f69d971c79123e669a34325f4e612fa602b35401;hb=f8cf5ac7b2f53510f80a0eaf286a25298be17bfe;hpb=ec8d2b32b63649e6d32bdfb306eda062769af823 diff --git a/hacks/glx/chessmodels.c b/hacks/glx/chessmodels.c index f69d971c..d47895aa 100644 --- a/hacks/glx/chessmodels.c +++ b/hacks/glx/chessmodels.c @@ -26,16 +26,22 @@ /* chessmodels.c: Contains the code for piece model creation */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif /* HAVE_CONFIG_H */ + #include #include -#ifdef HAVE_COCOA -# include -#else +#ifndef HAVE_COCOA # include # include #endif +#ifdef HAVE_JWZGLES +# include "jwzgles.h" +#endif /* HAVE_JWZGLES */ + #include "chessmodels.h" /* End of Data */ @@ -1680,16 +1686,24 @@ static int draw_piece( unsigned short *piece_data) } void gen_model_lists( int classic, int poly_count[PIECES]) { + + Bool queen_only_p = classic < 0; + if (classic < 0) classic = 0; + piece_size = classic ? 0.095 / 100 : 0.3 / 8192; - glNewList(KING, GL_COMPILE); - poly_count[KING] = draw_piece( classic ? classic_king_data : king_data); - glEndList(); + glGenLists (20); /* this is horrible! List numbers are hardcoded! */ glNewList(QUEEN, GL_COMPILE); poly_count[QUEEN] = draw_piece( classic ? classic_queen_data : queen_data); glEndList(); + if (queen_only_p) return; + + glNewList(KING, GL_COMPILE); + poly_count[KING] = draw_piece( classic ? classic_king_data : king_data); + glEndList(); + glNewList(BISHOP, GL_COMPILE); poly_count[BISHOP] = draw_piece( classic ? classic_bishop_data : bishop_data); glEndList();