Load mapped walls from savefiles, add livewallupdates cmdline flag

This commit is contained in:
jndean
2022-11-01 17:38:21 +00:00
parent c29c701f1a
commit c4da3ed561
4 changed files with 23 additions and 2 deletions

View File

@@ -115,6 +115,9 @@ boolean storedemo;
// If true, the main game loop has started.
boolean main_loop_started = false;
// Josef: CPU traces walls while IPU does automap
boolean livewallupdates = false;
char wadfile[1024]; // primary wad file
char mapdir[1024]; // directory of development maps
@@ -232,7 +235,8 @@ void D_Display(void) {
I_UpdateNoBlit();
// draw the view directly
if (gamestate == GS_LEVEL && /* JOSEF !automapactive && */ gametic)
int busy_with_automap = automapactive && !livewallupdates; // JOSEF
if (gamestate == GS_LEVEL && !busy_with_automap && gametic)
R_RenderPlayerView(&players[displayplayer]);
IPU_AM_Drawer(); // JOSEF: After RenderplayerView for wall updates
@@ -827,6 +831,10 @@ void D_DoomMain(void) {
printf("Z_Init: Init zone memory allocation daemon. \n");
Z_Init();
// JOSEF: flag to enable CPU wall mapping while in automap
if (M_CheckParm("-livewallupdates"))
livewallupdates = true;
//!
// @category net
//

View File

@@ -63,6 +63,7 @@
#include "z_zone.h"
#include "ipu_host.h"
#include "ipu_transfer.h"
#define SAVEGAMESIZE 0x2c000
@@ -1357,6 +1358,8 @@ void G_DoLoadGame(void) {
P_UnArchiveThinkers();
P_UnArchiveSpecials();
IPU_CheckAlreadyMappedLines();
if (!P_ReadSaveGameEOF())
I_Error("Bad savegame");

View File

@@ -16,6 +16,7 @@
#include "ipu/ipu_interface.h"
void IPU_G_LoadLevel_PackMiscValues(void* buf) {
assert(sizeof(G_LoadLevel_MiscValues_t) <= IPUMISCVALUESSIZE);
@@ -35,7 +36,7 @@ void IPU_G_LoadLevel_PackMiscValues(void* buf) {
}
#define MAX_BUFFERED_MAPPED_LINES 50
#define MAX_BUFFERED_MAPPED_LINES 1000
static int mapped_line_buf[MAX_BUFFERED_MAPPED_LINES];
static int mapped_line_count = 0;
@@ -47,6 +48,14 @@ void IPU_NotifyLineMapped(line_t *line) {
}
}
void IPU_CheckAlreadyMappedLines(void) {
for (int i = 0; i < numlines; ++i) {
if (lines[i].flags & ML_MAPPED) {
IPU_NotifyLineMapped(&lines[i]);
}
}
}
void IPU_G_Ticker_PackMiscValues(void* buf) {
assert(sizeof(G_Ticker_MiscValues_t) <= IPUMISCVALUESSIZE);

View File

@@ -15,6 +15,7 @@ void IPU_G_Responder_PackMiscValues(void* src_buf, void* dst_buf);
void IPU_LoadLumpForTransfer(int lumpnum, byte* buf);
void IPU_Setup_PackMarkNums(void* buf);
void IPU_NotifyLineMapped(line_t *line);
void IPU_CheckAlreadyMappedLines(void);