mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 05:52:59 +00:00 
			
		
		
		
	smooth_scrolling now configurable
This commit is contained in:
		| @@ -362,6 +362,7 @@ void initConfig() { | ||||
|   addsaver(sightranges[gCubeTiling], "sight-cubes", 7); | ||||
|   addsaver(sightranges[gCell120], "sight-120cell", 2 * M_PI); | ||||
|   addsaver(sightranges[gECell120], "sight-120cell-elliptic", M_PI); | ||||
|   addsaver(smooth_scrolling, "smooth-scrolling", false); | ||||
|  | ||||
|   addsaver(vid.consider_shader_projection, "shader-projection", true); | ||||
|    | ||||
|   | ||||
							
								
								
									
										14
									
								
								control.cpp
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								control.cpp
									
									
									
									
									
								
							| @@ -240,10 +240,10 @@ bool didsomething; | ||||
|  | ||||
| typedef SDL_Event eventtype; | ||||
|  | ||||
| bool smooth_movement = (DIM == 3); | ||||
| bool smooth_scrolling = false; | ||||
|  | ||||
| void handlePanning(int sym, int uni) { | ||||
|   if(rug::rugged || smooth_movement) return; | ||||
|   if(rug::rugged || smooth_scrolling) return; | ||||
|    | ||||
| #if !ISPANDORA | ||||
|   if(sym == SDLK_END && DIM == 3) {  | ||||
| @@ -581,7 +581,7 @@ void mainloopiter() { | ||||
|   SDL_Event ev; | ||||
|   DEBB(DF_GRAPH, (debugfile,"polling for events\n")); | ||||
|    | ||||
|   if(smooth_movement) { | ||||
|   if(smooth_scrolling && !shmup::on && !rug::rugged) { | ||||
|     static int lastticks; | ||||
|     ld t = (ticks - lastticks) * shiftmul / 1000.; | ||||
|     lastticks = ticks; | ||||
| @@ -591,13 +591,13 @@ void mainloopiter() { | ||||
|     if(keystate[SDLK_HOME] && DIM == 3 && DEFAULTNOR(SDLK_HOME)) | ||||
|       View = cpush(2, t) * View, didsomething = true, playermoved = false; | ||||
|     if(keystate[SDLK_RIGHT] && DEFAULTNOR(SDLK_RIGHT)) | ||||
|       View = cspin(0, 2, -t) * View, didsomething = true; | ||||
|       View = (DIM == 2 ? xpush(-t) : cspin(0, 2, -t)) * View, didsomething = true, playermoved = playermoved && DIM == 3; | ||||
|     if(keystate[SDLK_LEFT] && DEFAULTNOR(SDLK_LEFT)) | ||||
|       View = cspin(0, 2, t) * View, didsomething = true; | ||||
|       View = (DIM == 2 ? xpush(t) : cspin(0, 2, t)) * View, didsomething = true, playermoved = playermoved && DIM == 3; | ||||
|     if(keystate[SDLK_UP] && DEFAULTNOR(SDLK_UP)) | ||||
|       View = cspin(1, 2, t) * View, didsomething = true; | ||||
|       View = (DIM == 2 ? ypush(t) : cspin(1, 2, t)) * View, didsomething = true, playermoved = playermoved && DIM == 3; | ||||
|     if(keystate[SDLK_DOWN] && DEFAULTNOR(SDLK_DOWN)) | ||||
|       View = cspin(1, 2, -t) * View, didsomething = true; | ||||
|       View = (DIM == 2 ? ypush(-t) : cspin(1, 2, -t)) * View, didsomething = true, playermoved = playermoved && DIM == 3; | ||||
|     if(keystate[SDLK_PAGEUP] && DEFAULTNOR(SDLK_PAGEUP)) { | ||||
|       if(conformal::on) | ||||
|         conformal::rotation+=t; | ||||
|   | ||||
							
								
								
									
										1
									
								
								hyper.h
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								hyper.h
									
									
									
									
									
								
							| @@ -1792,6 +1792,7 @@ bool needConfirmationEvenIfSaved(); | ||||
| #define DEFAULTCONTROL (multi::players == 1 && !shmup::on && !multi::alwaysuse && !(rug::rugged && rug::renderonce)) | ||||
| #define DEFAULTNOR(sym) (DEFAULTCONTROL || multi::notremapped(sym)) | ||||
|  | ||||
| extern bool smooth_scrolling; | ||||
| extern bool timerghost; | ||||
| extern bool gen_wandering; | ||||
|  | ||||
|   | ||||
| @@ -379,6 +379,9 @@ struct shmup_configurer { | ||||
|     else dialog::addBreak(100); | ||||
|     if(playercfg > 3) | ||||
|       dialog::addItem(XLAT("configure player 4") + dsc(3), '4'); | ||||
|     else if(!shmup::on && !multi::alwaysuse) { | ||||
|       dialog::addBoolItem(XLAT("smooth scrolling"), smooth_scrolling, 'c'); | ||||
|       } | ||||
|     else dialog::addBreak(100); | ||||
|        | ||||
|     if(playercfg > 4) | ||||
| @@ -443,6 +446,7 @@ struct shmup_configurer { | ||||
|   #if CAP_SDLJOY | ||||
|     else if(uni == 'b') pushScreen(showJoyConfig); | ||||
|   #endif | ||||
|     else if(uni == 'c') smooth_scrolling = !smooth_scrolling; | ||||
|     else if(uni == 'r')  | ||||
|       for(int i=0; i<MAXPLAYER; i++)  | ||||
|         kills[i] = deaths[i] = treasures[i] = 0; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 ?
					?