diff options
author | Simon Howard | 2010-08-03 20:12:36 +0000 |
---|---|---|
committer | Simon Howard | 2010-08-03 20:12:36 +0000 |
commit | ad8d7a1efb8c61bb39568f76ab814919895cc501 (patch) | |
tree | 2a651f01712139337b2c3e7f7bdea55afd043885 /src/i_scale.c | |
parent | 4319d9cda4caab4a9c4d5f98a780ea8d9e3531f6 (diff) | |
download | chocolate-doom-ad8d7a1efb8c61bb39568f76ab814919895cc501.tar.gz chocolate-doom-ad8d7a1efb8c61bb39568f76ab814919895cc501.tar.bz2 chocolate-doom-ad8d7a1efb8c61bb39568f76ab814919895cc501.zip |
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
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 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); |