diff options
author | Simon Howard | 2010-09-09 23:13:06 +0000 |
---|---|---|
committer | Simon Howard | 2010-09-09 23:13:06 +0000 |
commit | 120d90c67b2a4aa0a8883c4897241dee2222acd2 (patch) | |
tree | b439e48483ebbd698c2daa6e24eeaaab1ba97470 /src/i_scale.c | |
parent | 79268587fc730e17cbd974a5583c7185604b59a3 (diff) | |
parent | 22fc405736dc4796958de221c07d52432f1b271b (diff) | |
download | chocolate-doom-120d90c67b2a4aa0a8883c4897241dee2222acd2.tar.gz chocolate-doom-120d90c67b2a4aa0a8883c4897241dee2222acd2.tar.bz2 chocolate-doom-120d90c67b2a4aa0a8883c4897241dee2222acd2.zip |
Merge from raven-branch.
Subversion-branch: /branches/strife-branch
Subversion-revision: 2051
Diffstat (limited to 'src/i_scale.c')
-rw-r--r-- | src/i_scale.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/i_scale.c b/src/i_scale.c index 4f08f5d6..2c0b718c 100644 --- a/src/i_scale.c +++ b/src/i_scale.c @@ -56,11 +56,11 @@ static int dest_pitch; // stretch_tables[1] : 40% / 60% // All other combinations can be reached from these two tables. -static byte *stretch_tables[2]; +static byte *stretch_tables[2] = { NULL, NULL }; // 50%/50% stretch table, for 800x600 squash mode -static byte *half_stretch_table; +static byte *half_stretch_table = NULL; // Called to set the source and destination buffers before doing the // scale. @@ -367,6 +367,11 @@ static byte *GenerateStretchTable(byte *palette, int pct) static void I_InitStretchTables(byte *palette) { + if (stretch_tables[0] != NULL) + { + return; + } + // We only actually need two lookup tables: // // mix 0% = just write line 1 @@ -388,6 +393,11 @@ static void I_InitStretchTables(byte *palette) static void I_InitSquashTable(byte *palette) { + if (half_stretch_table != NULL) + { + return; + } + printf("I_InitSquashTable: Generating lookup table.."); fflush(stdout); half_stretch_table = GenerateStretchTable(palette, 50); |