mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-26 03:17:39 +00:00 
			
		
		
		
	drawing:: flags now use flagtype
This commit is contained in:
		
							
								
								
									
										68
									
								
								drawing.cpp
									
									
									
									
									
								
							
							
						
						
									
										68
									
								
								drawing.cpp
									
									
									
									
									
								
							| @@ -9,38 +9,38 @@ | |||||||
| namespace hr { | namespace hr { | ||||||
|  |  | ||||||
| #if HDR | #if HDR | ||||||
| static constexpr int POLY_DRAWLINES = 1;            // draw the lines | static constexpr flagtype POLY_DRAWLINES = 1;            // draw the lines | ||||||
| static constexpr int POLY_DRAWAREA = 2;             // draw the area | static constexpr flagtype POLY_DRAWAREA = 2;             // draw the area | ||||||
| static constexpr int POLY_INVERSE = 4;              // draw the inverse -- useful in stereographic projection | static constexpr flagtype POLY_INVERSE = 4;              // draw the inverse -- useful in stereographic projection | ||||||
| static constexpr int POLY_ISSIDE = 8;               // never draw in inverse | static constexpr flagtype POLY_ISSIDE = 8;               // never draw in inverse | ||||||
| static constexpr int POLY_BEHIND = 16;              // there are points behind the camera | static constexpr flagtype POLY_BEHIND = 16;              // there are points behind the camera | ||||||
| static constexpr int POLY_TOOLARGE = 32;            // some coordinates are too large -- best not to draw to avoid glitches | static constexpr flagtype POLY_TOOLARGE = 32;            // some coordinates are too large -- best not to draw to avoid glitches | ||||||
| static constexpr int POLY_INFRONT = 64;             // on the sphere (orthogonal projection), do not draw without any points in front | static constexpr flagtype POLY_INFRONT = 64;             // on the sphere (orthogonal projection), do not draw without any points in front | ||||||
| static constexpr int POLY_HASWALLS = 128;           // floor shapes which have their sidewalls | static constexpr flagtype POLY_HASWALLS = 128;           // floor shapes which have their sidewalls | ||||||
| static constexpr int POLY_PLAIN = 256;              // plain floors | static constexpr flagtype POLY_PLAIN = 256;              // plain floors | ||||||
| static constexpr int POLY_FULL = 512;               // full floors | static constexpr flagtype POLY_FULL = 512;               // full floors | ||||||
| static constexpr int POLY_HASSHADOW = 1024;         // floor shapes which have their shadows, or can use shFloorShadow | static constexpr flagtype POLY_HASSHADOW = 1024;         // floor shapes which have their shadows, or can use shFloorShadow | ||||||
| static constexpr int POLY_GP = 2048;                // Goldberg shapes | static constexpr flagtype POLY_GP = 2048;                // Goldberg shapes | ||||||
| static constexpr int POLY_VCONVEX = 4096;           // Convex shape (vertex) | static constexpr flagtype POLY_VCONVEX = 4096;           // Convex shape (vertex) | ||||||
| static constexpr int POLY_CCONVEX = 8192;           // Convex shape (central) | static constexpr flagtype POLY_CCONVEX = 8192;           // Convex shape (central) | ||||||
| static constexpr int POLY_CENTERIN = 16384;         // new system of side checking  | static constexpr flagtype POLY_CENTERIN = 16384;         // new system of side checking | ||||||
| static constexpr int POLY_FORCEWIDE = (1<<15);      // force wide lines | static constexpr flagtype POLY_FORCEWIDE = Flag(15);      // force wide lines | ||||||
| static constexpr int POLY_NOTINFRONT = (1<<16);     // points not in front | static constexpr flagtype POLY_NOTINFRONT = Flag(16);     // points not in front | ||||||
| static constexpr int POLY_NIF_ERROR = (1<<17);      // points moved to the outline cross the image, disable | static constexpr flagtype POLY_NIF_ERROR = Flag(17);      // points moved to the outline cross the image, disable | ||||||
| static constexpr int POLY_BADCENTERIN = (1<<18);    // new system of side checking  | static constexpr flagtype POLY_BADCENTERIN = Flag(18);    // new system of side checking | ||||||
| static constexpr int POLY_PRECISE_WIDE = (1<<19);   // precise width calculation | static constexpr flagtype POLY_PRECISE_WIDE = Flag(19);   // precise width calculation | ||||||
| static constexpr int POLY_FORCE_INVERTED = (1<<20); // force inverted | static constexpr flagtype POLY_FORCE_INVERTED = Flag(20); // force inverted | ||||||
| static constexpr int POLY_ALWAYS_IN = (1<<21);      // always draw this | static constexpr flagtype POLY_ALWAYS_IN = Flag(21);      // always draw this | ||||||
| static constexpr int POLY_TRIANGLES = (1<<22);      // made of TRIANGLES, not TRIANGLE_FAN | static constexpr flagtype POLY_TRIANGLES = Flag(22);      // made of TRIANGLES, not TRIANGLE_FAN | ||||||
| static constexpr int POLY_INTENSE = (1<<23);        // extra intense colors | static constexpr flagtype POLY_INTENSE = Flag(23);        // extra intense colors | ||||||
| static constexpr int POLY_DEBUG = (1<<24);          // debug this shape | static constexpr flagtype POLY_DEBUG = Flag(24);          // debug this shape | ||||||
| static constexpr int POLY_PRINTABLE = (1<<25);      // these walls are printable | static constexpr flagtype POLY_PRINTABLE = Flag(25);      // these walls are printable | ||||||
| static constexpr int POLY_FAT = (1<<26);            // fatten this model in WRL export (used for Rug) | static constexpr flagtype POLY_FAT = Flag(26);            // fatten this model in WRL export (used for Rug) | ||||||
| static constexpr int POLY_SHADE_TEXTURE = (1<<27);  // texture has 'z' coordinate for shading | static constexpr flagtype POLY_SHADE_TEXTURE = Flag(27);  // texture has 'z' coordinate for shading | ||||||
| static constexpr int POLY_ONE_LEVEL = (1<<28);      // only one level of the universal cover in SL(2,R) | static constexpr flagtype POLY_ONE_LEVEL = Flag(28);      // only one level of the universal cover in SL(2,R) | ||||||
| static constexpr int POLY_APEIROGONAL = (1<<29);    // only vertices indexed up to she are drawn as the boundary | static constexpr flagtype POLY_APEIROGONAL = Flag(29);    // only vertices indexed up to she are drawn as the boundary | ||||||
| static constexpr int POLY_NO_FOG = (1<<30);         // disable fog for this | static constexpr flagtype POLY_NO_FOG = Flag(30);         // disable fog for this | ||||||
| static constexpr int POLY_FORCE_DEPTH = (1<<31);    // always depth test | static constexpr flagtype POLY_FORCE_DEPTH = Flag(31);    // always depth test | ||||||
|  |  | ||||||
| /** \brief A graphical element that can be drawn. Objects are not drawn immediately but rather queued. | /** \brief A graphical element that can be drawn. Objects are not drawn immediately but rather queued. | ||||||
|  * |  * | ||||||
| @@ -83,7 +83,7 @@ struct dqi_poly : drawqueueitem { | |||||||
|   /** \brief width of boundary lines */ |   /** \brief width of boundary lines */ | ||||||
|   double linewidth; |   double linewidth; | ||||||
|   /** \brief various flags */ |   /** \brief various flags */ | ||||||
|   int flags; |   flagtype flags; | ||||||
|   /** \brief Texture data for textured polygons. Requires POLY_TRIANGLES flag */ |   /** \brief Texture data for textured polygons. Requires POLY_TRIANGLES flag */ | ||||||
|   struct basic_textureinfo *tinf; |   struct basic_textureinfo *tinf; | ||||||
|   /** \brief used to find the correct side to draw in spherical geometries */ |   /** \brief used to find the correct side to draw in spherical geometries */ | ||||||
| @@ -1819,7 +1819,7 @@ void dqi_poly::draw() { | |||||||
|   if(flags & POLY_DEBUG) debug_this(); |   if(flags & POLY_DEBUG) debug_this(); | ||||||
|  |  | ||||||
|   if(debugflags & DF_VERTEX) { |   if(debugflags & DF_VERTEX) { | ||||||
|     println(hlog, int(prio), ": V=", V, " o=", offset, " c=", cnt, " ot=", offset_texture, " ol=", outline, " lw=", linewidth, " f=", flags, " i=", intester, " c=", cache, " ti=", (cell*) tinf); |     println(hlog, int(prio), ": V=", V, " o=", offset, " c=", cnt, " ot=", offset_texture, " ol=", outline, " lw=", linewidth, " f=", (color_t) flags, " i=", intester, " c=", cache, " ti=", (cell*) tinf); | ||||||
|     for(int i=0; i<cnt; i++) print(hlog, (*tab)[offset+i]); |     for(int i=0; i<cnt; i++) print(hlog, (*tab)[offset+i]); | ||||||
|     println(hlog); |     println(hlog); | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue