This is the doxygen documentation for gtkboard.

.
Main Page   Data Structures   File List   Data Fields   Globals  

cpento.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include "game.h"
#include "../pixmaps/alpha.xpm"
#include "../pixmaps/cpento.xpm"

Go to the source code of this file.

Defines

#define CPENTO_CELL_SIZE   36
#define CPENTO_BOARD_WID   15
#define CPENTO_BOARD_HEIT   9
#define CPENTO_NUM_PIECES   32
#define CPENTO_EMPTY   0
#define CPENTO_TILE_F   1
#define CPENTO_TILE_I   2
#define CPENTO_TILE_L   3
#define CPENTO_TILE_N   4
#define CPENTO_TILE_P   5
#define CPENTO_TILE_T   6
#define CPENTO_TILE_U   7
#define CPENTO_TILE_V   8
#define CPENTO_TILE_W   9
#define CPENTO_TILE_X   10
#define CPENTO_TILE_Y   11
#define CPENTO_TILE_Z   12
#define CPENTO_TILE_SIMPLE   13
#define CPENTO_TILE_RARROW   14
#define CPENTO_TILE_LARROW   15
#define CPENTO_TILE_FLIPLR   16
#define CPENTO_PIECE_BALL   17
#define CPENTO_PIECE_LEG_UP   18
#define CPENTO_PIECE_LEG_DOWN   19
#define CPENTO_PIECE_PIPE_VERT   20
#define CPENTO_PIECE_LEG_RIGHT   21
#define CPENTO_PIECE_BEND_UR   22
#define CPENTO_PIECE_BEND_DR   23
#define CPENTO_PIECE_T_LEFT   24
#define CPENTO_PIECE_LEG_LEFT   25
#define CPENTO_PIECE_BEND_UL   26
#define CPENTO_PIECE_BEND_DL   27
#define CPENTO_PIECE_T_RIGHT   28
#define CPENTO_PIECE_PIPE_HORIZ   29
#define CPENTO_PIECE_T_DOWN   30
#define CPENTO_PIECE_T_UP   31
#define CPENTO_PIECE_FOURWAY   32

Functions

void cpento_init (void)
int cpento_getmove (Pos *, int, int, GtkboardEventType, Player, byte **, int **)
void cpento_add_move (byte *move, int x, int y, int m)
void cpento_clear_left (byte *move)
void cpento_orient (int x, int y, int *nx, int *ny, int orient)
void cpento_rev_orient (int x, int y, int *nx, int *ny, int orient)
int cpento_tile_orient (int x, int y, int orient, char **pento)
void cpento_place_left (byte *move, char *pento[5], int piece_letter, int orient)
void cpento_place_right (byte *move, char *pento[5], int piece_letter, int orient, int x, int y)
int cpento_fits_right (byte *move, char *pento[5], int orient, int x, int y, Pos *pos)

Variables

char cpento_colors [6] = { 0,120,0, 10,130,10 }
int cpento_initpos [CPENTO_BOARD_WID *CPENTO_BOARD_HEIT]
char** cpento_pixmaps [CPENTO_NUM_PIECES]
Game CapturePento
char* ball_grey_36_36_xpm []
char* cpento_piece_list [][5]


Define Documentation

#define CPENTO_BOARD_HEIT   9
 

Definition at line 29 of file cpento.c.

#define CPENTO_BOARD_WID   15
 

Definition at line 28 of file cpento.c.

#define CPENTO_CELL_SIZE   36
 

Definition at line 27 of file cpento.c.

#define CPENTO_EMPTY   0
 

Definition at line 32 of file cpento.c.

#define CPENTO_NUM_PIECES   32
 

Definition at line 31 of file cpento.c.

#define CPENTO_PIECE_BALL   17
 

Definition at line 49 of file cpento.c.

#define CPENTO_PIECE_BEND_DL   27
 

Definition at line 59 of file cpento.c.

#define CPENTO_PIECE_BEND_DR   23
 

Definition at line 55 of file cpento.c.

#define CPENTO_PIECE_BEND_UL   26
 

Definition at line 58 of file cpento.c.

#define CPENTO_PIECE_BEND_UR   22
 

Definition at line 54 of file cpento.c.

#define CPENTO_PIECE_FOURWAY   32
 

Definition at line 64 of file cpento.c.

#define CPENTO_PIECE_LEG_DOWN   19
 

Definition at line 51 of file cpento.c.

#define CPENTO_PIECE_LEG_LEFT   25
 

Definition at line 57 of file cpento.c.

#define CPENTO_PIECE_LEG_RIGHT   21
 

Definition at line 53 of file cpento.c.

#define CPENTO_PIECE_LEG_UP   18
 

Definition at line 50 of file cpento.c.

#define CPENTO_PIECE_PIPE_HORIZ   29
 

Definition at line 61 of file cpento.c.

#define CPENTO_PIECE_PIPE_VERT   20
 

Definition at line 52 of file cpento.c.

#define CPENTO_PIECE_T_DOWN   30
 

Definition at line 62 of file cpento.c.

#define CPENTO_PIECE_T_LEFT   24
 

Definition at line 56 of file cpento.c.

#define CPENTO_PIECE_T_RIGHT   28
 

Definition at line 60 of file cpento.c.

#define CPENTO_PIECE_T_UP   31
 

Definition at line 63 of file cpento.c.

#define CPENTO_TILE_F   1
 

Definition at line 33 of file cpento.c.

#define CPENTO_TILE_FLIPLR   16
 

Definition at line 48 of file cpento.c.

#define CPENTO_TILE_I   2
 

Definition at line 34 of file cpento.c.

#define CPENTO_TILE_L   3
 

Definition at line 35 of file cpento.c.

#define CPENTO_TILE_LARROW   15
 

Definition at line 47 of file cpento.c.

#define CPENTO_TILE_N   4
 

Definition at line 36 of file cpento.c.

#define CPENTO_TILE_P   5
 

Definition at line 37 of file cpento.c.

#define CPENTO_TILE_RARROW   14
 

Definition at line 46 of file cpento.c.

#define CPENTO_TILE_SIMPLE   13
 

Definition at line 45 of file cpento.c.

#define CPENTO_TILE_T   6
 

Definition at line 38 of file cpento.c.

#define CPENTO_TILE_U   7
 

Definition at line 39 of file cpento.c.

#define CPENTO_TILE_V   8
 

Definition at line 40 of file cpento.c.

#define CPENTO_TILE_W   9
 

Definition at line 41 of file cpento.c.

#define CPENTO_TILE_X   10
 

Definition at line 42 of file cpento.c.

#define CPENTO_TILE_Y   11
 

Definition at line 43 of file cpento.c.

#define CPENTO_TILE_Z   12
 

Definition at line 44 of file cpento.c.


Function Documentation

void cpento_add_move ( byte * move,
int x,
int y,
int m ) [static]
 

Definition at line 304 of file cpento.c.

Referenced by cpento_clear_left(), cpento_place_left(), and cpento_place_right().

void cpento_clear_left ( byte * move ) [static]
 

Definition at line 322 of file cpento.c.

Referenced by cpento_getmove(), and cpento_place_left().

int cpento_fits_right ( byte * move,
char * pento[5],
int orient,
int x,
int y,
Pos * pos ) [static]
 

Definition at line 438 of file cpento.c.

Referenced by cpento_getmove().

int cpento_getmove ( Pos * pos,
int x,
int y,
GtkboardEventType type,
Player to_play,
byte ** movp,
int ** renderp ) [static]
 

Definition at line 460 of file cpento.c.

void cpento_init ( void ) [static]
 

Definition at line 182 of file cpento.c.

void cpento_orient ( int x,
int y,
int * nx,
int * ny,
int orient ) [static]
 

Definition at line 335 of file cpento.c.

Referenced by cpento_fits_right(), cpento_place_left(), and cpento_place_right().

void cpento_place_left ( byte * move,
char * pento[5],
int piece_letter,
int orient ) [static]
 

Definition at line 404 of file cpento.c.

Referenced by cpento_getmove().

void cpento_place_right ( byte * move,
char * pento[5],
int piece_letter,
int orient,
int x,
int y ) [static]
 

Definition at line 421 of file cpento.c.

Referenced by cpento_getmove().

void cpento_rev_orient ( int x,
int y,
int * nx,
int * ny,
int orient ) [static]
 

Definition at line 351 of file cpento.c.

Referenced by cpento_tile_orient().

int cpento_tile_orient ( int x,
int y,
int orient,
char ** pento ) [static]
 

Definition at line 366 of file cpento.c.

Referenced by cpento_place_left(), and cpento_place_right().


Variable Documentation

Game CapturePento
 

Initial value:

 {
    CPENTO_CELL_SIZE,
    CPENTO_BOARD_WID, CPENTO_BOARD_HEIT,
    CPENTO_NUM_PIECES,
    cpento_colors, cpento_initpos,
    cpento_pixmaps,
    "Capture Pentominoes",
    cpento_init
}

Definition at line 76 of file cpento.c.

char* ball_grey_36_36_xpm[] [static]
 

Definition at line 102 of file cpento.c.

char cpento_colors[6] = { 0,120,0, 10,130,10 } [static]
 

Definition at line 86 of file cpento.c.

int cpento_initpos[CPENTO_BOARD_WID*CPENTO_BOARD_HEIT] [static]
 

Initial value:

{
    1, 2, 3, 4, 5, 6,13,13,13,13,13,13,13,13,13,
    7, 8, 9,10,11,12,13, 0, 0, 0, 0, 0, 0, 0,13,
   13,13,13,13,13,13,13, 0, 0, 0, 0, 0, 0, 0,13,
   13, 0, 0, 0, 0, 0,13, 0, 0, 0, 0, 0, 0, 0,13,
   13, 0, 0, 0, 0, 0,13, 0, 0, 0, 0, 0, 0, 0,13,
   15, 0, 0, 0, 0, 0,14, 0, 0, 0, 0, 0, 0, 0,13,
   13, 0, 0, 0, 0, 0,13, 0, 0, 0, 0, 0, 0, 0,13,
   13, 0, 0, 0, 0, 0,13, 0, 0, 0, 0, 0, 0, 0,13,
   13,13,13,16,13,13,13,13,13,13,13,13,13,13,13,
}

Definition at line 89 of file cpento.c.

char* cpento_piece_list[][5] [static]
 

Definition at line 216 of file cpento.c.

char** cpento_pixmaps[CPENTO_NUM_PIECES] [static]
 

Definition at line 145 of file cpento.c.