minor tweaks to examples
This commit is contained in:
		
							parent
							
								
									20ea1354be
								
							
						
					
					
						commit
						52080c0ad0
					
				
					 3 changed files with 20 additions and 22 deletions
				
			
		|  | @ -2,8 +2,8 @@ | |||
| 
 | ||||
| use clap::Parser; | ||||
| 
 | ||||
| use servicepoint::Command::BitmapLinearWin; | ||||
| use servicepoint::*; | ||||
| use servicepoint::Command::BitmapLinearWin; | ||||
| 
 | ||||
| #[derive(Parser, Debug)] | ||||
| struct Cli { | ||||
|  | @ -19,13 +19,12 @@ fn main() { | |||
|     let mut pixels = PixelGrid::max_sized(); | ||||
|     pixels.fill(true); | ||||
| 
 | ||||
|     connection | ||||
|         .send(BitmapLinearWin( | ||||
|             Origin::new(0, 0), | ||||
|             pixels, | ||||
|             CompressionCode::Uncompressed, | ||||
|         )) | ||||
|         .expect("send failed"); | ||||
|     let command = BitmapLinearWin( | ||||
|         Origin::new(0, 0), | ||||
|         pixels, | ||||
|         CompressionCode::Uncompressed, | ||||
|     ); | ||||
|     connection.send(command).expect("send failed"); | ||||
| 
 | ||||
|     let max_brightness = usize::from(u8::from(Brightness::MAX)); | ||||
|     let mut brightnesses = BrightnessGrid::new(TILE_WIDTH, TILE_HEIGHT); | ||||
|  |  | |||
|  | @ -23,13 +23,12 @@ fn main() { | |||
|     let mut field = make_random_field(cli.probability); | ||||
| 
 | ||||
|     loop { | ||||
|         connection | ||||
|             .send(Command::BitmapLinearWin( | ||||
|                 Origin::new(0, 0), | ||||
|                 field.clone(), | ||||
|                 CompressionCode::Lzma, | ||||
|             )) | ||||
|             .expect("could not send"); | ||||
|         let command = Command::BitmapLinearWin( | ||||
|             Origin::new(0, 0), | ||||
|             field.clone(), | ||||
|             CompressionCode::Lzma, | ||||
|         ); | ||||
|         connection.send(command).expect("could not send"); | ||||
|         thread::sleep(FRAME_PACING); | ||||
|         field = iteration(field); | ||||
|     } | ||||
|  |  | |||
|  | @ -23,13 +23,13 @@ fn main() { | |||
|         for y in 0..PIXEL_HEIGHT { | ||||
|             pixels.set((y + x_offset) % PIXEL_WIDTH, y, true); | ||||
|         } | ||||
|         connection | ||||
|             .send(Command::BitmapLinearWin( | ||||
|                 Origin::new(0, 0), | ||||
|                 pixels.clone(), | ||||
|                 CompressionCode::Lzma, | ||||
|             )) | ||||
|             .unwrap(); | ||||
| 
 | ||||
|         let command = Command::BitmapLinearWin( | ||||
|             Origin::new(0, 0), | ||||
|             pixels.clone(), | ||||
|             CompressionCode::Lzma, | ||||
|         ); | ||||
|         connection.send(command).expect("send failed"); | ||||
|         thread::sleep(FRAME_PACING); | ||||
|     } | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Vinzenz Schroeter
						Vinzenz Schroeter