Hogwarts Wand Docs: ../server/tokens.h

Wand Sourcecode: ../server/tokens.h

//
// tokens.h  - OBSOLETE macros for creating & dissecting motion and pattern tokens
//
// Copyright (C) 2006  Nathan (Acorn) Pooley
// 
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// version 2 as published by the Free Software Foundation.
// 
// This program 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 General Public License (gpl.txt) for more details. 
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
// 
// You can contact the author, Nathan (Acorn) Pooley, by writing
// to Nathan (Acorn) Pooley, 949 Buckeye Drive, Sunnyvale, CA  94086, USA
// or through the form at http://www.rawbw.com/~acorn/wand/feedback.html
//
//
//
//
//#@DOC@ OBSOLETE wand motion tokens are defined in this file
//


#define CK_TOKSHAPE_CIRCLE  0
#define CK_TOKSHAPE_FLAT    1
#define CK_TOKSHAPE_REVERSE 2
#define CK_TOKSHAPE_START   3
#define CK_TOKSHAPE_STOP    4
#define CK_TOKSHAPE_PAUSE   5

#define CK_TOKSHAPE_CNT     6


#define CK_TOKSHAPE_STRINGS()                                               \
    "Circle",                                                               \
    "Flat  ",                                                               \
    "Revers",                                                               \
    "Begin ",                                                               \
    "End   ",                                                               \
    "Pause ",                                                               \
    "???   ",                                                               \
    "ERROR ",                                                               \


//
// 0sss0cqq   - token
//
// sss = shape
// qq  = quad
// c   = ccw
//      
#define CK_MAKE_TOKEN(shape,quad,ccw)                                       \
        ((((shape)&0x7) << 4) |                                             \
         (((shape)<CK_TOKSHAPE_PAUSE)?0:                                    \
          (((quad)&3)|((ccw)?4:0))))

#define CK_TOKEN_SHAPE(tok) ((tok)>>4)
#define CK_TOKEN_CCW(tok)                                                   \
            ((CK_TOKEN_SHAPE(tok)<CK_TOKSHAPE_PAUSE)?(((tok)>>2)&1):0)
#define CK_TOKEN_QUAD(tok)                                                  \
            ((CK_TOKEN_SHAPE(tok)<CK_TOKSHAPE_PAUSE)?((tok)&3):0)



This file Copyright (C) 2006 by Nathan (Acorn) Pooley
Go to TOP Wand page
Go to Acorn's personal webpage
Go to Hogwarts website: www.gotohogwarts.com
Snout: www.snout.org/game
Gadgets of Justice Unlimited
Snout GC (Wiki)
Snout Wiki
File created by do_doc at Wed May 30 03:30:23 PDT 2007