示例#1
0
// Called at new frame, if the video mode has changed
//
void SCR_Recalc(void)
{
	if (dedicated)
		return;

	// bytes per pixel quick access
	scr_bpp = vid.bpp;

	// scale 1,2,3 times in x and y the patches for the menus and overlays...
	// calculated once and for all, used by routines in v_video.c
	vid.dupx = vid.width / BASEVIDWIDTH;
	vid.dupy = vid.height / BASEVIDHEIGHT;
	vid.fdupx = (float)vid.width / BASEVIDWIDTH;
	vid.fdupy = (float)vid.height / BASEVIDHEIGHT;
	vid.baseratio = FixedDiv(vid.height << FRACBITS, BASEVIDHEIGHT << FRACBITS);

	// patch the asm code depending on vid buffer rowbytes
#ifdef RUSEASM
	if (R_ASM)
		ASM_PatchRowBytes(vid.rowbytes);
//	if (R_486 || R_586 || R_MMX)
//		MMX_PatchRowBytes(vid.rowbytes);
#endif

	// toggle off automap because some screensize-dependent values will
	// be calculated next time the automap is activated.
	if (automapactive)
		AM_Stop();

	// r_plane stuff: visplanes, openings, floorclip, ceilingclip, spanstart,
	//                spanstop, yslope, distscale, cachedheight, cacheddistance,
	//                cachedxstep, cachedystep
	//             -> allocated at the maximum vidsize, static.

	// r_main: xtoviewangle, allocated at the maximum size.
	// r_things: negonearray, screenheightarray allocated max. size.

	// set the screen[x] ptrs on the new vidbuffers
	V_Init();

	// scr_viewsize doesn't change, neither detailLevel, but the pixels
	// per screenblock is different now, since we've changed resolution.
	R_SetViewSize(); //just set setsizeneeded true now ..

	// vid.recalc lasts only for the next refresh...
	con_recalc = true;
	am_recalc = true;
}
示例#2
0
static boolean SCScreenSize(int option)
{
    if (option == RIGHT_DIR)
    {
        if (screenblocks < 11)
        {
            screenblocks++;
        }
    }
    else if (screenblocks > 3)
    {
        screenblocks--;
    }
    R_SetViewSize(screenblocks, detailLevel);
    return true;
}
示例#3
0
//
// IN_StartCamera
//
// Set up the intermissions camera
//
void IN_StartCamera(void)
{
    int i;

    if(!camerathings.isEmpty())
    {
        realbackdrop = 1;

        // pick a camera at random
        wi_camera = camerathings.getRandom(pr_misc);

        // remove the player mobjs (look silly in camera view)
        for(i = 0; i < MAXPLAYERS; ++i)
        {
            if(!playeringame[i])
                continue;
            // this is strange. the monsters can still see the player Mobj, (and
            // even kill it!) even tho it has been removed from the level. I make
            // it unshootable first so they lose interest.
            players[i].mo->flags &= ~MF_SHOOTABLE;
            players[i].mo->removeThinker();
        }

        intercam.x = wi_camera->x;
        intercam.y = wi_camera->y;
        intercam.angle = wi_camera->angle;
        intercam.pitch = 0;

        {
            // haleyjd: camera deep water HOM bug fix
            subsector_t *subsec =
                R_PointInSubsector(intercam.x, intercam.y);

            intercam.z = subsec->sector->floorheight + 41*FRACUNIT;
            intercam.heightsec = subsec->sector->heightsec;
        }
        // FIXME: does this bite the player's setting for the next map?
        R_SetViewSize(11);     // force fullscreen
    }
    else            // no camera, boring interpic
    {
        realbackdrop = 0;
        wi_camera = NULL;
        S_StopAllSequences(); // haleyjd 06/06/06
        S_StopLoopedSounds(); // haleyjd 10/06/06
    }
}
示例#4
0
void R_Init (void)
{
  // CPhipps - R_DrawColumn isn't constant anymore, so must
  //  initialise in code
  colfunc = R_DrawColumn;     // current column draw function
  if (SCREENWIDTH<320)
    I_Error("R_Init: Screenwidth(%d) < 320",SCREENWIDTH);
  lprintf(LO_INFO, "\nR_LoadTrigTables: ");
  R_LoadTrigTables();
  lprintf(LO_INFO, "\nR_InitData: ");
  R_InitData();
  R_SetViewSize(screenblocks);
  lprintf(LO_INFO, "\nR_Init: R_InitPlanes ");
  R_InitPlanes();
  lprintf(LO_INFO, "R_InitLightTables ");
  R_InitLightTables();
  lprintf(LO_INFO, "R_InitSkyMap ");
  R_InitSkyMap();
  lprintf(LO_INFO, "R_InitTranslationsTables ");
  R_InitTranslationTables();
}
示例#5
0
void R_Init (void)
{
    // CPhipps - R_DrawColumn isn't constant anymore, so must
    //  initialise in code
    // current column draw function
    lprintf(LO_INFO, "\nR_LoadTrigTables: ");
    R_LoadTrigTables();
    lprintf(LO_INFO, "\nR_InitData: ");
    R_InitData();
    R_SetViewSize(screenblocks);
    lprintf(LO_INFO, "\nR_Init: R_InitPlanes ");
    R_InitPlanes();
    lprintf(LO_INFO, "R_InitLightTables ");
    R_InitLightTables();
    lprintf(LO_INFO, "R_InitSkyMap ");
    R_InitSkyMap();
    lprintf(LO_INFO, "R_InitTranslationsTables ");
    R_InitTranslationTables();
    lprintf(LO_INFO, "R_InitPatches ");
    R_InitPatches();
}
示例#6
0
int CCmdViewSize(int argc, char **argv)
{
	int     min = 3, max = 11, *val = &screenblocks;

	if(argc != 2)
	{
		Con_Printf("Usage: %s (size)\n", argv[0]);
		Con_Printf("Size can be: +, -, (num).\n");
		return true;
	}
	if(!stricmp(argv[0], "sbsize"))
	{
		min = 1;
		max = 20;
		val = &cfg.sbarscale;
	}
	if(!stricmp(argv[1], "+"))
	{
		(*val)++;
		S_LocalSound(sfx_stnmov, NULL);
	}
	else if(!stricmp(argv[1], "-"))
	{
		(*val)--;
		S_LocalSound(sfx_stnmov, NULL);
	}
	else
		*val = strtol(argv[1], NULL, 0);

	if(*val < min)
		*val = min;
	if(*val > max)
		*val = max;

	// Update the view size if necessary.
	R_SetViewSize(screenblocks, 0);
	return true;
}
void M_SizeDisplay(int choice)
{
	switch(choice)
	{
	case 0:
		if (::g->screenSize > 7)
		{
			::g->screenblocks--;
			::g->screenSize--;
		}
		break;
	case 1:
		if (::g->screenSize < 8)
		{
			::g->screenblocks++;
			::g->screenSize++;
		}
		break;
	}


	R_SetViewSize (::g->screenblocks, ::g->detailLevel);
}
示例#8
0
void R_Init (void)
{
  // CPhipps - R_DrawColumn isn't constant anymore, so must 
  //  initialise in code
  colfunc = R_DrawColumn;     // current column draw function
  if (SCREENWIDTH<320) I_Error("Screenwidth(%d) < 320)",SCREENWIDTH);
#if defined TABLES_AS_LUMPS && defined NO_PREDEFINED_LUMPS
  lprintf(LO_INFO, "\nR_LoadTrigTables: ");
  R_LoadTrigTables();
#endif
  lprintf(LO_INFO, "\nR_InitData: ");
  R_InitData();
  R_InitStatusBar();
  R_SetViewSize(screenblocks);
  lprintf(LO_INFO, "\nR_Init: R_InitPlanes ");
  R_InitPlanes();
  lprintf(LO_INFO, "R_InitLightTables ");
  R_InitLightTables();
  lprintf(LO_INFO, "R_InitSkyMap ");
  R_InitSkyMap();
  lprintf(LO_INFO, "R_InitTranslationsTables ");
  R_InitTranslationTables();
}
示例#9
0
文件: screen.c 项目: TehRealSalt/SRB2
// Called at new frame, if the video mode has changed
//
void SCR_Recalc(void)
{
	if (dedicated)
		return;

	// bytes per pixel quick access
	scr_bpp = vid.bpp;

	// scale 1,2,3 times in x and y the patches for the menus and overlays...
	// calculated once and for all, used by routines in v_video.c
	vid.dupx = vid.width / BASEVIDWIDTH;
	vid.dupy = vid.height / BASEVIDHEIGHT;
	vid.dupx = vid.dupy = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy);
	vid.fdupx = FixedDiv(vid.width*FRACUNIT, BASEVIDWIDTH*FRACUNIT);
	vid.fdupy = FixedDiv(vid.height*FRACUNIT, BASEVIDHEIGHT*FRACUNIT);

#ifdef HWRENDER
	//if (rendermode != render_opengl && rendermode != render_none) // This was just placing it incorrectly at non aspect correct resolutions in opengl
	// 13/11/18:
	// The above is no longer necessary, since we want OpenGL to be just like software now
	// -- Monster Iestyn
#endif
		vid.fdupx = vid.fdupy = (vid.fdupx < vid.fdupy ? vid.fdupx : vid.fdupy);

	//vid.baseratio = FixedDiv(vid.height << FRACBITS, BASEVIDHEIGHT << FRACBITS);
	vid.baseratio = FRACUNIT;

	vid.meddupx = (UINT8)(vid.dupx >> 1) + 1;
	vid.meddupy = (UINT8)(vid.dupy >> 1) + 1;
#ifdef HWRENDER
	vid.fmeddupx = vid.meddupx*FRACUNIT;
	vid.fmeddupy = vid.meddupy*FRACUNIT;
#endif

	vid.smalldupx = (UINT8)(vid.dupx / 3) + 1;
	vid.smalldupy = (UINT8)(vid.dupy / 3) + 1;
#ifdef HWRENDER
	vid.fsmalldupx = vid.smalldupx*FRACUNIT;
	vid.fsmalldupy = vid.smalldupy*FRACUNIT;
#endif

	// toggle off automap because some screensize-dependent values will
	// be calculated next time the automap is activated.
	if (automapactive)
		AM_Stop();

	// r_plane stuff: visplanes, openings, floorclip, ceilingclip, spanstart,
	//                spanstop, yslope, distscale, cachedheight, cacheddistance,
	//                cachedxstep, cachedystep
	//             -> allocated at the maximum vidsize, static.

	// r_main: xtoviewangle, allocated at the maximum size.
	// r_things: negonearray, screenheightarray allocated max. size.

	// set the screen[x] ptrs on the new vidbuffers
	V_Init();

	// scr_viewsize doesn't change, neither detailLevel, but the pixels
	// per screenblock is different now, since we've changed resolution.
	R_SetViewSize(); //just set setsizeneeded true now ..

	// vid.recalc lasts only for the next refresh...
	con_recalc = true;
	am_recalc = true;
}