mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-23 18:24:59 +00:00
ZVISION: Convert panoramaOptions and tiltOptions to floats
This commit is contained in:
parent
a23970bbc6
commit
4acdf5b7d5
@ -47,7 +47,7 @@ void RenderTable::setRenderState(RenderState newState) {
|
||||
switch (newState) {
|
||||
case PANORAMA:
|
||||
_panoramaOptions.fieldOfView = 60;
|
||||
_panoramaOptions.linearScale = 1;
|
||||
_panoramaOptions.linearScale = 0.55f;
|
||||
generatePanoramaLookupTable();
|
||||
break;
|
||||
case TILT:
|
||||
@ -91,15 +91,12 @@ void RenderTable::mutateImage(uint16 *sourceBuffer, uint16* destBuffer, uint32 i
|
||||
}
|
||||
|
||||
void RenderTable::generatePanoramaLookupTable() {
|
||||
float fieldOfView = _panoramaOptions.fieldOfView;
|
||||
float scale = _panoramaOptions.linearScale;
|
||||
|
||||
memset(_internalBuffer, 0, _numRows * _numColumns * sizeof(uint16));
|
||||
|
||||
float halfWidth = (float)_numColumns / 2.0f;
|
||||
float halfHeight = (float)_numRows / 2.0f;
|
||||
|
||||
float fovRadians = (fieldOfView * M_PI / 180.0f);
|
||||
float fovRadians = (_panoramaOptions.fieldOfView * M_PI / 180.0f);
|
||||
float halfHeightOverTan = halfHeight / tan(fovRadians);
|
||||
float tanOverHalfHeight = tan(fovRadians) / halfHeight;
|
||||
|
||||
|
@ -48,14 +48,14 @@ private:
|
||||
RenderState _renderState;
|
||||
|
||||
struct {
|
||||
uint16 fieldOfView;
|
||||
uint16 linearScale;
|
||||
float fieldOfView;
|
||||
float linearScale;
|
||||
} _panoramaOptions;
|
||||
|
||||
// TODO: See if tilt and panorama need to have separate options
|
||||
struct {
|
||||
uint16 fieldOfView;
|
||||
uint16 linearScale;
|
||||
float fieldOfView;
|
||||
float linearScale;
|
||||
} _tiltOptions;
|
||||
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user