crosshair.h (1475B)
1 /* 2 Bible Karuta Game - Crosshair header file 3 "crosshair.h" 4 M. Yamanaka 5 email: myamanaka@live.com 6 website: csmyamanaka.com 7 license: MIT (See included "LICENSE" file for details) 8 */ 9 10 #include <stdlib.h> 11 12 /* 13 The crosshair object 14 Member variables in order: 15 pos ... xy-coordinates 16 gs ... overall state of crosshair: disabled, invisible, etc 17 as ... animation state of crosshair i.e. frame in spritesheet 18 fn ... file name of spritesheet file 19 */ 20 typedef struct Crosshair{ int pos[2], gs, as; const char* fn; } Crosshair; 21 22 /* 23 On second thought, there may not be a need for an entire crosshair 24 object. I might just need an integer array to encapsulate all the 25 information that I need. Of course this would mean that the spritesheet 26 file information will not be included but I may just draw it out with 27 SDL functions. 28 The five indicies of the "Xhair" data are: 29 0 ... x position 30 1 ... y position 31 2 ... state 32 3 ... animation index 33 4 ... radius 34 */ 35 typedef int Xhair[5]; 36 37 38 /* 39 Draw crosshair object 40 The crosshair struct should have all of the necessary information 41 required to draw the object so the crosshair object is the only 42 argument required in this function. Note that the object itself 43 is passed since no changes are made by the draw function. 44 Arguments: 45 Crosshair* ... crosshair object 46 This function returns an integer indicating the successfulnes of its 47 execution. 48 */ 49 int drawCrosshair(Xhair);