// // HI_drawLeaving // // Drawer function for first map stage, where "leaving..." is // shown and the previous levels are all X'd out // static void HI_drawLeaving(void) { int i; int lastlevel, thislevel; bool drawsecret; if(gameepisode > 3 && estrempty(hi_wbs.li_nextenterpic)) return; HI_drawOldLevelName(3); if(estrnonempty(hi_wbs.li_nextenterpic)) return; if(hi_wbs.last == 8) { // leaving secret level, handle specially lastlevel = hi_wbs.next; thislevel = 8; drawsecret = false; } else { lastlevel = thislevel = hi_wbs.last; drawsecret = hi_wbs.didsecret; } // draw all the previous levels for(i = 0; i < lastlevel; ++i) { V_DrawPatch(hipoints[hi_wbs.epsd][i].x, hipoints[hi_wbs.epsd][i].y, &subscreen43, hi_in_x); } // draw the secret level if appropriate if(drawsecret) { V_DrawPatch(hipoints[hi_wbs.epsd][8].x, hipoints[hi_wbs.epsd][8].y, &subscreen43, hi_in_x); } // blink the level we're leaving if(flashtime) { V_DrawPatch(hipoints[hi_wbs.epsd][thislevel].x, hipoints[hi_wbs.epsd][thislevel].y, &subscreen43, hi_in_x); } }
// // HI_drawGoing // // Drawer function for the final intermission stage where the // "now entering" is shown, and a pointer blinks at the next // stage on the map. // static void HI_drawGoing() { int i, previous; if(gameepisode > 3 && estrempty(hi_wbs.li_nextenterpic)) return; HI_drawNewLevelName(10); // don't proceed by drawing the location indicators if using "enterpic". // Keep them for a more advanced scripting. if(estrnonempty(hi_wbs.li_nextenterpic)) return; previous = hi_wbs.last; // handle secret level if(previous == 8) { previous = hi_wbs.next - 1; } // draw patches on levels visited for(i = 0; i <= previous; i++) { V_DrawPatch(hipoints[hi_wbs.epsd][i].x, hipoints[hi_wbs.epsd][i].y, &subscreen43, hi_in_x); } // draw patch on secret level if(hi_wbs.didsecret) { V_DrawPatch(hipoints[hi_wbs.epsd][8].x, hipoints[hi_wbs.epsd][8].y, &subscreen43, hi_in_x); } // blink destination arrow if(flashtime) { V_DrawPatch(hipoints[hi_wbs.epsd][hi_wbs.next].x, hipoints[hi_wbs.epsd][hi_wbs.next].y, &subscreen43, hi_in_yah); } }
// // E_SafeStateNameOrLabel // // haleyjd 07/19/14: Allows lookup of what may either be an EDF global state // name, DECORATE state label relative to a particular mobjinfo, or a state // DeHackEd number. // int E_SafeStateNameOrLabel(mobjinfo_t *mi, const char *name) { char *pos = nullptr; long num = strtol(name, &pos, 0); // Not a number? It is a state name. if(estrnonempty(pos)) { int statenum = NullStateNum; state_t *state = nullptr; // Try global resolution first. if((statenum = E_StateNumForName(name)) < 0) { // Try DECORATE state label resolution. if((state = E_GetJumpInfo(mi, name))) statenum = state->index; } return statenum; } else return E_SafeState((int)num); // DeHackEd number }
// // HI_drawSingleStats // // Drawer function for single-player mode stats stage. // Shows kills, items, secrets, and either time or the next // level name (depending on whether we're in a SOSR episode // or not). Note Heretic has no par times. // static void HI_drawSingleStats(void) { static int statstage = 0; V_FontWriteTextShadowed(in_bigfont, HIS_KILLS, 50, 65, &subscreen43); V_FontWriteTextShadowed(in_bigfont, HIS_ITEMS, 50, 90, &subscreen43); V_FontWriteTextShadowed(in_bigfont, HIS_SECRETS, 50, 115, &subscreen43); HI_drawOldLevelName(3); // prior to tic 30: draw nothing if(intertime < 30) { statstage = 0; return; } // tics 30 to 60: add kill count if(intertime > 30) { if(statstage == 0) { S_StartInterfaceSound(sfx_hdorcls); statstage = 1; } HI_drawLevelStat(players[consoleplayer].killcount, hi_wbs.maxkills, 200, 65); } // tics 60 to 90: add item count if(intertime > 60) { if(statstage == 1) { S_StartInterfaceSound(sfx_hdorcls); statstage = 2; } HI_drawLevelStat(players[consoleplayer].itemcount, hi_wbs.maxitems, 200, 90); } // tics 90 to 150: add secret count if(intertime > 90) { if(statstage == 2) { S_StartInterfaceSound(sfx_hdorcls); statstage = 3; } HI_drawLevelStat(players[consoleplayer].secretcount, hi_wbs.maxsecret, 200, 115); } // 150 to end: show time or next level name // Note that hitting space earlier than 150 sets the ticker to // 150 so that we jump here. if(intertime > 150) { if(statstage == 3) { S_StartInterfaceSound(sfx_hdorcls); statstage = 4; } if(gameepisode < 4 || estrnonempty(hi_wbs.li_nextenterpic)) { int time, hours, minutes, seconds; time = hi_wbs.plyr[consoleplayer].stime / TICRATE; hours = time / 3600; time -= hours * 3600; minutes = time / 60; time -= minutes * 60; seconds = time; V_FontWriteTextShadowed(in_bigfont, HIS_TIME, 85, 160, &subscreen43); HI_drawTime(hours, minutes, seconds, 155, 160); } else { HI_drawNewLevelName(160); acceleratestage = false; } } }
static void HI_loadData(void) { int i; char mapname[9]; memset(mapname, 0, 9); // load interpic hi_interpic = NULL; hi_exitpic = nullptr; if(estrnonempty(hi_wbs.li_lastexitpic)) { hi_exitpic = PatchLoader::CacheName(wGlobalDir, hi_wbs.li_lastexitpic, PU_STATIC); } if(estrnonempty(hi_wbs.li_nextenterpic)) { hi_interpic = PatchLoader::CacheName(wGlobalDir, hi_wbs.li_nextenterpic, PU_STATIC); } else if(gameepisode <= 3) { sprintf(mapname, "MAPE%d", gameepisode); hi_interpic = PatchLoader::CacheName(wGlobalDir, mapname, PU_STATIC); } // load positional indicators hi_in_x = PatchLoader::CacheName(wGlobalDir, "IN_X", PU_STATIC); hi_in_yah = PatchLoader::CacheName(wGlobalDir, "IN_YAH", PU_STATIC); // get lump numbers for faces for(i = 0; i < 4; i++) { char tempstr[9]; memset(tempstr, 0, 9); sprintf(tempstr, "FACEA%.1d", i); hi_faces[i] = W_GetNumForName(tempstr); sprintf(tempstr, "FACEB%.1d", i); hi_dead_faces[i] = W_GetNumForName(tempstr); } // haleyjd 03/27/05: EDF-defined intermission map names mapName = NULL; nextMapName = NULL; { char nameBuffer[24]; const char *basename; edf_string_t *str; // set current map if(hi_wbs.li_lastlevelname && *hi_wbs.li_lastlevelname) mapName = hi_wbs.li_lastlevelname; else { psnprintf(nameBuffer, 24, "_IN_NAME_%s", gamemapname); if((str = E_StringForName(nameBuffer))) mapName = str->string; } if(hi_wbs.li_nextlevelname && *hi_wbs.li_nextlevelname) { nextMapName = hi_wbs.li_nextlevelname; return; } // are we going to a secret level? basename = hi_wbs.gotosecret ? LevelInfo.nextSecret : LevelInfo.nextLevel; // set next map if(*basename) { psnprintf(nameBuffer, 24, "_IN_NAME_%s", basename); if((str = E_StringForName(nameBuffer))) nextMapName = str->string; } else { // try ExMy and MAPxy defaults for normally-named maps if(isExMy(gamemapname)) { psnprintf(nameBuffer, 24, "_IN_NAME_E%01dM%01d", hi_wbs.epsd + 1, hi_wbs.next + 1); if((str = E_StringForName(nameBuffer))) nextMapName = str->string; } else if(isMAPxy(gamemapname)) { psnprintf(nameBuffer, 24, "_IN_NAME_MAP%02d", hi_wbs.next + 1); if((str = E_StringForName(nameBuffer))) nextMapName = str->string; } } } }