Skip to content

Commit

Permalink
Cleanup|Client: Removed the "misc" subdirectory
Browse files Browse the repository at this point in the history
Relevant code moved to libdoomsday.
  • Loading branch information
skyjake committed Jul 17, 2020
1 parent 40b7b41 commit a798ca7
Show file tree
Hide file tree
Showing 17 changed files with 394 additions and 427 deletions.
128 changes: 0 additions & 128 deletions doomsday/apps/client/include/misc/r_util.h

This file was deleted.

82 changes: 79 additions & 3 deletions doomsday/apps/client/include/render/r_main.h
Expand Up @@ -18,10 +18,10 @@
* 02110-1301 USA</small>
*/

#ifndef DE_RENDER_R_MAIN_H
#define DE_RENDER_R_MAIN_H
#pragma once

#include "dd_types.h"
#include <de/matrix.h>

DE_EXTERN_C int levelFullBright;

Expand All @@ -41,4 +41,80 @@ void Rend_Draw2DPlayerSprites();
*/
void Rend_Draw3DPlayerSprites();

#endif // DE_RENDER_R_MAIN_H
#ifdef min
# undef min
#endif
#ifdef max
# undef max
#endif

/**
* Description of an inclusive..inclusive light intensity range.
*
* @ingroup data
*/
struct LightRange
{
float min;
float max;

LightRange(float _min = 0, float _max = 0) : min(_min), max(_max) {}
LightRange(float const minMax[2]) : min(minMax[0]), max(minMax[1]) {}
LightRange(const de::Vec2f &minMax) : min(minMax.x), max(minMax.y) {}
LightRange(const LightRange &other) : min(other.min), max(other.max) {}

/// Returns a textual representation of the lightlevels.
de::String asText() const {
return de::Stringf("(min: %.2f max: %.2f)", min, max);
}
};

/**
* Get a global angle from Cartesian coordinates in the map coordinate space
* relative to the viewer.
*
* @param point Map point to test.
*
* @return Angle between the test point and view x,y.
*/
angle_t R_ViewPointToAngle(de::Vec2d point);

/// @copydoc R_ViewPointToAngle()
inline angle_t R_ViewPointToAngle(coord_t x, coord_t y) {
return R_ViewPointToAngle(de::Vec2d(x, y));
}

/**
* Determine distance to the specified point relative to the viewer.
*
* @param x X coordinate to test.
* @param y Y coordinate to test.
*
* @return Distance from the viewer to the test point.
*/
coord_t R_ViewPointDistance(coord_t x, coord_t y);

void R_ProjectViewRelativeLine2D(coord_t const center[2], dd_bool alignToViewPlane,
coord_t width, coord_t offset, coord_t start[2], coord_t end[2]);

void R_ProjectViewRelativeLine2D(de::Vec2d const center, bool alignToViewPlane,
coord_t width, coord_t offset, de::Vec2d &start, de::Vec2d &end);


/**
* Generate texcoords on the surface centered on point.
*
* @param s Texture s coords written back here.
* @param t Texture t coords written back here.
* @param point Point on surface around which texture is centered.
* @param xScale Scale multiplier on the horizontal axis.
* @param yScale Scale multiplier on the vertical axis.
* @param v1 Top left vertex of the surface being projected on.
* @param v2 Bottom right vertex of the surface being projected on.
* @param tangentMatrix Normalized tangent space matrix for the surface being projected to.
*
* @return @c true if the generated coords are within bounds.
*/
bool R_GenerateTexCoords(de::Vec2f &s, de::Vec2f &t, const de::Vec3d &point,
float xScale, float yScale, const de::Vec3d &v1, const de::Vec3d &v2,
const de::Mat3f &tangentMatrix);
2 changes: 1 addition & 1 deletion doomsday/apps/client/include/render/walledge.h
Expand Up @@ -21,9 +21,9 @@
#define RENDER_WALLEDGE

#include "world/line.h"
#include "world/ihplane.h"
#include "wallspec.h"
#include "trianglestripbuilder.h"
#include "misc/ihplane.h"

#include <doomsday/mesh/hedge.h>
#include <de/error.h>
Expand Down
Expand Up @@ -27,7 +27,7 @@
#include <de/string.h>
#include <doomsday/defs/ded.h>
#include <doomsday/defs/dedtypes.h>
#include "misc/r_util.h" // LightRange
#include "render/r_main.h" // LightRange
#include "resource/clienttexture.h"
#include "resource/clientmaterial.h"

Expand Down
File renamed without changes.
25 changes: 13 additions & 12 deletions doomsday/apps/client/src/gl/gl_main.cpp
Expand Up @@ -30,17 +30,6 @@
#include "gl/gl_main.h"
#include "api_gl.h"

#include <de/legacy/concurrency.h>
#include <de/app.h>
#include <de/config.h>
#include <de/glinfo.h>
#include <de/glstate.h>
#include <de/logbuffer.h>
#include <doomsday/console/cmd.h>
#include <doomsday/console/var.h>
#include <doomsday/defs/mapinfo.h>
#include <doomsday/filesys/fs_main.h>
#include <doomsday/res/colorpalettes.h>
#include "clientapp.h"
#include "sys_system.h" // novideo

Expand All @@ -66,10 +55,22 @@
#include "render/rend_model.h"
#include "render/rend_particle.h"
#include "render/vr.h"
#include "misc/r_util.h"

#include "ui/ui_main.h"

#include <doomsday/console/cmd.h>
#include <doomsday/console/var.h>
#include <doomsday/defs/mapinfo.h>
#include <doomsday/filesys/fs_main.h>
#include <doomsday/r_util.h>
#include <doomsday/res/colorpalettes.h>
#include <de/legacy/concurrency.h>
#include <de/app.h>
#include <de/config.h>
#include <de/glinfo.h>
#include <de/glstate.h>
#include <de/logbuffer.h>

#include <SDL_video.h>

using namespace de;
Expand Down

0 comments on commit a798ca7

Please sign in to comment.