Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
endebug.c
Go to the documentation of this file.
1 
27 proto void DumpStack();
28 
50 proto void DumpStackString(out string stack);
51 
53 proto void DebugBreak(bool condition = true, void param1 = NULL, void param2 = NULL, void param3 = NULL, void param4 = NULL, void param5 = NULL, void param6 = NULL, void param7 = NULL, void param8 = NULL, void param9 = NULL);
54 
56 void CompileBreak();
57 
59 proto void DPrint(string var);
60 
62 {
63  INFO,
64  WARNING,
65  ERROR,
66 }
67 
83 proto void ErrorEx(string err, ErrorExSeverity severity = ErrorExSeverity.ERROR);
84 proto void ErrorExString(string err, out string str, ErrorExSeverity severity = ErrorExSeverity.ERROR);
85 
87 proto native void Error2(string title, string err);
88 
90 void Error(string err)
91 {
92  Error2("", err);
93 }
94 
96 proto void Print(void var);
97 
99 proto void PrintToRPT(void var);
100 
108 proto void PrintFormat(string fmt, void param1 = NULL, void param2 = NULL, void param3 = NULL, void param4 = NULL, void param5 = NULL, void param6 = NULL, void param7 = NULL, void param8 = NULL, void param9 = NULL);
109 
110  //------------------------------------------
116 {
117  BBOX, //< Just box
118  LINE, //< One or more lines
119  SPHERE, //< Sphere represented by triangle mesh
120  CYLINDER, //< Cylinder represented by triangle mesh
121  DIAMOND, //< Eight faced pyramid. Defined by bound-box, where middle part is equal to horizontal extents of box and top/bottom apogees lies on top/bottom side of box.
122  PYRAMID //< Four sided pyramid. Defined by bound-box, where base is equal to bottom side of box.
123 };
124 
126 {
127  NOZBUFFER, //< Do not compare z-buffer when render
128  NOZWRITE, //< Do not update z-buffer when render
129  WIREFRAME, //< Render just wire-frame outline. No solid faces
130  TRANSP, //< Is translucent
131  DOUBLESIDE, //< Double-sided (do not cull back-faces)
132  ONCE, //< Rendered just once and then it's automatically destroyed. Do not keep pointer to these!!
133  NOOUTLINE, //< Render just solid faces. No wire-frame outline.
134  BACKFACE, //< Render just back faces
135  NOCULL, //< Do not cull shapes by view frustum
136  VISIBLE, //< Make it visible. Set by default
137  ADDITIVE //< Additive blending (works with ShapeFlags.TRANSP)
138 };
139 
141 {
142  FIRSTCONTACT, //<In many cases only collided=true/false is enough
143  NEARESTCONTACT //<We want only one, the nearest contact
144  ONLYSTATIC //<Only static objects
145  ONLYDYNAMIC //<Only dynamic objects
146  ONLYWATER //<Only water components (legacy support for "walk on geometry")
147  ALLOBJECTS //<Valid when CF_FIRST_CONTACT, we get first contact for each object
148 }
149 
153 class Shape
154 {
156  proto private void ~Shape();
157 
158  proto native void GetMatrix(out vector mat[4]);
159  proto native void SetMatrix(vector mat[4]);
160  proto native void SetDirection(vector direction);
161  proto native void SetPosition(vector position);
162  proto native void SetColor(int color);
163  proto native void SetFlags(ShapeFlags flags);
164  proto native void Destroy();
165 
166  proto static native Shape Create(ShapeType type, int color, ShapeFlags flags, vector p1, vector p2);
167  proto static native Shape CreateLines(int color, ShapeFlags flags, vector p[], int num);
168  proto static native Shape CreateTris(int color, ShapeFlags flags, vector p[], int num);
169  proto static native Shape CreateSphere(int color, ShapeFlags flags, vector origin, float radius);
170  proto static native Shape CreateFrustum(float horizontalAngle, float verticalAngle, float length, int color, ShapeFlags flags);
171  proto static native Shape CreateCylinder(int color, ShapeFlags flags, vector origin, float radius, float length);
172 
173  static Shape CreateArrow(vector from, vector to, float size, int color, ShapeFlags flags)
174  {
175  vector dir = to - from;
176  dir.Normalize();
177  vector dir1 = dir * size;
178  size = size * 0.5;
179 
180  vector dir2 = dir.Perpend() * size;
181 
182  vector pts[5];
183  pts[0] = from;
184  pts[1] = to;
185  pts[2] = to - dir1 - dir2;
186  pts[3] = to - dir1 + dir2;
187  pts[4] = to;
188 
189  return CreateLines(color, flags, pts, 5);
190  }
191 
192  static Shape CreateBridgeArrow(vector from, vector to, float size, int color, ShapeFlags flags)
193  {
194  vector dir = to - from;
195  dir.Normalize();
196 
197  vector dir1 = Vector(0, 0, -size);
198  size = size * 0.5;
199 
200  vector dir2 = dir.Perpend() * size;
201 
202  vector pts[7];
203  pts[0] = from;
204  pts[1] = from + "0 0 1";
205  pts[2] = to + "0 0 1";
206  pts[3] = to;
207  pts[4] = to - dir1 - dir2;
208  pts[5] = to - dir1 + dir2;
209  pts[6] = to;
210 
211  return CreateLines(color, flags, pts, 7);
212  }
213 
214  static void CreateMatrix(vector mat[4])
215  {
216  vector org = mat[3];
217  int flags = ShapeFlags.NOZWRITE|ShapeFlags.DOUBLESIDE|ShapeFlags.TRANSP|ShapeFlags.ONCE;
218  Create(ShapeType.LINE, 0xffff0000, flags, org, mat[0] * 0.5 + org);
219  Create(ShapeType.LINE, 0xff00ff00, flags, org, mat[1] * 0.5 + org);
220  Create(ShapeType.LINE, 0xff0000ff, flags, org, mat[2] * 0.5 + org);
221  }
222 };
223 
225 
226 
227 //------------------------------------------
232 class DiagMenu
233 {
235  static proto bool IsInitialized();
236 
238  static proto void InitScriptDiags();
240  static proto void ClearScriptDiags();
241 
248  static proto void RegisterMenu(int id, string name, int parent);
249 
259  static proto void RegisterItem(int id, string shortcut, string name, int parent, string values, func callback = null);
260 
272  static proto void RegisterBool(int id, string shortcut, string name, int parent, bool reverse = false, func callback = null);
273 
283  static proto void RegisterRange(int id, string shortcut, string name, int parent, string valuenames, func callback = null);
284 
286  static proto void Unregister(int id);
287 
289  static proto bool IsRegistered(int id);
290 
309  static proto bool BindCallback(int id, func callback);
311  static proto void UnbindCallback(int id);
312 
314  static proto bool GetBool(int id, bool reverse = false);
316  static proto int GetValue(int id);
318  static proto void SetValue(int id, int value);
319 
321  static proto float GetRangeValue(int id);
323  static proto void SetRangeValue(int id, float value);
324 
326  static proto int GetEngineValue(int id);
328  static proto void SetEngineValue(int id, int value);
329 
331  static proto float GetEngineRangeValue(int id);
333  static proto void SetEngineRangeValue(int id, float value);
334 
336  static proto bool MenuExists(string name);
337 };
338 
340 
DPrint
proto void DPrint(string var)
Prints content of variable to console/log. Should be used for critical messages so it will appear in ...
ErrorExString
proto void ErrorExString(string err, out string str, ErrorExSeverity severity=ErrorExSeverity.ERROR)
Error
void Error(string err)
Messagebox with error message.
Definition: endebug.c:90
DumpStackString
proto void DumpStackString(out string stack)
Prints current call stack (stack trace) to given output.
ADDITIVE
@ ADDITIVE
Definition: endebug.c:137
NOZWRITE
@ NOZWRITE
Definition: endebug.c:128
SetColor
proto native void SetColor(int color)
ALLOBJECTS
NEARESTCONTACT ONLYSTATIC ONLYDYNAMIC ONLYWATER ALLOBJECTS
Definition: endebug.c:115
DiagMenu
Definition: endebug.c:232
BACKFACE
@ BACKFACE
Definition: endebug.c:134
TRANSP
@ TRANSP
Definition: endebug.c:130
ONCE
@ ONCE
Definition: endebug.c:132
DOUBLESIDE
@ DOUBLESIDE
Definition: endebug.c:131
GetMatrix
proto native void GetMatrix(out vector mat[4])
Print
proto void Print(void var)
Prints content of variable to console/log.
VISIBLE
@ VISIBLE
Definition: endebug.c:136
func
Definition: enconvert.c:10
ErrorEx
enum ShapeType ErrorEx
LINE
@ LINE
Definition: endebug.c:118
CollisionFlags
CollisionFlags
Definition: endebug.c:140
SPHERE
@ SPHERE
Definition: endebug.c:119
BBOX
@ BBOX
Definition: endebug.c:117
vector
Definition: enconvert.c:105
WARNING
WARNING
Definition: endebug.c:61
Destroy
proto native void Destroy()
Cleans up the Effect, including unregistering if needed.
Definition: effect.c:212
FIRSTCONTACT
FIRSTCONTACT
Definition: endebug.c:109
NOOUTLINE
@ NOOUTLINE
Definition: endebug.c:133
INFO
INFO
Definition: endebug.c:60
NOZBUFFER
@ NOZBUFFER
Definition: endebug.c:127
ShapeFlags
ShapeFlags
Definition: endebug.c:125
Error2
proto native void Error2(string title, string err)
Messagebox with error message.
NOCULL
@ NOCULL
Definition: endebug.c:135
ERROR
ERROR
Definition: endebug.c:62
ErrorExSeverity
ErrorExSeverity
Definition: endebug.c:61
PrintToRPT
proto void PrintToRPT(void var)
Prints content of variable to RPT file (performance warning - each write means fflush!...
SetMatrix
proto native void SetMatrix(vector mat[4])
PrintFormat
proto void PrintFormat(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Prints formated text to console/log.
SetFlags
proto native void SetFlags(ShapeFlags flags)
DumpStack
proto void DumpStack()
Prints current call stack (stack trace)
CompileBreak
void CompileBreak()
Triggers breakpoint in C++ in compile time(when app is running in debug enviroment)
name
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
SetPosition
proto native void SetPosition(vector position)
Set the world position of the Effect.
Definition: effect.c:436
DebugBreak
proto void DebugBreak(bool condition=true, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Triggers breakpoint in C++ in run time(when app is running in debug enviroment)
DIAMOND
@ DIAMOND
Definition: endebug.c:121
ShapeType
ShapeType
Definition: endebug.c:115
PYRAMID
@ PYRAMID
Definition: endebug.c:122
SetDirection
proto native void SetDirection(vector direction)
WIREFRAME
@ WIREFRAME
Definition: endebug.c:129
Vector
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
CYLINDER
@ CYLINDER
Definition: endebug.c:120
Shape
class DiagMenu Shape
don't call destructor directly. Use Destroy() instead