From e1d13667707b5d8180cfec024d0c4c5f152d4893 Mon Sep 17 00:00:00 2001 From: William McBrine Date: Sat, 7 Jul 2007 06:51:31 +0000 Subject: [PATCH] Added PDC_LINES and PDC_COLS. I'm not using LINES and COLS here, as in other ports, because those values are meant to apply to the controlling terminal, and this port is separate from any terminal. But I may have to think about it. --- sdl1/pdcscrn.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sdl1/pdcscrn.c b/sdl1/pdcscrn.c index 92989b85..7258e0c8 100644 --- a/sdl1/pdcscrn.c +++ b/sdl1/pdcscrn.c @@ -13,7 +13,7 @@ #include "pdcsdl.h" -RCSID("$Id: pdcscrn.c,v 1.28 2007/07/07 06:23:18 wmcbrine Exp $") +RCSID("$Id: pdcscrn.c,v 1.29 2007/07/07 06:51:31 wmcbrine Exp $") #include #include "deffont.h" @@ -155,8 +155,11 @@ int PDC_scr_open(int argc, char **argv) if (pdc_own_screen) { - pdc_sheight = 25 * pdc_fheight; - pdc_swidth = 80 * pdc_fwidth; + const char *env = getenv("PDC_LINES"); + pdc_sheight = (env ? atoi(env) : 25) * pdc_fheight; + + env = getenv("PDC_COLS"); + pdc_swidth = (env ? atoi(env) : 80) * pdc_fwidth; pdc_screen = SDL_SetVideoMode(pdc_swidth, pdc_sheight, 0, SDL_SWSURFACE|SDL_ANYFORMAT|SDL_RESIZABLE);