1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-22 18:32:44 +01:00

clang-format files in rwlib/source/rw

This commit is contained in:
Daniel Evans 2016-09-09 21:13:21 +01:00
parent a403cc87b7
commit 94cc76d36a
2 changed files with 22 additions and 28 deletions

View File

@ -2,23 +2,21 @@
#define _LIBRW_DEFINES_HPP_
#if RW_DEBUG && RW_VERBOSE_DEBUG_MESSAGES
#include <iostream>
#define RW_MESSAGE(msg) \
std::cout << __FILE__ << ":"<< __LINE__ << ": " << msg << std::endl
#define RW_ERROR(msg) \
std::cerr << __FILE__ << ":"<< __LINE__ << ": " << msg << std::endl
#define RW_CHECK(cond, msg) \
if(!(cond)) RW_ERROR(msg)
#include <iostream>
#define RW_MESSAGE(msg) \
std::cout << __FILE__ << ":" << __LINE__ << ": " << msg << std::endl
#define RW_ERROR(msg) \
std::cerr << __FILE__ << ":" << __LINE__ << ": " << msg << std::endl
#define RW_CHECK(cond, msg) \
if (!(cond)) RW_ERROR(msg)
#else
#define RW_MESSAGE(msg)
#define RW_ERROR(msg)
#define RW_CHECK(cond, msg)
#define RW_MESSAGE(msg)
#define RW_ERROR(msg)
#define RW_CHECK(cond, msg)
#endif
#define RW_UNUSED(var) \
(void) var
#define RW_UNUSED(var) (void)var
#define RW_UNIMPLEMENTED(msg) \
RW_MESSAGE("Unimplemented: " << msg)
#define RW_UNIMPLEMENTED(msg) RW_MESSAGE("Unimplemented: " << msg)
#endif

View File

@ -3,11 +3,11 @@
#define _RWTYPES_HPP_
#include <cstdint>
#include <map>
#include <string>
#include <glm/glm.hpp>
#include <map>
#include <memory>
#include <rw/defines.hpp>
#include <string>
#define RW_USING(feature) 1 == feature
@ -27,27 +27,24 @@
*/
#define WORLD_GRID_SIZE (4000l)
#define WORLD_CELL_SIZE (100l)
#define WORLD_GRID_WIDTH (WORLD_GRID_SIZE/WORLD_CELL_SIZE)
#define WORLD_GRID_CELLS (WORLD_GRID_WIDTH*WORLD_GRID_WIDTH)
#define WORLD_GRID_WIDTH (WORLD_GRID_SIZE / WORLD_CELL_SIZE)
#define WORLD_GRID_CELLS (WORLD_GRID_WIDTH * WORLD_GRID_WIDTH)
struct Animation;
typedef std::map<std::string, Animation*> AnimationSet;
namespace RWTypes
{
namespace RWTypes {
/**
* @struct RGB
* Stores 8 bit RGB data
*/
struct RGB
{
uint8_t r, g, b;
struct RGB {
uint8_t r, g, b;
operator glm::vec3() {
return glm::vec3(r, g, b)/255.f;
return glm::vec3(r, g, b) / 255.f;
}
};
@ -55,9 +52,8 @@ struct RGB
* @struct RGBA
* Stores 8 bit RGBA data
*/
struct RGBA
{
uint8_t r, g, b, a;
struct RGBA {
uint8_t r, g, b, a;
};
}