diff --git a/data/convert-icon b/data/convert-icon index ae1b0683..6fe50497 100755 --- a/data/convert-icon +++ b/data/convert-icon @@ -29,7 +29,7 @@ except ImportError: def convert_image(filename, output_filename): - im = Image.open(filename).convert("RGB") + im = Image.open(filename) outfile = open(output_filename, "w") @@ -43,7 +43,7 @@ def convert_image(filename, output_filename): outfile.write("static int %s_h = %i;\n" % (struct_name, size[1])) outfile.write("\n") - outfile.write("static unsigned char %s_data[] = {\n" % (struct_name)) + outfile.write("static const unsigned int %s_data[] = {\n" % (struct_name)) elements_on_line = 0 @@ -52,10 +52,10 @@ def convert_image(filename, output_filename): for y in range(size[1]): for x in range(size[0]): val = im.getpixel((x, y)) - outfile.write("0x%02x,0x%02x,0x%02x, " % val) + outfile.write("0x%02x%02x%02x%02x, " % val) elements_on_line += 1 - if elements_on_line >= 4: + if elements_on_line >= 6: elements_on_line = 0 outfile.write("\n") outfile.write(" ") diff --git a/data/doom.png b/data/doom.png index d75a8f23..0ef1fe9c 100644 Binary files a/data/doom.png and b/data/doom.png differ diff --git a/data/setup.png b/data/setup.png index 1491e244..4faaee73 100644 Binary files a/data/setup.png and b/data/setup.png differ diff --git a/src/Makefile.am b/src/Makefile.am index 16496d88..a1f7e3d4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -251,7 +251,7 @@ CLEANFILES = $(execgames_SCRIPTS) $(app_DATA) $(screensaver_DATA) if HAVE_PYTHON -icon.c : $(top_builddir)/data/doom8.ico +icon.c : $(top_builddir)/data/doom.png $(top_builddir)/data/convert-icon $< $@ endif diff --git a/src/i_video.c b/src/i_video.c index 51e910f3..021597ac 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -1217,38 +1217,14 @@ void I_InitWindowTitle(void) void I_InitWindowIcon(void) { SDL_Surface *surface; - Uint8 *mask; - int i; - // Generate the mask + surface = SDL_CreateRGBSurfaceFrom((void *) icon_data, icon_w, icon_h, + 32, icon_w * 4, + 0xff << 24, 0xff << 16, + 0xff << 8, 0xff << 0); - mask = malloc(icon_w * icon_h / 8); - memset(mask, 0, icon_w * icon_h / 8); - - for (i=0; iw, TXT_SCREEN_H * font->h, - 0);//SDL_WINDOW_ALLOW_HIGHDPI); + TXT_SDLWindow = + SDL_CreateWindow("libtextscreen", + SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, + TXT_SCREEN_W * font->w, TXT_SCREEN_H * font->h, + 0); - if (screen == NULL) + if (TXT_SDLWindow == NULL) return 0; // Instead, we draw everything into an intermediate 8-bit surface @@ -407,8 +408,9 @@ void TXT_UpdateScreenArea(int x, int y, int w, int h) SDL_UnlockSurface(screenbuffer); - SDL_BlitSurface(screenbuffer, &rect, SDL_GetWindowSurface(screen), &rect); - SDL_UpdateWindowSurfaceRects(screen, &rect, 1); + SDL_BlitSurface(screenbuffer, &rect, + SDL_GetWindowSurface(TXT_SDLWindow), &rect); + SDL_UpdateWindowSurfaceRects(TXT_SDLWindow, &rect, 1); } void TXT_UpdateScreen(void) @@ -863,7 +865,7 @@ void TXT_EnableKeyMapping(int enable) void TXT_SetWindowTitle(char *title) { - SDL_SetWindowTitle(screen, title); + SDL_SetWindowTitle(TXT_SDLWindow, title); } void TXT_SDL_SetEventCallback(TxtSDLEventCallbackFunc callback, void *user_data)