Skip to content

Commit

Permalink
Added icons for both windows
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanberndtsson committed Mar 20, 2016
1 parent a20edf3 commit 0199ebc
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Makefile
@@ -1,5 +1,5 @@
CC=gcc
CFLAGS_BASE=`sdl2-config --cflags` -I. -I.. -Wall -Werror -Wno-unused-function
CFLAGS_BASE=`sdl2-config --cflags` `pkg-config SDL2_image --cflags` -I. -I.. -Wall -Werror -Wno-unused-function
LDFLAGS_BASE=

CFLAGS=$(CFLAGS_EXTRA) $(CFLAGS_BASE)
Expand Down Expand Up @@ -35,7 +35,7 @@ LIBTESTS=tests/libtests.a
DEPS = $(EMU_OBJ) $(LIBCPU) $(LIBDEBUG) $(PARSEROBJ)
DEPS_TEST = $(EMU_TEST_OBJ) $(LIBCPU) $(LIBDEBUG) $(PARSEROBJ) $(LIBTESTS)

LIB=$(LIBCPU) $(LIBDEBUG) `sdl2-config --libs`
LIB=$(LIBCPU) $(LIBDEBUG) `sdl2-config --libs` `pkg-config SDL2_image --libs`

all: default

Expand Down
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -2,9 +2,9 @@

### Building

To build, the SDL2 library must be installed. Also, you need tools
compatible with Lex and Yacc. E.g. `apt-get install libsdl2-dev
flex bison`.
To build, the SDL2 library and the SDL2 image library must be installed. Also,
you need tools compatible with Lex and Yacc. E.g. `apt-get install libsdl2-dev
libsdl2-image-dev flex bison`.

There are a few different build options (always do `make clean` first):

Expand Down
5 changes: 5 additions & 0 deletions debug/display.c
@@ -1,4 +1,5 @@
#include <SDL.h>
#include <SDL_image.h>
#include <stdio.h>
#include <stdlib.h>
#include "font.h"
Expand Down Expand Up @@ -125,6 +126,7 @@ void display_swap_screen()
void display_setup()
{
Uint32 rmask, gmask, bmask, amask;
SDL_Surface *icon;

SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, SDL_SCALING_LINEAR);
debug_window = SDL_CreateWindow("Debugger screen", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
Expand Down Expand Up @@ -159,6 +161,9 @@ void display_setup()
debug_window_id = SDL_GetWindowID(debug_window);
printf("DEBUG: debug_window_id == %d\n", debug_window_id);

icon = IMG_Load("logo-monst.png");
SDL_SetWindowIcon(debug_window, icon);

display_swap_screen();
SDL_ShowWindow(debug_window);

Expand Down
Binary file added logo-main.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added logo-monst.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions screen.c
Expand Up @@ -2,6 +2,7 @@
#include <stdlib.h>
#include <string.h>
#include <SDL.h>
#include <SDL_image.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/time.h>
Expand Down Expand Up @@ -117,6 +118,7 @@ void screen_init()
{
/* should be rewritten with proper error checking */
Uint32 rmask, gmask, bmask, amask;
SDL_Surface *icon;

HANDLE_DIAGNOSTICS_NON_MMU_DEVICE(screen, "SCRN");

Expand Down Expand Up @@ -161,6 +163,9 @@ void screen_init()
FATAL("Did not get a video mode");
}

icon = IMG_Load("logo-main.png");
SDL_SetWindowIcon(window, icon);

if(ppmoutput) {
ppm_fd = open("ostis.ppm", O_WRONLY|O_CREAT|O_TRUNC, 0644);
}
Expand Down

0 comments on commit 0199ebc

Please sign in to comment.