… | |
… | |
16 | |
16 | |
17 | You should have received a copy of the GNU General Public License |
17 | You should have received a copy of the GNU General Public License |
18 | along with this program; if not, write to the Free Software |
18 | along with this program; if not, write to the Free Software |
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
20 | |
20 | |
21 | The authors can be reached via e-mail at crossfire-devel@real-time.com |
21 | The authors can be reached via e-mail at crossfire@schmorp.de |
22 | */ |
22 | */ |
23 | |
23 | |
24 | /* This file is best viewed with a window width of about 100 character */ |
24 | /* This file is best viewed with a window width of about 100 character */ |
25 | |
25 | |
26 | /* This file is really too large. With all the .h files |
26 | /* This file is really too large. With all the .h files |
… | |
… | |
425 | * flags[2] is 64 to 95 |
425 | * flags[2] is 64 to 95 |
426 | * flags[3] is 96 to 127 |
426 | * flags[3] is 96 to 127 |
427 | */ |
427 | */ |
428 | |
428 | |
429 | /* Basic routines to do above */ |
429 | /* Basic routines to do above */ |
430 | #define SET_FLAG(xyz, p) \ |
430 | #define SET_FLAG(obj, flag) (obj)->flags[flag] = 1 |
431 | ((xyz)->flags[p/32] |= (1U << (p % 32))) |
431 | #define CLEAR_FLAG(obj, flag) (obj)->flags[flag] = 0 |
432 | #define CLEAR_FLAG(xyz, p) \ |
432 | #define QUERY_FLAG(obj, flag) (obj)->flags[flag] |
433 | ((xyz)->flags[p/32] &= ~(1U << (p % 32))) |
|
|
434 | #define QUERY_FLAG(xyz, p) \ |
|
|
435 | ((xyz)->flags[p/32] & (1U << (p % 32))) |
|
|
436 | #define COMPARE_FLAGS(p,q) \ |
|
|
437 | ( \ |
|
|
438 | ((p)->flags[0] == (q)->flags[0]) && \ |
|
|
439 | ((p)->flags[1] == (q)->flags[1]) && \ |
|
|
440 | ((p)->flags[2] == (q)->flags[2]) && \ |
|
|
441 | ((p)->flags[3] == (q)->flags[3]) \ |
|
|
442 | ) |
|
|
443 | |
433 | |
444 | /* convenience macros to determine what kind of things we are dealing with */ |
434 | /* convenience macros to determine what kind of things we are dealing with */ |
445 | |
435 | |
446 | #define IS_WEAPON(op) \ |
436 | #define IS_WEAPON(op) \ |
447 | (op->type == ARROW || op->type == BOW || op->type == WEAPON) |
437 | (op->type == ARROW || op->type == BOW || op->type == WEAPON) |