Skip to content

Commit 1180713

Browse files
committed
- overhead map clipping handling for MP (fix flickering)
1 parent d809572 commit 1180713

4 files changed

Lines changed: 8 additions & 15 deletions

File tree

src_rebuild/Game/C/overlay.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,19 +123,17 @@ void InitOverlays(void)
123123
}
124124

125125
// [D] [T]
126-
void SetFullscreenDrawing(void)
126+
void SetFullscreenDrawing(int ofs)
127127
{
128128
DR_ENV *drenv;
129129
DRAWENV drawenv;
130130

131-
drenv = (DR_ENV *)current->primptr;
132-
133131
drawenv.clip.x = 256;
134132
SetDefDrawEnv(&drawenv, 0, current->draw.clip.y & 256, 320, 256);
135133

134+
drenv = (DR_ENV*)current->primptr;
136135
SetDrawEnv(drenv, &drawenv);
137-
138-
addPrim(current->ot + 2, drenv);
136+
addPrim(current->ot + ofs, drenv);
139137
current->primptr += sizeof(DR_ENV);
140138
}
141139

@@ -704,7 +702,7 @@ void DisplayOverlays(void)
704702
if (CurrentPlayerView == 0)
705703
return;
706704

707-
SetFullscreenDrawing();
705+
SetFullscreenDrawing(2);
708706
}
709707

710708
UpdateFlashValue();

src_rebuild/Game/C/overlay.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ extern char OverlayFlashValue;
3636
extern void InitOverlays(); // 0x00014A58
3737
extern void DisplayOverlays(); // 0x00014C3C
3838

39-
extern void SetFullscreenDrawing(); // 0x00015E70
39+
extern void SetFullscreenDrawing(int ofs); // 0x00015E70
4040

4141
extern void InitPercentageBar(PERCENTAGE_BAR *bar, int size, COLOUR_BAND *pColourBand, char *tag); // 0x00015F20
4242
extern void EnablePercentageBar(PERCENTAGE_BAR *bar, int max); // 0x00015F58

src_rebuild/Game/C/overmap.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,12 +1173,7 @@ void DrawOverheadMap(void)
11731173
}
11741174
}
11751175

1176-
// for restoring
1177-
drarea = (DR_AREA *)current->primptr;
1178-
SetDrawArea(drarea, &current->draw.clip);
1179-
1180-
addPrim(current->ot + 1, drarea);
1181-
current->primptr += sizeof(DR_AREA);
1176+
SetFullscreenDrawing(1);
11821177

11831178
WorldToOverheadMapPositions((VECTOR *)player->pos, &vec, 1, 0, 0);
11841179

@@ -1448,7 +1443,7 @@ void DrawOverheadMap(void)
14481443
clipped_size.x = map_minX + 1;
14491444
clipped_size.w = MAP_SIZE_W - 1;
14501445
clipped_size.h = MAP_SIZE_H;
1451-
clipped_size.y = current->draw.clip.y + map_minY;// +1;
1446+
clipped_size.y = (current->draw.clip.y & 256) + map_minY;
14521447

14531448
drarea = (DR_AREA*)current->primptr;
14541449

src_rebuild/Game/C/pause.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ void DrawVisibleMenus(void)
10611061

10621062
if (NumPlayers > 1)
10631063
{
1064-
SetFullscreenDrawing();
1064+
SetFullscreenDrawing(2);
10651065
}
10661066

10671067
pActive = VisibleMenus[VisibleMenu];

0 commit comments

Comments
 (0)