From 49a3bc6fd068309961c6903161a1ce16cd3f840e Mon Sep 17 00:00:00 2001 From: Michel Heily Date: Sun, 12 Jan 2020 01:29:36 +0200 Subject: [PATCH] feat: Add temporary project icon Former-commit-id: 05da47f328f076045f4b27f521c72e03648ede77 --- Cargo.toml | 2 +- README.md | 2 ++ assets/icon.png | Bin 0 -> 14931 bytes src/plat/sdl2/main.rs | 28 ++++++++++++++++++++++++++-- src/plat/sdl2/video.rs | 10 +++------- 5 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 assets/icon.png diff --git a/Cargo.toml b/Cargo.toml index 5af9b44..0cfef68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ nom = "5.0.0" colored = "1.8" ansi_term = "0.11.0" hexdump = "0.1.0" -sdl2 = "0.32.2" +sdl2 = {version = "0.32.2", features = ["image"]} minifb = "0.11.2" time = "0.1.42" bitfield = "0.13.1" diff --git a/README.md b/README.md index 167f7e9..b07ce69 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ [![Build Status](https://travis-ci.com/michelhe/rustboyadvance-ng.svg?branch=master)](https://travis-ci.com/michelhe/rustboyadvance-ng) +![icon ](assets/icon.png) + RustBoyAdvance-NG Nintendo GameBoy Advance emulator and debugger, written in the rust programming language. Currently passing armwrestler tests, and displays some of TONC's Demos. diff --git a/assets/icon.png b/assets/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..568b524c20b1d668aa0bb9d93f7f8dbc60ca407d GIT binary patch literal 14931 zcmZ{LV~{31(Css}ZQDE6j=f{swr%X#wr%h58EeP3ZF}bKdvD!;-}j@Fs;*Shl}?{Z zPMt(3$Vni;;=%#|00b#XQKf&q$3IhmhWyvgWi>fkH5e2&cA}cwJIh}t7;yU_`VNwz43kKKaP99zTkiM3T*p7j`W6Ze{HNj zAOE~78eD$x9eC;SyK#PhMCjEq|9U#E_5G%3y$*~itVL8XU|gt*tUi%7rwn_I9K<}U7fqhn9+_2%W)y=O-P916pB5s;2S-oc z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sdjTS&!;7-dC#^o`8O# zev>8JbQCL}owVE7rW=lU&?FW=KRA@|(!IPVN~{EI7rqR-Lrp)@DO@EQjkMK`I*E5$ z;)a8MQHNH*ZnW4zLRl=bR>Ojpf59QnA;Mj{^Qd?v{tC zw6W_ouZmPZQ ztQMGaTIKyP4vf3JxL)d(-~*!Su!DTH+o!03&=AlGo1WGT8@!(LG{~jK$6{_=pyNZb zB0>j#`4T!z-*}Zjgt=VnnN3dikOp)a0czn~2rjPL9>SG38CO(N7y7MHm+_Vt8dRFV z8VE4XcEt)W(lLeIzgxSeuD9QUuUEFab-jiHJcmH>;oRt}Hi?X87u(^814Z=eR5TgGvr60X1-(bRl($FTg7dQX-T!56AoM^4ELD2sJP#IJ$ literal 0 HcmV?d00001 diff --git a/src/plat/sdl2/main.rs b/src/plat/sdl2/main.rs index 5db6020..d13f036 100644 --- a/src/plat/sdl2/main.rs +++ b/src/plat/sdl2/main.rs @@ -1,6 +1,9 @@ extern crate sdl2; use sdl2::event::Event; +use sdl2::image::{InitFlag, LoadTexture}; use sdl2::keyboard::Keycode; +use sdl2::pixels::Color; +use sdl2::rect::Rect; use sdl2::EventPump; extern crate spin_sleep; @@ -52,10 +55,11 @@ fn main() { let debug = matches.occurrences_of("debug") != 0; - let sdl_context = sdl2::init().unwrap(); + let sdl_context = sdl2::init().expect("failed to initialize sdl2"); let mut event_pump = sdl_context.event_pump().unwrap(); let video_subsystem = sdl_context.video().unwrap(); + let _image_context = sdl2::image::init(InitFlag::PNG | InitFlag::JPG).unwrap(); let window = video_subsystem .window( "RustBoyAdvance", @@ -66,7 +70,27 @@ fn main() { .position_centered() .build() .unwrap(); - let video = Rc::new(RefCell::new(create_video_interface(window))); + let mut canvas = window.into_canvas().accelerated().build().unwrap(); + + // Display the icon as a placeholder + canvas.set_draw_color(Color::RGB(0x80, 0x75, 0x85)); // default background color for the icon + canvas.clear(); + let texture_creator = canvas.texture_creator(); + let icon_texture = texture_creator + .load_texture("assets/icon.png") + .expect("failed to load icon"); + canvas + .copy( + &icon_texture, + None, + Some(Rect::new(0, 0, SCREEN_WIDTH * SCALE, SCREEN_HEIGHT * SCALE)), + ) + .unwrap(); + canvas.present(); + + // TODO also set window icon + + let video = Rc::new(RefCell::new(create_video_interface(canvas))); let audio = Rc::new(RefCell::new(create_audio_player(&sdl_context))); let input = Rc::new(RefCell::new(create_input())); diff --git a/src/plat/sdl2/video.rs b/src/plat/sdl2/video.rs index ed78983..99164e9 100644 --- a/src/plat/sdl2/video.rs +++ b/src/plat/sdl2/video.rs @@ -1,7 +1,7 @@ -use sdl2::pixels::{Color, PixelFormatEnum}; +use sdl2::pixels::PixelFormatEnum; use sdl2::rect::Rect; use sdl2::render::{Texture, TextureCreator, WindowCanvas}; -use sdl2::video::{Window, WindowContext}; +use sdl2::video::WindowContext; use rustboyadvance_ng::core::gpu::{DISPLAY_HEIGHT, DISPLAY_WIDTH}; use rustboyadvance_ng::VideoInterface; @@ -42,11 +42,7 @@ impl<'a> VideoInterface for Sdl2Video<'a> { } } -pub fn create_video_interface<'a>(window: Window) -> Sdl2Video<'a> { - let mut canvas = window.into_canvas().accelerated().build().unwrap(); - canvas.set_draw_color(Color::RGB(0, 0, 0)); - canvas.clear(); - canvas.present(); +pub fn create_video_interface<'a>(canvas: WindowCanvas) -> Sdl2Video<'a> { let mut tc = canvas.texture_creator(); let texture = unsafe { let tc_ptr = &mut tc as *mut TextureCreator;