Difference between revisions of "Source:NetHack 3.6.0/include/lev.h"

From NetHackWiki
Jump to navigation Jump to search
(Created page with "__MIXEDSYNTAXHIGHLIGHT__ Below is the full text to '''lev.h''' from the source code of NetHack 3.6.0. To link to a particular line, write S...")
 
 
Line 3: Line 3:
  
 
{{NGPL}}
 
{{NGPL}}
  <span id="line1">1.   /* NetHack 3.6 lev.h $NHDT-Date: 1432512781 2015/05/25 00:13:01 $  $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ */</span>
+
  <span id="line1">1. /* NetHack 3.6 lev.h $NHDT-Date: 1432512781 2015/05/25 00:13:01 $  $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ */</span>
  <span id="line2">2.   /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */</span>
+
  <span id="line2">2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */</span>
  <span id="line3">3.   /* NetHack may be freely redistributed.  See license for details. */</span>
+
  <span id="line3">3. /* NetHack may be freely redistributed.  See license for details. */</span>
  <span id="line4">4.   </span>
+
  <span id="line4">4. </span>
  <span id="line5">5.   /* Common include file for save and restore routines */</span>
+
  <span id="line5">5. /* Common include file for save and restore routines */</span>
  <span id="line6">6.   </span>
+
  <span id="line6">6. </span>
  <span id="line7">7.   #ifndef LEV_H</span>
+
  <span id="line7">7. #ifndef LEV_H</span>
  <span id="line8">8.   #define LEV_H</span>
+
  <span id="line8">8. #define LEV_H</span>
  <span id="line9">9.   </span>
+
  <span id="line9">9. </span>
  <span id="line10">10.   #define COUNT_SAVE 0x1</span>
+
  <span id="line10">10. #define COUNT_SAVE 0x1</span>
  <span id="line11">11.   #define WRITE_SAVE 0x2</span>
+
  <span id="line11">11. #define WRITE_SAVE 0x2</span>
  <span id="line12">12.   #define FREE_SAVE 0x4</span>
+
  <span id="line12">12. #define FREE_SAVE 0x4</span>
  <span id="line13">13.   </span>
+
  <span id="line13">13. </span>
  <span id="line14">14.   #define MAX_BMASK 4</span>
+
  <span id="line14">14. #define MAX_BMASK 4</span>
  <span id="line15">15.   </span>
+
  <span id="line15">15. </span>
  <span id="line16">16.   /* operations of the various saveXXXchn & co. routines */</span>
+
  <span id="line16">16. /* operations of the various saveXXXchn & co. routines */</span>
  <span id="line17">17.   #define perform_bwrite(mode) ((mode) & (COUNT_SAVE | WRITE_SAVE))</span>
+
  <span id="line17">17. #define perform_bwrite(mode) ((mode) & (COUNT_SAVE | WRITE_SAVE))</span>
  <span id="line18">18.   #define release_data(mode) ((mode) &FREE_SAVE)</span>
+
  <span id="line18">18. #define release_data(mode) ((mode) &FREE_SAVE)</span>
  <span id="line19">19.   </span>
+
  <span id="line19">19. </span>
  <span id="line20">20.   /* The following are used in mkmaze.c */</span>
+
  <span id="line20">20. /* The following are used in mkmaze.c */</span>
  <span id="line21">21.   struct container {</span>
+
  <span id="line21">21. struct container {</span>
  <span id="line22">22.       struct container *next;</span>
+
  <span id="line22">22.     struct container *next;</span>
  <span id="line23">23.       xchar x, y;</span>
+
  <span id="line23">23.     xchar x, y;</span>
  <span id="line24">24.       short what;</span>
+
  <span id="line24">24.     short what;</span>
  <span id="line25">25.       genericptr_t list;</span>
+
  <span id="line25">25.     genericptr_t list;</span>
  <span id="line26">26.   };</span>
+
  <span id="line26">26. };</span>
  <span id="line27">27.   </span>
+
  <span id="line27">27. </span>
  <span id="line28">28.   #define CONS_OBJ 0</span>
+
  <span id="line28">28. #define CONS_OBJ 0</span>
  <span id="line29">29.   #define CONS_MON 1</span>
+
  <span id="line29">29. #define CONS_MON 1</span>
  <span id="line30">30.   #define CONS_HERO 2</span>
+
  <span id="line30">30. #define CONS_HERO 2</span>
  <span id="line31">31.   #define CONS_TRAP 3</span>
+
  <span id="line31">31. #define CONS_TRAP 3</span>
  <span id="line32">32.   </span>
+
  <span id="line32">32. </span>
  <span id="line33">33.   struct bubble {</span>
+
  <span id="line33">33. struct bubble {</span>
  <span id="line34">34.       xchar x, y;  /* coordinates of the upper left corner */</span>
+
  <span id="line34">34.     xchar x, y;  /* coordinates of the upper left corner */</span>
  <span id="line35">35.       schar dx, dy; /* the general direction of the bubble's movement */</span>
+
  <span id="line35">35.     schar dx, dy; /* the general direction of the bubble's movement */</span>
  <span id="line36">36.       uchar bm[MAX_BMASK + 2];    /* bubble bit mask */</span>
+
  <span id="line36">36.     uchar bm[MAX_BMASK + 2];    /* bubble bit mask */</span>
  <span id="line37">37.       struct bubble *prev, *next; /* need to traverse the list up and down */</span>
+
  <span id="line37">37.     struct bubble *prev, *next; /* need to traverse the list up and down */</span>
  <span id="line38">38.       struct container *cons;</span>
+
  <span id="line38">38.     struct container *cons;</span>
  <span id="line39">39.   };</span>
+
  <span id="line39">39. };</span>
  <span id="line40">40.   </span>
+
  <span id="line40">40. </span>
  <span id="line41">41.   /* used in light.c */</span>
+
  <span id="line41">41. /* used in light.c */</span>
  <span id="line42">42.   typedef struct ls_t {</span>
+
  <span id="line42">42. typedef struct ls_t {</span>
  <span id="line43">43.       struct ls_t *next;</span>
+
  <span id="line43">43.     struct ls_t *next;</span>
  <span id="line44">44.       xchar x, y;  /* source's position */</span>
+
  <span id="line44">44.     xchar x, y;  /* source's position */</span>
  <span id="line45">45.       short range; /* source's current range */</span>
+
  <span id="line45">45.     short range; /* source's current range */</span>
  <span id="line46">46.       short flags;</span>
+
  <span id="line46">46.     short flags;</span>
  <span id="line47">47.       short type;  /* type of light source */</span>
+
  <span id="line47">47.     short type;  /* type of light source */</span>
  <span id="line48">48.       anything id; /* source's identifier */</span>
+
  <span id="line48">48.     anything id; /* source's identifier */</span>
  <span id="line49">49.   } light_source;</span>
+
  <span id="line49">49. } light_source;</span>
  <span id="line50">50.   </span>
+
  <span id="line50">50. </span>
  <span id="line51">51.   #endif /* LEV_H */</span>
+
  <span id="line51">51. #endif /* LEV_H */</span>
 
[[Category:NetHack 3.6.0 source code|include/lev.h]]
 
[[Category:NetHack 3.6.0 source code|include/lev.h]]

Latest revision as of 13:27, 15 December 2015

Below is the full text to lev.h from the source code of NetHack 3.6.0. To link to a particular line, write [[Source:NetHack 3.6.0/include/lev.h#line123]], for example.

The NetHack General Public License applies to screenshots, source code and other content from NetHack.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.

 /* NetHack 3.6	lev.h	$NHDT-Date: 1432512781 2015/05/25 00:13:01 $  $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
 /*	Common include file for save and restore routines */
 
 #ifndef LEV_H
 #define LEV_H
 
 #define COUNT_SAVE 0x1
 #define WRITE_SAVE 0x2
 #define FREE_SAVE 0x4
 
 #define MAX_BMASK 4
 
 /* operations of the various saveXXXchn & co. routines */
 #define perform_bwrite(mode) ((mode) & (COUNT_SAVE | WRITE_SAVE))
 #define release_data(mode) ((mode) &FREE_SAVE)
 
 /* The following are used in mkmaze.c */
 struct container {
     struct container *next;
     xchar x, y;
     short what;
     genericptr_t list;
 };
 
 #define CONS_OBJ 0
 #define CONS_MON 1
 #define CONS_HERO 2
 #define CONS_TRAP 3
 
 struct bubble {
     xchar x, y;   /* coordinates of the upper left corner */
     schar dx, dy; /* the general direction of the bubble's movement */
     uchar bm[MAX_BMASK + 2];    /* bubble bit mask */
     struct bubble *prev, *next; /* need to traverse the list up and down */
     struct container *cons;
 };
 
 /* used in light.c */
 typedef struct ls_t {
     struct ls_t *next;
     xchar x, y;  /* source's position */
     short range; /* source's current range */
     short flags;
     short type;  /* type of light source */
     anything id; /* source's identifier */
 } light_source;
 
 #endif /* LEV_H */