mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-30 21:42:59 +00:00 
			
		
		
		
	CAP_ODS guards
This commit is contained in:
		
							
								
								
									
										4
									
								
								init.cpp
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								init.cpp
									
									
									
									
									
								
							| @@ -121,6 +121,10 @@ | |||||||
| #define CAP_EDIT (CAP_FILES && !ISWEB && !ISMINI) | #define CAP_EDIT (CAP_FILES && !ISWEB && !ISMINI) | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|  | #ifndef CAP_ODS | ||||||
|  | #define CAP_ODS 0 | ||||||
|  | #endif | ||||||
|  |  | ||||||
| #ifndef CAP_TEXTURE | #ifndef CAP_TEXTURE | ||||||
| #define CAP_TEXTURE (CAP_GL && (CAP_PNG || CAP_SDL_IMG)) | #define CAP_TEXTURE (CAP_GL && (CAP_PNG || CAP_SDL_IMG)) | ||||||
| #endif | #endif | ||||||
|   | |||||||
							
								
								
									
										15
									
								
								rug.cpp
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								rug.cpp
									
									
									
									
									
								
							| @@ -943,6 +943,7 @@ void getco(rugpoint *m, hyperpoint& h, int &spherepoints) { | |||||||
|  |  | ||||||
| extern int besti; | extern int besti; | ||||||
|  |  | ||||||
|  | #if CAP_ODS | ||||||
| /* these functions are for the ODS projection, used in VR videos */ | /* these functions are for the ODS projection, used in VR videos */ | ||||||
|  |  | ||||||
| void cyclefix(ld& a, ld b) { | void cyclefix(ld& a, ld b) { | ||||||
| @@ -1002,6 +1003,7 @@ bool project_ods(hyperpoint azeq, hyperpoint& h1, hyperpoint& h2, bool eye) { | |||||||
| //  printf("\n"); | //  printf("\n"); | ||||||
|   return true; |   return true; | ||||||
|   } |   } | ||||||
|  | #endif | ||||||
|  |  | ||||||
| void drawTriangle(triangle& t) { | void drawTriangle(triangle& t) { | ||||||
|   using namespace hyperpoint_vec;   |   using namespace hyperpoint_vec;   | ||||||
| @@ -1011,6 +1013,7 @@ void drawTriangle(triangle& t) { | |||||||
|     } |     } | ||||||
|   dt++; |   dt++; | ||||||
|  |  | ||||||
|  | #if CAP_ODS | ||||||
|   if(ods) { |   if(ods) { | ||||||
|     hyperpoint pts[3]; |     hyperpoint pts[3]; | ||||||
|     for(int i=0; i<3; i++) |     for(int i=0; i<3; i++) | ||||||
| @@ -1062,6 +1065,7 @@ void drawTriangle(triangle& t) { | |||||||
|       } |       } | ||||||
|     return; |     return; | ||||||
|     } |     } | ||||||
|  | #endif   | ||||||
|  |  | ||||||
|   int spherepoints = 0; |   int spherepoints = 0; | ||||||
|   array<hyperpoint,3> h; |   array<hyperpoint,3> h; | ||||||
| @@ -1233,10 +1237,13 @@ void drawRugScene() { | |||||||
|    |    | ||||||
|   ld tanfov = tan(fov * M_PI / 360); |   ld tanfov = tan(fov * M_PI / 360); | ||||||
|    |    | ||||||
|  | #if CAP_ODS | ||||||
|   if(ods) { |   if(ods) { | ||||||
|     glOrtho(-M_PI, M_PI, -M_PI, M_PI, 0, -M_PI * 2); |     glOrtho(-M_PI, M_PI, -M_PI, M_PI, 0, -M_PI * 2); | ||||||
|     } |     } | ||||||
|   else if(rug_perspective) { |   else  | ||||||
|  | #endif | ||||||
|  |   if(rug_perspective) { | ||||||
|     ld vnear = .001; |     ld vnear = .001; | ||||||
|     ld vfar = 1000; |     ld vfar = 1000; | ||||||
|     ld sca = vnear * tanfov / vid.xres; |     ld sca = vnear * tanfov / vid.xres; | ||||||
| @@ -1376,7 +1383,9 @@ void apply_rotation(const transmatrix& t) { | |||||||
|  |  | ||||||
| bool handlekeys(int sym, int uni) { | bool handlekeys(int sym, int uni) { | ||||||
|   if(uni == '4') { |   if(uni == '4') { | ||||||
|  | #if CAP_ODS | ||||||
|     ods = !ods; |     ods = !ods; | ||||||
|  | #endif | ||||||
|     return true; |     return true; | ||||||
|     } |     } | ||||||
|   else if(uni == '1') { |   else if(uni == '1') { | ||||||
| @@ -1630,10 +1639,12 @@ void show() { | |||||||
|       if(rug::rugged) rug::close(); |       if(rug::rugged) rug::close(); | ||||||
|       else rug::init(); |       else rug::init(); | ||||||
|       } |       } | ||||||
|  | #if CAP_ODS | ||||||
|     else if(uni == 'I') |     else if(uni == 'I') | ||||||
|       dialog::editNumber(ipd, 0, 1, .002, .05, "interpupilar distance", |       dialog::editNumber(ipd, 0, 1, .002, .05, "interpupilar distance", | ||||||
|         "Used in the ODS projection." |         "Used in the ODS projection." | ||||||
|         ); |         ); | ||||||
|  | #endif | ||||||
|     else if(uni == 'R') |     else if(uni == 'R') | ||||||
|       dialog::editNumber(finger_range, 0, 1, .01, .1, "finger range", |       dialog::editNumber(finger_range, 0, 1, .01, .1, "finger range", | ||||||
|         "Press 1 to enable the finger mode." |         "Press 1 to enable the finger mode." | ||||||
| @@ -1751,6 +1762,7 @@ int rugArgs() { | |||||||
|     shift(); vertex_limit = argi(); |     shift(); vertex_limit = argi(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | #if CAP_ODS | ||||||
|   else if(argis("-ods")) { |   else if(argis("-ods")) { | ||||||
|     ods = true; |     ods = true; | ||||||
|     } |     } | ||||||
| @@ -1758,6 +1770,7 @@ int rugArgs() { | |||||||
|   else if(argis("-ipd")) { |   else if(argis("-ipd")) { | ||||||
|     shift(); ipd = argf(); |     shift(); ipd = argf(); | ||||||
|     } |     } | ||||||
|  | #endif | ||||||
|  |  | ||||||
|   else return 1; |   else return 1; | ||||||
|   return 0; |   return 0; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue