mirror of
https://github.com/kaesaecracker/servicepoint-simulator.git
synced 2025-01-30 17:20:13 +01:00
update to servicepoint2 v0.4.1
This commit is contained in:
parent
3578a279c5
commit
33994537e6
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -1622,9 +1622,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "servicepoint2"
|
||||
version = "0.4.0"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e271ff29f683581a14d1712f76c0cf2dad956725cc1f36228ddde8ea783055cf"
|
||||
checksum = "54d49d501f34100406d70730d887775ed5961b6343ccb10d5ef0e105d7b295ae"
|
||||
dependencies = [
|
||||
"bzip2",
|
||||
"flate2",
|
||||
|
|
|
@ -7,7 +7,7 @@ license = "GPL-3.0-or-later"
|
|||
|
||||
[dependencies]
|
||||
# packet parsing
|
||||
servicepoint2 = "0.4.0"
|
||||
servicepoint2 = "0.4.1"
|
||||
|
||||
# gui
|
||||
winit = { version = "0.30", features = ["rwh_05"] } # for creating a window
|
||||
|
|
4
shell.nix
Normal file
4
shell.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{ pkgs ? import <nixpkgs> {} }:
|
||||
pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs.buildPackages; [ rustup pkg-config xe lzma ];
|
||||
}
|
|
@ -2,7 +2,7 @@ use std::sync::{RwLock, RwLockWriteGuard};
|
|||
|
||||
use log::{debug, error, info, warn};
|
||||
use servicepoint2::{
|
||||
ByteGrid, Command, Origin, PixelGrid, PIXEL_COUNT, PIXEL_WIDTH, TILE_SIZE,
|
||||
ByteGrid, Command, Origin, PIXEL_COUNT, PIXEL_WIDTH, PixelGrid, TILE_SIZE,
|
||||
};
|
||||
|
||||
use crate::font::BitmapFont;
|
||||
|
@ -89,8 +89,8 @@ pub(crate) fn execute_command(
|
|||
let offset_y = offset_y as usize;
|
||||
|
||||
let mut luma = luma_ref.write().unwrap();
|
||||
for inner_y in 0..grid.height {
|
||||
for inner_x in 0..grid.width {
|
||||
for inner_y in 0..grid.height() {
|
||||
for inner_x in 0..grid.width() {
|
||||
let brightness = grid.get(inner_x, inner_y);
|
||||
luma.set(
|
||||
offset_x + inner_x,
|
||||
|
@ -133,8 +133,8 @@ fn print_cp437_data(
|
|||
let x = x as usize;
|
||||
let y = y as usize;
|
||||
|
||||
for char_y in 0usize..grid.height {
|
||||
for char_x in 0usize..grid.width {
|
||||
for char_y in 0usize..grid.height() {
|
||||
for char_x in 0usize..grid.width() {
|
||||
let char_code = grid.get(char_x, char_y);
|
||||
|
||||
let tile_x = char_x + x;
|
||||
|
@ -159,10 +159,11 @@ fn print_pixel_grid(
|
|||
) {
|
||||
debug!(
|
||||
"printing {}x{} grid at {offset_x} {offset_y}",
|
||||
pixels.width, pixels.height
|
||||
pixels.width(),
|
||||
pixels.height()
|
||||
);
|
||||
for inner_y in 0..pixels.height {
|
||||
for inner_x in 0..pixels.width {
|
||||
for inner_y in 0..pixels.height() {
|
||||
for inner_x in 0..pixels.width() {
|
||||
let is_set = pixels.get(inner_x, inner_y);
|
||||
display.set(offset_x + inner_x, offset_y + inner_y, is_set);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue