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
// Iterate through all materials in all static instances in a Zone | |
{ | |
VisZoneResourceManager_cl &mgr = VisZoneResourceManager_cl::GlobalManager(); | |
// iterate through all zones | |
for (int i=mgr.GetResourceCount()-1; i >= 0; i--) | |
{ | |
VisZoneResource_cl *pZone = mgr.GetZoneByIndex(i); | |
if (!pZone || !pZone->m_bHandleZone || pZone->IsMissing()) continue; | |
// for all objects in the zone |
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
// Set a parameter value for a specific surface. | |
// It will set all parameters in all passes for all shader stages (vs, ps ...) of the surface technique | |
void SetSurfaceParameter(VisSurface_cl& surf, const char* param, const char* value) | |
{ | |
VCompiledTechnique* technique = surf.GetTechnique(); | |
if ( !technique ) | |
return; | |
int count = technique->GetShaderCount(); | |
for ( int s = 0; s < count; ++ s ) |
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
class gyInput : public gyReflectedObject | |
{ | |
GY_PIMPL_CLASS(); | |
GY_DECLARE_REFLECT(gyInput); | |
public: | |
gy_override int Create(gyVarDict& createParams); | |
gy_override void FillCreateTemplate(gyVarDict& outTemplate); | |
void Recycle(); | |
gyIDInputTrigger TriggerCreate( gyInputDevice devType, gyInputIndex iindex, const gyInputTriggerOpts& opts=gyInputTriggerOpts::DEFAULT ); |
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
[email protected] | |
-- This is an implementation of the basic A* | |
--[[ | |
Summary of the A* Method | |
1) Add the starting square (or node) to the open list. | |
2) Repeat the following: | |
a) Look for the lowest F cost square on the open list. We refer to this as the current square. | |
b) Switch it to the closed list. |
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
struct gyShape2D | |
{ | |
void CreateRect( gyv2f& lefttop, gyv2f& size ) | |
{ | |
gyVertexElement elements[] = | |
{ | |
gyVertexElement( VES_POSITION, 0, FMT_R32G32B32A32_F, 0 ), | |
}; | |
auto& rf = gyGetRendererFactory(); | |
vl = rf.CreateVertexLayout(elements,1); |
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
//////////////////////////////////////////////////////////////////////////////////////////////// | |
// DICTIONARY : DATA | |
//////////////////////////////////////////////////////////////////////////////////////////////// | |
typedef unsigned long (*flt_dict_hash)(const unsigned char*, int); | |
typedef int (*flt_dict_keycomp)(const char*, const char*, int); | |
typedef void (*flt_dict_visitor)(char* key, void* value); | |
typedef struct flt_dict_node | |
{ | |
char* key; | |
unsigned long keyhash; |
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
typedef struct flt_stack_node | |
{ | |
void* value; | |
struct flt_stack_node* prev; | |
}flt_stack_node; | |
typedef struct flt_stack | |
{ | |
struct flt_stack_node* tail; | |
int n_entries; |
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
#ifdef _MSC_VER | |
typedef struct flt_critsec | |
{ | |
CRITICAL_SECTION cs; | |
}flt_critsec; | |
flt_critsec* flt_critsec_create() | |
{ | |
flt_critsec* cs=(flt_critsec*)flt_malloc(sizeof(flt_critsec)); | |
InitializeCriticalSection(&cs->cs); |
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
typedef struct flt_stack | |
{ | |
void** entries; | |
int count; | |
int capacity; | |
}flt_stack; | |
int flt_stack_create(flt_stack** s, int capacity) | |
{ | |
flt_stack* _s = (flt_stack*)flt_calloc(1,sizeof(flt_stack)); |
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
struct flt_array; | |
typedef void (*flt_array_growpolicy)(flt_array*); | |
typedef struct flt_array | |
{ | |
void** data; | |
int size; | |
int capacity; | |
flt_array_growpolicy growpolicy; | |
}flt_array; |
OlderNewer