From 9bae32518b0ccfc359f6666c5eaf939d0ef084db Mon Sep 17 00:00:00 2001 From: Dendy Date: Sat, 7 Aug 2021 09:02:53 +0000 Subject: [PATCH] too many things --- .gitignore | 0 Makefile | 0 assets/logo.svg | 46 ++++++++++++++++++++++++++++++++++++++++++++++ assets/testing.svg | 17 +++++++++++++++++ src/fs.c | 0 src/fs.h | 0 src/grid.c | 0 src/grid.h | 0 src/main.c | 18 +++++++----------- src/texture.c | 0 src/texture.h | 0 11 files changed, 70 insertions(+), 11 deletions(-) mode change 100644 => 100755 .gitignore mode change 100644 => 100755 Makefile create mode 100755 assets/logo.svg create mode 100755 assets/testing.svg mode change 100644 => 100755 src/fs.c mode change 100644 => 100755 src/fs.h mode change 100644 => 100755 src/grid.c mode change 100644 => 100755 src/grid.h mode change 100644 => 100755 src/main.c mode change 100644 => 100755 src/texture.c mode change 100644 => 100755 src/texture.h diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 diff --git a/assets/logo.svg b/assets/logo.svg new file mode 100755 index 0000000..885833d --- /dev/null +++ b/assets/logo.svg @@ -0,0 +1,46 @@ + + + + + +Created by potrace 1.7, written by Peter Selinger 2001-2005 + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/testing.svg b/assets/testing.svg new file mode 100755 index 0000000..f7fc674 --- /dev/null +++ b/assets/testing.svg @@ -0,0 +1,17 @@ + + + + + + image/svg+xml + + + + + + + + + TEST + + diff --git a/src/fs.c b/src/fs.c old mode 100644 new mode 100755 diff --git a/src/fs.h b/src/fs.h old mode 100644 new mode 100755 diff --git a/src/grid.c b/src/grid.c old mode 100644 new mode 100755 diff --git a/src/grid.h b/src/grid.h old mode 100644 new mode 100755 diff --git a/src/main.c b/src/main.c old mode 100644 new mode 100755 index 91b6121..44b7b8b --- a/src/main.c +++ b/src/main.c @@ -25,6 +25,8 @@ int main(int argc, char* args[]) { if (IMG_Init(IMG_INIT_JPG || IMG_INIT_PNG) < 0) { fprintf(stderr, "Could not initialize SDL2_image: %s\n", IMG_GetError()); } + + SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "1"); window = SDL_CreateWindow("pscsp", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, @@ -91,17 +93,11 @@ int main(int argc, char* args[]) { if(e.type == SDL_QUIT){ quit = true; } - if(e.type == SDL_MOUSEWHEEL){ - if(e.wheel.y > 0){ // scroll up - if(zoom < max_zoom && currentKeyStates[SDL_SCANCODE_LCTRL]){ - zoom++; - } - } - else if(e.wheel.y < 0){ // scroll down - if(zoom > min_zoom && currentKeyStates[SDL_SCANCODE_LCTRL]){ - zoom--; - } - } + if(e.type == SDL_MOUSEWHEEL && currentKeyStates[SDL_SCANCODE_LCTRL]){ + printf("%d\n", e.wheel.y); + zoom += e.wheel.y * 4; + if( zoom > max_zoom) zoom = max_zoom; + else if(zoom < min_zoom) zoom = min_zoom; } } if(currentKeyStates[SDL_SCANCODE_ESCAPE]){ diff --git a/src/texture.c b/src/texture.c old mode 100644 new mode 100755 diff --git a/src/texture.h b/src/texture.h old mode 100644 new mode 100755