- WITH_NOWAD -> not WITH_WAD as this is preferred scheme
- Add a patch that adds the `-nograb' command line option which disables the input grabbing done by SDL when run in windowed mode [1] - Add dependency on `audio/timidity' so in-game music works again - Bump PORTREVISION Obtained from: http://roman.mainer.de/uhexen/
This commit is contained in:
parent
ff14d99c6f
commit
1328b8ca78
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=134578
@ -7,7 +7,7 @@
|
||||
|
||||
PORTNAME= uhexen
|
||||
PORTVERSION= 0.601
|
||||
PORTREVISION= 2
|
||||
PORTREVISION= 3
|
||||
CATEGORIES= games
|
||||
MASTER_SITES= http://uhexen.sourceforge.net/
|
||||
DISTNAME= ${PORTNAME}-latest
|
||||
@ -19,11 +19,12 @@ USE_SDL= mixer sdl
|
||||
USE_X_PREFIX= yes
|
||||
USE_GMAKE= yes
|
||||
|
||||
OPTIONS= NOWAD "Do not install demo-version WAD file" off
|
||||
OPTIONS= WAD "Install demo-version WAD file" on \
|
||||
MUSIC "Enable support for in-game music" on
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if !defined(WITH_NOWAD)
|
||||
.if defined(WITH_WAD)
|
||||
DISTFILES= ${DISTNAME}${EXTRACT_SUFX} hexen.zip
|
||||
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
|
||||
EXTRACT_DEPENDS= unzip:${PORTSDIR}/archivers/unzip
|
||||
@ -32,13 +33,17 @@ PLIST_SUB= WAD=""
|
||||
PLIST_SUB= WAD="@comment "
|
||||
.endif
|
||||
|
||||
.if defined(WITH_MUSIC)
|
||||
RUN_DEPENDS+= ${LOCALBASE}/lib/timidity/goemon.cfg:${PORTSDIR}/audio/timidity
|
||||
.endif
|
||||
|
||||
PLIST_FILES= bin/uhexen %%DATADIR%%/.keep_me %%WAD%%%%DATADIR%%/hexen.wad
|
||||
PLIST_DIRS= %%DATADIR%%
|
||||
|
||||
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
|
||||
|
||||
post-extract:
|
||||
.if !defined(WITH_NOWAD)
|
||||
.if defined(WITH_WAD)
|
||||
@${LOCALBASE}/bin/unzip -qo ${_DISTDIR}/hexen.zip \
|
||||
-d ${WRKSRC}
|
||||
.endif
|
||||
@ -46,7 +51,7 @@ post-extract:
|
||||
do-install:
|
||||
${INSTALL_PROGRAM} ${WRKSRC}/uhexen ${PREFIX}/bin
|
||||
@${MKDIR} ${DATADIR}
|
||||
.if !defined(WITH_NOWAD)
|
||||
.if defined(WITH_WAD)
|
||||
${INSTALL_DATA} ${WRKSRC}/hexen.wad ${DATADIR}
|
||||
.endif
|
||||
@${TOUCH} ${DATADIR}/.keep_me
|
||||
|
43
games/uhexen/files/patch-src::i_sdlvideo.c
Normal file
43
games/uhexen/files/patch-src::i_sdlvideo.c
Normal file
@ -0,0 +1,43 @@
|
||||
--- src/i_sdlvideo.c.orig Tue Dec 4 17:08:44 2001
|
||||
+++ src/i_sdlvideo.c Tue Sep 21 22:27:07 2004
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
int mouse_scale_factor;
|
||||
int save_buttons;
|
||||
+int grab_input;
|
||||
|
||||
extern int usemouse;
|
||||
|
||||
@@ -460,7 +461,13 @@
|
||||
success:
|
||||
if (WMAvailable) {
|
||||
SDL_WM_SetCaption("U-Hexen 0.6",NULL);
|
||||
- SDL_WM_GrabInput(SDL_GRAB_ON);
|
||||
+ if(M_CheckParm("-nograb")) {
|
||||
+ grab_input = 0;
|
||||
+ }
|
||||
+ else {
|
||||
+ grab_input = 1;
|
||||
+ SDL_WM_GrabInput(SDL_GRAB_ON);
|
||||
+ }
|
||||
}
|
||||
SDL_WarpMouse(SDLWidth/2,SDLHeight/2);
|
||||
SDL_ShowCursor(SDL_DISABLE);
|
||||
@@ -470,7 +477,7 @@
|
||||
void VSDL_ShutdownGraphics(void)
|
||||
{
|
||||
if (WMAvailable) {
|
||||
- SDL_WM_GrabInput(SDL_GRAB_OFF);
|
||||
+ if(grab_input == 1) SDL_WM_GrabInput(SDL_GRAB_OFF);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -599,7 +606,7 @@
|
||||
if (Event.motion.x==SDLWidth/2 && Event.motion.y==SDLHeight/2) break;
|
||||
if ((event.data2=(Event.motion.xrel)*mouse_scale_factor) ||
|
||||
(event.data3=(-Event.motion.yrel)*mouse_scale_factor)) {
|
||||
- SDL_WarpMouse(SDLWidth/2,SDLHeight/2);
|
||||
+ if(grab_input == 1) SDL_WarpMouse(SDLWidth/2,SDLHeight/2);
|
||||
event.type=ev_mouse;
|
||||
H2_PostEvent(&event);
|
||||
}
|
Loading…
Reference in New Issue
Block a user