home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2004 January
/
PCWorld_2004-01_cd.bin
/
Software
/
topware
/
winamp3
/
winamp3_0-full.exe
/
Lib
/
rotationlayer.m
< prev
next >
Wrap
Text File
|
2002-05-30
|
2KB
|
64 lines
//----------------------------------------------------------------------------------------
//
// rotationlayer.m
//
//----------------------------------------------------------------------------------------
// Use like this :
// #define ROTATION_LAYER_VAR MyVar
// #include "rotationlayer.m"
//
// _MyVarInit(Group parentgroup, String layername); // init rotationlayer
// _MyVarRotateDegree(double r); // in degrees
// _MyVarRotate(double r); // in radians
// double _MyVarGetRotationDegree(); // in degrees
// double _MyVarGetRotation(); // in radians
//
#ifndef PI
#define PI 3.1415926536
#endif
Global Double _##ROTATION_LAYER_VAR##R;
Global Layer _##ROTATION_LAYER_VAR##Layer;
Function _##ROTATION_LAYER_VAR##Init(Group parentgroup, String layername);
Function _##ROTATION_LAYER_VAR##RotateDegree(double r);
Function _##ROTATION_LAYER_VAR##Rotate(double r);
Function double _##ROTATION_LAYER_VAR##GetRotationDegree();
Function double _##ROTATION_LAYER_VAR##GetRotation();
_##ROTATION_LAYER_VAR##RotateDegree(double r) {
_##ROTATION_LAYER_VAR##Rotate(r * PI / 180.0);
}
_##ROTATION_LAYER_VAR##Rotate(double r) {
_##ROTATION_LAYER_VAR##R = r;
_##ROTATION_LAYER_VAR##Layer.fx_update();
}
double _##ROTATION_LAYER_VAR##GetRotationDegree() {
return _##ROTATION_LAYER_VAR##R * 180 / PI;
}
double _##ROTATION_LAYER_VAR##GetRotation() {
return _##ROTATION_LAYER_VAR##R;
}
_##ROTATION_LAYER_VAR##Init(Group parentgroup, String layername) {
_##ROTATION_LAYER_VAR##Layer = parentgroup.getObject(layername);
_##ROTATION_LAYER_VAR##Layer.fx_setGridSize(1,1);
_##ROTATION_LAYER_VAR##Layer.fx_setBgFx(0);
_##ROTATION_LAYER_VAR##Layer.fx_setWrap(1);
_##ROTATION_LAYER_VAR##Layer.fx_setBilinear(1);
_##ROTATION_LAYER_VAR##Layer.fx_setRect(0);
_##ROTATION_LAYER_VAR##Layer.fx_setClear(0);
_##ROTATION_LAYER_VAR##Layer.fx_setLocalized(1);
_##ROTATION_LAYER_VAR##Layer.fx_setRealtime(0);
_##ROTATION_LAYER_VAR##Layer.fx_setEnabled(1);
}
_##ROTATION_LAYER_VAR##Layer.fx_onGetPixelR(double r, double d, double x, double y) {
return r + _##ROTATION_LAYER_VAR##R;
}