From ad8d7a1efb8c61bb39568f76ab814919895cc501 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Tue, 3 Aug 2010 20:12:36 +0000 Subject: When in windowed mode, allow the screen size to be dynamically resized by dragging the window borders. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1949 --- src/i_scale.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/i_scale.c') diff --git a/src/i_scale.c b/src/i_scale.c index a022ab15..3f7b3a7d 100644 --- a/src/i_scale.c +++ b/src/i_scale.c @@ -53,11 +53,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. @@ -364,6 +364,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 @@ -385,6 +390,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); -- cgit v1.2.3