This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//================================================================== | |
// curTimeUS: current time in micro-seconds | |
// idxB : index of the currency we're looking to buy (for BTC/USD: 0=BTC, 1=USD) | |
bool BTT_Agent::checkShouldBuyLineFit( TimeUS curTimeUS, const size_t idxB ) const | |
{ | |
c_auto &tdis = mBTTask.GetCurTDIStream(); | |
c_auto &entries = tdis.GetCurBatch().mTDEntries; | |
c_auto timeMaxS = TimeUSToSecs( curTimeUS ); | |
c_auto timeMinS = timeMaxS - 60.0 * 60.0 * 12; // from previous N seconds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//================================================================== | |
/// FM_LiftDrag.cpp | |
/// | |
/// Created by Davide Pasca - 2017/6/12 | |
/// See the file "license.txt" that comes with this project for | |
/// copyright info. | |
//================================================================== | |
#include "stdafx.h" | |
#include "FM_Utils.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//================================================================== | |
/// DNET_Base.cpp | |
/// | |
/// Created by Davide Pasca - 2009/8/2 | |
/// See the file "license.txt" that comes with this project for | |
/// copyright info. | |
//================================================================== | |
#if defined(WIN32) | |
# include <WinSock2.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//================================================================== | |
template <typename _T> | |
inline _T SampleClamp2D( | |
const DVec<_T> &samp, | |
int sampW, | |
int sampH, | |
float u, | |
float v ) | |
{ | |
u = std::max( u, _T(0) ); // only clamp to min.. max comes below |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sure cost | |
void GameMain::UIInputTouchBegan( void *id, float x, float y ) | |
{ | |
DASSERT( !mEventLock ); mEventLock = true; | |
mEventData.WriteValue<u_int>( EVT_TOUCH_BEGAN ); | |
mEventData.WriteValue<void *>( id ); | |
mEventData.WriteValue<float>( x ); | |
mEventData.WriteValue<float>( y ); | |
mEventLock = false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <class _T, size_t _SIZE> | |
class DArray | |
{ | |
U32 mBuff[ (sizeof(_T) * _SIZE + 3) / 4 ]; | |
size_t mSize = 0; | |
#if defined(_DEBUG) || defined(DEBUG) | |
_T *mpDbgPtr = (_T *)mBuff; | |
#endif | |
public: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//-------------------------- | |
// setup geometry | |
const static u_int NDIV_PHI = 20; | |
const static u_int NDIV_THE = 20; | |
mPosBase.reserve( NDIV_PHI * NDIV_THE ); | |
auto &geom = *moBaseMesh->mpGeom; | |
geom.mNor.reserve( mPosBase.size() ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required (VERSION 2.6) | |
project (ivcc01_thecrib) | |
if(MSVC) #(((((((((((((((( | |
set(CMAKE_C_FLAGS_RELEASE "/DNDEBUG /DWIN32 /MD /Ox /Ot /Oi /GL /Ob2 /Oy /arch:SSE2") | |
set(CMAKE_CXX_FLAGS_RELEASE "/DNDEBUG /DWIN32 /MD /Ox /Ot /Oi /GL /Ob2 /Oy /arch:SSE2") | |
set(CMAKE_C_FLAGS_DEBUG "/D_DEBUG /DWIN32 /Zi /MDd /Od /arch:SSE2") | |
set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /DWIN32 /Zi /MDd /Od /arch:SSE2") | |
add_definitions( "/D_CRT_SECURE_NO_WARNINGS /wd4996 /nologo" ) # disable annoying secure CRT warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// "const auto" is just too common not to have an alias | |
#define c_auto const auto | |
class Type; // forward declaration if possible | |
//================================================================== | |
class ClassName | |
{ | |
size_t mMember = 0; // 'm' prefix for member variable | |
U8 *mpPointer {}; // 'mp' prefix for member pointer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace DGLUT | |
{ | |
//================================================================== | |
void CheckGLErr( const char *pFileName, int line ) | |
{ | |
GLenum err = glGetError(); | |
while (err != GL_NO_ERROR) | |
{ | |
const char *pErr = NULL; |