diff --git a/doomsday/Src/jHeretic/H_Console.c b/doomsday/Src/jHeretic/H_Console.c index 350e357ff4..c0479d828d 100644 --- a/doomsday/Src/jHeretic/H_Console.c +++ b/doomsday/Src/jHeretic/H_Console.c @@ -12,7 +12,8 @@ #include #include "jHeretic/Doomdef.h" #include "jHeretic/Soundst.h" -#include "jHeretic/settings.h" +#include "jHeretic/d_config.h" +#include "jHeretic/Mn_def.h" #include "g_common.h" #include "f_infine.h" @@ -33,7 +34,7 @@ DEFCC(CCmdViewSize); DEFCC(CCmdInventory); DEFCC(CCmdScreenShot); DEFCC(CCmdHereticFont); -DEFCC(CCmdMenuAction); + DEFCC(CCmdCycleSpy); DEFCC(CCmdCrosshair); DEFCC(CCmdSpawnMobj); @@ -46,19 +47,22 @@ DEFCC(CCmdCheatClip); DEFCC(CCmdCheatGive); DEFCC(CCmdCheatWarp); DEFCC(CCmdCheatPig); +DEFCC(CCmdSuicide); DEFCC(CCmdCheatMassacre); DEFCC(CCmdCheatWhere); DEFCC(CCmdCheatReveal); + DEFCC(CCmdBeginChat); +DEFCC(CCmdMsgRefresh); // PRIVATE FUNCTION PROTOTYPES --------------------------------------------- // EXTERNAL DATA DECLARATIONS ---------------------------------------------- -extern char *chat_macros[10]; - extern int testcvar; +extern boolean mn_SuicideConsole; + // PUBLIC DATA DEFINITIONS ------------------------------------------------- int consoleFlat = 6; @@ -104,8 +108,8 @@ cvar_t gameCVars[] = { "1=Lookspring active.", "NoAutoAim", OBSOLETE, CVT_INT, &cfg.noAutoAim, 0, 1, "1=Autoaiming disabled.", - "h_ViewSize", OBSOLETE | CVF_PROTECTED, CVT_INT, &cfg.screenblocks, 3, 11, - "View window size (3-11).", + "h_ViewSize", OBSOLETE | CVF_PROTECTED, CVT_INT, &cfg.screenblocks, 3, 13, + "View window size (3-13).", "h_sbSize", OBSOLETE | CVF_PROTECTED, CVT_INT, &cfg.sbarscale, 1, 20, "Status bar size (1-20).", "XHair", OBSOLETE | CVF_NO_MAX | CVF_PROTECTED, CVT_INT, &cfg.xhair, 0, 0, @@ -124,32 +128,32 @@ cvar_t gameCVars[] = { "1=Enable custom (external) music files.\n", // "SoundDebug", OBSOLETE|CVF_NO_ARCHIVE, CVT_INT, &DebugSound, 0, 1, "1=Display sound debug information.", //"ReverbDebug", OBSOLETE|CVF_NO_ARCHIVE, CVT_BYTE, &cfg.reverbDebug, 0, 1, "1=Reverberation debug information in the console.", - "Messages", OBSOLETE, CVT_INT, &cfg.messageson, 0, 1, "1=Show messages.", - "ShowMana", OBSOLETE, CVT_INT, &cfg.showFullscreenMana, 0, 1, - "1=Show mana when the status bar is hidden.", - "ShowArmor", OBSOLETE, CVT_INT, &cfg.showFullscreenArmor, 0, 1, + "Messages", OBSOLETE, CVT_INT, &cfg.msgShow, 0, 1, "1=Show messages.", + "ShowAmmo", OBSOLETE, CVT_BYTE, &cfg.hudShown[0], 0, 1, + "1=Show ammo when the status bar is hidden.", + "ShowArmor", OBSOLETE, CVT_BYTE, &cfg.hudShown[1], 0, 1, "1=Show armor when the status bar is hidden.", - "ShowKeys", OBSOLETE, CVT_INT, &cfg.showFullscreenKeys, 0, 1, + "ShowKeys", OBSOLETE, CVT_BYTE, &cfg.hudShown[2], 0, 1, "1=Show keys when the status bar is hidden.", - "ChatMacro0", OBSOLETE, CVT_CHARPTR, &chat_macros[0], 0, 0, + "ChatMacro0", OBSOLETE, CVT_CHARPTR, &cfg.chat_macros[0], 0, 0, "Chat macro 1.", - "ChatMacro1", OBSOLETE, CVT_CHARPTR, &chat_macros[1], 0, 0, + "ChatMacro1", OBSOLETE, CVT_CHARPTR, &cfg.chat_macros[1], 0, 0, "Chat macro 2.", - "ChatMacro2", OBSOLETE, CVT_CHARPTR, &chat_macros[2], 0, 0, + "ChatMacro2", OBSOLETE, CVT_CHARPTR, &cfg.chat_macros[2], 0, 0, "Chat macro 3.", - "ChatMacro3", OBSOLETE, CVT_CHARPTR, &chat_macros[3], 0, 0, + "ChatMacro3", OBSOLETE, CVT_CHARPTR, &cfg.chat_macros[3], 0, 0, "Chat macro 4.", - "ChatMacro4", OBSOLETE, CVT_CHARPTR, &chat_macros[4], 0, 0, + "ChatMacro4", OBSOLETE, CVT_CHARPTR, &cfg.chat_macros[4], 0, 0, "Chat macro 5.", - "ChatMacro5", OBSOLETE, CVT_CHARPTR, &chat_macros[5], 0, 0, + "ChatMacro5", OBSOLETE, CVT_CHARPTR, &cfg.chat_macros[5], 0, 0, "Chat macro 6.", - "ChatMacro6", OBSOLETE, CVT_CHARPTR, &chat_macros[6], 0, 0, + "ChatMacro6", OBSOLETE, CVT_CHARPTR, &cfg.chat_macros[6], 0, 0, "Chat macro 7.", - "ChatMacro7", OBSOLETE, CVT_CHARPTR, &chat_macros[7], 0, 0, + "ChatMacro7", OBSOLETE, CVT_CHARPTR, &cfg.chat_macros[7], 0, 0, "Chat macro 8.", - "ChatMacro8", OBSOLETE, CVT_CHARPTR, &chat_macros[8], 0, 0, + "ChatMacro8", OBSOLETE, CVT_CHARPTR, &cfg.chat_macros[8], 0, 0, "Chat macro 9.", - "ChatMacro9", OBSOLETE, CVT_CHARPTR, &chat_macros[9], 0, 0, + "ChatMacro9", OBSOLETE, CVT_CHARPTR, &cfg.chat_macros[9], 0, 0, "Chat macro 10.", "NoMonsters", OBSOLETE, CVT_BYTE, &cfg.netNomonsters, 0, 1, "1=No monsters.", @@ -178,8 +182,7 @@ cvar_t gameCVars[] = { "1=Fast monsters in non-demo single player.", "EyeHeight", OBSOLETE, CVT_INT, &cfg.eyeHeight, 41, 54, "Player eye height (the original is 41).", - "MenuScale", OBSOLETE, CVT_FLOAT, &cfg.menuScale, .1f, 1, - "Scaling for menu screens.", + "LevelTitle", OBSOLETE, CVT_BYTE, &cfg.levelTitle, 0, 1, "1=Show level title and author in the beginning.", "CounterCheat", OBSOLETE, CVT_BYTE, &cfg.counterCheat, 0, 63, @@ -218,8 +221,6 @@ cvar_t gameCVars[] = { "1=Joystick values => look angle delta.", "hud-fps", CVF_NO_ARCHIVE, CVT_INT, &cfg.showFPS, 0, 1, "1=Show the frames per second counter.", - "msg-echo", 0, CVT_INT, &cfg.echoMsg, 0, 1, - "1=Echo all messages to the console.", "ctl-use-immediate", 0, CVT_INT, &cfg.chooseAndUse, 0, 1, "1=Use items immediately from the inventory.", @@ -241,10 +242,14 @@ cvar_t gameCVars[] = { "1=Lookspring active.", "ctl-aim-noauto", 0, CVT_INT, &cfg.noAutoAim, 0, 1, "1=Autoaiming disabled.", - "view-size", CVF_PROTECTED, CVT_INT, &cfg.screenblocks, 3, 11, - "View window size (3-11).", + "view-size", CVF_PROTECTED, CVT_INT, &cfg.screenblocks, 3, 13, + "View window size (3-13).", "hud-status-size", CVF_PROTECTED, CVT_INT, &cfg.sbarscale, 1, 20, "Status bar size (1-20).", + "hud-status-alpha", 0, CVT_FLOAT, &cfg.statusbarAlpha, 0, 1, + "Status bar Alpha level.", + "hud-status-icon-a", 0, CVT_FLOAT, &cfg.statusbarCounterAlpha, 0, 1, + "Status bar icons & counters Alpha level.", "view-cross-type", CVF_NO_MAX | CVF_PROTECTED, CVT_INT, &cfg.xhair, 0, 0, "The current crosshair.", @@ -271,24 +276,35 @@ cvar_t gameCVars[] = { // "sound-debug", CVF_NO_ARCHIVE, CVT_INT, &DebugSound, 0, 1, "1=Display sound debug information.", // "sound-reverb-debug", CVF_NO_ARCHIVE, CVT_BYTE, &cfg.reverbDebug, 0, 1, "1=Reverberation debug information in the console.", - "msg-show", 0, CVT_INT, &cfg.messageson, 0, 1, "1=Show messages.", - "hud-mana", 0, CVT_INT, &cfg.showFullscreenMana, 0, 1, - "1=Show mana when the status bar is hidden.", - "hud-armor", 0, CVT_INT, &cfg.showFullscreenArmor, 0, 1, + "hud-ammo", 0, CVT_BYTE, &cfg.hudShown[HUD_AMMO], 0, 1, + "1=Show ammo when the status bar is hidden.", + "hud-armor", 0, CVT_BYTE, &cfg.hudShown[HUD_ARMOR], 0, 1, "1=Show armor when the status bar is hidden.", - "hud-keys", 0, CVT_INT, &cfg.showFullscreenKeys, 0, 1, + "hud-keys", 0, CVT_BYTE, &cfg.hudShown[HUD_KEYS], 0, 1, "1=Show keys when the status bar is hidden.", - - "chat-macro0", 0, CVT_CHARPTR, &chat_macros[0], 0, 0, "Chat macro 1.", - "chat-macro1", 0, CVT_CHARPTR, &chat_macros[1], 0, 0, "Chat macro 2.", - "chat-macro2", 0, CVT_CHARPTR, &chat_macros[2], 0, 0, "Chat macro 3.", - "chat-macro3", 0, CVT_CHARPTR, &chat_macros[3], 0, 0, "Chat macro 4.", - "chat-macro4", 0, CVT_CHARPTR, &chat_macros[4], 0, 0, "Chat macro 5.", - "chat-macro5", 0, CVT_CHARPTR, &chat_macros[5], 0, 0, "Chat macro 6.", - "chat-macro6", 0, CVT_CHARPTR, &chat_macros[6], 0, 0, "Chat macro 7.", - "chat-macro7", 0, CVT_CHARPTR, &chat_macros[7], 0, 0, "Chat macro 8.", - "chat-macro8", 0, CVT_CHARPTR, &chat_macros[8], 0, 0, "Chat macro 9.", - "chat-macro9", 0, CVT_CHARPTR, &chat_macros[9], 0, 0, "Chat macro 10.", + "hud-health", 0, CVT_BYTE, &cfg.hudShown[HUD_HEALTH], 0, 1, + "1=Show health when the status bar is hidden.", + "hud-artifact", 0, CVT_BYTE, &cfg.hudShown[HUD_ARTI], 0, 1, + "1=Show artifact when the status bar is hidden.", + + "hud-scale", 0, CVT_FLOAT, &cfg.hudScale, .1f, 1, + "Scaling for HUD elements (status bar hidden).", + "hud-color-r", 0, CVT_FLOAT, &cfg.hudColor[0], 0, 1, "HUD info color red component.", + "hud-color-g", 0, CVT_FLOAT, &cfg.hudColor[1], 0, 1, "HUD info color green component.", + "hud-color-b", 0, CVT_FLOAT, &cfg.hudColor[2], 0, 1, "HUD info color alpha component.", + "hud-color-a", 0, CVT_FLOAT, &cfg.hudColor[3], 0, 1, "HUD info alpha value.", + "hud-icon-alpha", 0, CVT_FLOAT, &cfg.hudIconAlpha, 0, 1, "HUD icon alpha value.", + + "chat-macro0", 0, CVT_CHARPTR, &cfg.chat_macros[0], 0, 0, "Chat macro 1.", + "chat-macro1", 0, CVT_CHARPTR, &cfg.chat_macros[1], 0, 0, "Chat macro 2.", + "chat-macro2", 0, CVT_CHARPTR, &cfg.chat_macros[2], 0, 0, "Chat macro 3.", + "chat-macro3", 0, CVT_CHARPTR, &cfg.chat_macros[3], 0, 0, "Chat macro 4.", + "chat-macro4", 0, CVT_CHARPTR, &cfg.chat_macros[4], 0, 0, "Chat macro 5.", + "chat-macro5", 0, CVT_CHARPTR, &cfg.chat_macros[5], 0, 0, "Chat macro 6.", + "chat-macro6", 0, CVT_CHARPTR, &cfg.chat_macros[6], 0, 0, "Chat macro 7.", + "chat-macro7", 0, CVT_CHARPTR, &cfg.chat_macros[7], 0, 0, "Chat macro 8.", + "chat-macro8", 0, CVT_CHARPTR, &cfg.chat_macros[8], 0, 0, "Chat macro 9.", + "chat-macro9", 0, CVT_CHARPTR, &cfg.chat_macros[9], 0, 0, "Chat macro 10.", // Game settings for servers. "server-game-nomonsters", 0, CVT_BYTE, &cfg.netNomonsters, 0, 1, @@ -324,17 +340,29 @@ cvar_t gameCVars[] = { "Player eye height (the original is 41).", "player-move-speed", 0, CVT_FLOAT, &cfg.playerMoveSpeed, 0, 1, "Player movement speed modifier.", - "menu-scale", 0, CVT_FLOAT, &cfg.menuScale, .1f, 1, - "Scaling for menu screens.", + "hud-title", 0, CVT_BYTE, &cfg.levelTitle, 0, 1, "1=Show level title and author in the beginning.", - "map-cheat-counter", 0, CVT_BYTE, &cfg.counterCheat, 0, 63, - "6-bit bitfield. Show kills, items and secret counters in automap.", - "map-cheat-counter-scale", 0, CVT_FLOAT, &cfg.counterCheatScale, .1f, 1, - "Size factor for the counters in the automap.", "game-corpsetime", CVF_NO_MAX, CVT_INT, &cfg.corpseTime, 0, 0, "Number of seconds after which dead monsters disappear.", + "msg-align", 0, CVT_INT, &cfg.msgAlign, 0, 2, + "Alignment of HUD messages. 0 = left, 1 = center, 2 = right.", + "msg-echo", 0, CVT_INT, &cfg.echoMsg, 0, 1, + "1=Echo all messages to the console.", + "msg-show", 0, CVT_INT, &cfg.msgShow, 0, 1, "1=Show messages.", + "msg-count", 0, CVT_INT, &cfg.msgCount, 0, 8, + "Number of HUD messages displayed at the same time.", + "msg-scale", CVF_NO_MAX, CVT_FLOAT, &cfg.msgScale, 0, 0, + "Scaling factor for HUD messages.", + "msg-uptime", CVF_NO_MAX, CVT_INT, &cfg.msgUptime, 35, 0, + "Number of tics to keep HUD messages on screen.", + "msg-blink", 0, CVT_BYTE, &cfg.msgBlink, 0, 1, + "1=HUD messages blink when they're printed.", + "msg-color-r", 0, CVT_FLOAT, &cfg.msgColor[0], 0, 1, "Color of HUD messages red component.", + "msg-color-g", 0, CVT_FLOAT, &cfg.msgColor[1], 0, 1, "Color of HUD messages green component.", + "msg-color-b", 0, CVT_FLOAT, &cfg.msgColor[2], 0, 1, "Color of HUD messages blue component.", + "xg-dev", 0, CVT_INT, &xgDev, 0, 1, "1=Print XG debug messages.", NULL @@ -350,6 +378,7 @@ ccmd_t gameCCmds[] = { "give", CCmdCheatGive, "Cheat command to give you various kinds of things.", "god", CCmdCheatGod, "I don't think He needs any help...", + "suicide", CCmdSuicide, "Kill yourself. What did you think?", "kill", CCmdCheatMassacre, "Kill all the monsters on the level.", "hereticfont", CCmdHereticFont, "Use the Heretic font.", "invleft", CCmdInventory, "Move inventory cursor to the left.", @@ -367,19 +396,8 @@ ccmd_t gameCCmds[] = { "spy", CCmdCycleSpy, "Change the viewplayer when not in deathmatch.", - // Menu actions. - "infoscreen", CCmdMenuAction, "Display the original Hexen help screens.", - "savegame", CCmdMenuAction, "Save the game.", - "loadgame", CCmdMenuAction, "Load a saved game.", - "soundmenu", CCmdMenuAction, "Open the sound menu.", - "quicksave", CCmdMenuAction, "Quicksave the game.", - "endgame", CCmdMenuAction, "End the current game.", - "togglemsgs", CCmdMenuAction, "Toggle messages on/off (cvar messages).", - "quickload", CCmdMenuAction, "Load the last quicksaved game.", - "quit", CCmdMenuAction, "Quit jHeretic.", - "togglegamma", CCmdMenuAction, "Change the gamma correction level.", - - "beginchat", CCmdBeginChat, "Enter chat mode. Destination optional.", + "beginchat", CCmdBeginChat, "Begin chat mode.", + "msgrefresh", CCmdMsgRefresh, "Show last HUD message.", "spawnmobj", CCmdSpawnMobj, "Spawn a new mobj.", "coord", CCmdPrintPlayerCoords, @@ -421,9 +439,55 @@ void H_ConsoleRegistration() D_NetConsoleRegistration(); } + +int CCmdPause(int argc, char **argv) +{ + extern boolean sendpause; + + if(!menuactive) + sendpause = true; + return true; +} + +void SuicideResponse(int option, void *data) +{ + if(option != 'y') + return; + + GL_Update(DDUF_BORDER); + mn_SuicideConsole = true; +} + +int CCmdSuicide(int argc, char **argv) +{ + if(gamestate != GS_LEVEL) + { + S_LocalSound(sfx_chat, NULL); + Con_Printf("Can only suicide when in a game!\n", argv[0]); + return true; + + } + + if(deathmatch) + { + S_LocalSound(sfx_chat, NULL); + Con_Printf("Can't suicide during a deathmatch!\n", argv[0]); + return true; + } + + if (!stricmp(argv[0], "suicide")) + { + Con_Open(false); + menuactive = false; + M_StartMessage("Are you sure you want to suicide?\n\nPress Y or N.", SuicideResponse, true); + return true; + } + return false; +} + int CCmdViewSize(int argc, char **argv) { - int min = 3, max = 11, *val = &cfg.screenblocks; + int min = 3, max = 13, *val = &cfg.screenblocks; if(argc != 2) { @@ -460,6 +524,28 @@ int CCmdScreenShot(int argc, char **argv) return true; } +int ConTextOut(char *text, int x, int y) +{ + extern int typein_time; + int old = typein_time; + + typein_time = 0xffffff; + M_WriteText2(x, y, text, hu_font_a, -1, -1, -1, -1); + typein_time = old; + return 0; +} + + +int ConTextWidth(char *text) +{ + return M_StringWidth(text, hu_font_a); +} + +void ConTextFilter(char *text) +{ + strupr(text); +} + DEFCC(CCmdHereticFont) { ddfont_t cfont; @@ -468,9 +554,9 @@ DEFCC(CCmdHereticFont) cfont.height = 9; cfont.sizeX = 1.2f; cfont.sizeY = 2; - cfont.TextOut = MN_DrTextA_CS; - cfont.Width = MN_TextAWidth; - cfont.Filter = MN_TextFilter; + cfont.TextOut = ConTextOut; + cfont.Width = ConTextWidth; + cfont.Filter = ConTextFilter; Con_SetFont(&cfont); return true; } diff --git a/doomsday/Src/jHeretic/H_Main.c b/doomsday/Src/jHeretic/H_Main.c index 5a9e457155..8a10edb3f1 100644 --- a/doomsday/Src/jHeretic/H_Main.c +++ b/doomsday/Src/jHeretic/H_Main.c @@ -9,12 +9,17 @@ #include "../Common/d_net.h" #include "jHeretic/P_local.h" #include "jHeretic/Soundst.h" -#include "jHeretic/settings.h" +#include "jHeretic/d_config.h" #include "jHeretic/AcFnLink.h" #include "jHeretic/Mn_def.h" +#include "../Common/hu_msg.h" +#include "../Common/hu_stuff.h" +#include "../Common/am_map.h" #include "f_infine.h" #include "g_update.h" +#define viewheight Get(DD_VIEWWINDOW_HEIGHT) + game_import_t gi; game_export_t gx; @@ -24,7 +29,7 @@ boolean ExtendedWAD = false; // true if episodes 4 and 5 present boolean nomonsters; // checkparm of -nomonsters boolean respawnparm; // checkparm of -respawn boolean debugmode; // checkparm of -debug -boolean ravpic; // checkparm of -ravpic +boolean devparm; // checkparm of -devparm boolean cdrom; // true if cd-rom mode active boolean singletics; // debug flag to cancel adaptiveness boolean noartiskip; // whether shift-enter skips an artifact @@ -34,11 +39,16 @@ int startepisode; int startmap; boolean autostart; extern boolean automapactive; +extern boolean amap_fullyopen; extern float lookOffset; static boolean devMap; static char gameModeString[17]; +// default font colours +const float deffontRGB[] = { .425f, 0.986f, 0.378f}; +const float deffontRGB2[] = { 1.0f, 1.0f, 1.0f}; + FILE *debugfile; // In m_multi.c. @@ -50,8 +60,8 @@ void R_DrawPlayerSprites(ddplayer_t *viewplr); void R_SetAllDoomsdayFlags(); void R_DrawRingFilter(); void X_Drawer(); -int H_PrivilegedResponder(event_t *event); -void H_DefaultBindings(); +int D_PrivilegedResponder(event_t *event); +void D_DefaultBindings(); void R_DrawLevelTitle(void) { @@ -74,7 +84,8 @@ void R_DrawLevelTitle(void) lname = (char *) Get(DD_MAP_NAME); lauthor = (char *) Get(DD_MAP_AUTHOR); - gl.Color4f(1, 1, 1, alpha); + Draw_BeginZoom((1 + cfg.hudScale)/2, 160, y); + if(lname) { // Skip the ExMx. @@ -85,14 +96,17 @@ void R_DrawLevelTitle(void) while(*lname && isspace(*lname)) lname++; } - MN_DrCenterTextB_CS(lname, 160, y); + M_WriteText3(160 - M_StringWidth(lname, hu_font_b) / 2, y, lname, + hu_font_b, deffontRGB[0], deffontRGB[1], deffontRGB[2], alpha, false, 0); y += 20; } - gl.Color4f(.5f, .5f, .5f, alpha); + if(lauthor && stricmp(lauthor, "raven software")) { - MN_DrCenterTextA_CS(lauthor, 160, y); + M_WriteText3(160 - M_StringWidth(lauthor, hu_font_a) / 2, y, lauthor, + hu_font_a, .5f, .5f, .5f, alpha, false, 0); } + Draw_EndZoom(); } //--------------------------------------------------------------------------- @@ -105,32 +119,60 @@ void R_DrawLevelTitle(void) void R_ExecuteSetViewSize(void); -extern boolean finalestage; +// wipegamestate can be set to -1 to force a wipe on the next draw +gamestate_t wipegamestate = GS_DEMOSCREEN; +extern boolean inhelpscreens; +extern boolean finalestage; +#define SIZEFACT 4 +#define SIZEFACT2 16 void D_Display(void) { - extern boolean MenuActive; - extern boolean askforquit; + static boolean viewactivestate = false; + static boolean menuactivestate = false; + static boolean inhelpscreensstate = false; + static int targx =0, targy = 0, targw =0, targh = 0; + static int x =0, y = 0, w =320, h = 200, offy = 0; + static int fullscreenmode = 0; + static gamestate_t oldgamestate = -1; + int ay; player_t *vplayer = &players[displayplayer]; boolean iscam = (vplayer->plr->flags & DDPF_CAMERA) != 0; // $democam + // $democam: can be set on every frame if(cfg.setblocks > 10 || iscam) { // Full screen. - R_ViewWindow(0, 0, 320, 200); + targx = 0; + targy = 0; + targw = 320; + targh = 200; } else { - int w = cfg.setblocks * 32; - int h = - cfg.setblocks * (200 - SBARHEIGHT * cfg.sbarscale / 20) / 10; - R_ViewWindow(160 - (w >> 1), - (200 - SBARHEIGHT * cfg.sbarscale / 20 - h) >> 1, w, h); + targw = cfg.setblocks * 32; + targh = cfg.setblocks * (200 - SBARHEIGHT * cfg.sbarscale / 20) / 10; + targx = 160 - (targw >> 1); + targy = (200 - SBARHEIGHT * cfg.sbarscale / 20 - targh) >> 1; } - // - // do buffered drawing - // + if(targw > w) + w+= (((targw-w)>> 1)+SIZEFACT2)>>SIZEFACT; + if(targw < w) + w-= (((w-targw)>> 1)+SIZEFACT2)>>SIZEFACT; + if(targh > h) + h+= (((targh-h)>> 1)+SIZEFACT2)>>SIZEFACT; + if(targh < h) + h-= (((h-targh)>> 1)+SIZEFACT2)>>SIZEFACT; + + if(cfg.setblocks < 10) + { + offy = (SBARHEIGHT * cfg.sbarscale/20); + R_ViewWindow(160-(w>>1), 100-((h+offy) >>1), w, h); + } else + R_ViewWindow(targx, targy, targw, targh); + + // Do buffered drawing switch (gamestate) { case GS_LEVEL: @@ -143,31 +185,71 @@ void D_Display(void) // a bug, but since there's an easy fix... break; } - if(automapactive) - AM_Drawer(); - else + if(!automapactive || !amap_fullyopen || cfg.automapBack[3] < 1 || cfg.automapWidth < 1 || cfg.automapHeight < 1) { - // Set flags for the renderer. + // Draw the player view. if(IS_CLIENT) + { + // Server updates mobj flags in NetSv_Ticker. R_SetAllDoomsdayFlags(); - GL_SetFilter(vplayer->plr->filter); + } // The view angle offset. Set(DD_VIEWANGLE_OFFSET, ANGLE_MAX * -lookOffset); - // With invulnerability, we want fullbright lighting. + GL_SetFilter(vplayer->plr->filter); + + // How about fullbright? Set(DD_FULLBRIGHT, vplayer->powers[pw_invulnerability]); + + // Render the view with possible custom filters. R_RenderPlayerView(vplayer->plr); + if(vplayer->powers[pw_invulnerability]) R_DrawRingFilter(); + + // Crosshair. if(!iscam) X_Drawer(); - R_DrawLevelTitle(); } - CT_Drawer(); - if(!iscam) - SB_Drawer(); // $democam - // Also update view borders? - if(Get(DD_VIEWWINDOW_HEIGHT) != 200) + + // Draw the automap? + if(automapactive) + AM_Drawer(); + + // These various HUD's will be drawn unless Doomsday advises not to + if(DD_GetInteger(DD_GAME_DRAW_HUD_HINT)) + { + + // Level information is shown for a few seconds in the + // beginning of a level. + R_DrawLevelTitle(); + + // Do we need to render a full status bar at this point? + if (!(automapactive && cfg.automapHudDisplay == 0 )){ + + if(!iscam) + if(true == (viewheight == 200) ) + { + // Fullscreen. Which mode? + ST_Drawer(cfg.setblocks - 10, true); // $democam + } else { + ST_Drawer(0 , true); // $democam + } + + fullscreenmode = viewheight == 200; + + } + + HU_Drawer(); + } + + // Need to update the borders? + if(oldgamestate != GS_LEVEL || + ((Get(DD_VIEWWINDOW_WIDTH) != 320 || menuactive || + cfg.sbarscale < 20 || (cfg.sbarscale == 20 && h < targh) || (automapactive && cfg.automapHudDisplay == 0 )))) + { + // Update the borders. GL_Update(DDUF_BORDER); + } break; case GS_INTERMISSION: @@ -182,21 +264,26 @@ void D_Display(void) default: break; } + GL_Update(DDUF_FULLSCREEN); - if(paused && !MenuActive && !askforquit && !fi_active) + menuactivestate = menuactive; + viewactivestate = viewactive; + inhelpscreensstate = inhelpscreens; + oldgamestate = wipegamestate = gamestate; + + // draw pause pic (but not if InFine active) + if(paused && !fi_active) { - if(!IS_NETGAME) - { - GL_DrawPatch(160, Get(DD_VIEWWINDOW_Y) + 5, - W_GetNumForName("PAUSED")); - } + if(automapactive) + ay = 4; else - { - GL_DrawPatch(160, 70, W_GetNumForName("PAUSED")); - } + ay = 4; // in jDOOM this is viewwindowy + 4 + + GL_DrawPatch(160, ay, W_GetNumForName("PAUSED")); } + // InFine is drawn whenever active. FI_Drawer(); } @@ -724,7 +811,7 @@ void H_PreInit(void) R_SetDataPath("}Data\\jHeretic\\"); R_SetBorderGfx(borderLumps); Con_DefineActions(actions); - // Add the JHexen cvars and ccmds to the console databases. + // Add the jHeretic cvars and ccmds to the console databases. H_ConsoleRegistration(); // Add a couple of probable locations for Heretic.wad. @@ -737,7 +824,6 @@ void H_PreInit(void) // Default settings (used if no config file found). memset(&cfg, 0, sizeof(cfg)); cfg.playerMoveSpeed = 1; - cfg.messageson = true; cfg.dclickuse = false; cfg.mouseSensiX = 8; cfg.mouseSensiY = 8; @@ -749,10 +835,34 @@ void H_PreInit(void) cfg.ringFilter = 1; cfg.eyeHeight = 41; cfg.menuScale = .9f; + cfg.menuColor[0] = deffontRGB[0]; // use the default colour by default. + cfg.menuColor[1] = deffontRGB[1]; + cfg.menuColor[2] = deffontRGB[2]; + cfg.menuColor2[0] = deffontRGB2[0]; // use the default colour by default. + cfg.menuColor2[1] = deffontRGB2[1]; + cfg.menuColor2[2] = deffontRGB2[2]; + cfg.menuEffects = 1; + cfg.menuFog = 4; + cfg.menuSlam = true; + cfg.flashcolor[0] = .7f; + cfg.flashcolor[1] = .9f; + cfg.flashcolor[2] = 1; + cfg.flashspeed = 4; + cfg.turningSkull = false; cfg.sbarscale = 20; - cfg.showFullscreenMana = 1; - cfg.showFullscreenArmor = 1; - cfg.showFullscreenKeys = 1; + cfg.hudShown[HUD_AMMO] = true; + cfg.hudShown[HUD_ARMOR] = true; + cfg.hudShown[HUD_KEYS] = true; + cfg.hudShown[HUD_HEALTH] = true; + cfg.hudShown[HUD_ARTI] = true; + cfg.hudScale = .7f; + cfg.hudColor[0] = .325f; + cfg.hudColor[1] = .686f; + cfg.hudColor[2] = .278f; + cfg.hudColor[3] = 1; + cfg.hudIconAlpha = 1; + cfg.usePatchReplacement = true; + cfg.tomeCounter = 10; cfg.tomeSound = 3; cfg.lookSpeed = 3; @@ -766,16 +876,62 @@ void H_PreInit(void) cfg.netColor = 4; // Use the default color by default. cfg.levelTitle = true; cfg.customMusic = true; - cfg.counterCheatScale = .7f; + cfg.cameraNoClip = true; cfg.bobView = cfg.bobWeapon = 1; cfg.jumpPower = 9; + cfg.statusbarAlpha = 1; + cfg.statusbarCounterAlpha = 1; + + cfg.automapPos = 5; + cfg.automapWidth = 1.0f; + cfg.automapHeight = 1.0f; + + cfg.automapL0[0] = 0.42f; // Unseen areas + cfg.automapL0[1] = 0.42f; + cfg.automapL0[2] = 0.42f; + + cfg.automapL1[0] = 0.41f; // onesided lines + cfg.automapL1[1] = 0.30f; + cfg.automapL1[2] = 0.15f; + + cfg.automapL2[0] = 0.82f; // floor height change lines + cfg.automapL2[1] = 0.70f; + cfg.automapL2[2] = 0.52f; + + cfg.automapL3[0] = 0.47f; // ceiling change lines + cfg.automapL3[1] = 0.30f; + cfg.automapL3[2] = 0.16f; + + cfg.automapBack[0] = 1.0f; + cfg.automapBack[1] = 1.0f; + cfg.automapBack[2] = 1.0f; + cfg.automapBack[3] = 1.0f; + cfg.automapLineAlpha = 1.0f; + cfg.automapShowDoors = true; + cfg.automapDoorGlow = 8; + cfg.automapHudDisplay = 2; + cfg.automapRotate = true; + cfg.automapBabyKeys = true; + cfg.counterCheatScale = .7f; //From jHeretic + + cfg.msgShow = true; + cfg.msgCount = 4; + cfg.msgScale = .8f; + cfg.msgUptime = 5 * TICSPERSEC; + cfg.msgAlign = ALIGN_CENTER; + cfg.msgBlink = true; + + cfg.msgColor[0] = deffontRGB2[0]; + cfg.msgColor[1] = deffontRGB2[1]; + cfg.msgColor[2] = deffontRGB2[2]; + // M_FindResponseFile(); // setbuf(stdout, NULL); nomonsters = ArgCheck("-nomonsters"); respawnparm = ArgCheck("-respawn"); - ravpic = ArgCheck("-ravpic"); + devparm = ArgCheck("-devparm"); noartiskip = ArgCheck("-noartiskip"); debugmode = ArgCheck("-debug"); startskill = sk_medium; @@ -783,6 +939,14 @@ void H_PreInit(void) startmap = 1; autostart = false; + G_Register(); // read-only game status cvars (for playsim) + + // Add the automap related cvars and ccmds to the console databases + AM_Register(); + + // Add the menu related cvars and ccmds to the console databases + MN_Register(); + // Check for -CDROM cdrom = false; #if 0 @@ -896,9 +1060,10 @@ void H_PostInit(void) SV_Init(); XG_ReadTypes(); + XG_Register(); // register XG classnames // Set the default bindings, if needed. - H_DefaultBindings(); + D_DefaultBindings(); // Init the view. R_SetViewSize(cfg.screenblocks, 0); @@ -931,15 +1096,17 @@ void H_PostInit(void) startmap, startskill + 1); } - Con_Message("MN_Init: Init menu system.\n"); - MN_Init(); - CT_Init(); - Con_Message("P_Init: Init Playloop state.\n"); P_Init(); - Con_Message("SB_Init: Loading patches.\n"); - SB_Init(); + Con_Message("HU_Init: Setting up heads up display.\n"); + HU_Init(); + + Con_Message("ST_Init: Loading patches.\n"); + ST_Init(); + + Con_Message("MN_Init: Init menu system.\n"); + MN_Init(); // // start the apropriate game based on parms @@ -1101,9 +1268,9 @@ game_export_t *GetGameAPI(game_import_t * imports) gx.MergeTicCmd = (void (*)(void*, void*)) G_MergeTiccmd; gx.G_Drawer = D_Display; gx.Ticker = H_Ticker; - gx.MN_Drawer = MN_Drawer; - gx.PrivilegedResponder = (boolean (*)(event_t *)) H_PrivilegedResponder; - gx.MN_Responder = MN_Responder; + gx.MN_Drawer = M_Drawer; + gx.PrivilegedResponder = (boolean (*)(event_t *)) D_PrivilegedResponder; + gx.MN_Responder = M_Responder; gx.G_Responder = G_Responder; gx.MobjThinker = P_MobjThinker; gx.MobjFriction = (fixed_t (*)(void *)) P_GetMobjFriction;