cards.h 2.11 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/*
 * Cards dll definitions
 *
 * Copyright (C) 2004 Sami Nopanen
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 20 21 22 23 24 25 26 27 28 29 30 31
 */

#ifndef __CARDS_H__
#define __CARDS_H__

/* Card suits */
#define CARD_SUIT_CLUBS    0
#define CARD_SUIT_DIAMONDS 1
#define CARD_SUIT_HEARTS   2
#define CARD_SUIT_SPADES   3


/* 0-51 = normal 52 cards of deck */
32
/* 52 = ghost card mask */
33
/* 53-68 = card backs */
34
#define CARD_FREE_MASK        52
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
#define CARD_BACK_CROSSHATCH  53
#define CARD_BACK_WEAVE1      54
#define CARD_BACK_WEAVE2      55
#define CARD_BACK_ROBOT       56
#define CARD_BACK_FLOWERS     57
#define CARD_BACK_VINE1       58
#define CARD_BACK_VINE2       59
#define CARD_BACK_FISH1       60
#define CARD_BACK_FISH2       61
#define CARD_BACK_SHELLS      62
#define CARD_BACK_CASTLE      63
#define CARD_BACK_ISLAND      64
#define CARD_BACK_CARDHAND    65
#define CARD_BACK_UNUSED      66
#define CARD_BACK_THE_X       67
#define CARD_BACK_THE_O       68

#define CARD_MAX              68

54 55 56 57 58 59 60 61 62
/* Drawing modes */
#define MODE_FACEUP             0
#define MODE_FACEDOWN           1
#define MODE_HILITE             2
#define MODE_GHOST              3
#define MODE_REMOVE             4
#define MODE_INVISIBLEGHOST     5
#define MODE_DECKX              6
#define MODE_DECKO              7
63

64 65
#define MODEFLAG_DONT_ROUND_CORNERS 0x80000000

66 67 68 69 70 71
/* As defined by CARD_SUIT_* */
#define SUIT_FROM_CARD(card) (card & 3)
/* 0 = ace, ..., 12 = king */
#define FACE_FROM_CARD(card) (card >> 2)

#endif