Debian Patches

Status for pachi/1:1.0-17

Patch Description Author Forwarded Bugs Origin Last update
source-fixes.diff Assorted source fixes for building as C++ and correct runtime Three sets of upstream source fixes that are neither score-file nor SDL related:
* build/runtime: initialise possibly-unused variables, drop dead/unused
locals, fix the signed/unsigned comparison in print_text(), clear the
name-entry field with spaces, and draw the remaining name placeholders
correctly;
* constness: the .c sources are compiled as C++ (included from faes.cpp),
where string literals have type const char[]. Widen the affected read-only
function parameters and the Cstages char* members to const char* so the
~142 "ISO C++ forbids converting a string constant to char*"
(-Wwrite-strings) warnings disappear;
* hardening/correctness: bound print_text()'s scratch buffer with
vsnprintf() instead of the unbounded vsprintf(); pass the credits line as
a "%s" argument instead of as the format string itself (it is not a
literal, so a stray '%' would read varargs that were never passed); and
fix the byte splitting in save_hiscoredata(), which used hibyte+256
instead of hibyte*256 for the time and subtracted scorescore/65536 instead
of vhibyte*65536 for the score, so the values written back did not match
the load_hiscoredata() reader.
diff -ruN pachi-1.0.orig/src/file.c pachi-1.0/src/file.c
Martin A. Godisch <godisch@debian.org> no
scorefile.diff Keep the high-score file as a single /var/games file All high-score file handling kept together in one patch:
* set the compiled-in SCOREDIR to the directory /var/games (FHS), the location
the maintainer scripts manage; the package name is part of the file name, not
a sub-directory;
* store the scores in one flat file SCOREDIR"/"PACKAGE".scores"
(i.e. /var/games/pachi.scores) instead of the upstream
SCOREDIR"/data/scores.dat" sub-tree;
* keep the upstream score-template install dir at $(SCOREPATH)/$(PACKAGE)/data,
unchanged after SCOREDIR was shortened;
* guard against a NULL FILE* when the score file does not exist yet;
* do not chgrp/chmod the score file from "make install" (the
install-data-local rule also lacked $(DESTDIR)); the shared file's owner
and mode are set by the maintainer scripts via dpkg-statoverride.
diff -ruN pachi-1.0.orig/configure.in pachi-1.0/configure.in
Martin A. Godisch <godisch@debian.org> no
sdl2-migration.diff Port from SDL 1.2 to SDL 2 Migrates the game to SDL 2 following the upstream SDL2 migration guide
(https://wiki.libsdl.org/SDL2/MigrationGuide). SDL_mixer is used through its
SDL 2 build; the SDL_mixer API used here is unchanged.
.
Rendering: the former SDL_SetVideoMode() framebuffer is replaced by a window
plus a renderer. "screen" stays an offscreen software surface (so all blitting,
locking and pixel access is untouched) and is uploaded to a streaming texture
and presented via the new flip_screen() helper, which replaces both SDL_Flip()
and the partial SDL_UpdateRect() calls. SDL_RenderSetLogicalSize() keeps the
fixed 800x600 image scaled with correct aspect ratio, so full-screen toggling
no longer rebuilds the surface.
.
flip_screen() always presents the whole frame, unlike the old per-region
SDL_UpdateRect(). Two effects that relied on the SDL 1.2 single-buffer behaviour
(pushed regions persisting on screen while the off-screen buffer was cleaned
independently) are adjusted for this:
* game_loop() composes the per-frame erase + monsters + player off-screen
behind a defer_present flag and shows them in a single flip, otherwise the
player sprite flickered (worst in full screen);
* respawn() redraws the whole poured-in column every frame instead of relying
on scan-lines persisting on screen: each sprite scan-line is drawn vertically
stretched over a P_h-pixel band at its current falling height, the bands tile
into one figure-shaped column, settled scan-lines stay so the player rebuilds
from the feet up, and the lowest still-falling row is bridged onto the settled
pixels so no gap shows between the falling column and the figure; the finished
build-up is wiped from the off-screen buffer once, at the end, so the normal
game loop resumes cleanly.
.
API renames: SDL_DisplayFormat() -> display_format() (SDL_ConvertSurface to the
screen format); SDL_SetAlpha() -> set_surface_alpha() (SDL_SetSurfaceBlendMode /
SDL_SetSurfaceAlphaMod); SDL_SRCCOLORKEY -> SDL_TRUE; SDL_WM_SetIcon/SetCaption/
GrabInput -> SDL_SetWindowIcon / window title at creation / SDL_SetWindowGrab;
the unused SDL_CreateRGBSurface() flag argument is set to 0.
.
Input: SDL_GetKeyState() -> SDL_GetKeyboardState() (now const and indexed by
scancode) for the in-game polled movement keys (SDL_SCANCODE_*, physical
position). The main menu instead reacts to discrete SDL_KEYDOWN events: reading
polled key state there re-fired actions on the SDL_WINDOWEVENTs that
SDL_SetWindowFullscreen() generates while a key was held, so the full-screen
toggle switched an unpredictable number of times. To make one keypress one
action without trusting SDL's auto-repeat flag (a key pressed during the black
intro load could leave that flag stuck after a swallowed KEYUP, so later presses
were ignored and the menu hung), the menu is armed on entry and on every key
release and consumes that arming on the first KEYDOWN. Text-entry comparisons
keep using key codes.
.
Also fixes two latent bugs uncovered by the port: intro.c passed invalid RGBA
masks to SDL_CreateRGBSurface() (NULL under SDL 2), and the window icon surface
was passed unchecked and never freed.
.
Build: configure.in now locates SDL 2 and its mixer via pkg-config
(PKG_CHECK_MODULES) instead of the SDL 1.2-only AM_PATH_SDL / -lSDL_mixer probes.
diff -ruN pachi-1.0.orig/configure.in pachi-1.0/configure.in
Martin A. Godisch <godisch@debian.org> no

All known versions for source package 'pachi'

Links