Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/doomdef.h
- ===================================================================
- --- D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/doomdef.h (revision 2849)
- +++ D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/doomdef.h (revision 2850)
- @@ -112,10 +112,6 @@
- // allows us to avoid the overhead of dynamic allocation
- // when multiple screen sizes are supported
- -// proff 08/17/98: Changed for high-res
- -#define MAX_SCREENWIDTH 2048
- -#define MAX_SCREENHEIGHT 1536
- -
- // SCREENWIDTH and SCREENHEIGHT define the visible size
- extern int SCREENWIDTH;
- extern int SCREENHEIGHT;
- Index: D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/i_video.h
- ===================================================================
- --- D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/i_video.h (revision 2849)
- +++ D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/i_video.h (revision 2850)
- @@ -42,8 +42,7 @@
- #endif
- void I_PreInitGraphics(void); /* CPhipps - do stuff immediately on start */
- -void I_CalculateRes(unsigned int width, unsigned int height); /* calculate resolution */
- -void I_SetRes(void); /* set resolution */
- +void I_InitScreenResolution(void); /* init resolution */
- void I_SetWindowCaption(void); /* Set the window caption */
- void I_SetWindowIcon(void); /* Set the application icon */
- void I_InitGraphics (void);
- Index: D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/SDL/i_video.c
- ===================================================================
- --- D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/SDL/i_video.c (revision 2849)
- +++ D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/SDL/i_video.c (revision 2850)
- @@ -59,6 +59,9 @@
- #include "doomtype.h"
- #include "v_video.h"
- #include "r_draw.h"
- +#include "r_things.h"
- +#include "r_plane.h"
- +#include "f_wipe.h"
- #include "d_main.h"
- #include "d_event.h"
- #include "i_joy.h"
- @@ -108,6 +111,8 @@
- extern int usemouse; // config file var
- static boolean mouse_enabled; // usemouse, but can be overriden by -nomouse
- +int I_GetModeFromString(const char *modestr);
- +
- /////////////////////////////////////////////////////////////////////////////////
- // Keyboard handling
- @@ -570,6 +575,15 @@
- atexit(I_ShutdownSDL);
- }
- +// e6y: resolution limitation is removed
- +void I_InitBuffersRes(void)
- +{
- + R_InitMeltRes();
- + R_InitSpritesRes();
- + R_InitBuffersRes();
- + R_InitPlanesRes();
- +}
- +
- // e6y
- // GLBoom use this function for trying to set the closest supported resolution if the requested mode can't be set correctly.
- // For example glboom.exe -geom 1025x768 -nowindow will set 1024x768.
- @@ -593,9 +607,6 @@
- twidth = modes[i]->w;
- theight = modes[i]->h;
- - if (twidth > MAX_SCREENWIDTH || theight> MAX_SCREENHEIGHT)
- - continue;
- -
- if (twidth == *width && theight == *height)
- return;
- @@ -657,7 +668,7 @@
- // e6y: processing of screen_multiply
- {
- - int factor = ((V_GetMode() == VID_MODEGL) ? 1 : screen_multiply);
- + int factor = ((V_GetMode() == VID_MODEGL) ? 1 : render_screen_multiply);
- REAL_SCREENWIDTH = SCREENWIDTH * factor;
- REAL_SCREENHEIGHT = SCREENHEIGHT * factor;
- REAL_SCREENPITCH = SCREENPITCH * factor;
- @@ -665,15 +676,84 @@
- }
- // CPhipps -
- -// I_SetRes
- +// I_InitScreenResolution
- // Sets the screen resolution
- // e6y: processing of screen_multiply
- -void I_SetRes(void)
- +void I_InitScreenResolution(void)
- {
- - int i;
- + int i, p, w, h;
- + char c;
- + video_mode_t mode;
- - I_CalculateRes(SCREENWIDTH, SCREENHEIGHT);
- + // Video stuff
- + if ((p = M_CheckParm("-width")))
- + if (myargv[p+1])
- + desired_screenwidth = atoi(myargv[p+1]);
- + if ((p = M_CheckParm("-height")))
- + if (myargv[p+1])
- + desired_screenheight = atoi(myargv[p+1]);
- +
- + if ((p = M_CheckParm("-fullscreen")))
- + use_fullscreen = 1;
- +
- + if ((p = M_CheckParm("-nofullscreen")))
- + use_fullscreen = 0;
- +
- + // e6y
- + // New command-line options for setting a window (-window)
- + // or fullscreen (-nowindow) mode temporarily which is not saved in cfg.
- + // It works like "-geom" switch
- + desired_fullscreen = use_fullscreen;
- + if ((p = M_CheckParm("-window")))
- + desired_fullscreen = 0;
- +
- + if ((p = M_CheckParm("-nowindow")))
- + desired_fullscreen = 1;
- +
- + // e6y
- + // change the screen size for the current session only
- + // syntax: -geom WidthxHeight[w|f]
- + // examples: -geom 320x200f, -geom 640x480w, -geom 1024x768
- + w = desired_screenwidth;
- + h = desired_screenheight;
- +
- + if (!(p = M_CheckParm("-geom")))
- + p = M_CheckParm("-geometry");
- +
- + if (p && p + 1 < myargc)
- + {
- + int count = sscanf(myargv[p+1], "%dx%d%c", &w, &h, &c);
- +
- + // at least width and height must be specified
- + // restoring original values if not
- + if (count < 2)
- + {
- + w = desired_screenwidth;
- + h = desired_screenheight;
- + }
- +
- + if (count >= 3)
- + {
- + if (tolower(c) == 'w')
- + desired_fullscreen = 0;
- + if (tolower(c) == 'f')
- + desired_fullscreen = 1;
- + }
- + }
- +
- + I_CalculateRes(w, h);
- +
- + lprintf(LO_INFO, "I_InitScreenResolution: %dx%d (%s)\n", SCREENWIDTH, SCREENHEIGHT, desired_fullscreen ? "fullscreen" : "nofullscreen");
- +
- + mode = I_GetModeFromString(default_videomode);
- + if ((i=M_CheckParm("-vidmode")) && i<myargc-1)
- + {
- + mode = I_GetModeFromString(myargv[i+1]);
- + }
- +
- + V_InitMode(mode);
- +
- // set first three to standard values
- for (i=0; i<3; i++) {
- screens[i].width = REAL_SCREENWIDTH;
- @@ -690,7 +770,9 @@
- screens[4].short_pitch = REAL_SCREENPITCH / V_GetModePixelDepth(VID_MODE16);
- screens[4].int_pitch = REAL_SCREENPITCH / V_GetModePixelDepth(VID_MODE32);
- - lprintf(LO_INFO,"I_SetRes: Using resolution %dx%d\n", REAL_SCREENWIDTH, REAL_SCREENHEIGHT);
- + I_InitBuffersRes();
- +
- + lprintf(LO_INFO,"I_InitScreenResolution: Using resolution %dx%d\n", REAL_SCREENWIDTH, REAL_SCREENHEIGHT);
- }
- //
- @@ -813,22 +895,10 @@
- void I_UpdateVideoMode(void)
- {
- int init_flags;
- - int i;
- - video_mode_t mode;
- - lprintf(LO_INFO, "I_UpdateVideoMode: %dx%d (%s)\n", SCREENWIDTH, SCREENHEIGHT, desired_fullscreen ? "fullscreen" : "nofullscreen");
- -
- - mode = I_GetModeFromString(default_videomode);
- - if ((i=M_CheckParm("-vidmode")) && i<myargc-1) {
- - mode = I_GetModeFromString(myargv[i+1]);
- - }
- -
- - V_InitMode(mode);
- V_DestroyUnusedTrueColorPalettes();
- V_FreeScreens();
- - I_SetRes();
- -
- // Initialize SDL with this graphics mode
- if (V_GetMode() == VID_MODEGL) {
- init_flags = SDL_OPENGL;
- Index: D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_main.c
- ===================================================================
- --- D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_main.c (revision 2849)
- +++ D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_main.c (revision 2850)
- @@ -100,7 +100,8 @@
- // to the lowest viewangle that maps back to x ranges
- // from clipangle to -clipangle.
- -angle_t xtoviewangle[MAX_SCREENWIDTH+1]; // killough 2/8/98
- +// e6y: resolution limitation is removed
- +angle_t *xtoviewangle; // killough 2/8/98
- // killough 3/20/98: Support dynamic colormaps, e.g. deep water
- // killough 4/4/98: support dynamic number of them as well
- Index: D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_bsp.c
- ===================================================================
- --- D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_bsp.c (revision 2849)
- +++ D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_bsp.c (revision 2850)
- @@ -69,7 +69,8 @@
- // Instead of clipsegs, let's try using an array with one entry for each column,
- // indicating whether it's blocked by a solid wall yet or not.
- -byte solidcol[MAX_SCREENWIDTH];
- +// e6y: resolution limitation is removed
- +byte *solidcol;
- // CPhipps -
- // R_ClipWallSegment
- Index: D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_state.h
- ===================================================================
- --- D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_state.h (revision 2849)
- +++ D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_state.h (revision 2850)
- @@ -103,7 +103,10 @@
- extern player_t *viewplayer;
- extern angle_t clipangle;
- extern int viewangletox[FINEANGLES/2];
- -extern angle_t xtoviewangle[MAX_SCREENWIDTH+1]; // killough 2/8/98
- +
- +// e6y: resolution limitation is removed
- +extern angle_t *xtoviewangle; // killough 2/8/98
- +
- extern fixed_t rw_distance;
- extern angle_t rw_normalangle;
- Index: D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/f_wipe.c
- ===================================================================
- --- D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/f_wipe.c (revision 2849)
- +++ D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/f_wipe.c (revision 2850)
- @@ -61,8 +61,17 @@
- static screeninfo_t wipe_scr_end;
- static screeninfo_t wipe_scr;
- -static int y_lookup[MAX_SCREENWIDTH];
- +// e6y: resolution limitation is removed
- +static int *y_lookup = NULL;
- +// e6y: resolution limitation is removed
- +void R_InitMeltRes(void)
- +{
- + if (y_lookup) free(y_lookup);
- +
- + y_lookup = malloc(SCREENWIDTH * sizeof(*y_lookup));
- +}
- +
- static int wipe_initMelt(int ticks)
- {
- int i;
- Index: D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_bsp.h
- ===================================================================
- --- D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_bsp.h (revision 2849)
- +++ D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_bsp.h (revision 2850)
- @@ -50,7 +50,8 @@
- extern drawseg_t *drawsegs;
- extern unsigned maxdrawsegs;
- -extern byte solidcol[MAX_SCREENWIDTH];
- +// e6y: resolution limitation is removed
- +extern byte *solidcol;
- extern drawseg_t *ds_p;
- Index: D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_things.c
- ===================================================================
- --- D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_things.c (revision 2849)
- +++ D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_things.c (revision 2850)
- @@ -76,8 +76,9 @@
- // constant arrays
- // used for psprite clipping and initializing clipping
- -int negonearray[MAX_SCREENWIDTH]; // killough 2/8/98: // dropoff overflow
- -int screenheightarray[MAX_SCREENWIDTH]; // change to MAX_* // dropoff overflow
- +// e6y: resolution limitation is removed
- +int *negonearray; // killough 2/8/98: // dropoff overflow
- +int *screenheightarray; // change to MAX_* // dropoff overflow
- //
- // INITIALIZATION FUNCTIONS
- @@ -93,6 +94,17 @@
- static spriteframe_t sprtemp[MAX_SPRITE_FRAMES];
- static int maxframe;
- +void R_InitSpritesRes(void)
- +{
- + if (xtoviewangle) free(xtoviewangle);
- + if (negonearray) free(negonearray);
- + if (screenheightarray) free(screenheightarray);
- +
- + xtoviewangle = malloc((SCREENWIDTH + 1) * sizeof(*xtoviewangle));
- + negonearray = malloc(SCREENWIDTH * sizeof(*negonearray));
- + screenheightarray = malloc(SCREENWIDTH * sizeof(*screenheightarray));
- +}
- +
- //
- // R_InstallSpriteLump
- // Local function for R_InitSprites.
- @@ -280,7 +292,7 @@
- void R_InitSprites(const char * const *namelist)
- {
- int i;
- - for (i=0; i<MAX_SCREENWIDTH; i++) // killough 2/8/98
- + for (i=0; i<SCREENWIDTH; i++) // killough 2/8/98
- negonearray[i] = -1;
- R_InitSpriteDefs(namelist);
- }
- @@ -1010,14 +1022,20 @@
- static void R_DrawSprite (vissprite_t* spr)
- {
- drawseg_t *ds;
- - int clipbot[MAX_SCREENWIDTH]; // killough 2/8/98: // dropoff overflow
- - int cliptop[MAX_SCREENWIDTH]; // change to MAX_* // dropoff overflow
- + static int *clipbot = NULL; // killough 2/8/98: // dropoff overflow
- + static int *cliptop = NULL; // change to MAX_* // dropoff overflow
- int x;
- int r1;
- int r2;
- fixed_t scale;
- fixed_t lowscale;
- + if (!clipbot)
- + {
- + clipbot = malloc(SCREENWIDTH * sizeof(*clipbot));
- + cliptop = malloc(SCREENWIDTH * sizeof(*cliptop));
- + }
- +
- for (x = spr->x1 ; x<=spr->x2 ; x++)
- clipbot[x] = cliptop[x] = -2;
- Index: D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/f_wipe.h
- ===================================================================
- --- D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/f_wipe.h (revision 2849)
- +++ D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/f_wipe.h (revision 2850)
- @@ -34,6 +34,9 @@
- #ifndef __F_WIPE_H__
- #define __F_WIPE_H__
- +// e6y: resolution limitation is removed
- +void R_InitMeltRes(void);
- +
- /*
- * SCREEN WIPE PACKAGE
- */
- Index: D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_draw.c
- ===================================================================
- --- D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_draw.c (revision 2849)
- +++ D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_draw.c (revision 2850)
- @@ -87,9 +87,12 @@
- static int temp_x = 0;
- static int tempyl[4], tempyh[4];
- -static byte byte_tempbuf[MAX_SCREENHEIGHT * 4];
- -static unsigned short short_tempbuf[MAX_SCREENHEIGHT * 4];
- -static unsigned int int_tempbuf[MAX_SCREENHEIGHT * 4];
- +
- +// e6y: resolution limitation is removed
- +static byte *byte_tempbuf;
- +static unsigned short *short_tempbuf;
- +static unsigned int *int_tempbuf;
- +
- static int startx = 0;
- static int temptype = COL_NONE;
- static int commontop, commonbot;
- @@ -985,6 +988,21 @@
- R_GetDrawSpanFunc(drawvars.filterfloor, drawvars.filterz)(dsvars);
- }
- +void R_InitBuffersRes(void)
- +{
- + extern byte *solidcol;
- +
- + if (solidcol) free(solidcol);
- + if (byte_tempbuf) free(byte_tempbuf);
- + if (short_tempbuf) free(short_tempbuf);
- + if (int_tempbuf) free(int_tempbuf);
- +
- + solidcol = malloc(SCREENWIDTH * sizeof(*solidcol));
- + byte_tempbuf = malloc((SCREENHEIGHT * 4) * sizeof(*byte_tempbuf));
- + short_tempbuf = malloc((SCREENHEIGHT * 4) * sizeof(*short_tempbuf));
- + int_tempbuf = malloc((SCREENHEIGHT * 4) * sizeof(*int_tempbuf));
- +}
- +
- //
- // R_InitBuffer
- // Creats lookup tables that avoid
- Index: D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_things.h
- ===================================================================
- --- D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_things.h (revision 2849)
- +++ D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_things.h (revision 2850)
- @@ -42,8 +42,9 @@
- /* Constant arrays used for psprite clipping and initializing clipping. */
- -extern int negonearray[MAX_SCREENWIDTH]; /* killough 2/8/98: */ // dropoff overflow
- -extern int screenheightarray[MAX_SCREENWIDTH]; /* change to MAX_* */ // dropoff overflow
- +// e6y: resolution limitation is removed
- +extern int *negonearray; /* killough 2/8/98: */ // dropoff overflow
- +extern int *screenheightarray; /* change to MAX_* */ // dropoff overflow
- /* Vars for R_DrawMaskedColumn */
- @@ -71,6 +72,7 @@
- void R_SortVisSprites(void);
- void R_AddSprites(subsector_t* subsec, int lightlevel);
- void R_DrawPlayerSprites(void);
- +void R_InitSpritesRes(void);
- void R_InitSprites(const char * const * namelist);
- void R_ClearSprites(void);
- void R_DrawMasked(void);
- Index: D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_draw.h
- ===================================================================
- --- D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_draw.h (revision 2849)
- +++ D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_draw.h (revision 2850)
- @@ -152,6 +152,8 @@
- void R_InitBuffer(int width, int height);
- +void R_InitBuffersRes(void);
- +
- // Initialize color translation tables, for player rendering etc.
- void R_InitTranslationTables(void);
- Index: D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_segs.c
- ===================================================================
- --- D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_segs.c (revision 2849)
- +++ D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_segs.c (revision 2850)
- @@ -214,7 +214,7 @@
- int_64_t t = ((int_64_t) centeryfrac << FRACBITS) -
- (int_64_t) dcvars.texturemid * spryscale;
- if (t + (int_64_t) textureheight[texnum] * spryscale < 0 ||
- - t > (int_64_t) MAX_SCREENHEIGHT << FRACBITS*2)
- + t > (int_64_t) SCREENHEIGHT << FRACBITS*2)
- continue; // skip if the texture is out of screen's range
- sprtopscreen = (long)(t >> FRACBITS);
- }
- Index: D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_defs.h
- ===================================================================
- --- D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_defs.h (revision 2849)
- +++ D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_defs.h (revision 2850)
- @@ -425,11 +425,12 @@
- int picnum, lightlevel, minx, maxx;
- fixed_t height;
- fixed_t xoffs, yoffs; // killough 2/28/98: Support scrolling flats
- - unsigned int pad1; // leave pads for [minx-1]/[maxx+1]
- - unsigned int top[MAX_SCREENWIDTH];
- - unsigned int pad2, pad3; // killough 2/8/98, 4/25/98
- - unsigned int bottom[MAX_SCREENWIDTH];
- - unsigned int pad4; // dropoff overflow
- + // e6y: resolution limitation is removed
- + // bottom and top arrays are dynamically
- + // allocated immediately after the visplane
- + unsigned short *bottom;
- + unsigned short pad1; // leave pads for [minx-1]/[maxx+1]
- + unsigned short top[3];
- } visplane_t;
- #endif
- Index: D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_plane.c
- ===================================================================
- --- D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_plane.c (revision 2849)
- +++ D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_plane.c (revision 2850)
- @@ -80,11 +80,15 @@
- // floorclip starts out SCREENHEIGHT
- // ceilingclip starts out -1
- -int floorclip[MAX_SCREENWIDTH], ceilingclip[MAX_SCREENWIDTH]; // dropoff overflow
- +// dropoff overflow
- +// e6y: resolution limitation is removed
- +int *floorclip = NULL;
- +int *ceilingclip = NULL;
- // spanstart holds the start of a plane span; initialized to 0 at start
- -static int spanstart[MAX_SCREENHEIGHT]; // killough 2/8/98
- +// e6y: resolution limitation is removed
- +static int *spanstart = NULL; // killough 2/8/98
- //
- // texture mapping
- @@ -96,14 +100,43 @@
- // killough 2/8/98: make variables static
- static fixed_t basexscale, baseyscale;
- -static fixed_t cachedheight[MAX_SCREENHEIGHT];
- -static fixed_t cacheddistance[MAX_SCREENHEIGHT];
- -static fixed_t cachedxstep[MAX_SCREENHEIGHT];
- -static fixed_t cachedystep[MAX_SCREENHEIGHT];
- +static fixed_t *cachedheight = NULL;
- +static fixed_t *cacheddistance = NULL;
- +static fixed_t *cachedxstep = NULL;
- +static fixed_t *cachedystep = NULL;
- static fixed_t xoffs,yoffs; // killough 2/28/98: flat offsets
- -fixed_t yslope[MAX_SCREENHEIGHT], distscale[MAX_SCREENWIDTH];
- +// e6y: resolution limitation is removed
- +fixed_t *yslope = NULL;
- +fixed_t *distscale = NULL;
- +void R_InitPlanesRes(void)
- +{
- + if (floorclip) free(floorclip);
- + if (ceilingclip) free(ceilingclip);
- + if (spanstart) free(spanstart);
- +
- + if (cachedheight) free(cachedheight);
- + if (cacheddistance) free(cacheddistance);
- + if (cachedxstep) free(cachedxstep);
- + if (cachedystep) free(cachedystep);
- +
- + if (yslope) free(yslope);
- + if (distscale) free(distscale);
- +
- + floorclip = malloc(SCREENWIDTH * sizeof(*floorclip));
- + ceilingclip = malloc(SCREENWIDTH * sizeof(*ceilingclip));
- + spanstart = malloc(SCREENHEIGHT * sizeof(*spanstart));
- +
- + cachedheight = malloc(SCREENHEIGHT * sizeof(*cachedheight));
- + cacheddistance = malloc(SCREENHEIGHT * sizeof(*cacheddistance));
- + cachedxstep = malloc(SCREENHEIGHT * sizeof(*cachedxstep));
- + cachedystep = malloc(SCREENHEIGHT * sizeof(*cachedystep));
- +
- + yslope = malloc(SCREENHEIGHT * sizeof(*yslope));
- + distscale = malloc(SCREENWIDTH * sizeof(*distscale));
- +}
- +
- //
- // R_InitPlanes
- // Only at game startup.
- @@ -220,7 +253,11 @@
- {
- visplane_t *check = freetail;
- if (!check)
- - check = calloc(1, sizeof *check);
- + {
- + // e6y: resolution limitation is removed
- + check = calloc(1, sizeof(*check) + sizeof(*check->top) * (SCREENWIDTH * 2 + sizeof(*check->bottom) * 4));
- + check->bottom = &check->top[SCREENWIDTH + sizeof(*check->bottom)];
- + }
- else
- if (!(freetail = freetail->next))
- freehead = &freetail;
- @@ -246,7 +283,7 @@
- new_pl->yoffs = pl->yoffs;
- new_pl->minx = start;
- new_pl->maxx = stop;
- - memset(new_pl->top, 0xff, sizeof new_pl->top);
- + memset(new_pl->top, 0xff, sizeof(*new_pl->top) * SCREENWIDTH);
- return new_pl;
- }
- //
- @@ -284,7 +321,7 @@
- check->xoffs = xoffs; // killough 2/28/98: Save offsets
- check->yoffs = yoffs;
- - memset (check->top, 0xff, sizeof check->top);
- + memset (check->top, 0xff, sizeof(*check->top) * SCREENWIDTH);
- return check;
- }
- @@ -442,7 +479,7 @@
- stop = pl->maxx + 1;
- planezlight = zlight[light];
- - pl->top[pl->minx-1] = pl->top[stop] = 0xffffffffu; // dropoff overflow
- + pl->top[pl->minx-1] = pl->top[stop] = 0xffffu; // dropoff overflow
- for (x = pl->minx ; x <= stop ; x++)
- R_MakeSpans(x,pl->top[x-1],pl->bottom[x-1],
- Index: D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_plane.h
- ===================================================================
- --- D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_plane.h (revision 2849)
- +++ D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/r_plane.h (revision 2850)
- @@ -46,9 +46,11 @@
- /* Visplane related. */
- extern int *lastopening; // dropoff overflow
- -extern int floorclip[], ceilingclip[]; // dropoff overflow
- -extern fixed_t yslope[], distscale[];
- +// e6y: resolution limitation is removed
- +extern int *floorclip, *ceilingclip; // dropoff overflow
- +extern fixed_t *yslope, *distscale;
- +void R_InitPlanesRes(void);
- void R_InitPlanes(void);
- void R_ClearPlanes(void);
- void R_DrawPlanes (void);
- Index: D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/m_misc.c
- ===================================================================
- --- D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/m_misc.c (revision 2849)
- +++ D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/m_misc.c (revision 2850)
- @@ -354,9 +354,9 @@
- {"videomode",{NULL, &default_videomode},{0,"8"},UL,UL,def_str,ss_none},
- #endif
- /* 640x480 default resolution */
- - {"screen_width",{&desired_screenwidth},{640}, 320, MAX_SCREENWIDTH,
- + {"screen_width",{&desired_screenwidth},{640}, 320, UL,
- def_int,ss_none},
- - {"screen_height",{&desired_screenheight},{480},200,MAX_SCREENHEIGHT,
- + {"screen_height",{&desired_screenheight},{480},200,UL,
- def_int,ss_none},
- {"use_fullscreen",{&use_fullscreen},{1},0,1, /* proff 21/05/2000 */
- def_bool,ss_none},
- Index: D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/d_main.c
- ===================================================================
- --- D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/d_main.c (revision 2849)
- +++ D:/andre/prg/doom/prboom-plus/branches/prboom-plus-24/src/d_main.c (revision 2850)
- @@ -1441,70 +1441,9 @@
- G_ReloadDefaults(); // killough 3/4/98: set defaults just loaded.
- // jff 3/24/98 this sets startskill if it was -1
- - // Video stuff
- - if ((p = M_CheckParm("-width")))
- - if (myargv[p+1])
- - desired_screenwidth = atoi(myargv[p+1]);
- + // Calculate the screen resolution and init all buffers
- + I_InitScreenResolution();
- - if ((p = M_CheckParm("-height")))
- - if (myargv[p+1])
- - desired_screenheight = atoi(myargv[p+1]);
- -
- - if ((p = M_CheckParm("-fullscreen")))
- - use_fullscreen = 1;
- -
- - if ((p = M_CheckParm("-nofullscreen")))
- - use_fullscreen = 0;
- -
- - // e6y
- - // New command-line options for setting a window (-window)
- - // or fullscreen (-nowindow) mode temporarily which is not saved in cfg.
- - // It works like "-geom" switch
- - desired_fullscreen = use_fullscreen;
- - if ((p = M_CheckParm("-window")))
- - desired_fullscreen = 0;
- -
- - if ((p = M_CheckParm("-nowindow")))
- - desired_fullscreen = 1;
- -
- - // e6y
- - // change the screen size for the current session only
- - // syntax: -geom WidthxHeight[w|f]
- - // examples: -geom 320x200f, -geom 640x480w, -geom 1024x768
- - {
- - int w, h;
- - char c;
- -
- - w = desired_screenwidth;
- - h = desired_screenheight;
- -
- - if (!(p = M_CheckParm("-geom")))
- - p = M_CheckParm("-geometry");
- -
- - if (p && p + 1 < myargc)
- - {
- - int count = sscanf(myargv[p+1], "%dx%d%c", &w, &h, &c);
- -
- - // at least width and height must be specified
- - // restoring original values if not
- - if (count < 2)
- - {
- - w = desired_screenwidth;
- - h = desired_screenheight;
- - }
- -
- - if (count >= 3)
- - {
- - if (tolower(c) == 'w')
- - desired_fullscreen = 0;
- - if (tolower(c) == 'f')
- - desired_fullscreen = 1;
- - }
- - }
- -
- - I_CalculateRes(w, h);
- - }
- -
- #ifdef GL_DOOM
- // proff 04/05/2000: for GL-specific switches
- gld_InitCommandLine();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement