Skip to content

Commit

Permalink
Numerous bug fixes, improvements and clean up to common playsim code.…
Browse files Browse the repository at this point in the history
… Added minor new feature(s) to HUD and inventory (auto-hiding HUD in jDoom. When finalized will implement in the other games). Commonised several customizability features/options not present in all supported games.

The menu headers are somewhat disorganised due to the fact that I have removed the new menu code as it is not yet ready and reinstated the "old" menu for now.
  • Loading branch information
danij committed Jul 31, 2006
1 parent f682b85 commit 9d8c222
Show file tree
Hide file tree
Showing 99 changed files with 3,107 additions and 2,639 deletions.
1 change: 1 addition & 0 deletions doomsday/build/win32/jdoom_cl.rsp
Expand Up @@ -4,6 +4,7 @@
./../../plugins/common/src/dmu_lib.c
./../../plugins/common/src/m_multi.c
./../../plugins/common/src/mn_menu.c
./../../plugins/jdoom/src/g_ctrl.c
./../../plugins/common/src/m_ctrl.c
./../../plugins/common/src/g_dglinit.c
./../../plugins/jdoom/src/d_api.c
Expand Down
2 changes: 2 additions & 0 deletions doomsday/build/win32/jheretic_cl.rsp
Expand Up @@ -4,6 +4,7 @@
./../../plugins/common/src/dmu_lib.c
./../../plugins/common/src/m_multi.c
./../../plugins/common/src/mn_menu.c
./../../plugins/jheretic/src/g_ctrl.c
./../../plugins/common/src/m_ctrl.c
./../../plugins/common/src/g_dglinit.c
./../../plugins/jheretic/src/h_api.c
Expand All @@ -16,6 +17,7 @@
./../../plugins/common/src/p_xgfile.c
./../../plugins/common/src/p_view.c
./../../plugins/common/src/p_user.c
./../../plugins/common/src/p_inventory.c
./../../plugins/common/src/p_tick.c
./../../plugins/jheretic/src/p_telept.c
./../../plugins/jheretic/src/p_switch.c
Expand Down
4 changes: 3 additions & 1 deletion doomsday/build/win32/jhexen_cl.rsp
Expand Up @@ -4,11 +4,12 @@
./../../plugins/common/src/dmu_lib.c
./../../plugins/common/src/m_multi.c
./../../plugins/common/src/mn_menu.c
./../../plugins/jhexen/src/g_ctrl.c
./../../plugins/common/src/m_ctrl.c
./../../plugins/common/src/g_update.c
./../../plugins/common/src/g_dglinit.c
./../../plugins/jhexen/src/x_api.c
./../../plugins/jhexen/src/hrefresh.c
./../../plugins/common/src/g_update.c
./../../plugins/jhexen/src/hconsole.c
./../../plugins/jhexen/src/h2_main.c
./../../plugins/jhexen/src/h2_Actn.c
Expand All @@ -20,6 +21,7 @@
./../../plugins/common/src/p_actor.c
./../../plugins/common/src/p_player.c
./../../plugins/common/src/p_user.c
./../../plugins/common/src/p_inventory.c
./../../plugins/jhexen/src/p_things.c
./../../plugins/jhexen/src/p_telept.c
./../../plugins/jhexen/src/p_switch.c
Expand Down
7 changes: 3 additions & 4 deletions doomsday/build/win32/vcbuild.bat
Expand Up @@ -100,15 +100,14 @@ md %BIN_DIR%
md %OBJ_DIR%
GOTO Done


:: *** Resources (dialogs for Doomsday and drD3D)
:: Requires rc.exe and cvtres.exe from the Platform SDK.
:Res
rc ./../../engine/win32/res/Doomsday.rc
cvtres /OUT:doomsday_res.obj /MACHINE:X86 ./../../engine/win32/doomsday.res
cvtres /OUT:%OBJ_DIR%doomsday_res.obj /MACHINE:X86 ./../../engine/win32/res/Doomsday.res
rc ./../../plugins/d3d/res/drD3D.rc
IF NOT EXIST %OBJ_DIR%/drD3D md %OBJ_DIR%/drD3D
cvtres /OUT:drD3D_res.obj /MACHINE:X86 ./../../plugins/d3d/res/drD3D.res
cvtres /OUT:%OBJ_DIR%/drD3D/drD3D_res.obj /MACHINE:X86 ./../../plugins/d3d/res/drD3D.res
GOTO Done


Expand Down Expand Up @@ -143,7 +142,7 @@ GOTO DONE
:Doomsday
CALL vcbuild checkdmt
ECHO Compiling Doomsday.exe (Engine)...
cl %FLAGS% %INCS% %INCS_ENGINE_WIN32% %INCS_ENGINE_PORTABLE% %INCS_LZSS_PORTABLE% %INCS_LIBPNG_PORTABLE% %INCS_ZLIB% %INCS_PLUGIN_COMMON% %DEFINES% /D "__DOOMSDAY__" ./../../engine/win32/res/doomsday_res.obj @doomsday_cl.rsp /link /OUT:"./%BIN_DIR%/Doomsday.exe" /DEF:"./../../engine/api/doomsday.def" %LFLAGS% %LIBS% sdl_net.lib sdl.lib wsock32.lib %EXTERNAL%/libpng/win32/libpng.lib %EXTERNAL%/zlib/win32/libz.lib fmodvc.lib %EXTERNAL%/lzss/win32/lzss.lib dinput.lib dsound.lib eaxguid.lib dxguid.lib winmm.lib %EXTERNAL%/libpng/win32/libpng.lib %EXTERNAL%/zlib/win32/libz.lib %EXTERNAL%/lzss/win32/LZSS.lib gdi32.lib ole32.lib user32.lib
cl %FLAGS% %INCS% %INCS_ENGINE_WIN32% %INCS_ENGINE_PORTABLE% %INCS_LZSS_PORTABLE% %INCS_LIBPNG_PORTABLE% %INCS_ZLIB% %INCS_PLUGIN_COMMON% %DEFINES% /D "__DOOMSDAY__" ./%OBJ_DIR%/doomsday_res.obj @doomsday_cl.rsp /link /OUT:"./%BIN_DIR%/Doomsday.exe" /DEF:"./../../engine/api/doomsday.def" /IMPLIB:"./%BIN_DIR%/Doomsday.lib" %LFLAGS% %LIBS% sdl_net.lib sdl.lib wsock32.lib %EXTERNAL%/libpng/win32/libpng.lib %EXTERNAL%/zlib/win32/libz.lib fmodvc.lib %EXTERNAL%/lzss/win32/lzss.lib dinput.lib dsound.lib eaxguid.lib dxguid.lib winmm.lib %EXTERNAL%/libpng/win32/libpng.lib %EXTERNAL%/zlib/win32/libz.lib %EXTERNAL%/lzss/win32/LZSS.lib gdi32.lib ole32.lib user32.lib
GOTO Done


Expand Down
31 changes: 22 additions & 9 deletions doomsday/plugins/common/include/am_map.h
Expand Up @@ -98,21 +98,34 @@ void AM_Stop(void);
#define WHITE (256-47)
#define YOURCOLORS WHITE
#define YOURRANGE 0
#define WALLRANGE REDRANGE
#define TSWALLCOLORS GRAYS
#define TSWALLRANGE GRAYSRANGE
#define FDWALLRANGE BROWNRANGE
#define CDWALLRANGE YELLOWRANGE
#define THINGCOLORS GREENS
#define THINGRANGE GREENRANGE

# ifdef __WOLFTC__
# define WALLCOLORS GRAYS
# define WALLRANGE GRAYSRANGE
# define TSWALLCOLORS BROWNS
# define TSWALLRANGE BROWNRANGE
# define CDWALLCOLORS BROWNS
# define CDWALLRANGE BROWNRANGE
# define THINGCOLORS REDS
# define THINGRANGE REDRANGE
# else
# define WALLCOLORS REDS
# define WALLRANGE REDRANGE
# define TSWALLCOLORS GRAYS
# define TSWALLRANGE GRAYSRANGE
# define CDWALLCOLORS YELLOWS
# define CDWALLRANGE YELLOWRANGE
# define THINGCOLORS GREENS
# define THINGRANGE GREENRANGE
#endif

#define SECRETWALLCOLORS WALLCOLORS
#define SECRETWALLRANGE WALLRANGE
#define GRIDCOLORS (GRAYS + GRAYSRANGE/2)
#define GRIDRANGE 0
#define XHAIRCOLORS GRAYS
#define WALLCOLORS REDS
#define FDWALLCOLORS BROWNS
#define CDWALLCOLORS YELLOWS
#define FDWALLRANGE BROWNRANGE

#define BORDEROFFSET 3

Expand Down
2 changes: 0 additions & 2 deletions doomsday/plugins/common/include/g_common.h
Expand Up @@ -26,8 +26,6 @@ enum {
void G_Register(void);
void G_PreInit(void);
void G_PostInit(void);
void G_BuildTiccmd(ticcmd_t *cmd, float elapsedTime);
void G_MergeTiccmd(ticcmd_t *dest, ticcmd_t *src);
void G_StartTitle(void);
void G_PostInit(void);
void G_PreInit(void);
Expand Down
71 changes: 71 additions & 0 deletions doomsday/plugins/common/include/g_controls.h
@@ -0,0 +1,71 @@
/* DE1: $Id: cl_def.h 3323 2006-06-13 17:25:33Z skyjake $
* Copyright (C) 2005 Jaakko Keränen <jaakko.keranen@iki.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not: http://www.opensource.org/
*/

/*
* g_controls.h: Common code for game controls
*
*/

#ifndef __COMMON_CONTROLS_H__
#define __COMMON_CONTROLS_H__

#include "p_ticcmd.h"
#include "mn_def.h"

#define CTLCFG_TYPE void

CTLCFG_TYPE SCControlConfig(int option, void *data);

// Control flags.
#define CLF_ACTION 0x1 // The control is an action (+/- in front).
#define CLF_REPEAT 0x2 // Bind down + repeat.

typedef struct {
char *command; // The command to execute.
int flags;
int bindClass; // Class it should be bound into
int defKey; //
int defMouse; // Zero means there is no default.
int defJoy; //
} Control_t;

extern const Control_t controls[];

// Game registered bindClasses
enum {
GBC_CLASS1 = NUM_DDBINDCLASSES,
GBC_CLASS2,
GBC_CLASS3,
GBC_MENUHOTKEY,
GBC_CHAT,
GBC_MESSAGE
};

extern const Control_t *grabbing;

void G_ControlRegister(void);
void G_DefaultBindings(void);
void G_BindClassRegistration(void);

void G_BuildTiccmd(ticcmd_t *cmd, float elapsedTime);
void G_MergeTiccmd(ticcmd_t *dest, ticcmd_t *src);

void G_LookAround(void);
boolean G_AdjustControlState(event_t* ev);
void G_ResetMousePos(void);

#endif
8 changes: 8 additions & 0 deletions doomsday/plugins/common/include/hu_stuff.h
Expand Up @@ -79,7 +79,15 @@ void WI_DrawParamText(int x, int y, char *string, dpatch_t * defFont,
float defAlpha, boolean defCase, boolean defTypeIn,
int halign);

void M_WriteText(int x, int y, char *string);
void M_WriteText2(int x, int y, char *string, dpatch_t *font, float red,
float green, float blue, float alpha);
void M_WriteText3(int x, int y, const char *string, dpatch_t *font,
float red, float green, float blue, float alpha,
boolean doTypeIn, int initialCount);

int M_DrawText(int x, int y, boolean direct, char *string);
void M_DrawTitle(char *text, int y);

int M_StringWidth(char *string, dpatch_t * font);
int M_StringHeight(char *string, dpatch_t * font);
Expand Down
64 changes: 64 additions & 0 deletions doomsday/plugins/common/include/p_inventory.h
@@ -0,0 +1,64 @@
/* DE1: $Id: template.c 2645 2006-01-21 12:58:39Z skyjake $
* Copyright (C) 1999- Activision
*
* This program is covered by the HERETIC / HEXEN (LIMITED USE) source
* code license; you can redistribute it and/or modify it under the terms
* of the HERETIC / HEXEN source code license as published by Activision.
*
* THIS MATERIAL IS NOT MADE OR SUPPORTED BY ACTIVISION.
*
* WARRANTY INFORMATION.
* This program is provided as is. Activision and it's affiliates make no
* warranties of any kind, whether oral or written , express or implied,
* including any warranty of merchantability, fitness for a particular
* purpose or non-infringement, and no other representations or claims of
* any kind shall be binding on or obligate Activision or it's affiliates.
*
* LICENSE CONDITIONS.
* You shall not:
*
* 1) Exploit this Program or any of its parts commercially.
* 2) Use this Program, or permit use of this Program, on more than one
* computer, computer terminal, or workstation at the same time.
* 3) Make copies of this Program or any part thereof, or make copies of
* the materials accompanying this Program.
* 4) Use the program, or permit use of this Program, in a network,
* multi-user arrangement or remote access arrangement, including any
* online use, except as otherwise explicitly provided by this Program.
* 5) Sell, rent, lease or license any copies of this Program, without
* the express prior written consent of Activision.
* 6) Remove, disable or circumvent any proprietary notices or labels
* contained on or within the Program.
*
* You should have received a copy of the HERETIC / HEXEN source code
* license along with this program (Ravenlic.txt); if not:
* http://www.ravensoft.com/
*/

/*
* p_inventory.h: Common code for player inventory
*
*/

#ifndef __COMMON_INVENTORY_H__
#define __COMMON_INVENTORY_H__

extern boolean artiskip;
extern boolean usearti;
extern int inv_ptr;

boolean P_GiveArtifact(player_t *player, artitype_e arti, mobj_t *mo);

void P_InventoryRemoveArtifact(player_t *player, int slot);
boolean P_InventoryUseArtifact(player_t *player, artitype_e arti);
void P_InventoryNextArtifact(player_t *player);

#if __JHERETIC__
void P_InventoryCheckReadyArtifact(player_t *player);
#endif

boolean P_UseArtifactOnPlayer(player_t *player, artitype_e arti);

DEFCC(CCmdInventory);

#endif
1 change: 0 additions & 1 deletion doomsday/plugins/common/include/p_mapsetup.h
Expand Up @@ -37,7 +37,6 @@ extern int numthings;
#endif

void P_SetupLevel(int episode, int map, int playermask, skill_t skill);
void P_LocateMapLumps(int episode, int map, int *lumpIndices);


#endif
24 changes: 23 additions & 1 deletion doomsday/plugins/common/include/p_start.h
@@ -1,3 +1,25 @@
/* DE1: $Id$
* Copyright (C) 2005 Jaakko Keränen <jaakko.keranen@iki.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not: http://www.opensource.org/
*/

/*
* p_start.h: Common playsim code relating to (re)spawn of map objects
* and map setup.
*/

#ifndef __COMMON_PLAYSTART_H__
#define __COMMON_PLAYSTART_H__

Expand All @@ -14,7 +36,7 @@ boolean P_FuzzySpawn(thing_t * spot, int playernum,
thing_t *P_GetPlayerStart(int group, int pnum);
void P_DealPlayerStarts(void);
void P_SpawnPlayers(void);

void P_GetMapLumpName(int episode, int map, char *lumpName);
void P_LocateMapLumps(int episode, int map, int *lumpIndices);

#endif

0 comments on commit 9d8c222

Please sign in to comment.