--- ace-of-penguins.old/docs/toolkit.html
+++ ace-of-penguins/docs/toolkit.html
@@ -193,13 +193,13 @@
This function sets up the interface to X and creates the initial
window. This function must be called exactly once from
--- ace-of-penguins.old/games/canfield.c
+++ ace-of-penguins/games/canfield.c
@@ -396,10 +396,10 @@
Picture *cp = get_centered_pic();
if ((cp == youlose || cp == youwin)
- && (x > table_width/2-cp->w/2
- && x < table_width/2+cp->w/2
- && y > table_height/2-cp->h/2
- && y < table_height/2+cp->h/2)) {
+ && (x > ace_table_width/2-cp->w/2
+ && x < ace_table_width/2+cp->w/2
+ && y > ace_table_height/2-cp->h/2
+ && y < ace_table_height/2+cp->h/2)) {
set_centered_pic(0);
start_again();
--- ace-of-penguins.old/games/freecell.c
+++ ace-of-penguins/games/freecell.c
@@ -122,8 +122,8 @@
{
int cw, ch;
stack_get_card_size (&cw, &ch);
- if (xlogo->w < table_width - 8*cw && xlogo->h < ch)
- put_picture(xlogo, table_width/2-xlogo->w/2, ch/2-xlogo->h/2,
+ if (xlogo->w < ace_table_width - 8*cw && xlogo->h < ch)
+ put_picture(xlogo, ace_table_width/2-xlogo->w/2, ch/2-xlogo->h/2,
0, 0, xlogo->h, xlogo->w);
stack_redraw();
}
@@ -142,13 +142,13 @@
stack_undo();
return;
}
- if (p == splash)
- return;
if (k == KEY_F(1) || k == 'h' || k == 'H')
{
help("freecell.html", freecell_help);
return;
}
+ if (p == splash)
+ return;
if (k == KEY_F(2) || p || k == 'r' || k == 'R')
{
start_again();
@@ -648,11 +648,11 @@
splash = get_picture("freecell");
youwin = get_picture("youwin");
youlose = get_picture("youlose");
- if (table_width == 0 || table_height == 0)
+ if (ace_table_width == 0 || ace_table_height == 0)
{
- table_width = 640;
- table_height = 480;
+ ace_table_width = 640;
+ ace_table_height = 480;
}
- init_table(table_width, table_height);
+ init_table(ace_table_width, ace_table_height);
table_loop();
}
--- ace-of-penguins.old/games/freecell.html
+++ ace-of-penguins/games/freecell.html
@@ -75,7 +75,7 @@
When viewing help, the space bar, F1 or Esc
return you to your game. Numbers show that section (0 for any
-pre-header section). Letters show section starting with that letter.
+pre-header section). Letters show the section starting with that letter.
Credits
Credits
--- ace-of-penguins.old/games/golf.c
+++ ace-of-penguins/games/golf.c
@@ -110,7 +110,7 @@
sprintf(s, "%2d", c);
else
strcpy(s, " ");
- text(s, M*2, table_height-M-H-2);
+ text(s, M*2, ace_table_height-M-H-2);
}
static void
@@ -144,9 +144,9 @@
{
int s, v;
- arrow_offset = (table_width - 7 * W) / 8;
+ arrow_offset = (ace_table_width - 7 * W) / 8;
arrow_delta = arrow_offset + W;
- arrow_offset = (table_width - 7*W - 6*arrow_offset)/2;
+ arrow_offset = (ace_table_width - 7*W - 6*arrow_offset)/2;
stack_load_standard_deck();
splash = get_picture("golf");
@@ -163,8 +163,8 @@
stack_set_offset(stacks[s], STACK_OFFSET_DOWN);
}
- deck = stack_create(M, table_height-M-H);
- discard = stack_create(M*2+W, table_height-M-H);
+ deck = stack_create(M, ace_table_height-M-H);
+ discard = stack_create(M*2+W, ace_table_height-M-H);
stack_set_offset(discard, STACK_OFFSET_TBRIGHT);
for (s=0; s<4; s++)
@@ -222,10 +222,10 @@
Picture *cp = get_centered_pic();
if ((cp == youlose || cp == youwin)
- && (x > table_width/2-cp->w/2
- && x < table_width/2+cp->w/2
- && y > table_height/2-cp->h/2
- && y < table_height/2+cp->h/2))
+ && (x > ace_table_width/2-cp->w/2
+ && x < ace_table_width/2+cp->w/2
+ && y > ace_table_height/2-cp->h/2
+ && y < ace_table_height/2+cp->h/2))
{
set_centered_pic(0);
start_again();
@@ -324,9 +324,9 @@
int alt_width = 3*M+2*W+51*R;
init_ace(argc, argv, fmap);
register_imagelib(appimglib_imagelib);
- table_width = 8*M+7*W;
- if (table_width < alt_width) table_width = alt_width;
- table_height = 3*M+5*CARD_FAN_DOWN+2*H;
- init_table(table_width, table_height);
+ ace_table_width = 8*M+7*W;
+ if (ace_table_width < alt_width) ace_table_width = alt_width;
+ ace_table_height = 3*M+5*CARD_FAN_DOWN+2*H;
+ init_table(ace_table_width, ace_table_height);
table_loop();
}
--- ace-of-penguins.old/games/golf.html
+++ ace-of-penguins/games/golf.html
@@ -57,7 +57,7 @@
When viewing help, the space bar, F1 or Esc
return you to your game. Numbers show that section (0 for any
-pre-header section). Letters show section starting with that letter.
+pre-header section). Letters show the section starting with that letter.
Credits
Credits
--- ace-of-penguins.old/games/mastermind.c
+++ ace-of-penguins/games/mastermind.c
@@ -74,9 +74,9 @@
py = (gy+active_row*gdy)-(BSZ+1)*5/2;
if (py < CARD_MARGIN)
py = CARD_MARGIN;
- if (py > table_height-CARD_MARGIN-6*BSZ-5)
- py = table_height-CARD_MARGIN-6*BSZ-5;
- invalidate(0, 0, px+BSZ, table_height);
+ if (py > ace_table_height-CARD_MARGIN-6*BSZ-5)
+ py = ace_table_height-CARD_MARGIN-6*BSZ-5;
+ invalidate(0, 0, px+BSZ, ace_table_height);
}
static void
@@ -107,7 +107,7 @@
show_solution()
{
solution_shown = 1;
- invalidate(0, 0, table_width, table_height);
+ invalidate(0, 0, ace_table_width, ace_table_height);
}
static void
@@ -200,13 +200,15 @@
{
int i;
Picture *p = get_centered_pic();
+ int is_help = (k == KEY_F(1)) || (k == 'h');
+
set_centered_pic(0);
- if (p == splash)
- return;
+ if ((p == splash) && !is_help) return;
+
if (p == youwin || p == youlose || solution_shown)
{
start_again();
- invalidate(0, 0, table_width, table_height);
+ invalidate(0, 0, ace_table_width, ace_table_height);
return;
}
if (k == 3 || k == 27 || k == 'q')
@@ -214,7 +216,7 @@
if (k == KEY_F(2))
{
start_again();
- invalidate(0, 0, table_width, table_height);
+ invalidate(0, 0, ace_table_width, ace_table_height);
return;
}
if (k == KEY_F(1) || k == 'h')
@@ -223,6 +225,8 @@
help("mastermind.html", mastermind_help);
return;
}
+ if (p == splash) return;
+
if (k == 'r') key_color(0);
if (k == 'o') key_color(1);
if (k == 'y') key_color(2);
@@ -246,7 +250,7 @@
if (p == youwin || p == youlose || solution_shown)
{
start_again();
- invalidate(0, 0, table_width, table_height);
+ invalidate(0, 0, ace_table_width, ace_table_height);
return;
}
drag_ox = x;
@@ -355,9 +359,12 @@
rdx = SSZ+3;
rdy = gdy;
- table_width = rx + 3*rdx + SSZ + WGAP;
- table_height = gy + BSZ + CARD_MARGIN;
+ ace_table_width = rx + 3*rdx + SSZ + WGAP;
+ ace_table_height = gy + BSZ + CARD_MARGIN;
+
+ if (ace_table_width < 400) ace_table_width = 400;
+ if (ace_table_height < 300) ace_table_height = 300;
- init_table(table_width, table_height);
+ init_table(ace_table_width, ace_table_height);
table_loop();
}
--- ace-of-penguins.old/games/mastermind.html
+++ ace-of-penguins/games/mastermind.html
@@ -54,7 +54,7 @@
When viewing help, the space bar, F1 or Esc
return you to your game. Numbers show that section (0 for any
-pre-header section). Letters show section starting with that letter.
+pre-header section). Letters show the section starting with that letter.
Credits
Credits
--- ace-of-penguins.old/games/merlin.html
+++ ace-of-penguins/games/merlin.html
@@ -41,7 +41,7 @@
When viewing help, the space bar, F1 or Esc
return you to your game. Numbers show that section (0 for any
-pre-header section). Letters show section starting with that letter.
+pre-header section). Letters show the section starting with that letter.
Credits
Credits
--- ace-of-penguins.old/games/minesweeper.c
+++ ace-of-penguins/games/minesweeper.c
@@ -57,6 +57,8 @@
#define TM 26
#define TH (401+TM)
+#define y0 minesweeper_y0
+
static int level=0, x0, y0, sz, ct, sc;
static Picture *splash, *title, *xlogo;
@@ -127,7 +129,7 @@
untagged = num_bombs[level];
penguin = PENGUIN_NORMAL;
title_y = (y0-sc-TD_PH+1)/2;
- invalidate(0, 0, table_width, table_height);
+ invalidate(0, 0, ace_table_width, ace_table_height);
}
static void
@@ -165,7 +167,7 @@
int x, y;
penguin = p;
x = TD_PX+penguin*TD_PW;
- put_picture(title, table_width/2-TD_PW/2-x, title_y, x, 0, TD_PW, TD_PH);
+ put_picture(title, ace_table_width/2-TD_PW/2-x, title_y, x, 0, TD_PW, TD_PH);
}
static void
@@ -347,7 +349,7 @@
static void
click(int x, int y, int b)
{
- if (y < y0-sc && x > table_width/2-TD_PW/2 && x < table_width/2+TD_PW/2)
+ if (y < y0-sc && x > ace_table_width/2-TD_PW/2 && x < ace_table_width/2+TD_PW/2)
{
if (b > 1)
{
@@ -457,7 +459,7 @@
}
set_penguin(penguin);
show_untagged();
- put_picture(xlogo, table_width-xlogo->w-x0, title_y, 0, 0, xlogo->w, xlogo->h);
+ put_picture(xlogo, ace_table_width-xlogo->w-x0, title_y, 0, 0, xlogo->w, xlogo->h);
}
static FunctionMapping fmap[] = {
--- ace-of-penguins.old/games/minesweeper.html
+++ ace-of-penguins/games/minesweeper.html
@@ -68,7 +68,7 @@
When viewing help, the space bar, F1 or Esc
return you to your game. Numbers show that section (0 for any
-pre-header section). Letters show section starting with that letter.
+pre-header section). Letters show the section starting with that letter.
Credits
--- ace-of-penguins.old/games/pegged.c
+++ ace-of-penguins/games/pegged.c
@@ -175,12 +175,12 @@
switch (gr)
{
case RULES_VH:
- cx = table_width/2 - (gw-1)*20;
- cy = table_height/2 - (gh-1)*20;
+ cx = ace_table_width/2 - (gw-1)*20;
+ cy = ace_table_height/2 - (gh-1)*20;
break;
case RULES_TRI:
- cx = table_width/2 - (gw-1)*20;
- cy = table_height/2 - (gh-1)*GRID_YY_TRI/2;
+ cx = ace_table_width/2 - (gw-1)*20;
+ cy = ace_table_height/2 - (gh-1)*GRID_YY_TRI/2;
break;
default:
printf("no rules!\n");
@@ -212,7 +212,7 @@
gy[x][y] = cy + y*GRID_YY_TRI;
}
}
- invalidate(0, 0, table_width, table_height);
+ invalidate(0, 0, ace_table_width, ace_table_height);
next_undo = 0;
}
@@ -237,7 +237,7 @@
redraw()
{
int x, y;
- put_picture(xlogo, table_width-xlogo->w-4, 4, 0, 0, xlogo->w, xlogo->h);
+ put_picture(xlogo, ace_table_width-xlogo->w-4, 4, 0, 0, xlogo->w, xlogo->h);
for (x=0; xWhen viewing help, the space bar, F1 or Esc
return you to your game. Numbers show that section (0 for any
-pre-header section). Letters show section starting with that letter.
+pre-header section). Letters show the section starting with that letter.
Credits
Credits
--- ace-of-penguins.old/games/solitaire.c
+++ ace-of-penguins/games/solitaire.c
@@ -425,10 +425,10 @@
};
if ((cp == youlose || cp == youwin)
- && (x > table_width/2-cp->w/2
- && x < table_width/2+cp->w/2
- && y > table_height/2-cp->h/2
- && y < table_height/2+cp->h/2))
+ && (x > ace_table_width/2-cp->w/2
+ && x < ace_table_width/2+cp->w/2
+ && y > ace_table_height/2-cp->h/2
+ && y < ace_table_height/2+cp->h/2))
{
set_centered_pic(0);
start_again();
@@ -641,9 +641,9 @@
if (vegas)
{
sprintf (buffer, "$%d", winnings);
- text (buffer, M, table_height - M);
+ text (buffer, M, ace_table_height - M);
if (redraw)
- invalidate (M, table_height - M - font_height,
+ invalidate (M, ace_table_height - M - font_height,
10 * font_width, font_height);
}
}
@@ -670,11 +670,11 @@
if (vegas)
flip_3s = 1;
- if (table_width == 0 || table_height == 0)
+ if (ace_table_width == 0 || ace_table_height == 0)
{
- table_width = W*7+M*8;
- table_height = H+3*M+19*F+font_height;
+ ace_table_width = W*7+M*8;
+ ace_table_height = H+3*M+19*F+font_height;
}
- init_table(table_width, table_height);
+ init_table(ace_table_width, ace_table_height);
table_loop();
}
--- ace-of-penguins.old/games/solitaire.html
+++ ace-of-penguins/games/solitaire.html
@@ -68,7 +68,7 @@
When viewing help, the space bar, F1 or Esc
return you to your game. Numbers show that section (0 for any
-pre-header section). Letters show section starting with that letter.
+pre-header section). Letters show the section starting with that letter.
Credits
Credits
--- ace-of-penguins.old/games/spider.c
+++ ace-of-penguins/games/spider.c
@@ -493,12 +493,12 @@
youlose = get_picture("youlose");
arrow = get_picture("golf-arrow");
no_arrow = get_picture("golf-noarrow");
- if (table_width == 0 || table_height == 0)
+ if (ace_table_width == 0 || ace_table_height == 0)
{
- table_width = 10*(W+M) + M;
- table_height = 600;
+ ace_table_width = 10*(W+M) + M;
+ ace_table_height = 600;
}
- init_table(table_width, table_height);
+ init_table(ace_table_width, ace_table_height);
table_loop();
return 0;
}
--- ace-of-penguins.old/games/taipedit.c
+++ ace-of-penguins/games/taipedit.c
@@ -81,8 +81,8 @@
static void
init()
{
- lbx = table_width-MARGIN-tpe_bs->w;
- lby = table_height-MARGIN-tpe_bs->h;
+ lbx = ace_table_width-MARGIN-tpe_bs->w;
+ lby = ace_table_height-MARGIN-tpe_bs->h;
lbw = tpe_bs->w;
lbh = tpe_bs->h;
load(0);
@@ -161,7 +161,7 @@
if (layer != z)
{
layer = z;
- invalidate(0, 0, table_width, table_height);
+ invalidate(0, 0, ace_table_width, ace_table_height);
}
return 1;
}
@@ -263,7 +263,7 @@
for (z=z1; z<=z2; z++)
temp[x][y][z] = grid[x+dx][y+dy][z+dz];
memcpy(grid, temp, sizeof(temp));
- invalidate(0, 0, table_width, table_height);
+ invalidate(0, 0, ace_table_width, ace_table_height);
}
static void
@@ -315,7 +315,7 @@
if (layer != k - '1')
{
layer = k - '1';
- invalidate(0, 0, table_width, table_height);
+ invalidate(0, 0, ace_table_width, ace_table_height);
}
}
--- ace-of-penguins.old/games/taipedit.html
+++ ace-of-penguins/games/taipedit.html
@@ -77,7 +77,7 @@
When viewing help, the space bar, F1 or Esc
return you to your game. Numbers show that section (0 for help's
-title). Letters show section starting with that letter.
+title). Letters show the section starting with that letter.
Credits
Credits
--- ace-of-penguins.old/games/taipei.c
+++ ace-of-penguins/games/taipei.c
@@ -345,7 +345,7 @@
break;
}
sprintf(tmp, " %3d %3d", num_tiles, c);
- text(tmp, 2, table_height-2);
+ text(tmp, 2, ace_table_height-2);
}
static void
@@ -457,7 +457,7 @@
one_means_filled = 0;
redraw_free_tile_count();
- invalidate(0, 0, table_width, table_height);
+ invalidate(0, 0, ace_table_width, ace_table_height);
}
static void
@@ -653,10 +653,10 @@
Picture *cp = get_centered_pic();
if ((cp == youlose || cp == youwin)
- && (x > table_width/2-cp->w/2
- && x < table_width/2+cp->w/2
- && y > table_height/2-cp->h/2
- && y < table_height/2+cp->h/2))
+ && (x > ace_table_width/2-cp->w/2
+ && x < ace_table_width/2+cp->w/2
+ && y > ace_table_height/2-cp->h/2
+ && y < ace_table_height/2+cp->h/2))
{
set_centered_pic(0);
start_again();
--- ace-of-penguins.old/games/taipei.html
+++ ace-of-penguins/games/taipei.html
@@ -134,7 +134,7 @@
When viewing help, the space bar, F1 or Esc
return you to your game. Numbers show that section (0 for any
-pre-header section). Letters show section starting with that letter.
+pre-header section). Letters show the section starting with that letter.
Credits
Credits
--- ace-of-penguins.old/games/taipeilib.c
+++ ace-of-penguins/games/taipeilib.c
@@ -56,7 +56,7 @@
grid[x][y][z] = 1;
}
- invalidate(0, 0, table_width, table_height);
+ invalidate(0, 0, ace_table_width, ace_table_height);
}
void
--- ace-of-penguins.old/games/taipeilib.h
+++ ace-of-penguins/games/taipeilib.h
@@ -1,3 +1,4 @@
+#include "imagelib.h"
#include "taipei.h"
extern unsigned char grid[GRID_SX][GRID_SY][GRID_SZ];
--- ace-of-penguins.old/games/thornq.c
+++ ace-of-penguins/games/thornq.c
@@ -209,8 +209,8 @@
{
int cw, ch;
stack_get_card_size (&cw, &ch);
- if (xlogo->w < table_width - 8*cw && xlogo->h < ch)
- put_picture(xlogo, table_width/2-xlogo->w/2, ch/2-xlogo->h/2,
+ if (xlogo->w < ace_table_width - 8*cw && xlogo->h < ch)
+ put_picture(xlogo, ace_table_width/2-xlogo->w/2, ch/2-xlogo->h/2,
0, 0, xlogo->h, xlogo->w);
stack_redraw();
redraw_arrows();
@@ -703,12 +703,12 @@
arrow = get_picture("thornq-arrow");
no_arrow = get_picture("thornq-noarrow");
- if (table_width == 0 || table_height == 0)
+ if (ace_table_width == 0 || ace_table_height == 0)
{
- table_width = WIN_W;
- table_height = WIN_H;
+ ace_table_width = WIN_W;
+ ace_table_height = WIN_H;
}
- init_table(table_width, table_height);
+ init_table(ace_table_width, ace_table_height);
table_loop();
return 0;
--- ace-of-penguins.old/games/thornq.html
+++ ace-of-penguins/games/thornq.html
@@ -66,7 +66,7 @@
When viewing help, the space bar, F1 or Esc
return you to your game. Numbers show that section (0 for any
-pre-header section). Letters show section starting with that letter.
+pre-header section). Letters show the section starting with that letter.
Credits
Credits
--- ace-of-penguins.old/lib/cards.h
+++ ace-of-penguins/lib/cards.h
@@ -16,7 +16,10 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef _cards_h_
+#include "imagelib.h"
+
#define _cards_h_
+#include "stdinc.h"
#define CARD_WIDTH 73
#define CARD_HEIGHT 97
--- ace-of-penguins.old/lib/funcs.h
+++ ace-of-penguins/lib/funcs.h
@@ -15,6 +15,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include "stdinc.h"
+
extern void (*click_cb)(int x, int y, int b);
extern void (*drag_cb)(int x, int y, int b);
--- ace-of-penguins.old/lib/help.c
+++ ace-of-penguins/lib/help.c
@@ -15,12 +15,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include
-#include
-#include
-#include
-#include
-#include
+#include "stdinc.h"
+
#include
#include
#include
@@ -119,10 +115,10 @@
if (max_vscroll < y)
max_vscroll = y;
}
- max_vscroll -= (table_height - menu_height);
+ max_vscroll -= (ace_table_height - menu_height);
if (max_vscroll < 0)
max_vscroll = 0;
- invalidate(0, 0, table_width, table_height);
+ invalidate(0, 0, ace_table_width, ace_table_height);
}
static void
@@ -144,16 +140,16 @@
help_foreground = pixel_for(255, 255, 255);
help_beyondcolor = pixel_for(0, 0, 0);
}
- if (table_width < 300)
+ if (ace_table_width < 300)
{
- bigpoints = 120;
- smallpoints = 80;
+ bigpoints = 200;
+ smallpoints = 200;
use_helvetica = 1;
}
else
{
- bigpoints = 180;
- smallpoints = 100;
+ bigpoints = 200;
+ smallpoints = 200;
use_helvetica = 0;
}
for (i=0; i<16; i++)
@@ -167,7 +163,7 @@
fonts[i] = XLoadQueryFont(display, name);
}
fonts[MENU_FONT] =
- XLoadQueryFont(display, "*-helvetica-medium-r-normal--*-100-*-*-*-*-*-*");
+ XLoadQueryFont(display, "*-helvetica-medium-r-normal--*-200-*-*-*-*-*-*");
for (i=0; i<17; i++)
{
if (!fonts[i])
@@ -195,8 +191,8 @@
mx = 0;
w = words + menus[cur_menu];
i = w->x + w->width + ts;
- if (i > table_width - 20)
- mx = i - table_width + ts/2 + 20;
+ if (i > ace_table_width - 20)
+ mx = i - ace_table_width + ts/2 + 20;
XSetForeground(display, gc, help_foreground);
XSetFont(display, gc, fonts[MENU_FONT]->fid);
@@ -217,17 +213,17 @@
if (menus[i] == cur_page-1)
{
XDrawLine(display, window, gc, -2, y, l-2, y);
- XDrawLine(display, window, gc, r+2, y, table_width+2, y);
+ XDrawLine(display, window, gc, r+2, y, ace_table_width+2, y);
saw_cur_menu = 1;
}
}
XDrawPoint(display, window, gc, r+1, y-1);
if (!saw_cur_menu)
- XDrawLine(display, window, gc, 0, y, table_width, y);
+ XDrawLine(display, window, gc, 0, y, ace_table_width, y);
XSetForeground(display, gc, help_beyondcolor);
- XFillRectangle(display, window, gc, r+2, 0, table_width-r-2, y);
- XDrawLine(display, window, gc, 0, 0, table_width, 0);
+ XFillRectangle(display, window, gc, r+2, 0, ace_table_width-r-2, y);
+ XDrawLine(display, window, gc, 0, 0, ace_table_width, 0);
XDrawLine(display, window, gc, 0, 0, 0, y-1);
XDrawLine(display, window, gc, 1, 0, 1, y-2);
XDrawLine(display, window, gc, 2, 0, 2, 4);
@@ -245,7 +241,7 @@
XDrawLine(display, window, gc, r-4, 1, r+4, 1);
}
- clip_more (0, menu_height+3, table_width, table_height-menu_height-3);
+ clip_more (0, menu_height+3, ace_table_width, ace_table_height-menu_height-3);
for (i=cur_page; i= '0' && c <= '9')
@@ -302,9 +298,9 @@
switch (c)
{
case KEY_DOWN: vs = 10; break;
- case KEY_PGDN: vs = (table_height-menu_height)*9/10; break;
+ case KEY_PGDN: vs = (ace_table_height-menu_height)*9/10; break;
case KEY_UP: vs = -10; break;
- case KEY_PGUP: vs = -(table_height-menu_height)*9/10; break;
+ case KEY_PGUP: vs = -(ace_table_height-menu_height)*9/10; break;
}
if (vs)
{
@@ -314,7 +310,7 @@
if (vscroll < 0)
vscroll = 0;
if (vscroll != old_vscroll)
- invalidate(0, menu_height+3, table_width, table_height);
+ invalidate(0, menu_height+3, ace_table_width, ace_table_height);
}
}
@@ -342,28 +338,28 @@
}
/* rescale y to whole screen */
- y = (y-menu_height) * table_height / (table_height - menu_height);
+ y = (y-menu_height) * ace_table_height / (ace_table_height - menu_height);
- if (y > table_height/3 && y < table_height*2/3)
+ if (y > ace_table_height/3 && y < ace_table_height*2/3)
{
- if (x < table_width/6)
+ if (x < ace_table_width/6)
{
my_help_key (KEY_LEFT, x, y);
return;
}
- else if (x > table_width*5/6)
+ else if (x > ace_table_width*5/6)
{
my_help_key (KEY_RIGHT, x, y);
return;
}
}
- vscroll += (y - table_height/2);
+ vscroll += (y - ace_table_height/2);
if (vscroll > max_vscroll)
vscroll = max_vscroll;
if (vscroll < 0)
vscroll = 0;
if (vscroll != old_vscroll)
- invalidate(0, menu_height+3, table_width, table_height);
+ invalidate(0, menu_height+3, ace_table_width, ace_table_height);
}
#define MARGIN 10
@@ -377,7 +373,7 @@
FILE *f;
static int initted = 0;
int row_top, row_width;
- int max_width = table_width - 2 * MARGIN;
+ int max_width = ace_table_width - 2 * MARGIN;
int first_in_row;
int menu_x = 2;
Word *floating_left = 0, *floating_right = 0;
@@ -571,7 +567,7 @@
if (floating_right)
row_top = floating_right->y;
floating_right = w;
- w->x = table_width - MARGIN - w->width;
+ w->x = ace_table_width - MARGIN - w->width;
w->y = row_top + w->a;
continue;
}
--- ace-of-penguins.old/lib/imagelib.h
+++ ace-of-penguins/lib/imagelib.h
@@ -5,6 +5,8 @@
#error include imagelib.h before cards.h
#endif
+#include "stdinc.h"
+
#ifndef PIXELS_TYPE
#define PIXELS_TYPE void *
#endif
--- ace-of-penguins.old/lib/make-imglib.c
+++ ace-of-penguins/lib/make-imglib.c
@@ -1,11 +1,4 @@
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
+#include "stdinc.h"
#include
static int verbose = 0;
--- ace-of-penguins.old/lib/penguins.c
+++ ace-of-penguins/lib/penguins.c
@@ -15,8 +15,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include
-#include
#include "cards.h"
char *suits = "hdcs";
--- ace-of-penguins.old/lib/stack.c
+++ ace-of-penguins/lib/stack.c
@@ -15,14 +15,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
+#include "stdinc.h"
typedef struct Stack {
struct Stack *prev, *next;
@@ -853,7 +846,7 @@
/* 1 pixel per millisecond */
dist = isqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
- dist = dist * 213 / table_width;
+ dist = dist * 213 / ace_table_width;
ox = y1;
oy = x1;
--- ace-of-penguins.old/lib/stdinc.h
+++ ace-of-penguins/lib/stdinc.h
@@ -0,0 +1,17 @@
+#ifndef __STDINC_H__
+#define __STDINC_H__ 1
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#endif
--- ace-of-penguins.old/lib/table.c
+++ ace-of-penguins/lib/table.c
@@ -15,10 +15,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include
-#include
-#include
-#include
+#include "stdinc.h"
#include
#include
@@ -43,7 +40,7 @@
#define DBLCLICK_MOVE 5
-int table_width=0, table_height=0, table_type;
+int ace_table_width=0, ace_table_height=0, table_type;
int display_width, display_height;
static Picture *centered_pic = 0;
@@ -57,8 +54,8 @@
static OptionDesc *options[5];
static OptionDesc ace_options[] = {
- { "-width", OPTION_INTEGER, &table_width },
- { "-height", OPTION_INTEGER, &table_height },
+ { "-width", OPTION_INTEGER, &ace_table_width },
+ { "-height", OPTION_INTEGER, &ace_table_height },
{ 0, 0, 0 }
};
@@ -158,8 +155,8 @@
ew = width;
eh = height;
- table_width = width;
- table_height = height;
+ ace_table_width = width;
+ ace_table_height = height;
xwin_create (width, height);
}
@@ -236,8 +233,8 @@
int x, y, w=0, h=0;
if (centered_pic)
{
- x = table_width/2-centered_pic->w/2;
- y = table_height/2-centered_pic->h/2;
+ x = ace_table_width/2-centered_pic->w/2;
+ y = ace_table_height/2-centered_pic->h/2;
w = centered_pic->w;
h = centered_pic->h;
}
@@ -246,12 +243,12 @@
{
if (centered_pic->w > w)
{
- x = table_width/2-centered_pic->w/2;
+ x = ace_table_width/2-centered_pic->w/2;
w = centered_pic->w;
}
if (centered_pic->h > h)
{
- y = table_height/2-centered_pic->h/2;
+ y = ace_table_height/2-centered_pic->h/2;
h = centered_pic->h;
}
}
@@ -269,12 +266,12 @@
redraw_centered_pic()
{
if (centered_pic)
- put_picture(centered_pic, table_width/2-centered_pic->w/2,
- table_height/2-centered_pic->h/2,
+ put_picture(centered_pic, ace_table_width/2-centered_pic->w/2,
+ ace_table_height/2-centered_pic->h/2,
0, 0, centered_pic->w, centered_pic->h);
}
-#define CLEAR_CLIP ex = 0; ey = 0; ew = table_width; eh = table_height; xwin_noclip();
+#define CLEAR_CLIP ex = 0; ey = 0; ew = ace_table_width; eh = ace_table_height; xwin_noclip();
static int dcx, dcy, dct=0; /* double click memory */
static int drag_enabled=0;
@@ -348,21 +345,21 @@
maybe_init();
if (no_resize)
- xwin_fixed_size(table_width, table_height);
+ xwin_fixed_size(ace_table_width, ace_table_height);
else
{
graphics_disabled = 1;
resize_cb(event.w, event.h);
graphics_disabled = 0;
if (no_resize)
- xwin_fixed_size(table_width, table_height);
+ xwin_fixed_size(ace_table_width, ace_table_height);
else
{
- table_width = event.w;
- table_height = event.h;
+ ace_table_width = event.w;
+ ace_table_height = event.h;
if (first_expose)
{
- clear (0, 0, table_width, table_height);
+ clear (0, 0, ace_table_width, ace_table_height);
redraw_cb();
}
}
@@ -495,10 +492,10 @@
eh += ey;
ey = 0;
}
- if (ex+ew > table_width)
- ew = table_width - ex;
- if (ey+eh > table_height)
- eh = table_height - ey;
+ if (ex+ew > ace_table_width)
+ ew = ace_table_width - ex;
+ if (ey+eh > ace_table_height)
+ eh = ace_table_height - ey;
reset_clip();
}
--- ace-of-penguins.old/lib/table.h
+++ ace-of-penguins/lib/table.h
@@ -7,7 +7,7 @@
extern int table_type;
extern int display_width, display_height;
-extern int table_width, table_height;
+extern int ace_table_width, ace_table_height;
#define OPTION_BOOLEAN 1
#define OPTION_STRING 2
@@ -24,10 +24,10 @@
void *function;
} FunctionMapping;
-/* This sets display_width/height, sets table_width/height to preferred or zero */
+/* This sets display_width/height, sets ace_table_width/height to preferred or zero */
void init_ace(int argc, char **argv, FunctionMapping *funcs);
/* This creates the initial window */
-void init_table(int table_width, int table_height);
+void init_table(int ace_table_width, int ace_table_height);
extern int get_picture_default_width, get_picture_default_height;
--- ace-of-penguins.old/lib/table_rn.c
+++ ace-of-penguins/lib/table_rn.c
@@ -17,6 +17,7 @@
/* Not all platforms do these right, so supply our own */
+#include "stdinc.h"
#include
static unsigned long long next = 0;
--- ace-of-penguins.old/lib/text2c.c
+++ ace-of-penguins/lib/text2c.c
@@ -15,8 +15,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include
-#include
+#include "stdinc.h"
int
main(int argc, char **argv)
--- ace-of-penguins.old/lib/xwin.c
+++ ace-of-penguins/lib/xwin.c
@@ -15,14 +15,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include
-#include
-#include
-#include
-#include
+#include "stdinc.h"
#include
-
#include
#include
#include
@@ -360,12 +355,12 @@
};
#define NUM_KEYMAPS (sizeof(key_mappings)/sizeof(key_mappings[0]))
-#define WROT(x,y,w,h) if (xrotate) { int t = x; x = table_width-y-h; y = t; \
+#define WROT(x,y,w,h) if (xrotate) { int t = x; x = ace_table_width-y-h; y = t; \
t = w; w = h; h = t; }
-#define PROT(x,y) if (xrotate) { int t = x; x = table_width-y; y = t; }
-#define WROT2(x,y,w,h) if (xrotate) { int t = y; y = table_width-x-w; x = t; \
+#define PROT(x,y) if (xrotate) { int t = x; x = ace_table_width-y; y = t; }
+#define WROT2(x,y,w,h) if (xrotate) { int t = y; y = ace_table_width-x-w; x = t; \
t = w; w = h; h = t; }
-#define PROT2(x,y) if (xrotate) { int t = y; y = table_width-x; x = t; }
+#define PROT2(x,y) if (xrotate) { int t = y; y = ace_table_width-x; x = t; }
int
xwin_nextevent (XWin_Event *ev)
@@ -1145,7 +1140,7 @@
w = h;
h = t;
t = dy;
- dy = table_height - dx - src->width;
+ dy = ace_table_height - dx - src->width;
dx = t;
}
--- ace-of-penguins.old/lib/xwin.h
+++ ace-of-penguins/lib/xwin.h
@@ -27,9 +27,9 @@
int time; /* milliseconds. button, motion only */
} XWin_Event;
-/* sets display_width, display_height, table_width/height to preferred */
+/* sets display_width, display_height, ace_table_width/height to preferred */
int xwin_init (int argc, char **argv);
-/* sets table_width, table_height to actual */
+/* sets ace_table_width, ace_table_height to actual */
void xwin_create (int width, int height);
int xwin_nextevent (XWin_Event *event);