summaryrefslogtreecommitdiff
path: root/src/i_scale.c
diff options
context:
space:
mode:
authorSimon Howard2010-08-31 19:26:32 +0000
committerSimon Howard2010-08-31 19:26:32 +0000
commit22fc405736dc4796958de221c07d52432f1b271b (patch)
treec05962aa5e839566ea40dd9b1f4ba3581954af8a /src/i_scale.c
parentf391d85c96afa91a2302c58191ce8d401fdba2e2 (diff)
parent64918568eee62c73cbb87aa1bd68e191f19a4af3 (diff)
downloadchocolate-doom-22fc405736dc4796958de221c07d52432f1b271b.tar.gz
chocolate-doom-22fc405736dc4796958de221c07d52432f1b271b.tar.bz2
chocolate-doom-22fc405736dc4796958de221c07d52432f1b271b.zip
Merge from trunk.
Subversion-branch: /branches/raven-branch Subversion-revision: 1987
Diffstat (limited to 'src/i_scale.c')
-rw-r--r--src/i_scale.c14
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);