commit x64 compilation from lulu cause the other branch dont seems to compile properly at home
This commit is contained in:
73
include/modules/script_squirrel/legacy/clock_binding.cpp
Normal file
73
include/modules/script_squirrel/legacy/clock_binding.cpp
Normal file
@ -0,0 +1,73 @@
|
||||
/* -----------------------------------------------------------------------------
|
||||
GSFramework
|
||||
Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
|
||||
----------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
#include "binding_helpers.h"
|
||||
#include "script_squirrel/cobject/matrix_decl.h"
|
||||
#include "core/clock.h"
|
||||
#include <windows.h>
|
||||
|
||||
using namespace GS::Script;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
SQInteger ClockReset(HSQUIRRELVM vm)
|
||||
{
|
||||
__SQ_GETSINGLESAFEPTR(clock, GS::Core::Clock, typetag_Clock)
|
||||
clock->Reset();
|
||||
__SQ_RETURN
|
||||
}
|
||||
SQInteger ClockGetCounter(HSQUIRRELVM vm)
|
||||
{
|
||||
// Get frequency
|
||||
LARGE_INTEGER frequency;
|
||||
QueryPerformanceFrequency(&frequency);
|
||||
LARGE_INTEGER counter;
|
||||
QueryPerformanceCounter(&counter);
|
||||
__SQ_RETURNINT(counter.QuadPart)
|
||||
}
|
||||
SQInteger ClockGetFrequency(HSQUIRRELVM vm)
|
||||
{
|
||||
// Get frequency
|
||||
LARGE_INTEGER frequency;
|
||||
QueryPerformanceFrequency(&frequency);
|
||||
__SQ_RETURNINT(frequency.QuadPart)
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void RegisterClockBinding(HSQUIRRELVM vm)
|
||||
{
|
||||
/*#
|
||||
Topic: Clock
|
||||
Type: Clock
|
||||
#*/
|
||||
|
||||
/*#
|
||||
Section: ClockGeneral
|
||||
Desc: General functions
|
||||
#*/
|
||||
/*#
|
||||
Func: ClockReset
|
||||
Proto: void:Clock
|
||||
Desc: Reset a clock object.
|
||||
#*/
|
||||
sq_register(vm, ClockReset, "ClockReset", _SC(".x"));
|
||||
|
||||
/*#
|
||||
Func: ClockGetCounter
|
||||
Proto: int:Clock
|
||||
Desc: Get the counter of a clock object.
|
||||
#*/
|
||||
sq_register(vm, ClockGetCounter, "ClockGetCounter", _SC(".x"));
|
||||
|
||||
/*#
|
||||
Func: ClockGetFrequency
|
||||
Proto: int:Clock
|
||||
Desc: Get the frequency of a clock object.
|
||||
#*/
|
||||
sq_register(vm, ClockGetFrequency, "ClockGetFrequency", _SC(".x"));
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
Reference in New Issue
Block a user