2011-07-07 15:37:47 +00:00
|
|
|
// Emacs style mode select -*- C++ -*-
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// $Id:$
|
|
|
|
//
|
|
|
|
// Copyright (C) 1993-1996 by id Software, Inc.
|
|
|
|
//
|
|
|
|
// This source is available for distribution and/or modification
|
|
|
|
// only under the terms of the DOOM Source Code License as
|
|
|
|
// published by id Software. All rights reserved.
|
|
|
|
//
|
|
|
|
// The source is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
// $Log:$
|
|
|
|
//
|
|
|
|
// DESCRIPTION:
|
|
|
|
// Rendering main loop and setup functions,
|
|
|
|
// utility functions (BSP, geometry, trigonometry).
|
|
|
|
// See tables.c, too.
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// HEADER FILES ------------------------------------------------------------
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
#include "templates.h"
|
|
|
|
#include "doomdef.h"
|
|
|
|
#include "d_net.h"
|
|
|
|
#include "doomstat.h"
|
|
|
|
#include "m_random.h"
|
|
|
|
#include "m_bbox.h"
|
|
|
|
#include "r_sky.h"
|
|
|
|
#include "st_stuff.h"
|
|
|
|
#include "c_cvars.h"
|
|
|
|
#include "c_dispatch.h"
|
|
|
|
#include "v_video.h"
|
|
|
|
#include "stats.h"
|
|
|
|
#include "i_video.h"
|
|
|
|
#include "i_system.h"
|
|
|
|
#include "a_sharedglobal.h"
|
|
|
|
#include "r_data/r_translate.h"
|
|
|
|
#include "p_3dmidtex.h"
|
|
|
|
#include "r_data/r_interpolate.h"
|
|
|
|
#include "v_palette.h"
|
|
|
|
#include "po_man.h"
|
|
|
|
#include "p_effect.h"
|
|
|
|
#include "st_start.h"
|
|
|
|
#include "v_font.h"
|
|
|
|
#include "r_renderer.h"
|
|
|
|
#include "r_data/colormaps.h"
|
|
|
|
#include "farchive.h"
|
2016-02-15 01:14:34 +00:00
|
|
|
#include "r_utility.h"
|
|
|
|
#include "d_player.h"
|
2016-02-19 13:08:41 +00:00
|
|
|
#include "p_local.h"
|
2011-07-07 15:37:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
// EXTERNAL DATA DECLARATIONS ----------------------------------------------
|
|
|
|
|
|
|
|
extern bool DrawFSHUD; // [RH] Defined in d_main.cpp
|
|
|
|
EXTERN_CVAR (Bool, cl_capfps)
|
|
|
|
|
|
|
|
// TYPES -------------------------------------------------------------------
|
|
|
|
|
|
|
|
struct InterpolationViewer
|
|
|
|
{
|
|
|
|
AActor *ViewActor;
|
|
|
|
int otic;
|
|
|
|
fixed_t oviewx, oviewy, oviewz;
|
|
|
|
fixed_t nviewx, nviewy, nviewz;
|
|
|
|
int oviewpitch, nviewpitch;
|
|
|
|
angle_t oviewangle, nviewangle;
|
|
|
|
};
|
|
|
|
|
|
|
|
// PRIVATE DATA DECLARATIONS -----------------------------------------------
|
|
|
|
static TArray<InterpolationViewer> PastViewers;
|
|
|
|
static FRandom pr_torchflicker ("TorchFlicker");
|
|
|
|
static FRandom pr_hom;
|
|
|
|
static bool NoInterpolateView;
|
2016-02-27 17:06:24 +00:00
|
|
|
static TArray<fixedvec3a> InterpolationPath;
|
2011-07-07 15:37:47 +00:00
|
|
|
|
|
|
|
// PUBLIC DATA DEFINITIONS -------------------------------------------------
|
|
|
|
|
|
|
|
CVAR (Bool, r_deathcamera, false, CVAR_ARCHIVE)
|
|
|
|
CVAR (Int, r_clearbuffer, 0, 0)
|
2011-07-07 19:53:42 +00:00
|
|
|
CVAR (Bool, r_drawvoxels, true, 0)
|
|
|
|
CVAR (Bool, r_drawplayersprites, true, 0) // [RH] Draw player sprites?
|
2013-11-29 12:24:38 +00:00
|
|
|
CUSTOM_CVAR(Float, r_quakeintensity, 1.0f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
|
|
|
{
|
|
|
|
if (self < 0.f) self = 0.f;
|
|
|
|
else if (self > 1.f) self = 1.f;
|
|
|
|
}
|
2011-07-07 15:37:47 +00:00
|
|
|
|
|
|
|
DCanvas *RenderTarget; // [RH] canvas to render to
|
|
|
|
|
2011-07-07 19:53:42 +00:00
|
|
|
int viewwindowx;
|
|
|
|
int viewwindowy;
|
|
|
|
|
2011-07-07 15:37:47 +00:00
|
|
|
fixed_t viewx;
|
|
|
|
fixed_t viewy;
|
|
|
|
fixed_t viewz;
|
|
|
|
int viewpitch;
|
2011-07-07 19:53:42 +00:00
|
|
|
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
int viewwidth;
|
|
|
|
int viewheight;
|
|
|
|
int centerx;
|
|
|
|
int centery;
|
|
|
|
int centerxwide;
|
|
|
|
}
|
|
|
|
|
2011-07-07 15:37:47 +00:00
|
|
|
int otic;
|
|
|
|
|
|
|
|
angle_t viewangle;
|
|
|
|
sector_t *viewsector;
|
|
|
|
|
|
|
|
fixed_t viewcos, viewtancos;
|
|
|
|
fixed_t viewsin, viewtansin;
|
|
|
|
|
|
|
|
AActor *camera; // [RH] camera to draw from. doesn't have to be a player
|
|
|
|
|
|
|
|
fixed_t r_TicFrac; // [RH] Fractional tic to render
|
|
|
|
DWORD r_FrameTime; // [RH] Time this frame started drawing (in ms)
|
|
|
|
bool r_NoInterpolate;
|
|
|
|
bool r_showviewer;
|
|
|
|
|
|
|
|
angle_t LocalViewAngle;
|
|
|
|
int LocalViewPitch;
|
|
|
|
bool LocalKeyboardTurner;
|
|
|
|
|
|
|
|
float LastFOV;
|
|
|
|
int WidescreenRatio;
|
|
|
|
int setblocks;
|
|
|
|
int extralight;
|
2011-07-07 19:53:42 +00:00
|
|
|
bool setsizeneeded;
|
|
|
|
fixed_t FocalTangent;
|
2011-07-07 15:37:47 +00:00
|
|
|
|
|
|
|
unsigned int R_OldBlend = ~0;
|
2011-07-07 19:53:42 +00:00
|
|
|
int validcount = 1; // increment every time a check is made
|
|
|
|
int FieldOfView = 2048; // Fineangles in the SCREENWIDTH wide window
|
|
|
|
|
|
|
|
FCanvasTextureInfo *FCanvasTextureInfo::List;
|
2011-07-07 15:37:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
// CODE --------------------------------------------------------------------
|
|
|
|
static void R_Shutdown ();
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// SlopeDiv
|
|
|
|
//
|
|
|
|
// Utility function, called by R_PointToAngle.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
angle_t SlopeDiv (unsigned int num, unsigned den)
|
|
|
|
{
|
|
|
|
unsigned int ans;
|
|
|
|
|
|
|
|
if (den < 512)
|
|
|
|
return (ANG45 - 1); //tantoangle[SLOPERANGE]
|
|
|
|
|
|
|
|
ans = (num << 3) / (den >> 8);
|
|
|
|
|
|
|
|
return ans <= SLOPERANGE ? tantoangle[ans] : (ANG45 - 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// R_PointToAngle
|
|
|
|
//
|
|
|
|
// To get a global angle from cartesian coordinates, the coordinates are
|
|
|
|
// flipped until they are in the first octant of the coordinate system,
|
|
|
|
// then the y (<=x) is scaled and divided by x to get a tangent (slope)
|
|
|
|
// value which is looked up in the tantoangle[] table.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
angle_t R_PointToAngle2 (fixed_t x1, fixed_t y1, fixed_t x, fixed_t y)
|
|
|
|
{
|
|
|
|
x -= x1;
|
|
|
|
y -= y1;
|
|
|
|
|
|
|
|
if ((x | y) == 0)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// We need to be aware of overflows here. If the values get larger than INT_MAX/4
|
|
|
|
// this code won't work anymore.
|
|
|
|
|
|
|
|
if (x < INT_MAX/4 && x > -INT_MAX/4 && y < INT_MAX/4 && y > -INT_MAX/4)
|
|
|
|
{
|
|
|
|
if (x >= 0)
|
|
|
|
{
|
|
|
|
if (y >= 0)
|
|
|
|
{
|
|
|
|
if (x > y)
|
|
|
|
{ // octant 0
|
|
|
|
return SlopeDiv(y, x);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ // octant 1
|
|
|
|
return ANG90 - 1 - SlopeDiv(x, y);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else // y < 0
|
|
|
|
{
|
|
|
|
y = -y;
|
|
|
|
if (x > y)
|
|
|
|
{ // octant 8
|
|
|
|
return 0 - SlopeDiv(y, x);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ // octant 7
|
|
|
|
return ANG270 + SlopeDiv(x, y);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else // x < 0
|
|
|
|
{
|
|
|
|
x = -x;
|
|
|
|
if (y >= 0)
|
|
|
|
{
|
|
|
|
if (x > y)
|
|
|
|
{ // octant 3
|
|
|
|
return ANG180 - 1 - SlopeDiv(y, x);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ // octant 2
|
|
|
|
return ANG90 + SlopeDiv(x, y);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else // y < 0
|
|
|
|
{
|
|
|
|
y = -y;
|
|
|
|
if (x > y)
|
|
|
|
{ // octant 4
|
|
|
|
return ANG180 + SlopeDiv(y, x);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ // octant 5
|
|
|
|
return ANG270 - 1 - SlopeDiv(x, y);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// we have to use the slower but more precise floating point atan2 function here.
|
|
|
|
return xs_RoundToUInt(atan2(double(y), double(x)) * (ANGLE_180/M_PI));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// R_InitPointToAngle
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void R_InitPointToAngle (void)
|
|
|
|
{
|
|
|
|
double f;
|
|
|
|
int i;
|
|
|
|
//
|
|
|
|
// slope (tangent) to angle lookup
|
|
|
|
//
|
|
|
|
for (i = 0; i <= SLOPERANGE; i++)
|
|
|
|
{
|
|
|
|
f = atan2 ((double)i, (double)SLOPERANGE) / (6.28318530718 /* 2*pi */);
|
|
|
|
tantoangle[i] = (angle_t)(0xffffffff*f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// R_PointToDist2
|
|
|
|
//
|
|
|
|
// Returns the distance from (0,0) to some other point. In a
|
|
|
|
// floating point environment, we'd probably be better off using the
|
|
|
|
// Pythagorean Theorem to determine the result.
|
|
|
|
//
|
|
|
|
// killough 5/2/98: simplified
|
|
|
|
// [RH] Simplified further [sin (t + 90 deg) == cos (t)]
|
|
|
|
// Not used. Should it go away?
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
fixed_t R_PointToDist2 (fixed_t dx, fixed_t dy)
|
|
|
|
{
|
|
|
|
dx = abs (dx);
|
|
|
|
dy = abs (dy);
|
|
|
|
|
|
|
|
if ((dx | dy) == 0)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dy > dx)
|
|
|
|
{
|
|
|
|
swapvalues (dx, dy);
|
|
|
|
}
|
|
|
|
|
|
|
|
return FixedDiv (dx, finecosine[tantoangle[FixedDiv (dy, dx) >> DBITS] >> ANGLETOFINESHIFT]);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// R_InitTables
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void R_InitTables (void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
const double pimul = PI*2/FINEANGLES;
|
|
|
|
|
|
|
|
// viewangle tangent table
|
|
|
|
finetangent[0] = (fixed_t)(FRACUNIT*tan ((0.5-FINEANGLES/4)*pimul)+0.5);
|
|
|
|
for (i = 1; i < FINEANGLES/2; i++)
|
|
|
|
{
|
|
|
|
finetangent[i] = (fixed_t)(FRACUNIT*tan ((i-FINEANGLES/4)*pimul)+0.5);
|
|
|
|
}
|
|
|
|
|
|
|
|
// finesine table
|
|
|
|
for (i = 0; i < FINEANGLES/4; i++)
|
|
|
|
{
|
|
|
|
finesine[i] = (fixed_t)(FRACUNIT * sin (i*pimul));
|
|
|
|
}
|
|
|
|
for (i = 0; i < FINEANGLES/4; i++)
|
|
|
|
{
|
|
|
|
finesine[i+FINEANGLES/4] = finesine[FINEANGLES/4-1-i];
|
|
|
|
}
|
|
|
|
for (i = 0; i < FINEANGLES/2; i++)
|
|
|
|
{
|
|
|
|
finesine[i+FINEANGLES/2] = -finesine[i];
|
|
|
|
}
|
|
|
|
finesine[FINEANGLES/4] = FRACUNIT;
|
|
|
|
finesine[FINEANGLES*3/4] = -FRACUNIT;
|
|
|
|
memcpy (&finesine[FINEANGLES], &finesine[0], sizeof(angle_t)*FINEANGLES/4);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// R_SetFOV
|
|
|
|
//
|
|
|
|
// Changes the field of view in degrees
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void R_SetFOV (float fov)
|
|
|
|
{
|
|
|
|
if (fov < 5.f)
|
|
|
|
fov = 5.f;
|
|
|
|
else if (fov > 170.f)
|
|
|
|
fov = 170.f;
|
|
|
|
if (fov != LastFOV)
|
|
|
|
{
|
|
|
|
LastFOV = fov;
|
|
|
|
FieldOfView = (int)(fov * (float)FINEANGLES / 360.f);
|
|
|
|
setsizeneeded = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// R_GetFOV
|
|
|
|
//
|
|
|
|
// Returns the current field of view in degrees
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
float R_GetFOV ()
|
|
|
|
{
|
|
|
|
return LastFOV;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// R_SetViewSize
|
|
|
|
//
|
|
|
|
// Do not really change anything here, because it might be in the middle
|
|
|
|
// of a refresh. The change will take effect next refresh.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void R_SetViewSize (int blocks)
|
|
|
|
{
|
|
|
|
setsizeneeded = true;
|
|
|
|
setblocks = blocks;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// R_SetWindow
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void R_SetWindow (int windowSize, int fullWidth, int fullHeight, int stHeight)
|
|
|
|
{
|
|
|
|
int trueratio;
|
|
|
|
|
|
|
|
if (windowSize >= 11)
|
|
|
|
{
|
|
|
|
viewwidth = fullWidth;
|
|
|
|
freelookviewheight = viewheight = fullHeight;
|
|
|
|
}
|
|
|
|
else if (windowSize == 10)
|
|
|
|
{
|
|
|
|
viewwidth = fullWidth;
|
|
|
|
viewheight = stHeight;
|
|
|
|
freelookviewheight = fullHeight;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
viewwidth = ((setblocks*fullWidth)/10) & (~15);
|
|
|
|
viewheight = ((setblocks*stHeight)/10)&~7;
|
|
|
|
freelookviewheight = ((setblocks*fullHeight)/10)&~7;
|
|
|
|
}
|
|
|
|
|
|
|
|
// If the screen is approximately 16:9 or 16:10, consider it widescreen.
|
|
|
|
WidescreenRatio = CheckRatio (fullWidth, fullHeight, &trueratio);
|
|
|
|
|
|
|
|
DrawFSHUD = (windowSize == 11);
|
|
|
|
|
|
|
|
// [RH] Sky height fix for screens not 200 (or 240) pixels tall
|
|
|
|
R_InitSkyMap ();
|
2011-07-07 19:53:42 +00:00
|
|
|
|
|
|
|
centery = viewheight/2;
|
|
|
|
centerx = viewwidth/2;
|
|
|
|
if (WidescreenRatio & 4)
|
|
|
|
{
|
|
|
|
centerxwide = centerx;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
centerxwide = centerx * BaseRatioSizes[WidescreenRatio][3] / 48;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int fov = FieldOfView;
|
|
|
|
|
|
|
|
// For widescreen displays, increase the FOV so that the middle part of the
|
|
|
|
// screen that would be visible on a 4:3 display has the requested FOV.
|
|
|
|
if (centerxwide != centerx)
|
|
|
|
{ // centerxwide is what centerx would be if the display was not widescreen
|
|
|
|
fov = int(atan(double(centerx)*tan(double(fov)*M_PI/(FINEANGLES))/double(centerxwide))*(FINEANGLES)/M_PI);
|
|
|
|
if (fov > 170*FINEANGLES/360)
|
|
|
|
fov = 170*FINEANGLES/360;
|
|
|
|
}
|
|
|
|
|
|
|
|
FocalTangent = finetangent[FINEANGLES/4+fov/2];
|
2011-07-07 15:37:47 +00:00
|
|
|
Renderer->SetWindow(windowSize, fullWidth, fullHeight, stHeight, trueratio);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// R_ExecuteSetViewSize
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void R_ExecuteSetViewSize ()
|
|
|
|
{
|
|
|
|
setsizeneeded = false;
|
2013-02-27 03:10:25 +00:00
|
|
|
V_SetBorderNeedRefresh();
|
2011-07-07 15:37:47 +00:00
|
|
|
|
|
|
|
R_SetWindow (setblocks, SCREENWIDTH, SCREENHEIGHT, ST_Y);
|
|
|
|
|
|
|
|
// Handle resize, e.g. smaller view windows with border and/or status bar.
|
|
|
|
viewwindowx = (screen->GetWidth() - viewwidth) >> 1;
|
|
|
|
|
|
|
|
// Same with base row offset.
|
|
|
|
viewwindowy = (viewwidth == screen->GetWidth()) ? 0 : (ST_Y - viewheight) >> 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// CVAR screenblocks
|
|
|
|
//
|
|
|
|
// Selects the size of the visible window
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
CUSTOM_CVAR (Int, screenblocks, 10, CVAR_ARCHIVE)
|
|
|
|
{
|
|
|
|
if (self > 12)
|
|
|
|
self = 12;
|
|
|
|
else if (self < 3)
|
|
|
|
self = 3;
|
|
|
|
else
|
|
|
|
R_SetViewSize (self);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// R_PointInSubsector
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
subsector_t *R_PointInSubsector (fixed_t x, fixed_t y)
|
|
|
|
{
|
|
|
|
node_t *node;
|
|
|
|
int side;
|
|
|
|
|
|
|
|
// single subsector is a special case
|
|
|
|
if (numnodes == 0)
|
|
|
|
return subsectors;
|
|
|
|
|
|
|
|
node = nodes + numnodes - 1;
|
|
|
|
|
|
|
|
do
|
|
|
|
{
|
|
|
|
side = R_PointOnSide (x, y, node);
|
|
|
|
node = (node_t *)node->children[side];
|
|
|
|
}
|
|
|
|
while (!((size_t)node & 1));
|
|
|
|
|
|
|
|
return (subsector_t *)((BYTE *)node - 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// R_Init
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void R_Init ()
|
|
|
|
{
|
|
|
|
atterm (R_Shutdown);
|
|
|
|
|
|
|
|
StartScreen->Progress();
|
|
|
|
V_InitFonts();
|
|
|
|
StartScreen->Progress();
|
2011-08-14 23:53:20 +00:00
|
|
|
// Colormap init moved back to InitPalette()
|
|
|
|
//R_InitColormaps ();
|
|
|
|
//StartScreen->Progress();
|
2011-07-07 15:37:47 +00:00
|
|
|
|
|
|
|
R_InitPointToAngle ();
|
|
|
|
R_InitTables ();
|
|
|
|
R_InitTranslationTables ();
|
|
|
|
R_SetViewSize (screenblocks);
|
|
|
|
Renderer->Init();
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// R_Shutdown
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
static void R_Shutdown ()
|
|
|
|
{
|
|
|
|
R_DeinitTranslationTables();
|
|
|
|
R_DeinitColormaps ();
|
|
|
|
FCanvasTextureInfo::EmptyList();
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// R_InterpolateView
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
//CVAR (Int, tf, 0, 0)
|
|
|
|
EXTERN_CVAR (Bool, cl_noprediction)
|
|
|
|
|
|
|
|
void R_InterpolateView (player_t *player, fixed_t frac, InterpolationViewer *iview)
|
|
|
|
{
|
|
|
|
// frac = tf;
|
|
|
|
if (NoInterpolateView)
|
|
|
|
{
|
2016-02-27 00:19:57 +00:00
|
|
|
InterpolationPath.Clear();
|
2011-07-07 15:37:47 +00:00
|
|
|
NoInterpolateView = false;
|
|
|
|
iview->oviewx = iview->nviewx;
|
|
|
|
iview->oviewy = iview->nviewy;
|
|
|
|
iview->oviewz = iview->nviewz;
|
|
|
|
iview->oviewpitch = iview->nviewpitch;
|
|
|
|
iview->oviewangle = iview->nviewangle;
|
|
|
|
}
|
2016-02-24 00:06:48 +00:00
|
|
|
int oldgroup = R_PointInSubsector(iview->oviewx, iview->oviewy)->sector->PortalGroup;
|
|
|
|
int newgroup = R_PointInSubsector(iview->nviewx, iview->nviewy)->sector->PortalGroup;
|
2016-02-27 00:19:57 +00:00
|
|
|
|
2016-02-27 17:06:24 +00:00
|
|
|
fixed_t oviewangle = iview->oviewangle;
|
|
|
|
fixed_t nviewangle = iview->nviewangle;
|
2016-02-27 00:19:57 +00:00
|
|
|
if ((iview->oviewx != iview->nviewx || iview->oviewy != iview->nviewy) && InterpolationPath.Size() > 0)
|
|
|
|
{
|
|
|
|
viewx = iview->nviewx;
|
|
|
|
viewy = iview->nviewy;
|
|
|
|
viewz = iview->nviewz;
|
|
|
|
|
|
|
|
// Interpolating through line portals is a messy affair.
|
|
|
|
// What needs be done is to store the portal transitions of the camera actor as waypoints
|
|
|
|
// and then find out on which part of the path the current view lies.
|
|
|
|
// Needless to say, this doesn't work for chasecam mode.
|
|
|
|
if (!r_showviewer)
|
|
|
|
{
|
|
|
|
fixed_t pathlen = 0;
|
|
|
|
fixed_t zdiff = 0;
|
|
|
|
fixed_t totalzdiff = 0;
|
2016-02-27 17:06:24 +00:00
|
|
|
angle_t adiff = 0;
|
|
|
|
angle_t totaladiff = 0;
|
2016-02-27 00:19:57 +00:00
|
|
|
fixed_t oviewz = iview->oviewz;
|
|
|
|
fixed_t nviewz = iview->nviewz;
|
2016-02-27 17:06:24 +00:00
|
|
|
fixedvec3a oldpos = { iview->oviewx, iview->oviewy, 0, 0 };
|
|
|
|
fixedvec3a newpos = { iview->nviewx, iview->nviewy, 0, 0 };
|
2016-02-27 00:19:57 +00:00
|
|
|
InterpolationPath.Push(newpos); // add this to the array to simplify the loops below
|
|
|
|
|
|
|
|
for (unsigned i = 0; i < InterpolationPath.Size(); i += 2)
|
|
|
|
{
|
2016-02-27 17:06:24 +00:00
|
|
|
fixedvec3a &start = i == 0 ? oldpos : InterpolationPath[i - 1];
|
|
|
|
fixedvec3a &end = InterpolationPath[i];
|
2016-02-27 00:19:57 +00:00
|
|
|
pathlen += xs_CRoundToInt(TVector2<double>(end.x - start.x, end.y - start.y).Length());
|
|
|
|
totalzdiff += start.z;
|
2016-02-27 17:06:24 +00:00
|
|
|
totaladiff += start.angle;
|
2016-02-27 00:19:57 +00:00
|
|
|
}
|
|
|
|
fixed_t interpolatedlen = FixedMul(frac, pathlen);
|
|
|
|
|
|
|
|
for (unsigned i = 0; i < InterpolationPath.Size(); i += 2)
|
|
|
|
{
|
2016-02-27 17:06:24 +00:00
|
|
|
fixedvec3a &start = i == 0 ? oldpos : InterpolationPath[i - 1];
|
|
|
|
fixedvec3a &end = InterpolationPath[i];
|
2016-02-27 00:19:57 +00:00
|
|
|
fixed_t fraglen = xs_CRoundToInt(TVector2<double>(end.x - start.x, end.y - start.y).Length());
|
|
|
|
zdiff += start.z;
|
2016-02-27 17:06:24 +00:00
|
|
|
adiff += start.angle;
|
2016-02-27 00:19:57 +00:00
|
|
|
if (fraglen <= interpolatedlen)
|
|
|
|
{
|
|
|
|
interpolatedlen -= fraglen;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fixed_t fragfrac = FixedDiv(interpolatedlen, fraglen);
|
|
|
|
oviewz += zdiff;
|
|
|
|
nviewz -= totalzdiff - zdiff;
|
2016-02-27 17:06:24 +00:00
|
|
|
oviewangle += adiff;
|
|
|
|
nviewangle -= totaladiff - adiff;
|
2016-02-27 00:19:57 +00:00
|
|
|
viewx = start.x + FixedMul(fragfrac, end.x - start.x);
|
|
|
|
viewy = start.y + FixedMul(fragfrac, end.y - start.y);
|
|
|
|
viewz = oviewz + FixedMul(frac, nviewz - oviewz);
|
2016-02-27 17:06:24 +00:00
|
|
|
break;
|
2016-02-27 00:19:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
InterpolationPath.Pop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fixedvec2 disp = Displacements.getOffset(oldgroup, newgroup);
|
|
|
|
viewx = iview->oviewx + FixedMul(frac, iview->nviewx - iview->oviewx - disp.x);
|
|
|
|
viewy = iview->oviewy + FixedMul(frac, iview->nviewy - iview->oviewy - disp.y);
|
|
|
|
viewz = iview->oviewz + FixedMul(frac, iview->nviewz - iview->oviewz);
|
|
|
|
}
|
2011-07-07 15:37:47 +00:00
|
|
|
if (player != NULL &&
|
2013-10-10 02:50:24 +00:00
|
|
|
!(player->cheats & CF_INTERPVIEW) &&
|
2011-07-07 15:37:47 +00:00
|
|
|
player - players == consoleplayer &&
|
|
|
|
camera == player->mo &&
|
|
|
|
!demoplayback &&
|
2016-01-19 10:50:07 +00:00
|
|
|
iview->nviewx == camera->X() &&
|
|
|
|
iview->nviewy == camera->Y() &&
|
2011-07-07 15:37:47 +00:00
|
|
|
!(player->cheats & (CF_TOTALLYFROZEN|CF_FROZEN)) &&
|
|
|
|
player->playerstate == PST_LIVE &&
|
|
|
|
player->mo->reactiontime == 0 &&
|
|
|
|
!NoInterpolateView &&
|
|
|
|
!paused &&
|
|
|
|
(!netgame || !cl_noprediction) &&
|
|
|
|
!LocalKeyboardTurner)
|
|
|
|
{
|
2016-02-27 17:06:24 +00:00
|
|
|
viewangle = nviewangle + (LocalViewAngle & 0xFFFF0000);
|
2011-07-07 15:37:47 +00:00
|
|
|
|
2012-04-03 04:09:30 +00:00
|
|
|
fixed_t delta = player->centering ? 0 : -(signed)(LocalViewPitch & 0xFFFF0000);
|
2011-07-07 15:37:47 +00:00
|
|
|
|
|
|
|
viewpitch = iview->nviewpitch;
|
|
|
|
if (delta > 0)
|
|
|
|
{
|
|
|
|
// Avoid overflowing viewpitch (can happen when a netgame is stalled)
|
2014-01-17 18:27:12 +00:00
|
|
|
if (viewpitch > INT_MAX - delta)
|
2011-07-07 15:37:47 +00:00
|
|
|
{
|
2011-12-06 01:25:37 +00:00
|
|
|
viewpitch = player->MaxPitch;
|
2011-07-07 15:37:47 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-12-06 01:25:37 +00:00
|
|
|
viewpitch = MIN(viewpitch + delta, player->MaxPitch);
|
2011-07-07 15:37:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (delta < 0)
|
|
|
|
{
|
|
|
|
// Avoid overflowing viewpitch (can happen when a netgame is stalled)
|
2014-01-17 18:27:12 +00:00
|
|
|
if (viewpitch < INT_MIN - delta)
|
2011-07-07 15:37:47 +00:00
|
|
|
{
|
2011-12-06 01:25:37 +00:00
|
|
|
viewpitch = player->MinPitch;
|
2011-07-07 15:37:47 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-12-06 01:25:37 +00:00
|
|
|
viewpitch = MAX(viewpitch + delta, player->MinPitch);
|
2011-07-07 15:37:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
viewpitch = iview->oviewpitch + FixedMul (frac, iview->nviewpitch - iview->oviewpitch);
|
2016-02-27 17:06:24 +00:00
|
|
|
viewangle = oviewangle + FixedMul (frac, nviewangle - oviewangle);
|
2011-07-07 15:37:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Due to interpolation this is not necessarily the same as the sector the camera is in.
|
|
|
|
viewsector = R_PointInSubsector(viewx, viewy)->sector;
|
2016-02-24 09:08:23 +00:00
|
|
|
bool moved = false;
|
|
|
|
while (!viewsector->PortalBlocksMovement(sector_t::ceiling))
|
2016-02-24 00:06:48 +00:00
|
|
|
{
|
|
|
|
AActor *point = viewsector->SkyBoxes[sector_t::ceiling];
|
|
|
|
if (viewz > point->threshold)
|
|
|
|
{
|
|
|
|
viewx += point->scaleX;
|
|
|
|
viewy += point->scaleY;
|
|
|
|
viewsector = R_PointInSubsector(viewx, viewy)->sector;
|
2016-02-24 09:08:23 +00:00
|
|
|
moved = true;
|
2016-02-24 00:06:48 +00:00
|
|
|
}
|
2016-02-24 09:08:23 +00:00
|
|
|
else break;
|
2016-02-24 00:06:48 +00:00
|
|
|
}
|
2016-02-24 09:08:23 +00:00
|
|
|
if (!moved)
|
2016-02-24 00:06:48 +00:00
|
|
|
{
|
2016-02-24 09:08:23 +00:00
|
|
|
while (!viewsector->PortalBlocksMovement(sector_t::floor))
|
2016-02-24 00:06:48 +00:00
|
|
|
{
|
2016-02-24 09:08:23 +00:00
|
|
|
AActor *point = viewsector->SkyBoxes[sector_t::floor];
|
|
|
|
if (viewz < point->threshold)
|
|
|
|
{
|
|
|
|
viewx += point->scaleX;
|
|
|
|
viewy += point->scaleY;
|
|
|
|
viewsector = R_PointInSubsector(viewx, viewy)->sector;
|
|
|
|
moved = true;
|
|
|
|
}
|
|
|
|
else break;
|
2016-02-24 00:06:48 +00:00
|
|
|
}
|
|
|
|
}
|
2011-07-07 15:37:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// R_ResetViewInterpolation
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void R_ResetViewInterpolation ()
|
|
|
|
{
|
2016-02-27 00:19:57 +00:00
|
|
|
InterpolationPath.Clear();
|
2011-07-07 15:37:47 +00:00
|
|
|
NoInterpolateView = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// R_SetViewAngle
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void R_SetViewAngle ()
|
|
|
|
{
|
|
|
|
angle_t ang = viewangle >> ANGLETOFINESHIFT;
|
|
|
|
|
|
|
|
viewsin = finesine[ang];
|
|
|
|
viewcos = finecosine[ang];
|
|
|
|
|
|
|
|
viewtansin = FixedMul (FocalTangent, viewsin);
|
|
|
|
viewtancos = FixedMul (FocalTangent, viewcos);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// FindPastViewer
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
static InterpolationViewer *FindPastViewer (AActor *actor)
|
|
|
|
{
|
|
|
|
for (unsigned int i = 0; i < PastViewers.Size(); ++i)
|
|
|
|
{
|
|
|
|
if (PastViewers[i].ViewActor == actor)
|
|
|
|
{
|
|
|
|
return &PastViewers[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Not found, so make a new one
|
|
|
|
InterpolationViewer iview = { NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
|
|
|
iview.ViewActor = actor;
|
|
|
|
iview.otic = -1;
|
2016-02-27 00:19:57 +00:00
|
|
|
InterpolationPath.Clear();
|
2011-07-07 15:37:47 +00:00
|
|
|
return &PastViewers[PastViewers.Push (iview)];
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// R_FreePastViewers
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void R_FreePastViewers ()
|
|
|
|
{
|
2016-02-27 00:19:57 +00:00
|
|
|
InterpolationPath.Clear();
|
2011-07-07 15:37:47 +00:00
|
|
|
PastViewers.Clear ();
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// R_ClearPastViewer
|
|
|
|
//
|
|
|
|
// If the actor changed in a non-interpolatable way, remove it.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void R_ClearPastViewer (AActor *actor)
|
|
|
|
{
|
2016-02-27 00:19:57 +00:00
|
|
|
InterpolationPath.Clear();
|
2011-07-07 15:37:47 +00:00
|
|
|
for (unsigned int i = 0; i < PastViewers.Size(); ++i)
|
|
|
|
{
|
|
|
|
if (PastViewers[i].ViewActor == actor)
|
|
|
|
{
|
|
|
|
// Found it, so remove it.
|
|
|
|
if (i == PastViewers.Size())
|
|
|
|
{
|
|
|
|
PastViewers.Delete (i);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
PastViewers.Pop (PastViewers[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-08-23 03:17:11 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// R_RebuildViewInterpolation
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void R_RebuildViewInterpolation(player_t *player)
|
|
|
|
{
|
2014-09-26 08:52:11 +00:00
|
|
|
if (player == NULL || player->camera == NULL)
|
|
|
|
return;
|
2014-08-23 03:17:11 +00:00
|
|
|
|
2014-09-26 08:52:11 +00:00
|
|
|
if (!NoInterpolateView)
|
|
|
|
return;
|
|
|
|
NoInterpolateView = false;
|
2014-08-23 03:17:11 +00:00
|
|
|
|
2014-09-26 08:52:11 +00:00
|
|
|
InterpolationViewer *iview = FindPastViewer(player->camera);
|
|
|
|
|
|
|
|
iview->oviewx = iview->nviewx;
|
|
|
|
iview->oviewy = iview->nviewy;
|
|
|
|
iview->oviewz = iview->nviewz;
|
|
|
|
iview->oviewpitch = iview->nviewpitch;
|
|
|
|
iview->oviewangle = iview->nviewangle;
|
2016-02-27 00:19:57 +00:00
|
|
|
InterpolationPath.Clear();
|
2014-08-23 03:17:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// R_GetViewInterpolationStatus
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
bool R_GetViewInterpolationStatus()
|
|
|
|
{
|
|
|
|
return NoInterpolateView;
|
|
|
|
}
|
|
|
|
|
2016-02-27 00:19:57 +00:00
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// R_ClearInterpolationPath
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void R_ClearInterpolationPath()
|
|
|
|
{
|
|
|
|
InterpolationPath.Clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// R_AddInterpolationPoint
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2016-02-27 17:06:24 +00:00
|
|
|
void R_AddInterpolationPoint(const fixedvec3a &vec)
|
2016-02-27 00:19:57 +00:00
|
|
|
{
|
|
|
|
InterpolationPath.Push(vec);
|
|
|
|
}
|
|
|
|
|
2015-02-18 20:48:52 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// QuakePower
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
Added QF_SINE
- Squashed commit of the following:
commit bc45fe3263d34ef5f746f524687999c19bf7b779
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:51:05 2015 -0600
wave scale -> wave speed
commit ff96388b128c724c1198757bfa52f1935a263356
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:45:32 2015 -0600
More sine quake fixes
commit 2a89749a6fe6d271b9fbdc218779f680afcf4cb6
Merge: 719dfbe 5456074
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:37:22 2015 -0600
Added QF_WAVE to A_QuakeEx.
- Changes the random quakes into a sine wave (see Shadow Warrior/Rise of the Triad reboots, Hard Reset, etc.)
- Added 3 properties to control waves per second along each individual axis. Only works with QF_WAVE.
- Intensity X/Y/Z property becomes the amplitude of the wave.
- Stacks with regular quakes, allowing shaking along the camera which must be called using A_QuakeEx WITHOUT the flag, or the other quaking functions.
- Uses the youngest quake's time for positioning.
commit 54560741581e8d15cc7060e8e068cf85e9a4b432
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:21:19 2015 -0600
Recommitted recommended changes by Randi, with some modifications. Now, we should be finished!
commit 6f4473013411686d88fc185bdc1cc58b1035b0f1
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:52:57 2015 -0600
Finish this revert.
commit 467e53f9400f588a2ada9b32e7634cb1f4ad5066
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:46:02 2015 -0600
Reverted back to what was working.
commit da9de56a67efda08036e481fd5fccd5392ce6810
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:53:20 2015 -0600
Forgot this bit, for testing.
commit c5093d9bb97caf8478cefc32abc56a036feeea58
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:52:46 2015 -0600
Some more progress, but...
- This did not solve anything. In fact, it did the opposite -- completely broke wave quakes. Now they only happen whenever a random quake is in progress.
- Left in the commented code on purpose so Randi can test it.
commit 7e526405d2127cbb279f66008c8f8e55a5d497f3
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:50:42 2015 -0600
- Use newest waveform timer, not oldest.
commit 1356443609dbc6c7f46e081d0846816dc0836124
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:32:09 2015 -0600
- Got regular quakes to multiply onto sine quakes, but the vice versa needs fixing too.
commit d95796c94c70cd0229d4a6d30f69e3a7568b9588
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 16:46:21 2015 -0600
- Last hurdle. Now just need to figure out how to properly scale up and down.
commit 4bc3458e689155ce72c09776604d9eb4fa73d8be
Author: MajorCooke <paul.growney22@gmail.com>
Date: Tue Feb 24 23:18:03 2015 -0600
- Fixed the quakes being unstackable.
commit b51012d6d4ea065bf7f6fc9c1a0472966491f7af
Author: MajorCooke <paul.growney22@gmail.com>
Date: Mon Feb 23 23:48:34 2015 -0600
QF_WAVE renamed from SINE.
- Lots of ground covered, but still more to go.
- Still need to figure out how to make the camera properly shudder.
commit 427e4893193470bbf45415ffec70a0b69b8cccfd
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sun Feb 22 16:52:30 2015 -0600
- Begin the groundworks for QF_SINE.
- Need to figure out how to rework and manipulate the sine wave to move faster, and to allow going below 0 without breaking it too much.
2015-03-02 00:53:34 +00:00
|
|
|
static fixed_t QuakePower(fixed_t factor, fixed_t intensity, fixed_t offset)
|
|
|
|
{
|
|
|
|
fixed_t randumb;
|
|
|
|
|
2015-02-18 20:48:52 +00:00
|
|
|
if (intensity == 0)
|
|
|
|
{
|
Added QF_SINE
- Squashed commit of the following:
commit bc45fe3263d34ef5f746f524687999c19bf7b779
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:51:05 2015 -0600
wave scale -> wave speed
commit ff96388b128c724c1198757bfa52f1935a263356
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:45:32 2015 -0600
More sine quake fixes
commit 2a89749a6fe6d271b9fbdc218779f680afcf4cb6
Merge: 719dfbe 5456074
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:37:22 2015 -0600
Added QF_WAVE to A_QuakeEx.
- Changes the random quakes into a sine wave (see Shadow Warrior/Rise of the Triad reboots, Hard Reset, etc.)
- Added 3 properties to control waves per second along each individual axis. Only works with QF_WAVE.
- Intensity X/Y/Z property becomes the amplitude of the wave.
- Stacks with regular quakes, allowing shaking along the camera which must be called using A_QuakeEx WITHOUT the flag, or the other quaking functions.
- Uses the youngest quake's time for positioning.
commit 54560741581e8d15cc7060e8e068cf85e9a4b432
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:21:19 2015 -0600
Recommitted recommended changes by Randi, with some modifications. Now, we should be finished!
commit 6f4473013411686d88fc185bdc1cc58b1035b0f1
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:52:57 2015 -0600
Finish this revert.
commit 467e53f9400f588a2ada9b32e7634cb1f4ad5066
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:46:02 2015 -0600
Reverted back to what was working.
commit da9de56a67efda08036e481fd5fccd5392ce6810
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:53:20 2015 -0600
Forgot this bit, for testing.
commit c5093d9bb97caf8478cefc32abc56a036feeea58
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:52:46 2015 -0600
Some more progress, but...
- This did not solve anything. In fact, it did the opposite -- completely broke wave quakes. Now they only happen whenever a random quake is in progress.
- Left in the commented code on purpose so Randi can test it.
commit 7e526405d2127cbb279f66008c8f8e55a5d497f3
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:50:42 2015 -0600
- Use newest waveform timer, not oldest.
commit 1356443609dbc6c7f46e081d0846816dc0836124
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:32:09 2015 -0600
- Got regular quakes to multiply onto sine quakes, but the vice versa needs fixing too.
commit d95796c94c70cd0229d4a6d30f69e3a7568b9588
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 16:46:21 2015 -0600
- Last hurdle. Now just need to figure out how to properly scale up and down.
commit 4bc3458e689155ce72c09776604d9eb4fa73d8be
Author: MajorCooke <paul.growney22@gmail.com>
Date: Tue Feb 24 23:18:03 2015 -0600
- Fixed the quakes being unstackable.
commit b51012d6d4ea065bf7f6fc9c1a0472966491f7af
Author: MajorCooke <paul.growney22@gmail.com>
Date: Mon Feb 23 23:48:34 2015 -0600
QF_WAVE renamed from SINE.
- Lots of ground covered, but still more to go.
- Still need to figure out how to make the camera properly shudder.
commit 427e4893193470bbf45415ffec70a0b69b8cccfd
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sun Feb 22 16:52:30 2015 -0600
- Begin the groundworks for QF_SINE.
- Need to figure out how to rework and manipulate the sine wave to move faster, and to allow going below 0 without breaking it too much.
2015-03-02 00:53:34 +00:00
|
|
|
randumb = 0;
|
2015-02-18 20:48:52 +00:00
|
|
|
}
|
2015-02-20 03:42:32 +00:00
|
|
|
else
|
|
|
|
{
|
Added QF_SINE
- Squashed commit of the following:
commit bc45fe3263d34ef5f746f524687999c19bf7b779
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:51:05 2015 -0600
wave scale -> wave speed
commit ff96388b128c724c1198757bfa52f1935a263356
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:45:32 2015 -0600
More sine quake fixes
commit 2a89749a6fe6d271b9fbdc218779f680afcf4cb6
Merge: 719dfbe 5456074
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:37:22 2015 -0600
Added QF_WAVE to A_QuakeEx.
- Changes the random quakes into a sine wave (see Shadow Warrior/Rise of the Triad reboots, Hard Reset, etc.)
- Added 3 properties to control waves per second along each individual axis. Only works with QF_WAVE.
- Intensity X/Y/Z property becomes the amplitude of the wave.
- Stacks with regular quakes, allowing shaking along the camera which must be called using A_QuakeEx WITHOUT the flag, or the other quaking functions.
- Uses the youngest quake's time for positioning.
commit 54560741581e8d15cc7060e8e068cf85e9a4b432
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:21:19 2015 -0600
Recommitted recommended changes by Randi, with some modifications. Now, we should be finished!
commit 6f4473013411686d88fc185bdc1cc58b1035b0f1
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:52:57 2015 -0600
Finish this revert.
commit 467e53f9400f588a2ada9b32e7634cb1f4ad5066
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:46:02 2015 -0600
Reverted back to what was working.
commit da9de56a67efda08036e481fd5fccd5392ce6810
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:53:20 2015 -0600
Forgot this bit, for testing.
commit c5093d9bb97caf8478cefc32abc56a036feeea58
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:52:46 2015 -0600
Some more progress, but...
- This did not solve anything. In fact, it did the opposite -- completely broke wave quakes. Now they only happen whenever a random quake is in progress.
- Left in the commented code on purpose so Randi can test it.
commit 7e526405d2127cbb279f66008c8f8e55a5d497f3
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:50:42 2015 -0600
- Use newest waveform timer, not oldest.
commit 1356443609dbc6c7f46e081d0846816dc0836124
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:32:09 2015 -0600
- Got regular quakes to multiply onto sine quakes, but the vice versa needs fixing too.
commit d95796c94c70cd0229d4a6d30f69e3a7568b9588
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 16:46:21 2015 -0600
- Last hurdle. Now just need to figure out how to properly scale up and down.
commit 4bc3458e689155ce72c09776604d9eb4fa73d8be
Author: MajorCooke <paul.growney22@gmail.com>
Date: Tue Feb 24 23:18:03 2015 -0600
- Fixed the quakes being unstackable.
commit b51012d6d4ea065bf7f6fc9c1a0472966491f7af
Author: MajorCooke <paul.growney22@gmail.com>
Date: Mon Feb 23 23:48:34 2015 -0600
QF_WAVE renamed from SINE.
- Lots of ground covered, but still more to go.
- Still need to figure out how to make the camera properly shudder.
commit 427e4893193470bbf45415ffec70a0b69b8cccfd
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sun Feb 22 16:52:30 2015 -0600
- Begin the groundworks for QF_SINE.
- Need to figure out how to rework and manipulate the sine wave to move faster, and to allow going below 0 without breaking it too much.
2015-03-02 00:53:34 +00:00
|
|
|
randumb = pr_torchflicker(intensity * 2) - intensity;
|
2015-02-20 03:42:32 +00:00
|
|
|
}
|
Added QF_SINE
- Squashed commit of the following:
commit bc45fe3263d34ef5f746f524687999c19bf7b779
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:51:05 2015 -0600
wave scale -> wave speed
commit ff96388b128c724c1198757bfa52f1935a263356
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:45:32 2015 -0600
More sine quake fixes
commit 2a89749a6fe6d271b9fbdc218779f680afcf4cb6
Merge: 719dfbe 5456074
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:37:22 2015 -0600
Added QF_WAVE to A_QuakeEx.
- Changes the random quakes into a sine wave (see Shadow Warrior/Rise of the Triad reboots, Hard Reset, etc.)
- Added 3 properties to control waves per second along each individual axis. Only works with QF_WAVE.
- Intensity X/Y/Z property becomes the amplitude of the wave.
- Stacks with regular quakes, allowing shaking along the camera which must be called using A_QuakeEx WITHOUT the flag, or the other quaking functions.
- Uses the youngest quake's time for positioning.
commit 54560741581e8d15cc7060e8e068cf85e9a4b432
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:21:19 2015 -0600
Recommitted recommended changes by Randi, with some modifications. Now, we should be finished!
commit 6f4473013411686d88fc185bdc1cc58b1035b0f1
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:52:57 2015 -0600
Finish this revert.
commit 467e53f9400f588a2ada9b32e7634cb1f4ad5066
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:46:02 2015 -0600
Reverted back to what was working.
commit da9de56a67efda08036e481fd5fccd5392ce6810
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:53:20 2015 -0600
Forgot this bit, for testing.
commit c5093d9bb97caf8478cefc32abc56a036feeea58
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:52:46 2015 -0600
Some more progress, but...
- This did not solve anything. In fact, it did the opposite -- completely broke wave quakes. Now they only happen whenever a random quake is in progress.
- Left in the commented code on purpose so Randi can test it.
commit 7e526405d2127cbb279f66008c8f8e55a5d497f3
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:50:42 2015 -0600
- Use newest waveform timer, not oldest.
commit 1356443609dbc6c7f46e081d0846816dc0836124
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:32:09 2015 -0600
- Got regular quakes to multiply onto sine quakes, but the vice versa needs fixing too.
commit d95796c94c70cd0229d4a6d30f69e3a7568b9588
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 16:46:21 2015 -0600
- Last hurdle. Now just need to figure out how to properly scale up and down.
commit 4bc3458e689155ce72c09776604d9eb4fa73d8be
Author: MajorCooke <paul.growney22@gmail.com>
Date: Tue Feb 24 23:18:03 2015 -0600
- Fixed the quakes being unstackable.
commit b51012d6d4ea065bf7f6fc9c1a0472966491f7af
Author: MajorCooke <paul.growney22@gmail.com>
Date: Mon Feb 23 23:48:34 2015 -0600
QF_WAVE renamed from SINE.
- Lots of ground covered, but still more to go.
- Still need to figure out how to make the camera properly shudder.
commit 427e4893193470bbf45415ffec70a0b69b8cccfd
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sun Feb 22 16:52:30 2015 -0600
- Begin the groundworks for QF_SINE.
- Need to figure out how to rework and manipulate the sine wave to move faster, and to allow going below 0 without breaking it too much.
2015-03-02 00:53:34 +00:00
|
|
|
return FixedMul(factor, randumb + offset);
|
2015-02-18 20:48:52 +00:00
|
|
|
}
|
2014-08-23 03:17:11 +00:00
|
|
|
|
2011-07-07 15:37:47 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// R_SetupFrame
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void R_SetupFrame (AActor *actor)
|
|
|
|
{
|
|
|
|
if (actor == NULL)
|
|
|
|
{
|
|
|
|
I_Error ("Tried to render from a NULL actor.");
|
|
|
|
}
|
|
|
|
|
|
|
|
player_t *player = actor->player;
|
|
|
|
unsigned int newblend;
|
|
|
|
InterpolationViewer *iview;
|
|
|
|
|
|
|
|
if (player != NULL && player->mo == actor)
|
|
|
|
{ // [RH] Use camera instead of viewplayer
|
|
|
|
camera = player->camera;
|
|
|
|
if (camera == NULL)
|
|
|
|
{
|
|
|
|
camera = player->camera = player->mo;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
camera = actor;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (camera == NULL)
|
|
|
|
{
|
|
|
|
I_Error ("You lost your body. Bad dehacked work is likely to blame.");
|
|
|
|
}
|
|
|
|
|
|
|
|
iview = FindPastViewer (camera);
|
|
|
|
|
|
|
|
int nowtic = I_GetTime (false);
|
|
|
|
if (iview->otic != -1 && nowtic > iview->otic)
|
|
|
|
{
|
|
|
|
iview->otic = nowtic;
|
|
|
|
iview->oviewx = iview->nviewx;
|
|
|
|
iview->oviewy = iview->nviewy;
|
|
|
|
iview->oviewz = iview->nviewz;
|
|
|
|
iview->oviewpitch = iview->nviewpitch;
|
|
|
|
iview->oviewangle = iview->nviewangle;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (player != NULL && gamestate != GS_TITLELEVEL &&
|
2011-10-03 00:56:01 +00:00
|
|
|
((player->cheats & CF_CHASECAM) || (r_deathcamera && camera->health <= 0)))
|
2011-07-07 15:37:47 +00:00
|
|
|
{
|
|
|
|
// [RH] Use chasecam view
|
|
|
|
P_AimCamera (camera, iview->nviewx, iview->nviewy, iview->nviewz, viewsector);
|
|
|
|
r_showviewer = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-01-19 10:50:07 +00:00
|
|
|
iview->nviewx = camera->X();
|
|
|
|
iview->nviewy = camera->Y();
|
2016-01-19 12:43:11 +00:00
|
|
|
iview->nviewz = camera->player ? camera->player->viewz : camera->Z() + camera->GetCameraHeight();
|
2011-07-07 15:37:47 +00:00
|
|
|
viewsector = camera->Sector;
|
|
|
|
r_showviewer = false;
|
|
|
|
}
|
|
|
|
iview->nviewpitch = camera->pitch;
|
|
|
|
if (camera->player != 0)
|
|
|
|
{
|
|
|
|
player = camera->player;
|
|
|
|
}
|
|
|
|
|
2011-07-07 19:53:42 +00:00
|
|
|
iview->nviewangle = camera->angle;
|
2011-07-07 15:37:47 +00:00
|
|
|
if (iview->otic == -1 || r_NoInterpolate)
|
|
|
|
{
|
|
|
|
R_ResetViewInterpolation ();
|
|
|
|
iview->otic = nowtic;
|
|
|
|
}
|
|
|
|
|
|
|
|
r_TicFrac = I_GetTimeFrac (&r_FrameTime);
|
|
|
|
if (cl_capfps || r_NoInterpolate)
|
|
|
|
{
|
|
|
|
r_TicFrac = FRACUNIT;
|
|
|
|
}
|
|
|
|
|
|
|
|
R_InterpolateView (player, r_TicFrac, iview);
|
|
|
|
|
|
|
|
#ifdef TEST_X
|
|
|
|
viewx = TEST_X;
|
|
|
|
viewy = TEST_Y;
|
|
|
|
viewz = TEST_Z;
|
|
|
|
viewangle = TEST_ANGLE;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
R_SetViewAngle ();
|
|
|
|
|
|
|
|
interpolator.DoInterpolations (r_TicFrac);
|
|
|
|
|
|
|
|
// Keep the view within the sector's floor and ceiling
|
2016-02-14 20:02:18 +00:00
|
|
|
if (viewsector->PortalBlocksMovement(sector_t::ceiling))
|
2011-07-07 15:37:47 +00:00
|
|
|
{
|
2016-02-14 20:02:18 +00:00
|
|
|
fixed_t theZ = viewsector->ceilingplane.ZatPoint(viewx, viewy) - 4 * FRACUNIT;
|
|
|
|
if (viewz > theZ)
|
|
|
|
{
|
|
|
|
viewz = theZ;
|
|
|
|
}
|
2011-07-07 15:37:47 +00:00
|
|
|
}
|
|
|
|
|
2016-02-14 20:02:18 +00:00
|
|
|
if (viewsector->PortalBlocksMovement(sector_t::floor))
|
2011-07-07 15:37:47 +00:00
|
|
|
{
|
2016-02-14 20:02:18 +00:00
|
|
|
fixed_t theZ = viewsector->floorplane.ZatPoint(viewx, viewy) + 4 * FRACUNIT;
|
|
|
|
if (viewz < theZ)
|
|
|
|
{
|
|
|
|
viewz = theZ;
|
|
|
|
}
|
2011-07-07 15:37:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!paused)
|
|
|
|
{
|
Added QF_SINE
- Squashed commit of the following:
commit bc45fe3263d34ef5f746f524687999c19bf7b779
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:51:05 2015 -0600
wave scale -> wave speed
commit ff96388b128c724c1198757bfa52f1935a263356
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:45:32 2015 -0600
More sine quake fixes
commit 2a89749a6fe6d271b9fbdc218779f680afcf4cb6
Merge: 719dfbe 5456074
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:37:22 2015 -0600
Added QF_WAVE to A_QuakeEx.
- Changes the random quakes into a sine wave (see Shadow Warrior/Rise of the Triad reboots, Hard Reset, etc.)
- Added 3 properties to control waves per second along each individual axis. Only works with QF_WAVE.
- Intensity X/Y/Z property becomes the amplitude of the wave.
- Stacks with regular quakes, allowing shaking along the camera which must be called using A_QuakeEx WITHOUT the flag, or the other quaking functions.
- Uses the youngest quake's time for positioning.
commit 54560741581e8d15cc7060e8e068cf85e9a4b432
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:21:19 2015 -0600
Recommitted recommended changes by Randi, with some modifications. Now, we should be finished!
commit 6f4473013411686d88fc185bdc1cc58b1035b0f1
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:52:57 2015 -0600
Finish this revert.
commit 467e53f9400f588a2ada9b32e7634cb1f4ad5066
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:46:02 2015 -0600
Reverted back to what was working.
commit da9de56a67efda08036e481fd5fccd5392ce6810
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:53:20 2015 -0600
Forgot this bit, for testing.
commit c5093d9bb97caf8478cefc32abc56a036feeea58
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:52:46 2015 -0600
Some more progress, but...
- This did not solve anything. In fact, it did the opposite -- completely broke wave quakes. Now they only happen whenever a random quake is in progress.
- Left in the commented code on purpose so Randi can test it.
commit 7e526405d2127cbb279f66008c8f8e55a5d497f3
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:50:42 2015 -0600
- Use newest waveform timer, not oldest.
commit 1356443609dbc6c7f46e081d0846816dc0836124
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:32:09 2015 -0600
- Got regular quakes to multiply onto sine quakes, but the vice versa needs fixing too.
commit d95796c94c70cd0229d4a6d30f69e3a7568b9588
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 16:46:21 2015 -0600
- Last hurdle. Now just need to figure out how to properly scale up and down.
commit 4bc3458e689155ce72c09776604d9eb4fa73d8be
Author: MajorCooke <paul.growney22@gmail.com>
Date: Tue Feb 24 23:18:03 2015 -0600
- Fixed the quakes being unstackable.
commit b51012d6d4ea065bf7f6fc9c1a0472966491f7af
Author: MajorCooke <paul.growney22@gmail.com>
Date: Mon Feb 23 23:48:34 2015 -0600
QF_WAVE renamed from SINE.
- Lots of ground covered, but still more to go.
- Still need to figure out how to make the camera properly shudder.
commit 427e4893193470bbf45415ffec70a0b69b8cccfd
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sun Feb 22 16:52:30 2015 -0600
- Begin the groundworks for QF_SINE.
- Need to figure out how to rework and manipulate the sine wave to move faster, and to allow going below 0 without breaking it too much.
2015-03-02 00:53:34 +00:00
|
|
|
FQuakeJiggers jiggers = { 0, };
|
|
|
|
|
|
|
|
if (DEarthquake::StaticGetQuakeIntensities(camera, jiggers) > 0)
|
2011-07-07 15:37:47 +00:00
|
|
|
{
|
2015-02-21 01:36:13 +00:00
|
|
|
fixed_t quakefactor = FLOAT2FIXED(r_quakeintensity);
|
2013-11-29 12:24:38 +00:00
|
|
|
|
Added QF_SINE
- Squashed commit of the following:
commit bc45fe3263d34ef5f746f524687999c19bf7b779
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:51:05 2015 -0600
wave scale -> wave speed
commit ff96388b128c724c1198757bfa52f1935a263356
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:45:32 2015 -0600
More sine quake fixes
commit 2a89749a6fe6d271b9fbdc218779f680afcf4cb6
Merge: 719dfbe 5456074
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:37:22 2015 -0600
Added QF_WAVE to A_QuakeEx.
- Changes the random quakes into a sine wave (see Shadow Warrior/Rise of the Triad reboots, Hard Reset, etc.)
- Added 3 properties to control waves per second along each individual axis. Only works with QF_WAVE.
- Intensity X/Y/Z property becomes the amplitude of the wave.
- Stacks with regular quakes, allowing shaking along the camera which must be called using A_QuakeEx WITHOUT the flag, or the other quaking functions.
- Uses the youngest quake's time for positioning.
commit 54560741581e8d15cc7060e8e068cf85e9a4b432
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:21:19 2015 -0600
Recommitted recommended changes by Randi, with some modifications. Now, we should be finished!
commit 6f4473013411686d88fc185bdc1cc58b1035b0f1
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:52:57 2015 -0600
Finish this revert.
commit 467e53f9400f588a2ada9b32e7634cb1f4ad5066
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:46:02 2015 -0600
Reverted back to what was working.
commit da9de56a67efda08036e481fd5fccd5392ce6810
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:53:20 2015 -0600
Forgot this bit, for testing.
commit c5093d9bb97caf8478cefc32abc56a036feeea58
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:52:46 2015 -0600
Some more progress, but...
- This did not solve anything. In fact, it did the opposite -- completely broke wave quakes. Now they only happen whenever a random quake is in progress.
- Left in the commented code on purpose so Randi can test it.
commit 7e526405d2127cbb279f66008c8f8e55a5d497f3
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:50:42 2015 -0600
- Use newest waveform timer, not oldest.
commit 1356443609dbc6c7f46e081d0846816dc0836124
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:32:09 2015 -0600
- Got regular quakes to multiply onto sine quakes, but the vice versa needs fixing too.
commit d95796c94c70cd0229d4a6d30f69e3a7568b9588
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 16:46:21 2015 -0600
- Last hurdle. Now just need to figure out how to properly scale up and down.
commit 4bc3458e689155ce72c09776604d9eb4fa73d8be
Author: MajorCooke <paul.growney22@gmail.com>
Date: Tue Feb 24 23:18:03 2015 -0600
- Fixed the quakes being unstackable.
commit b51012d6d4ea065bf7f6fc9c1a0472966491f7af
Author: MajorCooke <paul.growney22@gmail.com>
Date: Mon Feb 23 23:48:34 2015 -0600
QF_WAVE renamed from SINE.
- Lots of ground covered, but still more to go.
- Still need to figure out how to make the camera properly shudder.
commit 427e4893193470bbf45415ffec70a0b69b8cccfd
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sun Feb 22 16:52:30 2015 -0600
- Begin the groundworks for QF_SINE.
- Need to figure out how to rework and manipulate the sine wave to move faster, and to allow going below 0 without breaking it too much.
2015-03-02 00:53:34 +00:00
|
|
|
if ((jiggers.RelIntensityX | jiggers.RelOffsetX) != 0)
|
2015-02-14 21:58:39 +00:00
|
|
|
{
|
2015-02-18 20:48:52 +00:00
|
|
|
int ang = (camera->angle) >> ANGLETOFINESHIFT;
|
Added QF_SINE
- Squashed commit of the following:
commit bc45fe3263d34ef5f746f524687999c19bf7b779
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:51:05 2015 -0600
wave scale -> wave speed
commit ff96388b128c724c1198757bfa52f1935a263356
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:45:32 2015 -0600
More sine quake fixes
commit 2a89749a6fe6d271b9fbdc218779f680afcf4cb6
Merge: 719dfbe 5456074
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:37:22 2015 -0600
Added QF_WAVE to A_QuakeEx.
- Changes the random quakes into a sine wave (see Shadow Warrior/Rise of the Triad reboots, Hard Reset, etc.)
- Added 3 properties to control waves per second along each individual axis. Only works with QF_WAVE.
- Intensity X/Y/Z property becomes the amplitude of the wave.
- Stacks with regular quakes, allowing shaking along the camera which must be called using A_QuakeEx WITHOUT the flag, or the other quaking functions.
- Uses the youngest quake's time for positioning.
commit 54560741581e8d15cc7060e8e068cf85e9a4b432
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:21:19 2015 -0600
Recommitted recommended changes by Randi, with some modifications. Now, we should be finished!
commit 6f4473013411686d88fc185bdc1cc58b1035b0f1
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:52:57 2015 -0600
Finish this revert.
commit 467e53f9400f588a2ada9b32e7634cb1f4ad5066
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:46:02 2015 -0600
Reverted back to what was working.
commit da9de56a67efda08036e481fd5fccd5392ce6810
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:53:20 2015 -0600
Forgot this bit, for testing.
commit c5093d9bb97caf8478cefc32abc56a036feeea58
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:52:46 2015 -0600
Some more progress, but...
- This did not solve anything. In fact, it did the opposite -- completely broke wave quakes. Now they only happen whenever a random quake is in progress.
- Left in the commented code on purpose so Randi can test it.
commit 7e526405d2127cbb279f66008c8f8e55a5d497f3
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:50:42 2015 -0600
- Use newest waveform timer, not oldest.
commit 1356443609dbc6c7f46e081d0846816dc0836124
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:32:09 2015 -0600
- Got regular quakes to multiply onto sine quakes, but the vice versa needs fixing too.
commit d95796c94c70cd0229d4a6d30f69e3a7568b9588
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 16:46:21 2015 -0600
- Last hurdle. Now just need to figure out how to properly scale up and down.
commit 4bc3458e689155ce72c09776604d9eb4fa73d8be
Author: MajorCooke <paul.growney22@gmail.com>
Date: Tue Feb 24 23:18:03 2015 -0600
- Fixed the quakes being unstackable.
commit b51012d6d4ea065bf7f6fc9c1a0472966491f7af
Author: MajorCooke <paul.growney22@gmail.com>
Date: Mon Feb 23 23:48:34 2015 -0600
QF_WAVE renamed from SINE.
- Lots of ground covered, but still more to go.
- Still need to figure out how to make the camera properly shudder.
commit 427e4893193470bbf45415ffec70a0b69b8cccfd
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sun Feb 22 16:52:30 2015 -0600
- Begin the groundworks for QF_SINE.
- Need to figure out how to rework and manipulate the sine wave to move faster, and to allow going below 0 without breaking it too much.
2015-03-02 00:53:34 +00:00
|
|
|
fixed_t power = QuakePower(quakefactor, jiggers.RelIntensityX, jiggers.RelOffsetX);
|
2015-02-18 20:48:52 +00:00
|
|
|
viewx += FixedMul(finecosine[ang], power);
|
|
|
|
viewy += FixedMul(finesine[ang], power);
|
2015-02-14 21:58:39 +00:00
|
|
|
}
|
Added QF_SINE
- Squashed commit of the following:
commit bc45fe3263d34ef5f746f524687999c19bf7b779
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:51:05 2015 -0600
wave scale -> wave speed
commit ff96388b128c724c1198757bfa52f1935a263356
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:45:32 2015 -0600
More sine quake fixes
commit 2a89749a6fe6d271b9fbdc218779f680afcf4cb6
Merge: 719dfbe 5456074
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:37:22 2015 -0600
Added QF_WAVE to A_QuakeEx.
- Changes the random quakes into a sine wave (see Shadow Warrior/Rise of the Triad reboots, Hard Reset, etc.)
- Added 3 properties to control waves per second along each individual axis. Only works with QF_WAVE.
- Intensity X/Y/Z property becomes the amplitude of the wave.
- Stacks with regular quakes, allowing shaking along the camera which must be called using A_QuakeEx WITHOUT the flag, or the other quaking functions.
- Uses the youngest quake's time for positioning.
commit 54560741581e8d15cc7060e8e068cf85e9a4b432
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:21:19 2015 -0600
Recommitted recommended changes by Randi, with some modifications. Now, we should be finished!
commit 6f4473013411686d88fc185bdc1cc58b1035b0f1
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:52:57 2015 -0600
Finish this revert.
commit 467e53f9400f588a2ada9b32e7634cb1f4ad5066
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:46:02 2015 -0600
Reverted back to what was working.
commit da9de56a67efda08036e481fd5fccd5392ce6810
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:53:20 2015 -0600
Forgot this bit, for testing.
commit c5093d9bb97caf8478cefc32abc56a036feeea58
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:52:46 2015 -0600
Some more progress, but...
- This did not solve anything. In fact, it did the opposite -- completely broke wave quakes. Now they only happen whenever a random quake is in progress.
- Left in the commented code on purpose so Randi can test it.
commit 7e526405d2127cbb279f66008c8f8e55a5d497f3
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:50:42 2015 -0600
- Use newest waveform timer, not oldest.
commit 1356443609dbc6c7f46e081d0846816dc0836124
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:32:09 2015 -0600
- Got regular quakes to multiply onto sine quakes, but the vice versa needs fixing too.
commit d95796c94c70cd0229d4a6d30f69e3a7568b9588
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 16:46:21 2015 -0600
- Last hurdle. Now just need to figure out how to properly scale up and down.
commit 4bc3458e689155ce72c09776604d9eb4fa73d8be
Author: MajorCooke <paul.growney22@gmail.com>
Date: Tue Feb 24 23:18:03 2015 -0600
- Fixed the quakes being unstackable.
commit b51012d6d4ea065bf7f6fc9c1a0472966491f7af
Author: MajorCooke <paul.growney22@gmail.com>
Date: Mon Feb 23 23:48:34 2015 -0600
QF_WAVE renamed from SINE.
- Lots of ground covered, but still more to go.
- Still need to figure out how to make the camera properly shudder.
commit 427e4893193470bbf45415ffec70a0b69b8cccfd
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sun Feb 22 16:52:30 2015 -0600
- Begin the groundworks for QF_SINE.
- Need to figure out how to rework and manipulate the sine wave to move faster, and to allow going below 0 without breaking it too much.
2015-03-02 00:53:34 +00:00
|
|
|
if ((jiggers.RelIntensityY | jiggers.RelOffsetY) != 0)
|
2015-02-18 20:48:52 +00:00
|
|
|
{
|
|
|
|
int ang = (camera->angle + ANG90) >> ANGLETOFINESHIFT;
|
Added QF_SINE
- Squashed commit of the following:
commit bc45fe3263d34ef5f746f524687999c19bf7b779
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:51:05 2015 -0600
wave scale -> wave speed
commit ff96388b128c724c1198757bfa52f1935a263356
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:45:32 2015 -0600
More sine quake fixes
commit 2a89749a6fe6d271b9fbdc218779f680afcf4cb6
Merge: 719dfbe 5456074
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:37:22 2015 -0600
Added QF_WAVE to A_QuakeEx.
- Changes the random quakes into a sine wave (see Shadow Warrior/Rise of the Triad reboots, Hard Reset, etc.)
- Added 3 properties to control waves per second along each individual axis. Only works with QF_WAVE.
- Intensity X/Y/Z property becomes the amplitude of the wave.
- Stacks with regular quakes, allowing shaking along the camera which must be called using A_QuakeEx WITHOUT the flag, or the other quaking functions.
- Uses the youngest quake's time for positioning.
commit 54560741581e8d15cc7060e8e068cf85e9a4b432
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:21:19 2015 -0600
Recommitted recommended changes by Randi, with some modifications. Now, we should be finished!
commit 6f4473013411686d88fc185bdc1cc58b1035b0f1
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:52:57 2015 -0600
Finish this revert.
commit 467e53f9400f588a2ada9b32e7634cb1f4ad5066
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:46:02 2015 -0600
Reverted back to what was working.
commit da9de56a67efda08036e481fd5fccd5392ce6810
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:53:20 2015 -0600
Forgot this bit, for testing.
commit c5093d9bb97caf8478cefc32abc56a036feeea58
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:52:46 2015 -0600
Some more progress, but...
- This did not solve anything. In fact, it did the opposite -- completely broke wave quakes. Now they only happen whenever a random quake is in progress.
- Left in the commented code on purpose so Randi can test it.
commit 7e526405d2127cbb279f66008c8f8e55a5d497f3
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:50:42 2015 -0600
- Use newest waveform timer, not oldest.
commit 1356443609dbc6c7f46e081d0846816dc0836124
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:32:09 2015 -0600
- Got regular quakes to multiply onto sine quakes, but the vice versa needs fixing too.
commit d95796c94c70cd0229d4a6d30f69e3a7568b9588
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 16:46:21 2015 -0600
- Last hurdle. Now just need to figure out how to properly scale up and down.
commit 4bc3458e689155ce72c09776604d9eb4fa73d8be
Author: MajorCooke <paul.growney22@gmail.com>
Date: Tue Feb 24 23:18:03 2015 -0600
- Fixed the quakes being unstackable.
commit b51012d6d4ea065bf7f6fc9c1a0472966491f7af
Author: MajorCooke <paul.growney22@gmail.com>
Date: Mon Feb 23 23:48:34 2015 -0600
QF_WAVE renamed from SINE.
- Lots of ground covered, but still more to go.
- Still need to figure out how to make the camera properly shudder.
commit 427e4893193470bbf45415ffec70a0b69b8cccfd
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sun Feb 22 16:52:30 2015 -0600
- Begin the groundworks for QF_SINE.
- Need to figure out how to rework and manipulate the sine wave to move faster, and to allow going below 0 without breaking it too much.
2015-03-02 00:53:34 +00:00
|
|
|
fixed_t power = QuakePower(quakefactor, jiggers.RelIntensityY, jiggers.RelOffsetY);
|
2015-02-18 20:48:52 +00:00
|
|
|
viewx += FixedMul(finecosine[ang], power);
|
|
|
|
viewy += FixedMul(finesine[ang], power);
|
|
|
|
}
|
Added QF_SINE
- Squashed commit of the following:
commit bc45fe3263d34ef5f746f524687999c19bf7b779
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:51:05 2015 -0600
wave scale -> wave speed
commit ff96388b128c724c1198757bfa52f1935a263356
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:45:32 2015 -0600
More sine quake fixes
commit 2a89749a6fe6d271b9fbdc218779f680afcf4cb6
Merge: 719dfbe 5456074
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:37:22 2015 -0600
Added QF_WAVE to A_QuakeEx.
- Changes the random quakes into a sine wave (see Shadow Warrior/Rise of the Triad reboots, Hard Reset, etc.)
- Added 3 properties to control waves per second along each individual axis. Only works with QF_WAVE.
- Intensity X/Y/Z property becomes the amplitude of the wave.
- Stacks with regular quakes, allowing shaking along the camera which must be called using A_QuakeEx WITHOUT the flag, or the other quaking functions.
- Uses the youngest quake's time for positioning.
commit 54560741581e8d15cc7060e8e068cf85e9a4b432
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:21:19 2015 -0600
Recommitted recommended changes by Randi, with some modifications. Now, we should be finished!
commit 6f4473013411686d88fc185bdc1cc58b1035b0f1
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:52:57 2015 -0600
Finish this revert.
commit 467e53f9400f588a2ada9b32e7634cb1f4ad5066
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:46:02 2015 -0600
Reverted back to what was working.
commit da9de56a67efda08036e481fd5fccd5392ce6810
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:53:20 2015 -0600
Forgot this bit, for testing.
commit c5093d9bb97caf8478cefc32abc56a036feeea58
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:52:46 2015 -0600
Some more progress, but...
- This did not solve anything. In fact, it did the opposite -- completely broke wave quakes. Now they only happen whenever a random quake is in progress.
- Left in the commented code on purpose so Randi can test it.
commit 7e526405d2127cbb279f66008c8f8e55a5d497f3
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:50:42 2015 -0600
- Use newest waveform timer, not oldest.
commit 1356443609dbc6c7f46e081d0846816dc0836124
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:32:09 2015 -0600
- Got regular quakes to multiply onto sine quakes, but the vice versa needs fixing too.
commit d95796c94c70cd0229d4a6d30f69e3a7568b9588
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 16:46:21 2015 -0600
- Last hurdle. Now just need to figure out how to properly scale up and down.
commit 4bc3458e689155ce72c09776604d9eb4fa73d8be
Author: MajorCooke <paul.growney22@gmail.com>
Date: Tue Feb 24 23:18:03 2015 -0600
- Fixed the quakes being unstackable.
commit b51012d6d4ea065bf7f6fc9c1a0472966491f7af
Author: MajorCooke <paul.growney22@gmail.com>
Date: Mon Feb 23 23:48:34 2015 -0600
QF_WAVE renamed from SINE.
- Lots of ground covered, but still more to go.
- Still need to figure out how to make the camera properly shudder.
commit 427e4893193470bbf45415ffec70a0b69b8cccfd
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sun Feb 22 16:52:30 2015 -0600
- Begin the groundworks for QF_SINE.
- Need to figure out how to rework and manipulate the sine wave to move faster, and to allow going below 0 without breaking it too much.
2015-03-02 00:53:34 +00:00
|
|
|
// FIXME: Relative Z is not relative
|
|
|
|
// [MC]On it! Will be introducing pitch after QF_WAVE.
|
|
|
|
if ((jiggers.RelIntensityZ | jiggers.RelOffsetZ) != 0)
|
2015-02-18 20:48:52 +00:00
|
|
|
{
|
Added QF_SINE
- Squashed commit of the following:
commit bc45fe3263d34ef5f746f524687999c19bf7b779
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:51:05 2015 -0600
wave scale -> wave speed
commit ff96388b128c724c1198757bfa52f1935a263356
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:45:32 2015 -0600
More sine quake fixes
commit 2a89749a6fe6d271b9fbdc218779f680afcf4cb6
Merge: 719dfbe 5456074
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:37:22 2015 -0600
Added QF_WAVE to A_QuakeEx.
- Changes the random quakes into a sine wave (see Shadow Warrior/Rise of the Triad reboots, Hard Reset, etc.)
- Added 3 properties to control waves per second along each individual axis. Only works with QF_WAVE.
- Intensity X/Y/Z property becomes the amplitude of the wave.
- Stacks with regular quakes, allowing shaking along the camera which must be called using A_QuakeEx WITHOUT the flag, or the other quaking functions.
- Uses the youngest quake's time for positioning.
commit 54560741581e8d15cc7060e8e068cf85e9a4b432
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:21:19 2015 -0600
Recommitted recommended changes by Randi, with some modifications. Now, we should be finished!
commit 6f4473013411686d88fc185bdc1cc58b1035b0f1
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:52:57 2015 -0600
Finish this revert.
commit 467e53f9400f588a2ada9b32e7634cb1f4ad5066
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:46:02 2015 -0600
Reverted back to what was working.
commit da9de56a67efda08036e481fd5fccd5392ce6810
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:53:20 2015 -0600
Forgot this bit, for testing.
commit c5093d9bb97caf8478cefc32abc56a036feeea58
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:52:46 2015 -0600
Some more progress, but...
- This did not solve anything. In fact, it did the opposite -- completely broke wave quakes. Now they only happen whenever a random quake is in progress.
- Left in the commented code on purpose so Randi can test it.
commit 7e526405d2127cbb279f66008c8f8e55a5d497f3
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:50:42 2015 -0600
- Use newest waveform timer, not oldest.
commit 1356443609dbc6c7f46e081d0846816dc0836124
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:32:09 2015 -0600
- Got regular quakes to multiply onto sine quakes, but the vice versa needs fixing too.
commit d95796c94c70cd0229d4a6d30f69e3a7568b9588
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 16:46:21 2015 -0600
- Last hurdle. Now just need to figure out how to properly scale up and down.
commit 4bc3458e689155ce72c09776604d9eb4fa73d8be
Author: MajorCooke <paul.growney22@gmail.com>
Date: Tue Feb 24 23:18:03 2015 -0600
- Fixed the quakes being unstackable.
commit b51012d6d4ea065bf7f6fc9c1a0472966491f7af
Author: MajorCooke <paul.growney22@gmail.com>
Date: Mon Feb 23 23:48:34 2015 -0600
QF_WAVE renamed from SINE.
- Lots of ground covered, but still more to go.
- Still need to figure out how to make the camera properly shudder.
commit 427e4893193470bbf45415ffec70a0b69b8cccfd
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sun Feb 22 16:52:30 2015 -0600
- Begin the groundworks for QF_SINE.
- Need to figure out how to rework and manipulate the sine wave to move faster, and to allow going below 0 without breaking it too much.
2015-03-02 00:53:34 +00:00
|
|
|
viewz += QuakePower(quakefactor, jiggers.RelIntensityZ, jiggers.RelOffsetZ);
|
2015-02-18 20:48:52 +00:00
|
|
|
}
|
Added QF_SINE
- Squashed commit of the following:
commit bc45fe3263d34ef5f746f524687999c19bf7b779
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:51:05 2015 -0600
wave scale -> wave speed
commit ff96388b128c724c1198757bfa52f1935a263356
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:45:32 2015 -0600
More sine quake fixes
commit 2a89749a6fe6d271b9fbdc218779f680afcf4cb6
Merge: 719dfbe 5456074
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:37:22 2015 -0600
Added QF_WAVE to A_QuakeEx.
- Changes the random quakes into a sine wave (see Shadow Warrior/Rise of the Triad reboots, Hard Reset, etc.)
- Added 3 properties to control waves per second along each individual axis. Only works with QF_WAVE.
- Intensity X/Y/Z property becomes the amplitude of the wave.
- Stacks with regular quakes, allowing shaking along the camera which must be called using A_QuakeEx WITHOUT the flag, or the other quaking functions.
- Uses the youngest quake's time for positioning.
commit 54560741581e8d15cc7060e8e068cf85e9a4b432
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:21:19 2015 -0600
Recommitted recommended changes by Randi, with some modifications. Now, we should be finished!
commit 6f4473013411686d88fc185bdc1cc58b1035b0f1
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:52:57 2015 -0600
Finish this revert.
commit 467e53f9400f588a2ada9b32e7634cb1f4ad5066
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:46:02 2015 -0600
Reverted back to what was working.
commit da9de56a67efda08036e481fd5fccd5392ce6810
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:53:20 2015 -0600
Forgot this bit, for testing.
commit c5093d9bb97caf8478cefc32abc56a036feeea58
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:52:46 2015 -0600
Some more progress, but...
- This did not solve anything. In fact, it did the opposite -- completely broke wave quakes. Now they only happen whenever a random quake is in progress.
- Left in the commented code on purpose so Randi can test it.
commit 7e526405d2127cbb279f66008c8f8e55a5d497f3
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:50:42 2015 -0600
- Use newest waveform timer, not oldest.
commit 1356443609dbc6c7f46e081d0846816dc0836124
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:32:09 2015 -0600
- Got regular quakes to multiply onto sine quakes, but the vice versa needs fixing too.
commit d95796c94c70cd0229d4a6d30f69e3a7568b9588
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 16:46:21 2015 -0600
- Last hurdle. Now just need to figure out how to properly scale up and down.
commit 4bc3458e689155ce72c09776604d9eb4fa73d8be
Author: MajorCooke <paul.growney22@gmail.com>
Date: Tue Feb 24 23:18:03 2015 -0600
- Fixed the quakes being unstackable.
commit b51012d6d4ea065bf7f6fc9c1a0472966491f7af
Author: MajorCooke <paul.growney22@gmail.com>
Date: Mon Feb 23 23:48:34 2015 -0600
QF_WAVE renamed from SINE.
- Lots of ground covered, but still more to go.
- Still need to figure out how to make the camera properly shudder.
commit 427e4893193470bbf45415ffec70a0b69b8cccfd
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sun Feb 22 16:52:30 2015 -0600
- Begin the groundworks for QF_SINE.
- Need to figure out how to rework and manipulate the sine wave to move faster, and to allow going below 0 without breaking it too much.
2015-03-02 00:53:34 +00:00
|
|
|
if ((jiggers.IntensityX | jiggers.OffsetX) != 0)
|
2015-02-18 20:48:52 +00:00
|
|
|
{
|
Added QF_SINE
- Squashed commit of the following:
commit bc45fe3263d34ef5f746f524687999c19bf7b779
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:51:05 2015 -0600
wave scale -> wave speed
commit ff96388b128c724c1198757bfa52f1935a263356
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:45:32 2015 -0600
More sine quake fixes
commit 2a89749a6fe6d271b9fbdc218779f680afcf4cb6
Merge: 719dfbe 5456074
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:37:22 2015 -0600
Added QF_WAVE to A_QuakeEx.
- Changes the random quakes into a sine wave (see Shadow Warrior/Rise of the Triad reboots, Hard Reset, etc.)
- Added 3 properties to control waves per second along each individual axis. Only works with QF_WAVE.
- Intensity X/Y/Z property becomes the amplitude of the wave.
- Stacks with regular quakes, allowing shaking along the camera which must be called using A_QuakeEx WITHOUT the flag, or the other quaking functions.
- Uses the youngest quake's time for positioning.
commit 54560741581e8d15cc7060e8e068cf85e9a4b432
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:21:19 2015 -0600
Recommitted recommended changes by Randi, with some modifications. Now, we should be finished!
commit 6f4473013411686d88fc185bdc1cc58b1035b0f1
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:52:57 2015 -0600
Finish this revert.
commit 467e53f9400f588a2ada9b32e7634cb1f4ad5066
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:46:02 2015 -0600
Reverted back to what was working.
commit da9de56a67efda08036e481fd5fccd5392ce6810
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:53:20 2015 -0600
Forgot this bit, for testing.
commit c5093d9bb97caf8478cefc32abc56a036feeea58
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:52:46 2015 -0600
Some more progress, but...
- This did not solve anything. In fact, it did the opposite -- completely broke wave quakes. Now they only happen whenever a random quake is in progress.
- Left in the commented code on purpose so Randi can test it.
commit 7e526405d2127cbb279f66008c8f8e55a5d497f3
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:50:42 2015 -0600
- Use newest waveform timer, not oldest.
commit 1356443609dbc6c7f46e081d0846816dc0836124
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:32:09 2015 -0600
- Got regular quakes to multiply onto sine quakes, but the vice versa needs fixing too.
commit d95796c94c70cd0229d4a6d30f69e3a7568b9588
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 16:46:21 2015 -0600
- Last hurdle. Now just need to figure out how to properly scale up and down.
commit 4bc3458e689155ce72c09776604d9eb4fa73d8be
Author: MajorCooke <paul.growney22@gmail.com>
Date: Tue Feb 24 23:18:03 2015 -0600
- Fixed the quakes being unstackable.
commit b51012d6d4ea065bf7f6fc9c1a0472966491f7af
Author: MajorCooke <paul.growney22@gmail.com>
Date: Mon Feb 23 23:48:34 2015 -0600
QF_WAVE renamed from SINE.
- Lots of ground covered, but still more to go.
- Still need to figure out how to make the camera properly shudder.
commit 427e4893193470bbf45415ffec70a0b69b8cccfd
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sun Feb 22 16:52:30 2015 -0600
- Begin the groundworks for QF_SINE.
- Need to figure out how to rework and manipulate the sine wave to move faster, and to allow going below 0 without breaking it too much.
2015-03-02 00:53:34 +00:00
|
|
|
viewx += QuakePower(quakefactor, jiggers.IntensityX, jiggers.OffsetX);
|
2015-02-18 20:48:52 +00:00
|
|
|
}
|
Added QF_SINE
- Squashed commit of the following:
commit bc45fe3263d34ef5f746f524687999c19bf7b779
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:51:05 2015 -0600
wave scale -> wave speed
commit ff96388b128c724c1198757bfa52f1935a263356
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:45:32 2015 -0600
More sine quake fixes
commit 2a89749a6fe6d271b9fbdc218779f680afcf4cb6
Merge: 719dfbe 5456074
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:37:22 2015 -0600
Added QF_WAVE to A_QuakeEx.
- Changes the random quakes into a sine wave (see Shadow Warrior/Rise of the Triad reboots, Hard Reset, etc.)
- Added 3 properties to control waves per second along each individual axis. Only works with QF_WAVE.
- Intensity X/Y/Z property becomes the amplitude of the wave.
- Stacks with regular quakes, allowing shaking along the camera which must be called using A_QuakeEx WITHOUT the flag, or the other quaking functions.
- Uses the youngest quake's time for positioning.
commit 54560741581e8d15cc7060e8e068cf85e9a4b432
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:21:19 2015 -0600
Recommitted recommended changes by Randi, with some modifications. Now, we should be finished!
commit 6f4473013411686d88fc185bdc1cc58b1035b0f1
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:52:57 2015 -0600
Finish this revert.
commit 467e53f9400f588a2ada9b32e7634cb1f4ad5066
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:46:02 2015 -0600
Reverted back to what was working.
commit da9de56a67efda08036e481fd5fccd5392ce6810
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:53:20 2015 -0600
Forgot this bit, for testing.
commit c5093d9bb97caf8478cefc32abc56a036feeea58
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:52:46 2015 -0600
Some more progress, but...
- This did not solve anything. In fact, it did the opposite -- completely broke wave quakes. Now they only happen whenever a random quake is in progress.
- Left in the commented code on purpose so Randi can test it.
commit 7e526405d2127cbb279f66008c8f8e55a5d497f3
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:50:42 2015 -0600
- Use newest waveform timer, not oldest.
commit 1356443609dbc6c7f46e081d0846816dc0836124
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:32:09 2015 -0600
- Got regular quakes to multiply onto sine quakes, but the vice versa needs fixing too.
commit d95796c94c70cd0229d4a6d30f69e3a7568b9588
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 16:46:21 2015 -0600
- Last hurdle. Now just need to figure out how to properly scale up and down.
commit 4bc3458e689155ce72c09776604d9eb4fa73d8be
Author: MajorCooke <paul.growney22@gmail.com>
Date: Tue Feb 24 23:18:03 2015 -0600
- Fixed the quakes being unstackable.
commit b51012d6d4ea065bf7f6fc9c1a0472966491f7af
Author: MajorCooke <paul.growney22@gmail.com>
Date: Mon Feb 23 23:48:34 2015 -0600
QF_WAVE renamed from SINE.
- Lots of ground covered, but still more to go.
- Still need to figure out how to make the camera properly shudder.
commit 427e4893193470bbf45415ffec70a0b69b8cccfd
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sun Feb 22 16:52:30 2015 -0600
- Begin the groundworks for QF_SINE.
- Need to figure out how to rework and manipulate the sine wave to move faster, and to allow going below 0 without breaking it too much.
2015-03-02 00:53:34 +00:00
|
|
|
if ((jiggers.IntensityY | jiggers.OffsetY) != 0)
|
2015-02-18 20:48:52 +00:00
|
|
|
{
|
Added QF_SINE
- Squashed commit of the following:
commit bc45fe3263d34ef5f746f524687999c19bf7b779
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:51:05 2015 -0600
wave scale -> wave speed
commit ff96388b128c724c1198757bfa52f1935a263356
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:45:32 2015 -0600
More sine quake fixes
commit 2a89749a6fe6d271b9fbdc218779f680afcf4cb6
Merge: 719dfbe 5456074
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:37:22 2015 -0600
Added QF_WAVE to A_QuakeEx.
- Changes the random quakes into a sine wave (see Shadow Warrior/Rise of the Triad reboots, Hard Reset, etc.)
- Added 3 properties to control waves per second along each individual axis. Only works with QF_WAVE.
- Intensity X/Y/Z property becomes the amplitude of the wave.
- Stacks with regular quakes, allowing shaking along the camera which must be called using A_QuakeEx WITHOUT the flag, or the other quaking functions.
- Uses the youngest quake's time for positioning.
commit 54560741581e8d15cc7060e8e068cf85e9a4b432
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:21:19 2015 -0600
Recommitted recommended changes by Randi, with some modifications. Now, we should be finished!
commit 6f4473013411686d88fc185bdc1cc58b1035b0f1
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:52:57 2015 -0600
Finish this revert.
commit 467e53f9400f588a2ada9b32e7634cb1f4ad5066
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:46:02 2015 -0600
Reverted back to what was working.
commit da9de56a67efda08036e481fd5fccd5392ce6810
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:53:20 2015 -0600
Forgot this bit, for testing.
commit c5093d9bb97caf8478cefc32abc56a036feeea58
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:52:46 2015 -0600
Some more progress, but...
- This did not solve anything. In fact, it did the opposite -- completely broke wave quakes. Now they only happen whenever a random quake is in progress.
- Left in the commented code on purpose so Randi can test it.
commit 7e526405d2127cbb279f66008c8f8e55a5d497f3
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:50:42 2015 -0600
- Use newest waveform timer, not oldest.
commit 1356443609dbc6c7f46e081d0846816dc0836124
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:32:09 2015 -0600
- Got regular quakes to multiply onto sine quakes, but the vice versa needs fixing too.
commit d95796c94c70cd0229d4a6d30f69e3a7568b9588
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 16:46:21 2015 -0600
- Last hurdle. Now just need to figure out how to properly scale up and down.
commit 4bc3458e689155ce72c09776604d9eb4fa73d8be
Author: MajorCooke <paul.growney22@gmail.com>
Date: Tue Feb 24 23:18:03 2015 -0600
- Fixed the quakes being unstackable.
commit b51012d6d4ea065bf7f6fc9c1a0472966491f7af
Author: MajorCooke <paul.growney22@gmail.com>
Date: Mon Feb 23 23:48:34 2015 -0600
QF_WAVE renamed from SINE.
- Lots of ground covered, but still more to go.
- Still need to figure out how to make the camera properly shudder.
commit 427e4893193470bbf45415ffec70a0b69b8cccfd
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sun Feb 22 16:52:30 2015 -0600
- Begin the groundworks for QF_SINE.
- Need to figure out how to rework and manipulate the sine wave to move faster, and to allow going below 0 without breaking it too much.
2015-03-02 00:53:34 +00:00
|
|
|
viewy += QuakePower(quakefactor, jiggers.IntensityY, jiggers.OffsetY);
|
2015-02-18 20:48:52 +00:00
|
|
|
}
|
Added QF_SINE
- Squashed commit of the following:
commit bc45fe3263d34ef5f746f524687999c19bf7b779
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:51:05 2015 -0600
wave scale -> wave speed
commit ff96388b128c724c1198757bfa52f1935a263356
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:45:32 2015 -0600
More sine quake fixes
commit 2a89749a6fe6d271b9fbdc218779f680afcf4cb6
Merge: 719dfbe 5456074
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:37:22 2015 -0600
Added QF_WAVE to A_QuakeEx.
- Changes the random quakes into a sine wave (see Shadow Warrior/Rise of the Triad reboots, Hard Reset, etc.)
- Added 3 properties to control waves per second along each individual axis. Only works with QF_WAVE.
- Intensity X/Y/Z property becomes the amplitude of the wave.
- Stacks with regular quakes, allowing shaking along the camera which must be called using A_QuakeEx WITHOUT the flag, or the other quaking functions.
- Uses the youngest quake's time for positioning.
commit 54560741581e8d15cc7060e8e068cf85e9a4b432
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:21:19 2015 -0600
Recommitted recommended changes by Randi, with some modifications. Now, we should be finished!
commit 6f4473013411686d88fc185bdc1cc58b1035b0f1
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:52:57 2015 -0600
Finish this revert.
commit 467e53f9400f588a2ada9b32e7634cb1f4ad5066
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:46:02 2015 -0600
Reverted back to what was working.
commit da9de56a67efda08036e481fd5fccd5392ce6810
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:53:20 2015 -0600
Forgot this bit, for testing.
commit c5093d9bb97caf8478cefc32abc56a036feeea58
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:52:46 2015 -0600
Some more progress, but...
- This did not solve anything. In fact, it did the opposite -- completely broke wave quakes. Now they only happen whenever a random quake is in progress.
- Left in the commented code on purpose so Randi can test it.
commit 7e526405d2127cbb279f66008c8f8e55a5d497f3
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:50:42 2015 -0600
- Use newest waveform timer, not oldest.
commit 1356443609dbc6c7f46e081d0846816dc0836124
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:32:09 2015 -0600
- Got regular quakes to multiply onto sine quakes, but the vice versa needs fixing too.
commit d95796c94c70cd0229d4a6d30f69e3a7568b9588
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 16:46:21 2015 -0600
- Last hurdle. Now just need to figure out how to properly scale up and down.
commit 4bc3458e689155ce72c09776604d9eb4fa73d8be
Author: MajorCooke <paul.growney22@gmail.com>
Date: Tue Feb 24 23:18:03 2015 -0600
- Fixed the quakes being unstackable.
commit b51012d6d4ea065bf7f6fc9c1a0472966491f7af
Author: MajorCooke <paul.growney22@gmail.com>
Date: Mon Feb 23 23:48:34 2015 -0600
QF_WAVE renamed from SINE.
- Lots of ground covered, but still more to go.
- Still need to figure out how to make the camera properly shudder.
commit 427e4893193470bbf45415ffec70a0b69b8cccfd
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sun Feb 22 16:52:30 2015 -0600
- Begin the groundworks for QF_SINE.
- Need to figure out how to rework and manipulate the sine wave to move faster, and to allow going below 0 without breaking it too much.
2015-03-02 00:53:34 +00:00
|
|
|
if ((jiggers.IntensityZ | jiggers.OffsetZ) != 0)
|
2015-02-14 21:58:39 +00:00
|
|
|
{
|
Added QF_SINE
- Squashed commit of the following:
commit bc45fe3263d34ef5f746f524687999c19bf7b779
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:51:05 2015 -0600
wave scale -> wave speed
commit ff96388b128c724c1198757bfa52f1935a263356
Author: Randy Heit <rheit@users.noreply.github.com>
Date: Sun Mar 1 18:45:32 2015 -0600
More sine quake fixes
commit 2a89749a6fe6d271b9fbdc218779f680afcf4cb6
Merge: 719dfbe 5456074
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:37:22 2015 -0600
Added QF_WAVE to A_QuakeEx.
- Changes the random quakes into a sine wave (see Shadow Warrior/Rise of the Triad reboots, Hard Reset, etc.)
- Added 3 properties to control waves per second along each individual axis. Only works with QF_WAVE.
- Intensity X/Y/Z property becomes the amplitude of the wave.
- Stacks with regular quakes, allowing shaking along the camera which must be called using A_QuakeEx WITHOUT the flag, or the other quaking functions.
- Uses the youngest quake's time for positioning.
commit 54560741581e8d15cc7060e8e068cf85e9a4b432
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 20:21:19 2015 -0600
Recommitted recommended changes by Randi, with some modifications. Now, we should be finished!
commit 6f4473013411686d88fc185bdc1cc58b1035b0f1
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:52:57 2015 -0600
Finish this revert.
commit 467e53f9400f588a2ada9b32e7634cb1f4ad5066
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sat Feb 28 12:46:02 2015 -0600
Reverted back to what was working.
commit da9de56a67efda08036e481fd5fccd5392ce6810
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:53:20 2015 -0600
Forgot this bit, for testing.
commit c5093d9bb97caf8478cefc32abc56a036feeea58
Author: MajorCooke <paul.growney22@gmail.com>
Date: Thu Feb 26 18:52:46 2015 -0600
Some more progress, but...
- This did not solve anything. In fact, it did the opposite -- completely broke wave quakes. Now they only happen whenever a random quake is in progress.
- Left in the commented code on purpose so Randi can test it.
commit 7e526405d2127cbb279f66008c8f8e55a5d497f3
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:50:42 2015 -0600
- Use newest waveform timer, not oldest.
commit 1356443609dbc6c7f46e081d0846816dc0836124
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 17:32:09 2015 -0600
- Got regular quakes to multiply onto sine quakes, but the vice versa needs fixing too.
commit d95796c94c70cd0229d4a6d30f69e3a7568b9588
Author: MajorCooke <paul.growney22@gmail.com>
Date: Wed Feb 25 16:46:21 2015 -0600
- Last hurdle. Now just need to figure out how to properly scale up and down.
commit 4bc3458e689155ce72c09776604d9eb4fa73d8be
Author: MajorCooke <paul.growney22@gmail.com>
Date: Tue Feb 24 23:18:03 2015 -0600
- Fixed the quakes being unstackable.
commit b51012d6d4ea065bf7f6fc9c1a0472966491f7af
Author: MajorCooke <paul.growney22@gmail.com>
Date: Mon Feb 23 23:48:34 2015 -0600
QF_WAVE renamed from SINE.
- Lots of ground covered, but still more to go.
- Still need to figure out how to make the camera properly shudder.
commit 427e4893193470bbf45415ffec70a0b69b8cccfd
Author: MajorCooke <paul.growney22@gmail.com>
Date: Sun Feb 22 16:52:30 2015 -0600
- Begin the groundworks for QF_SINE.
- Need to figure out how to rework and manipulate the sine wave to move faster, and to allow going below 0 without breaking it too much.
2015-03-02 00:53:34 +00:00
|
|
|
viewz += QuakePower(quakefactor, jiggers.IntensityZ, jiggers.OffsetZ);
|
2015-02-14 21:58:39 +00:00
|
|
|
}
|
2011-07-07 15:37:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
extralight = camera->player ? camera->player->extralight : 0;
|
|
|
|
|
|
|
|
// killough 3/20/98, 4/4/98: select colormap based on player status
|
|
|
|
// [RH] Can also select a blend
|
|
|
|
newblend = 0;
|
|
|
|
|
|
|
|
TArray<lightlist_t> &lightlist = viewsector->e->XFloor.lightlist;
|
|
|
|
if (lightlist.Size() > 0)
|
|
|
|
{
|
2013-04-17 01:32:40 +00:00
|
|
|
for(unsigned int i = 0; i < lightlist.Size(); i++)
|
2011-07-07 15:37:47 +00:00
|
|
|
{
|
2013-04-17 01:32:40 +00:00
|
|
|
secplane_t *plane;
|
|
|
|
int viewside;
|
|
|
|
plane = (i < lightlist.Size()-1) ? &lightlist[i+1].plane : &viewsector->floorplane;
|
|
|
|
viewside = plane->PointOnSide(viewx, viewy, viewz);
|
|
|
|
// Reverse the direction of the test if the plane was downward facing.
|
|
|
|
// We want to know if the view is above it, whatever its orientation may be.
|
|
|
|
if (plane->c < 0)
|
|
|
|
viewside = -viewside;
|
|
|
|
if (viewside > 0)
|
2011-07-07 15:37:47 +00:00
|
|
|
{
|
|
|
|
// 3d floor 'fog' is rendered as a blending value
|
|
|
|
PalEntry blendv = lightlist[i].blend;
|
|
|
|
|
|
|
|
// If no alpha is set, use 50%
|
|
|
|
if (blendv.a==0 && blendv!=0) blendv.a=128;
|
|
|
|
newblend = blendv.d;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const sector_t *s = viewsector->GetHeightSec();
|
|
|
|
if (s != NULL)
|
|
|
|
{
|
2013-04-17 01:32:40 +00:00
|
|
|
newblend = s->floorplane.PointOnSide(viewx, viewy, viewz) < 0
|
2011-07-07 15:37:47 +00:00
|
|
|
? s->bottommap
|
2013-04-17 01:32:40 +00:00
|
|
|
: s->ceilingplane.PointOnSide(viewx, viewy, viewz) < 0
|
2011-07-07 15:37:47 +00:00
|
|
|
? s->topmap
|
|
|
|
: s->midmap;
|
|
|
|
if (APART(newblend) == 0 && newblend >= numfakecmaps)
|
|
|
|
newblend = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// [RH] Don't override testblend unless entering a sector with a
|
|
|
|
// blend different from the previous sector's. Same goes with
|
|
|
|
// NormalLight's maps pointer.
|
|
|
|
if (R_OldBlend != newblend)
|
|
|
|
{
|
|
|
|
R_OldBlend = newblend;
|
|
|
|
if (APART(newblend))
|
|
|
|
{
|
|
|
|
BaseBlendR = RPART(newblend);
|
|
|
|
BaseBlendG = GPART(newblend);
|
|
|
|
BaseBlendB = BPART(newblend);
|
|
|
|
BaseBlendA = APART(newblend) / 255.f;
|
|
|
|
NormalLight.Maps = realcolormaps;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
NormalLight.Maps = realcolormaps + NUMCOLORMAPS*256*newblend;
|
|
|
|
BaseBlendR = BaseBlendG = BaseBlendB = 0;
|
|
|
|
BaseBlendA = 0.f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-05-06 03:39:45 +00:00
|
|
|
Renderer->CopyStackedViewParameters();
|
2011-07-07 15:37:47 +00:00
|
|
|
Renderer->SetupFrame(player);
|
|
|
|
|
|
|
|
validcount++;
|
|
|
|
|
|
|
|
if (RenderTarget == screen && r_clearbuffer != 0)
|
|
|
|
{
|
|
|
|
int color;
|
|
|
|
int hom = r_clearbuffer;
|
|
|
|
|
|
|
|
if (hom == 3)
|
|
|
|
{
|
|
|
|
hom = ((I_FPSTime() / 128) & 1) + 1;
|
|
|
|
}
|
|
|
|
if (hom == 1)
|
|
|
|
{
|
|
|
|
color = GPalette.BlackIndex;
|
|
|
|
}
|
|
|
|
else if (hom == 2)
|
|
|
|
{
|
|
|
|
color = GPalette.WhiteIndex;
|
|
|
|
}
|
|
|
|
else if (hom == 4)
|
|
|
|
{
|
|
|
|
color = (I_FPSTime() / 32) & 255;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
color = pr_hom();
|
|
|
|
}
|
|
|
|
Renderer->ClearBuffer(color);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// FCanvasTextureInfo :: Add
|
|
|
|
//
|
|
|
|
// Assigns a camera to a canvas texture.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void FCanvasTextureInfo::Add (AActor *viewpoint, FTextureID picnum, int fov)
|
|
|
|
{
|
|
|
|
FCanvasTextureInfo *probe;
|
|
|
|
FCanvasTexture *texture;
|
|
|
|
|
|
|
|
if (!picnum.isValid())
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
texture = static_cast<FCanvasTexture *>(TexMan[picnum]);
|
|
|
|
if (!texture->bHasCanvas)
|
|
|
|
{
|
2014-05-24 23:12:16 +00:00
|
|
|
Printf ("%s is not a valid target for a camera\n", texture->Name.GetChars());
|
2011-07-07 15:37:47 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Is this texture already assigned to a camera?
|
|
|
|
for (probe = List; probe != NULL; probe = probe->Next)
|
|
|
|
{
|
|
|
|
if (probe->Texture == texture)
|
|
|
|
{
|
|
|
|
// Yes, change its assignment to this new camera
|
|
|
|
if (probe->Viewpoint != viewpoint || probe->FOV != fov)
|
|
|
|
{
|
|
|
|
texture->bFirstUpdate = true;
|
|
|
|
}
|
|
|
|
probe->Viewpoint = viewpoint;
|
|
|
|
probe->FOV = fov;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// No, create a new assignment
|
|
|
|
probe = new FCanvasTextureInfo;
|
|
|
|
probe->Viewpoint = viewpoint;
|
|
|
|
probe->Texture = texture;
|
|
|
|
probe->PicNum = picnum;
|
|
|
|
probe->FOV = fov;
|
|
|
|
probe->Next = List;
|
|
|
|
texture->bFirstUpdate = true;
|
|
|
|
List = probe;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// FCanvasTextureInfo :: UpdateAll
|
|
|
|
//
|
|
|
|
// Updates all canvas textures that were visible in the last frame.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void FCanvasTextureInfo::UpdateAll ()
|
|
|
|
{
|
|
|
|
FCanvasTextureInfo *probe;
|
|
|
|
|
|
|
|
for (probe = List; probe != NULL; probe = probe->Next)
|
|
|
|
{
|
|
|
|
if (probe->Viewpoint != NULL && probe->Texture->bNeedsUpdate)
|
|
|
|
{
|
|
|
|
Renderer->RenderTextureView(probe->Texture, probe->Viewpoint, probe->FOV);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// FCanvasTextureInfo :: EmptyList
|
|
|
|
//
|
|
|
|
// Removes all camera->texture assignments.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void FCanvasTextureInfo::EmptyList ()
|
|
|
|
{
|
|
|
|
FCanvasTextureInfo *probe, *next;
|
|
|
|
|
|
|
|
for (probe = List; probe != NULL; probe = next)
|
|
|
|
{
|
|
|
|
next = probe->Next;
|
2012-02-28 02:17:29 +00:00
|
|
|
probe->Texture->Unload();
|
2011-07-07 15:37:47 +00:00
|
|
|
delete probe;
|
|
|
|
}
|
|
|
|
List = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// FCanvasTextureInfo :: Serialize
|
|
|
|
//
|
|
|
|
// Reads or writes the current set of mappings in an archive.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void FCanvasTextureInfo::Serialize (FArchive &arc)
|
|
|
|
{
|
|
|
|
if (arc.IsStoring ())
|
|
|
|
{
|
|
|
|
FCanvasTextureInfo *probe;
|
|
|
|
|
|
|
|
for (probe = List; probe != NULL; probe = probe->Next)
|
|
|
|
{
|
|
|
|
if (probe->Texture != NULL && probe->Viewpoint != NULL)
|
|
|
|
{
|
|
|
|
arc << probe->Viewpoint << probe->FOV << probe->PicNum;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
AActor *nullactor = NULL;
|
|
|
|
arc << nullactor;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
AActor *viewpoint;
|
|
|
|
int fov;
|
|
|
|
FTextureID picnum;
|
|
|
|
|
|
|
|
EmptyList ();
|
|
|
|
while (arc << viewpoint, viewpoint != NULL)
|
|
|
|
{
|
|
|
|
arc << fov << picnum;
|
|
|
|
Add (viewpoint, picnum, fov);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// FCanvasTextureInfo :: Mark
|
|
|
|
//
|
|
|
|
// Marks all viewpoints in the list for the collector.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void FCanvasTextureInfo::Mark()
|
|
|
|
{
|
|
|
|
for (FCanvasTextureInfo *probe = List; probe != NULL; probe = probe->Next)
|
|
|
|
{
|
|
|
|
GC::Mark(probe->Viewpoint);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|