Skip to content

Commit 3f47238

Browse files
tseng0201tseng
authored and
tseng
committed
PROVIDE THE PROOF FOR MEMORY REDUCION
provide the proof for memory reduction, detail in doomdef.h
1 parent 19cd46f commit 3f47238

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/doomdef.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,19 @@
2929

3030
// Disable screens wipe effect, you will get worse game experience,
3131
// but it can save about 130KB on DOOMHEAP.
32+
// In f_wipe.c, only wipe_initMelt() and wipe_shittyColMajorXform() call Z_Malloc ask for some sapce,
33+
// wipe_initMelt() ask 320 * 8(width * sizeof(int)) = 2560 bytes,
34+
// wipe_shittyColMajorXform() ask 160 * 200 * 2(width/2 * height*2) = 64000 bytes,
35+
// it will be call twice so it will totaly ask 128000 bytes,
36+
// it means we can save 2560 + 128000 = 130560 bytes on DOOMHEAP when disable screens wipe.
3237
#define DISABLE_WIPES
3338

3439
// Discard screen buffers, any screen effect will direct output on your screen,
35-
// It can save 192kb on heap.
40+
// It can save 192kb memory usage.
41+
// Each screen buffer is 320 * 200 * 1 = 64000 bytes,
42+
// COMBINE_SCREENS will make four screen buffers merge to one,
43+
// so we can save (4 - 1) * 320 * 200 = 192000 bytes.
44+
// In this Implement it will set "CombinedScreens[SCREENWIDTH*SCREENHEIGHT]" to replace original "CombinedScreens[SCREENWIDTH*SCREENHEIGHT*4]".
3645
// Remeber you can only use this when disable screens wipe.
3746
#define COMBINE_SCREENS
3847

0 commit comments

Comments
 (0)