home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1996 May / PCOnline_05_1996.bin / linux / source / xap / xgames / xtetris-.pat < prev    next >
Text File  |  1995-10-10  |  6KB  |  187 lines

  1. This file implements -quayle mode for xtetris.  -- jwz
  2.  
  3. diff -cr xtetris-2.5.2/defs.h xtetris-quayle/defs.h
  4. *** xtetris-2.5.2/defs.h    Mon Sep 30 22:50:48 1991
  5. --- xtetris-quayle/defs.h    Sat Jan  9 13:41:11 1993
  6. ***************
  7. *** 47,52 ****
  8. --- 47,53 ----
  9.     Dimension speed;
  10.     String scorefile;
  11.     String customization;
  12. +   Boolean quayle;
  13.   }
  14.   resources;
  15.   
  16. ***************
  17. *** 81,87 ****
  18.   
  19.   shape_ptr grid[UWIDTH][UHEIGHT];
  20.   
  21. ! extern shape_type shape[7];
  22.   
  23.   void    print_high_scores(), done_proc(), quit_proc(), start_proc(), pause_proc(), newgame_proc();
  24.   void    resume_proc(), about_proc();
  25. --- 82,88 ----
  26.   
  27.   shape_ptr grid[UWIDTH][UHEIGHT];
  28.   
  29. ! extern shape_type shape[];
  30.   
  31.   void    print_high_scores(), done_proc(), quit_proc(), start_proc(), pause_proc(), newgame_proc();
  32.   void    resume_proc(), about_proc();
  33. diff -cr xtetris-2.5.2/main.c xtetris-quayle/main.c
  34. *** xtetris-2.5.2/main.c    Mon Oct 19 11:29:04 1992
  35. --- xtetris-quayle/main.c    Sat Jan  9 13:41:11 1993
  36. ***************
  37. *** 61,66 ****
  38. --- 61,68 ----
  39.        offset(speed),             XtRImmediate,      (XtPointer)STANDARD_SPEED},
  40.     {"scorefile",    "ScoreFile",   XtRString,      sizeof(String),
  41.        offset(scorefile),         XtRString,      HIGH_SCORE_TABLE},
  42. +   {"quayle",    "Boolean",   XtRBoolean,      sizeof(Boolean),
  43. +      offset(quayle),         XtRImmediate,      (XtPointer)False},
  44.   };
  45.     
  46.   static XrmOptionDescRec Options[] = {
  47. ***************
  48. *** 70,75 ****
  49. --- 72,78 ----
  50.     {"-boxsize",  "boxSize",                    XrmoptionSepArg,  NULL },
  51.     {"-color",    "customization",          XrmoptionNoArg,    ".c" },
  52.     {"-bw",    "customization",          XrmoptionNoArg,    ".bw" },
  53. +   {"-quayle",   "quayle",                     XrmoptionNoArg,   "TRUE" }
  54.   };
  55.   
  56.   static XtResource ShapeResources[] = {
  57. ***************
  58. *** 137,143 ****
  59.     }
  60.   
  61.     db = XtDatabase(display);
  62. !   XrmPutStringResource( db, "customization", resources.customization );
  63.     
  64.     toplevel = XtVaAppCreateShell( NULL, "Xtetris",
  65.                   applicationShellWidgetClass,
  66. --- 140,146 ----
  67.     }
  68.   
  69.     db = XtDatabase(display);
  70. !   XrmPutStringResource( &db, "customization", resources.customization );
  71.     
  72.     toplevel = XtVaAppCreateShell( NULL, "Xtetris",
  73.                   applicationShellWidgetClass,
  74. ***************
  75. *** 151,159 ****
  76.                   NULL, (Cardinal) 0);
  77.     XtAppAddActions( context, actions, XtNumber(actions) );
  78.     
  79. !   for (i = 0; i < 7; i++) {
  80. !     static char *names[7] = { "object0","object1","object2","object3","object4",
  81. !                 "object5","object6" };
  82.       XtGetSubresources( toplevel, (caddr_t) &shape[i], names[i], "Object",
  83.                 ShapeResources, XtNumber(ShapeResources),
  84.                 NULL, (Cardinal) 0 );
  85. --- 154,164 ----
  86.                   NULL, (Cardinal) 0);
  87.     XtAppAddActions( context, actions, XtNumber(actions) );
  88.     
  89. !   if (resources.quayle) resources.usescorefile = False;
  90. !   for (i = 0; i < 8; i++) {
  91. !     static char *names[] = { "object0","object1","object2","object3","object4",
  92. !                  "object5","object6", "objectQ" };
  93.       XtGetSubresources( toplevel, (caddr_t) &shape[i], names[i], "Object",
  94.                 ShapeResources, XtNumber(ShapeResources),
  95.                 NULL, (Cardinal) 0 );
  96. diff -cr xtetris-2.5.2/shape.c xtetris-quayle/shape.c
  97. *** xtetris-2.5.2/shape.c    Mon Oct 19 11:50:21 1992
  98. --- xtetris-quayle/shape.c    Sat Jan  9 13:41:12 1993
  99. ***************
  100. *** 3,9 ****
  101.   # define random rand
  102.   #endif
  103.   
  104. ! shape_type shape[7] = {
  105.   
  106.   /*      bitmap    score X Y wid ht */
  107.     { /* Shape 0 */
  108. --- 3,9 ----
  109.   # define random rand
  110.   #endif
  111.   
  112. ! shape_type shape[] = {
  113.   
  114.   /*      bitmap    score X Y wid ht */
  115.     { /* Shape 0 */
  116. ***************
  117. *** 53,58 ****
  118. --- 53,65 ----
  119.         { 0x000044c0, 7,  { {1,0,1,3}, {0,2,1,1} }, {{0,0,0,0},{0,0,0,0}}, 2,  0,2,  {0,0,0,0}, {0,0,0,0}, {0,0,0,0} },   /*   #  */
  120.         { 0x00008e00, 6,  { {0,1,3,1}, {0,0,1,1} }, {{0,0,0,0},{0,0,0,0}}, 2,  0,3,  {0,0,0,0}, {0,0,0,0}, {0,0,0,0} },   /*      */
  121.         { 0x0000c880, 7,  { {0,0,1,3}, {1,0,1,1} }, {{0,0,0,0},{0,0,0,0}}, 2,  0,2,  {0,0,0,0}, {0,0,0,0}, {0,0,0,0} } }, /*      */
  122. +   },
  123. +   { /* Quayle */
  124. +     { { 0x00000400,  21, { {1,1,1,1}, {0,0,0,0} }, {{0,0,0,0},{0,0,0,0}}, 1,  1,1, {0,0,0,0}, {0,0,0,0}, {0,0,0,0} },   /*      */
  125. +       { 0x00000400, 272, { {1,1,1,1}, {0,0,0,0} }, {{0,0,0,0},{0,0,0,0}}, 1,  1,1, {0,0,0,0}, {0,0,0,0}, {0,0,0,0} },   /*  #   */
  126. +       { 0x00000400, 119, { {1,1,1,1}, {0,0,0,0} }, {{0,0,0,0},{0,0,0,0}}, 1,  1,1, {0,0,0,0}, {0,0,0,0}, {0,0,0,0} },   /*      */
  127. +       { 0x00000400, 645, { {1,1,1,1}, {0,0,0,0} }, {{0,0,0,0},{0,0,0,0}}, 1,  1,1, {0,0,0,0}, {0,0,0,0}, {0,0,0,0} } }, /*      */
  128.     }
  129.   };
  130.   
  131. ***************
  132. *** 112,118 ****
  133.     /* First set the highesty values (could have specified these statically, but the
  134.        human cost is too high.  This is one-shot anyway). */
  135.   
  136. !   for (s = 0; s < 7; s++)
  137.       {
  138.         shape_ptr sh = &shape[s];
  139.         XGCValues gcv;
  140. --- 119,125 ----
  141.     /* First set the highesty values (could have specified these statically, but the
  142.        human cost is too high.  This is one-shot anyway). */
  143.   
  144. !   for (s = 0; s < XtNumber(shape); s++)
  145.       {
  146.         shape_ptr sh = &shape[s];
  147.         XGCValues gcv;
  148. ***************
  149. *** 206,212 ****
  150.   {
  151.     shape_no = next_no;
  152.     rot = next_rot;
  153. !   next_no = random() % 7;
  154.     next_rot = random() % 4;
  155.     xpos = (UWIDTH / 2) - 1;
  156.     ypos = -4;
  157. --- 213,222 ----
  158.   {
  159.     shape_no = next_no;
  160.     rot = next_rot;
  161. !   if (resources.quayle)
  162. !     next_no = 7;
  163. !   else
  164. !     next_no = random() % 7;
  165.     next_rot = random() % 4;
  166.     xpos = (UWIDTH / 2) - 1;
  167.     ypos = -4;
  168. diff -cr xtetris-2.5.2/xtetris.man xtetris-quayle/xtetris.man
  169. *** xtetris-2.5.2/xtetris.man    Thu Oct  3 11:30:01 1991
  170. --- xtetris-quayle/xtetris.man    Sat Jan  9 13:41:12 1993
  171. ***************
  172. *** 85,90 ****
  173. --- 85,95 ----
  174.   Determines whether to use the color or black-and-white
  175.   application-defaults file.  This sets the new X11R5 "customization"
  176.   resource to ".c" or ".bw", depending on your choice.
  177. + .TP 8
  178. + .B -quayle
  179. + Puts \fIxtetris\fP into Dan Quayle Mode.  "If we do not succeed, then 
  180. + we face the risk of failure."
  181.   .SH FILES
  182.   .IP /usr/lib/X11/tetris_scores
  183.   .IP /usr/lib/X11/app-defaults/Xtetris
  184.