Skip to content

Commit

Permalink
Reformat: Layers
Browse files Browse the repository at this point in the history
  • Loading branch information
invokr committed Jan 15, 2017
1 parent 3d01d0a commit 88a3f6a
Show file tree
Hide file tree
Showing 550 changed files with 89,326 additions and 86,934 deletions.
22 changes: 10 additions & 12 deletions src/Layers/xrAPI/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,24 @@

// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef WINVER // Allow use of features specific to Windows XP or later.
#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows.
#ifndef WINVER // Allow use of features specific to Windows XP or later.
#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif

#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif

#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
#endif

#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later.
#define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE.
#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later.
#define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE.
#endif

#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>



// TODO: reference additional headers your program requires here
2 changes: 1 addition & 1 deletion src/Layers/xrAPI/xrAPI.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "stdafx.h"
#include "Include/xrAPI/xrAPI.h"
#include "stdafx.h"

EngineGlobalEnvironment GlobalEnv = {};
bool g_dedicated_server = false;
22 changes: 11 additions & 11 deletions src/Layers/xrRender/Animation.cpp
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#include "stdafx.h"
#include "stdafx.h"

#include "animation.h"
#include "animation.h"

using namespace animation;
using namespace animation;

const channal_rule channels::rules[channels::max] = { { lerp, lerp }, { lerp, lerp }, { lerp, add }, {lerp, add } };
const channal_rule channels::rules[channels::max] = {{lerp, lerp}, {lerp, lerp}, {lerp, add}, {lerp, add}};

channels::channels( )
channels::channels()
{
init( );
init();
}

void channels::init( )
void channels::init()
{
std::fill( factors, factors + max, 1.f );
std::fill(factors, factors + max, 1.f);
}

void channels:: set_factor ( u16 channel, float factor )
void channels::set_factor(u16 channel, float factor)
{
VERIFY( channel < max );
factors[channel] = factor;
VERIFY(channel < max);
factors[channel] = factor;
}
90 changes: 43 additions & 47 deletions src/Layers/xrRender/Animation.h
Original file line number Diff line number Diff line change
@@ -1,52 +1,48 @@
#pragma once

#include "KinematicAnimatedDefs.h"
#include "KinematicAnimatedDefs.h"

namespace animation
namespace animation
{
enum mix_type
{
lerp =0 ,
add ,
};

struct channal_rule
{
mix_type intern_;
mix_type extern_;
};

struct channel_def
{
float factor;
channal_rule rule;
};

class channels
{
public:
static const u32 max = MAX_CHANNELS;

private:
static const channal_rule rules [ max ];
float factors [ max ];
public:
channels ( );
void init ( );
void set_factor ( u16 channel, float factor );
public:

IC const channal_rule &rule( u16 channel )
{
return rules[ channel ];
}

IC void get_def ( u16 channel, channel_def &def )
{
VERIFY( channel < max );
def.rule = rules[ channel ];
def.factor = factors[ channel ];
}

};
enum mix_type
{
lerp = 0,
add,
};

struct channal_rule
{
mix_type intern_;
mix_type extern_;
};

struct channel_def
{
float factor;
channal_rule rule;
};

class channels
{
public:
static const u32 max = MAX_CHANNELS;

private:
static const channal_rule rules[max];
float factors[max];

public:
channels();
void init();
void set_factor(u16 channel, float factor);

public:
IC const channal_rule& rule(u16 channel) { return rules[channel]; }
IC void get_def(u16 channel, channel_def& def)
{
VERIFY(channel < max);
def.rule = rules[channel];
def.factor = factors[channel];
}
};
};
Loading

0 comments on commit 88a3f6a

Please sign in to comment.