Mercurial > hg > early-roguelike
comparison srogue/disply.c @ 225:4f6e056438eb
Merge the GCC5 and build fix branches.
| author | John "Elwin" Edwards | 
|---|---|
| date | Wed, 02 Mar 2016 21:28:34 -0500 | 
| parents | 94a0d9dd5ce1 | 
| children | e52a8a7ad4c5 | 
   comparison
  equal
  deleted
  inserted
  replaced
| 224:4d0f53998e8a | 225:4f6e056438eb | 
|---|---|
| 16 | 16 | 
| 17 /* | 17 /* | 
| 18 * displevl: | 18 * displevl: | 
| 19 * Display detailed level for wizard and scroll | 19 * Display detailed level for wizard and scroll | 
| 20 */ | 20 */ | 
| 21 displevl() | 21 void | 
| 22 displevl(void) | |
| 22 { | 23 { | 
| 23 reg char ch, mch; | 24 reg char ch, mch; | 
| 24 reg int i,j; | 25 reg int i,j; | 
| 25 reg struct room *rp; | 26 reg struct room *rp; | 
| 26 | 27 | 
| 71 | 72 | 
| 72 /* | 73 /* | 
| 73 * dispmons: | 74 * dispmons: | 
| 74 * Show monsters for wizard and potion | 75 * Show monsters for wizard and potion | 
| 75 */ | 76 */ | 
| 76 dispmons() | 77 void | 
| 78 dispmons(void) | |
| 77 { | 79 { | 
| 78 reg int ch, y, x; | 80 reg int ch, y, x; | 
| 79 reg struct thing *it; | 81 reg struct thing *it; | 
| 80 reg struct linked_list *item; | 82 reg struct linked_list *item; | 
| 81 | 83 | 
| 93 | 95 | 
| 94 /* | 96 /* | 
| 95 * winat: | 97 * winat: | 
| 96 * Get whatever character is at a location on the screen | 98 * Get whatever character is at a location on the screen | 
| 97 */ | 99 */ | 
| 98 winat(y, x) | 100 char | 
| 99 int x, y; | 101 winat(int y, int x) | 
| 100 { | 102 { | 
| 101 reg char ch; | 103 reg char ch; | 
| 102 | 104 | 
| 103 if (mvwinch(mw,y,x) == ' ') | 105 if (mvwinch(mw,y,x) == ' ') | 
| 104 ch = mvinch(y, x); /* non-monsters */ | 106 ch = mvinch(y, x); /* non-monsters */ | 
| 109 | 111 | 
| 110 /* | 112 /* | 
| 111 * cordok: | 113 * cordok: | 
| 112 * Returns TRUE if coordinate is on usable screen | 114 * Returns TRUE if coordinate is on usable screen | 
| 113 */ | 115 */ | 
| 114 cordok(y, x) | 116 bool | 
| 115 int y, x; | 117 cordok(int y, int x) | 
| 116 { | 118 { | 
| 117 if (x < 0 || y < 0 || x >= COLS || y >= LINES - 1) | 119 if (x < 0 || y < 0 || x >= COLS || y >= LINES - 1) | 
| 118 return FALSE; | 120 return FALSE; | 
| 119 return TRUE; | 121 return TRUE; | 
| 120 } | 122 } | 
| 121 | 123 | 
| 122 /* | 124 /* | 
| 123 * pl_on: | 125 * pl_on: | 
| 124 * Returns TRUE if the player's flag is set | 126 * Returns TRUE if the player's flag is set | 
| 125 */ | 127 */ | 
| 126 pl_on(what) | 128 bool | 
| 127 long what; | 129 pl_on(long what) | 
| 128 { | 130 { | 
| 129 return (player.t_flags & what); | 131 return (player.t_flags & what); | 
| 130 } | 132 } | 
| 131 | 133 | 
| 132 | 134 | 
| 133 /* | 135 /* | 
| 134 * pl_off: | 136 * pl_off: | 
| 135 * Returns TRUE when player's flag is reset | 137 * Returns TRUE when player's flag is reset | 
| 136 */ | 138 */ | 
| 137 pl_off(what) | 139 bool | 
| 138 long what; | 140 pl_off(long what) | 
| 139 { | 141 { | 
| 140 return (!(player.t_flags & what)); | 142 return (!(player.t_flags & what)); | 
| 141 } | 143 } | 
| 142 | 144 | 
| 143 | 145 | 
| 144 /* | 146 /* | 
| 145 * o_on: | 147 * o_on: | 
| 146 * Returns TRUE in the objects flag is set | 148 * Returns TRUE in the objects flag is set | 
| 147 */ | 149 */ | 
| 148 o_on(what,bit) | 150 bool | 
| 149 struct object *what; | 151 o_on(struct object *what, long bit) | 
| 150 long bit; | |
| 151 { | 152 { | 
| 152 reg int flag; | 153 reg int flag; | 
| 153 | 154 | 
| 154 flag = FALSE; | 155 flag = FALSE; | 
| 155 if (what != NULL) | 156 if (what != NULL) | 
| 160 | 161 | 
| 161 /* | 162 /* | 
| 162 * o_off: | 163 * o_off: | 
| 163 * Returns TRUE is the objects flag is reset | 164 * Returns TRUE is the objects flag is reset | 
| 164 */ | 165 */ | 
| 165 o_off(what,bit) | 166 bool | 
| 166 struct object *what; | 167 o_off(struct object *what, long bit) | 
| 167 long bit; | |
| 168 { | 168 { | 
| 169 reg int flag; | 169 reg int flag; | 
| 170 | 170 | 
| 171 flag = FALSE; | 171 flag = FALSE; | 
| 172 if (what != NULL) | 172 if (what != NULL) | 
| 177 | 177 | 
| 178 /* | 178 /* | 
| 179 * setoflg: | 179 * setoflg: | 
| 180 * Set the specified flag for the object | 180 * Set the specified flag for the object | 
| 181 */ | 181 */ | 
| 182 setoflg(what,bit) | 182 void | 
| 183 struct object *what; | 183 setoflg(struct object *what, long bit) | 
| 184 long bit; | |
| 185 { | 184 { | 
| 186 what->o_flags |= bit; | 185 what->o_flags |= bit; | 
| 187 } | 186 } | 
| 188 | 187 | 
| 189 | 188 | 
| 190 /* | 189 /* | 
| 191 * resoflg: | 190 * resoflg: | 
| 192 * Reset the specified flag for the object | 191 * Reset the specified flag for the object | 
| 193 */ | 192 */ | 
| 194 resoflg(what,bit) | 193 void | 
| 195 struct object *what; | 194 resoflg(struct object *what, long bit) | 
| 196 long bit; | |
| 197 { | 195 { | 
| 198 what->o_flags &= ~bit; | 196 what->o_flags &= ~bit; | 
| 199 } | 197 } | 
