Hello community, here is the log from the commit of package SDL_bgi for openSUSE:Factory checked in at 2018-09-20 11:42:39 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/SDL_bgi (Old) and /work/SRC/openSUSE:Factory/.SDL_bgi.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "SDL_bgi" Thu Sep 20 11:42:39 2018 rev:13 rq:636649 version:2.2.3 Changes: -------- --- /work/SRC/openSUSE:Factory/SDL_bgi/SDL_bgi.changes 2018-09-11 17:21:09.499055602 +0200 +++ /work/SRC/openSUSE:Factory/.SDL_bgi.new/SDL_bgi.changes 2018-09-20 11:42:41.880812985 +0200 @@ -1,0 +2,6 @@ +Wed Sep 19 12:48:29 UTC 2018 - Jan Engelhardt <jeng...@inai.de> + +- Update to new upstream release 2.2.3 + * fixed unspecified bug in setalpha() + +------------------------------------------------------------------- Old: ---- SDL_bgi-2.2.2.tar.gz New: ---- SDL_bgi-2.2.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ SDL_bgi.spec ++++++ --- /var/tmp/diff_new_pack.p72X9o/_old 2018-09-20 11:42:42.320812727 +0200 +++ /var/tmp/diff_new_pack.p72X9o/_new 2018-09-20 11:42:42.320812727 +0200 @@ -12,13 +12,13 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: SDL_bgi %define lname libSDL_bgi2 -Version: 2.2.2 +Version: 2.2.3 Release: 0 Summary: BGI-compatible 2D graphics C library with SDL backend License: Zlib AND GPL-2.0-or-later ++++++ SDL_bgi-2.2.2.tar.gz -> SDL_bgi-2.2.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SDL_bgi-2.2.2/ChangeLog new/SDL_bgi-2.2.3/ChangeLog --- old/SDL_bgi-2.2.2/ChangeLog 2018-09-11 00:00:33.000000000 +0200 +++ new/SDL_bgi-2.2.3/ChangeLog 2018-09-18 10:01:12.000000000 +0200 @@ -1,6 +1,11 @@ Changelog --------- +v. 2.2.3, 2018-09-18 +- fixed bug in setalpha() +- rewritten readimagefile() to change unwanted behaviour + (reported by Fanourios Attard) + v. 2.2.2, 2018-09-10 - documentation updates (clarification on colours) - constants TMP_FG_COL, TMP_BG_COL, and TMP_FILL_COL added diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SDL_bgi-2.2.2/VERSION new/SDL_bgi-2.2.3/VERSION --- old/SDL_bgi-2.2.2/VERSION 2018-09-10 11:37:19.000000000 +0200 +++ new/SDL_bgi-2.2.3/VERSION 2018-09-13 08:26:34.000000000 +0200 @@ -1 +1 @@ -2.2.2 +2.2.3 Binary files old/SDL_bgi-2.2.2/doc/sdl_bgi-quickref.pdf and new/SDL_bgi-2.2.3/doc/sdl_bgi-quickref.pdf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SDL_bgi-2.2.2/doc/sdl_bgi-quickref.tex new/SDL_bgi-2.2.3/doc/sdl_bgi-quickref.tex --- old/SDL_bgi-2.2.2/doc/sdl_bgi-quickref.tex 2018-09-10 00:00:09.000000000 +0200 +++ new/SDL_bgi-2.2.3/doc/sdl_bgi-quickref.tex 2018-09-18 10:00:44.000000000 +0200 @@ -1,7 +1,7 @@ % sdl_bgi-quickref.tex % % Guido Gonzato, PhD -% September 11, 2018 +% September 18, 2018 \documentclass[a4paper,11pt]{article} \usepackage{graphicx} @@ -18,7 +18,7 @@ \newcommand{\SDLbgi}{\texttt{SDL\_bgi}} -\newcommand{\version}{2.2.2} % !!! <<<=== Change here !!! +\newcommand{\version}{2.2.3} % !!! <<<=== Change here !!! \newcommand{\V}{\texttt{void}} % void \newcommand{\I}{\texttt{int}} % int @@ -131,7 +131,7 @@ #ifndef _SDL_BGI_H #define _SDL_BGI_H -#define SDL_BGI_VERSION 2.2.2 +#define SDL_BGI_VERSION 2.2.3 #define NOPE 0 #define YEAH 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SDL_bgi-2.2.2/doc/using.md new/SDL_bgi-2.2.3/doc/using.md --- old/SDL_bgi-2.2.2/doc/using.md 2018-09-11 00:07:27.000000000 +0200 +++ new/SDL_bgi-2.2.3/doc/using.md 2018-09-18 10:16:07.000000000 +0200 @@ -281,7 +281,7 @@ - `void sdlbgislow(void)` triggers "slow mode" even if the graphics system was opened with `initwindow()`. Calling `refresh()` is not needed. -- `void setwinoptions (char *title, int x, int y, Uint32 flags)` lets +- `void setwinoptions(char *title, int x, int y, Uint32 flags)` lets you specify the window title (default is `SDL_bgi`), window position, and SDL2 window flags OR'ed together. @@ -296,23 +296,22 @@ Multiple Windows ---------------- -Subsequent calls to `initgraph ()` make it possible to open several +Subsequent calls to `initgraph()` make it possible to open several windows; only one of them is active (= being drawn on) at any given time, regardless of focus. Functions `setvisualpage()` and `setactivepage()` only work properly in single window mode. -- Optionally, use `setwinoptions (char *title, int x, int y, Uint32 +- Optionally, use `setwinoptions(char *title, int x, int y, Uint32 flags)` as explained above; -- `int getcurrentwindow ()` to get an identifier for the current -window; +- `int getcurrentwindow()` returns the current window identifier; -- `void setcurrentwindow (int id)` sets the current window. `id` is an -integer identifier, as returned by `getcurrentwindow ()`; +- `void setcurrentwindow(int id)` sets the current window. `id` is an +integer identifier, as returned by `getcurrentwindow()`; -- `void closewindow (int id)` closes a window of given id. +- `void closewindow(int id)` closes a window of given id. The real thing Binary files old/SDL_bgi-2.2.2/doc/using.pdf and new/SDL_bgi-2.2.3/doc/using.pdf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SDL_bgi-2.2.2/sdl_bgi.spec new/SDL_bgi-2.2.3/sdl_bgi.spec --- old/SDL_bgi-2.2.2/sdl_bgi.spec 2018-09-11 00:09:28.000000000 +0200 +++ new/SDL_bgi-2.2.3/sdl_bgi.spec 2018-09-17 14:56:47.000000000 +0200 @@ -4,7 +4,7 @@ Summary: BGI-compatible 2D graphics C library Name: SDL_bgi -Version: 2.2.2 +Version: 2.2.3 Release: 1 License: ZLib Group: Libraries diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SDL_bgi-2.2.2/src/SDL_bgi.c new/SDL_bgi-2.2.3/src/SDL_bgi.c --- old/SDL_bgi-2.2.2/src/SDL_bgi.c 2018-09-11 11:43:13.000000000 +0200 +++ new/SDL_bgi-2.2.3/src/SDL_bgi.c 2018-09-18 09:58:43.000000000 +0200 @@ -5,7 +5,7 @@ // and for teaching. // // By Guido Gonzato, PhD -// September 10, 2018 +// September 18, 2018 /* @@ -1824,7 +1824,11 @@ if (YEAH == first_run) { first_run = NOPE; - SDL_Init (SDL_INIT_VIDEO); // initialize SDL2 + // initialise SDL2 + if (SDL_Init (SDL_INIT_VIDEO) != 0) { + SDL_Log ("SDL_Init failed: %s", SDL_GetError()); + exit (1); + } // initialise active_windows[] for (int i = 0; i < NUM_BGI_WIN; i++) active_windows[i] = NOPE; @@ -1916,6 +1920,7 @@ // window ok; create renderer bgi_rnd[current_window] = SDL_CreateRenderer (bgi_win[current_window], -1, + // slow but guaranteed to exist SDL_RENDERER_SOFTWARE); if (NULL == bgi_rnd[current_window]) { @@ -2987,11 +2992,11 @@ // Reads a .bmp file and displays it immediately at (x1, y1 ). SDL_Surface - *bm_surface; - SDL_Texture - *bm_texture; + *bm_surface, + *cur_surface; SDL_Rect - src_rect, dest_rect; + src_rect, + dest_rect; // load bitmap bm_surface = SDL_LoadBMP (bitmapname); @@ -3000,14 +3005,7 @@ return; } - // create texture - bm_texture = SDL_CreateTextureFromSurface - (bgi_rnd[current_window], bm_surface); - if (NULL == bm_texture) { - printf ("SDL_CreateTextureFromSurface error: %s\n", SDL_GetError ()); - return; - } - + // source rect, position and size src_rect.x = 0; src_rect.y = 0; src_rect.w = bm_surface->w; @@ -3022,8 +3020,8 @@ dest_rect.h = src_rect.h; } else { // change size - dest_rect.w = x2 - x1; - dest_rect.h = y2 - y1; + dest_rect.w = x2 - x1 + 1; + dest_rect.h = y2 - y1 + 1; } // clip it if necessary @@ -3032,15 +3030,19 @@ if (y1 + vp.top + src_rect.h > vp.bottom && vp.clip) dest_rect.h = vp.bottom - y1 - vp.top + 1; - SDL_RenderCopy (bgi_rnd[current_window], - bm_texture, + // get SDL surface from current window + cur_surface = SDL_GetWindowSurface (bgi_win[current_window]); + + // blit bitmap surface to current surface + SDL_BlitScaled (bm_surface, &src_rect, + cur_surface, &dest_rect); + + bgi_activepage[current_window] = cur_surface->pixels; + refresh (); SDL_FreeSurface (bm_surface); - SDL_DestroyTexture (bm_texture); - // this is needed - we're not working with bgi_activepage - SDL_RenderPresent (bgi_rnd[current_window]); - + } // readimagefile () // ----- @@ -3181,18 +3183,15 @@ Uint32 tmp; - // alpha is only allowed in argb mode - if (col <= BGI_COLORS) - return; - - // COLOR () set up the BGI_COLORS + 1 (temporary) color + // COLOR () set up the WHITE + 1 color if (-1 == col) { bgi_argb_mode = YEAH; - bgi_fg_color = BGI_COLORS + 1; + bgi_fg_color = WHITE + 1; + } + else { + bgi_argb_mode = NOPE; + bgi_fg_color = col; } - else - bgi_fg_color = BGI_COLORS + TMP_COLORS + col; - tmp = palette[bgi_fg_color] << 8; // get rid of alpha tmp = tmp >> 8; palette[bgi_fg_color] = ((Uint32)alpha << 24) | tmp; @@ -3553,8 +3552,8 @@ &dest_rect, bgi_activepage[current_window], pitch); - // SDL_UpdateTexture (bgi_txt, NULL, bgi_activepage[current_window], pitch); - SDL_SetTextureBlendMode (bgi_txt[current_window], SDL_BLENDMODE_BLEND); + SDL_SetTextureBlendMode (bgi_txt[current_window], + SDL_BLENDMODE_BLEND); SDL_RenderCopy (bgi_rnd[current_window], bgi_txt[current_window], &src_rect, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SDL_bgi-2.2.2/src/SDL_bgi.h new/SDL_bgi-2.2.3/src/SDL_bgi.h --- old/SDL_bgi-2.2.2/src/SDL_bgi.h 2018-09-11 07:56:01.000000000 +0200 +++ new/SDL_bgi-2.2.3/src/SDL_bgi.h 2018-09-18 09:52:35.000000000 +0200 @@ -3,7 +3,7 @@ // A BGI (Borland Graphics Library) implementation based on SDL2. // Easy to use, pretty fast, and useful for porting old programs. // Guido Gonzato, PhD -// September 10, 2018 +// September 18, 2018 /* This software is provided 'as-is', without any express or implied @@ -40,7 +40,7 @@ #ifndef _SDL_BGI_H #define _SDL_BGI_H -#define SDL_BGI_VERSION 2.2.2 +#define SDL_BGI_VERSION 2.2.3 #define NOPE 0 #define YEAH 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SDL_bgi-2.2.2/test/multiwin.c new/SDL_bgi-2.2.3/test/multiwin.c --- old/SDL_bgi-2.2.2/test/multiwin.c 2018-07-26 12:06:47.000000000 +0200 +++ new/SDL_bgi-2.2.3/test/multiwin.c 2018-09-17 14:49:22.000000000 +0200 @@ -27,7 +27,7 @@ { int gd, gm = SDL_320x200; - int win1, win2, win3; + int win1, win2, win3, x, y; setwinoptions ("First Window", 10, 10, -1); initgraph (&gd, &gm, ""); @@ -35,6 +35,9 @@ circle (50, 100, 50); win1 = getcurrentwindow (); printf ("Current window: %d\n", win1); + x = getmaxx () - 110; + y = getmaxy () - 60; + readimagefile ("logo.bmp", x, y, x + 100, y + 50); getevent (); delay (500); @@ -45,6 +48,7 @@ circle (100, 100, 50); win2 = getcurrentwindow (); printf ("Current window: %d\n", win2); + readimagefile ("logo.bmp", x, y, x + 100, y + 50); getevent (); delay (500); @@ -56,12 +60,15 @@ circle (150, 100, 50); win3 = getcurrentwindow (); printf ("Current window: %d\n", win3); + x = getmaxx () - 110; + y = getmaxy () - 60; + readimagefile ("logo.bmp", x, y, x + 100, y + 50); getevent (); delay (500); setcurrentwindow (win1); setcolor (WHITE); - circle (200, 100, 50); + circle (150, 100, 50); win1 = getcurrentwindow (); printf ("Current window: %d\n", win1); outtextxy (0, 10, "Back to the FIRST window; press a key");