Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
proto.c
Go to the documentation of this file.
1/*
2Function/method modifiers:
3proto - prototyping of internal function (C++ side)
4native - native call convention of internal function (C++ side)
5volatile - internal function that may call back to script (hint for
6 compiler that context need to be saved on stack)
7private - function may not be called from script
8event - hint for tools that the function should be exposed as
9 Entity script event.
10
11Variable modifiers:
12owned - modifier for returing internal functions. Tells to script-VM,
13that returning variable (string or array) must not be released
14out - modifier for function parameters. It tells that variable will
15 be changed by function call (used mainly by internal functions)
16inout - modifier for function parameters. It tells that variable will
17 be used and then changed by function call (used mainly by internal functions)
18
19const - constants. May not be modified.
20reference - hint for tools (Material editor), that the variable may be used
21 as parameter in material
22\code
23 //some example "reference" variables for use in material editor
24 reference float g_testVariable1;
25 reference float g_testVariable2;
26 reference float g_testVariable3;
27
28 class TestClass
29 {
30 //some example "reference" variables for use in material editor
31 reference float testVar1;
32 reference float testVar2;
33 reference float testVar3;
34 }
35\endcode
36*/
37
38/*===================================================================*/
39/* Enforce engine API */
40/*===================================================================*/
41
42//----------------------------------------------
43int VectorToRGBA( vector vec, float h)
44{
45 float x,y,z;
46 int r,g,b,a;
47
48 x = vec[0];
49 y = vec[1];
50 z = vec[2];
51
52 x = x * 127.0 + 128.0;
53 y = y * 127.0 + 128.0;
54 z = z * 127.0 + 128.0;
55 h = h * 255.0;
56
57 a = (int)h << 24;
58 r = (int)x << 16;
59 g = (int)y << 8;
60 b = z;
61
62 return r | g | b | a;
63}
64
65
66//-----------------------------------------------------------------
67proto int ARGB(int a, int r, int g, int b);
68
69//-----------------------------------------------------------------
71proto int ARGBF(float fa, float fr, float fg, float fb);
72
73//-----------------------------------------------------------------
74proto int ABGR(int a, int r, int g, int b);
75
76//-----------------------------------------------------------------
77proto int ABGRF(float fa, float fr, float fg, float fb);
78
79//-----------------------------------------------------------------
80int AWHITE(int a)
81{
82 return a << 24 | 0xffffff;
83}
Definition int.c:13
proto int ABGRF(float fa, float fr, float fg, float fb)
proto int ARGBF(float fa, float fr, float fg, float fb)
Converts <0.0, 1.0> ARGB into color.
int VectorToRGBA(vector vec, float h)
Definition proto.c:43
proto int ARGB(int a, int r, int g, int b)
proto int ABGR(int a, int r, int g, int b)
int AWHITE(int a)
Definition proto.c:80