1 /*
2  * Copyright 2014 Kai Jourdan. All rights reserved.
3  * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
4  */
5 
6 // Reference(s):
7 // - Based on code from Brian Luczkiewicz
8 //   https://github.com/blucz/Vector
9 // - Uses the SIMPLEX-Font which is a variant of the Hershey font (public domain)
10 //   https://web.archive.org/web/20120313001837/http://paulbourke.net/dataformats/hershey/
11 //
12 #include <float.h>  // FLT_EPSILON
13 #include <alloca.h> // alloca
14 
15 #include <bx/math.h>
16 
17 #include "vectordisplay.h"
18 #include "bgfx_utils.h"
19 
20 //Config stuff
21 const int MAX_NUMBER_VERTICES = 20000;
22 
23 const int MAX_DECAY_STEPS = 60;
24 const int DEFAULT_DECAY_STEPS = 5;
25 const float DEFAULT_DECAY_VALUE = 0.8f;
26 const float DEFAULT_INITIAL_DECAY = 0.04f;
27 const float DEFAULT_DRAW_OFFSET_X = 0.0f;
28 const float DEFAULT_DRAW_OFFSET_Y = 0.0f;
29 const float DEFAULT_DRAW_SCALE = 1.0f;
30 const float DEFAULT_BRIGHTNESS = 1.0f;
31 
32 //internal config
33 const int TEXTURE_SIZE = 64;
34 const int HALF_TEXTURE_SIZE = TEXTURE_SIZE / 2;
35 
init()36 void PosColorUvVertex::init()
37 {
38 	ms_layout
39 		.begin()
40 		.add(bgfx::Attrib::Position,  3, bgfx::AttribType::Float)
41 		.add(bgfx::Attrib::TexCoord0, 2, bgfx::AttribType::Float)
42 		.add(bgfx::Attrib::Color0,    4, bgfx::AttribType::Uint8, true)
43 		.end();
44 }
45 
46 bgfx::VertexLayout PosColorUvVertex::ms_layout;
47 
normalizef(float _a)48 inline float normalizef(float _a)
49 {
50 	return bx::wrap(_a, 2.0f * bx::kPi);
51 }
52 
VectorDisplay()53 VectorDisplay::VectorDisplay()
54 	: m_originBottomLeft(false)
55 	, m_texelHalf(false)
56 {
57 }
58 
init(bool _originBottomLeft,float _texelHalf)59 void VectorDisplay::init(bool _originBottomLeft, float _texelHalf)
60 {
61 	m_originBottomLeft = _originBottomLeft;
62 	m_texelHalf = _texelHalf;
63 }
64 
65 
setup(uint16_t _width,uint16_t _height,uint8_t _view)66 void VectorDisplay::setup(uint16_t _width, uint16_t _height, uint8_t _view)
67 {
68 	PosColorUvVertex::init();
69 
70 	m_decayValue = DEFAULT_DECAY_VALUE;
71 	setDrawColor(1.0f, 1.0f, 1.0f, 1.0f);
72 
73 	m_screenWidth  = _width;
74 	m_screenHeight = _height;
75 	m_glowWidth    = m_screenWidth / 3;
76 	m_glowHeight   = m_screenHeight / 3;
77 	m_initialDecay = DEFAULT_INITIAL_DECAY;
78 
79 	m_drawOffsetX = DEFAULT_DRAW_OFFSET_X;
80 	m_drawOffsetY = DEFAULT_DRAW_OFFSET_Y;
81 	m_drawScale   = DEFAULT_DRAW_SCALE;
82 	m_brightness  = DEFAULT_BRIGHTNESS;
83 
84 	m_currentDrawStep = 0;
85 
86 	setDefaultThickness();
87 
88 	setDecaySteps(DEFAULT_DECAY_STEPS);
89 
90 	m_view = _view;
91 
92 	m_drawToScreenShader = loadProgram("vs_vectordisplay_fb", "fs_vectordisplay_fb");
93 	m_blurShader         = loadProgram("vs_vectordisplay_fb", "fs_vectordisplay_blur");
94 	m_blitShader         = loadProgram("vs_vectordisplay_fb", "fs_vectordisplay_blit");
95 
96 	u_params   = bgfx::createUniform("u_params",   bgfx::UniformType::Vec4);
97 	s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Sampler);
98 
99 	genLinetex();
100 
101 	bgfx::setViewClear(_view, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH, 0x000000ff, 1.0f, 0);
102 
103 	setupResDependent();
104 }
105 
resize(uint16_t _width,uint16_t _height)106 void VectorDisplay::resize(uint16_t _width, uint16_t _height)
107 {
108 	teardownResDependent();
109 	m_screenWidth = _width;
110 	m_screenHeight = _height;
111 	m_glowWidth = _width / 3;
112 	m_glowHeight = _height / 3;
113 	setupResDependent();
114 }
115 
teardown()116 void VectorDisplay::teardown()
117 {
118 	for (size_t i = 0; i < m_vertexBuffers.size(); ++i)
119 	{
120 		bgfx::destroy(m_vertexBuffers[i]);
121 	}
122 
123 	teardownResDependent();
124 
125 	bgfx::destroy(m_drawToScreenShader);
126 	bgfx::destroy(m_blurShader);
127 	bgfx::destroy(m_blitShader);
128 
129 	bgfx::destroy(u_params);
130 	bgfx::destroy(s_texColor);
131 
132 	bgfx::destroy(m_lineTexId);
133 }
134 
beginFrame()135 void VectorDisplay::beginFrame()
136 {
137 	m_points.clear();
138 }
139 
endFrame()140 void VectorDisplay::endFrame()
141 {
142 	const bgfx::Caps* caps = bgfx::getCaps();
143 
144 	float proj[16];
145 	bx::mtxOrtho(
146 		  proj
147 		, 0.0f
148 		, (float)m_screenWidth
149 		, (float)m_screenHeight
150 		, 0.0f
151 		, 0.0f
152 		, 1000.0f
153 		, 0.0f
154 		, caps->homogeneousDepth
155 		);
156 
157 	bgfx::setViewRect(m_view, 0, 0, m_screenWidth, m_screenHeight);
158 	bgfx::setViewFrameBuffer(m_view, m_sceneFrameBuffer);
159 	bgfx::setViewTransform(m_view, NULL, proj);
160 
161 	// advance step
162 	m_currentDrawStep = (m_currentDrawStep + 1) % m_numberDecaySteps;
163 
164 	BX_CHECK(m_points.size() < MAX_NUMBER_VERTICES, "");
165 
166 	bgfx::update(
167 		  m_vertexBuffers[m_currentDrawStep]
168 		, 0
169 		, bgfx::copy(m_points.data(), (uint32_t)m_points.size() * sizeof(PosColorUvVertex) )
170 		);
171 	m_vertexBuffersSize[m_currentDrawStep] = (uint32_t)m_points.size();
172 
173 	for (int loopvar = 0; loopvar < m_numberDecaySteps; loopvar++)
174 	{
175 		int stepi = m_numberDecaySteps - loopvar - 1;
176 		int i = (m_currentDrawStep + m_numberDecaySteps - stepi) % m_numberDecaySteps;
177 
178 		if (m_vertexBuffersSize[i] != 0)
179 		{
180 			float alpha;
181 			if (stepi == 0)
182 			{
183 				alpha = 1.0f;
184 			}
185 			else if (stepi == 1)
186 			{
187 				alpha = m_initialDecay;
188 			}
189 			else
190 			{
191 				alpha = bx::pow(m_decayValue, stepi - 1.0f) * m_initialDecay;
192 			}
193 
194 			float params[4] = { 0.0f, 0.0f, 0.0f, alpha };
195 			bgfx::setUniform(u_params, &params);
196 
197 			bgfx::setTexture(0, s_texColor, m_lineTexId);
198 
199 			bgfx::setVertexBuffer(0, m_vertexBuffers[i], 0, m_vertexBuffersSize[i]); // explicitly feed vertex number!
200 
201 			bgfx::setState(0
202 				| BGFX_STATE_WRITE_RGB
203 				| BGFX_STATE_WRITE_A
204 				| BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_DST_ALPHA)
205 				| BGFX_STATE_BLEND_EQUATION_SEPARATE(BGFX_STATE_BLEND_EQUATION_ADD, BGFX_STATE_BLEND_EQUATION_MAX)
206 				);
207 
208 			bgfx::setViewName(m_view, "RenderVectorDisplay");
209 			bgfx::submit(m_view, m_drawToScreenShader);
210 		}
211 	}
212 
213 	uint8_t viewCounter = m_view + 1;
214 
215 	bx::mtxOrtho(proj, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 100.0f, 0.0f, caps->homogeneousDepth);
216 
217 	float glow_iter_mult = 1.05f + ( (m_brightness - 1.0f) / 5.0f);
218 	float glow_fin_mult  = 1.25f + ( (m_brightness - 1.0f) / 2.0f);
219 	float params[4] =  { 0.0f, 0.0f, glow_iter_mult, 1.0f };
220 
221 	if (m_brightness > 0)
222 	{
223 		bgfx::setTexture(0, s_texColor, bgfx::getTexture(m_sceneFrameBuffer) );
224 
225 		int npasses = (int)(m_brightness * 4);
226 		for (int pass = 0; pass < npasses; pass++)
227 		{
228 			// render the glow1 texture to the glow0 buffer with horizontal blur
229 
230 			bgfx::setViewFrameBuffer(viewCounter, m_glow0FrameBuffer);
231 			bgfx::setViewRect(viewCounter, 0, 0, m_glowWidth, m_glowHeight);
232 			bgfx::setState(0
233 				| BGFX_STATE_WRITE_RGB
234 				| BGFX_STATE_WRITE_A
235 				);
236 			params[0] = 1.0f / m_glowWidth;
237 			params[1] = 0.0f;
238 			bgfx::setUniform(u_params, &params);
239 
240 			bgfx::setViewTransform(viewCounter, NULL, proj);
241 			screenSpaceQuad(m_glowWidth, m_glowHeight);
242 			bgfx::setViewName(viewCounter, "BlendPassA");
243 			bgfx::submit(viewCounter, m_blurShader);
244 
245 			viewCounter++;
246 
247 			bgfx::setViewFrameBuffer(viewCounter, m_glow1FrameBuffer);
248 			bgfx::setViewRect(viewCounter, 0, 0, m_glowWidth, m_glowHeight);
249 			bgfx::setTexture(0, s_texColor, bgfx::getTexture(m_glow0FrameBuffer) );
250 
251 			bgfx::setViewTransform(viewCounter, NULL, proj);
252 			screenSpaceQuad(m_glowWidth, m_glowHeight);
253 
254 			params[0] = 0.0f;
255 			params[1] = 1.0f / m_glowHeight;
256 			params[2] = glow_iter_mult;
257 			params[3] = 1.0f;
258 			bgfx::setUniform(u_params, params);
259 
260 			bgfx::setState(0
261 				| BGFX_STATE_WRITE_RGB
262 				| BGFX_STATE_WRITE_A
263 				);
264 
265 			bgfx::setViewName(viewCounter, "BlendPassB");
266 			bgfx::submit(viewCounter, m_blurShader);
267 
268 			viewCounter++;
269 
270 			//set for next iteration
271 			bgfx::setTexture(0, s_texColor, bgfx::getTexture(m_glow1FrameBuffer) );
272 		}
273 	}
274 
275 	bgfx::discard();
276 
277 	//now do last pass, combination of blur and normal buffer to screen
278 	bgfx::setViewTransform(viewCounter, NULL, proj);
279 	bgfx::setViewRect(viewCounter, 0, 0, m_screenWidth, m_screenHeight);
280 	bgfx::setTexture(0, s_texColor, bgfx::getTexture(m_sceneFrameBuffer) );
281 	bgfx::setState(0
282 		| BGFX_STATE_WRITE_RGB
283 		| BGFX_STATE_WRITE_A
284 		| BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE)
285 		);
286 
287 	params[2] = 1.0f;
288 	params[3] = 1.0f;
289 	bgfx::setUniform(u_params, params);
290 	bgfx::setViewName(viewCounter, "BlendVectorToDisplay");
291 	screenSpaceQuad(m_screenWidth, m_screenHeight);
292 	bgfx::submit(viewCounter, m_blitShader);
293 	viewCounter++;
294 
295 	if (m_brightness > 0)
296 	{
297 		// blend in the glow
298 		bgfx::setViewTransform(viewCounter, NULL, proj);
299 		bgfx::setViewRect(viewCounter, 0, 0, m_screenWidth, m_screenHeight);
300 		bgfx::setTexture(0, s_texColor, bgfx::getTexture(m_glow1FrameBuffer) );
301 		bgfx::setState(0
302 			| BGFX_STATE_WRITE_RGB
303 			| BGFX_STATE_WRITE_A
304 			| BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE)
305 			);
306 
307 		params[2] = glow_fin_mult;
308 		bgfx::setUniform(u_params, params);
309 		bgfx::setViewName(viewCounter, "BlendBlurToDisplay");
310 		screenSpaceQuad(m_screenWidth, m_screenHeight);
311 		bgfx::submit(viewCounter, m_blitShader);
312 		viewCounter++;
313 	}
314 }
315 
beginDraw(float _x,float _y)316 void VectorDisplay::beginDraw(float _x, float _y)
317 {
318 	BX_CHECK(0 == m_pendingPoints.size(), "Begin draw on already filled buffer!");
319 
320 	PendingPoint point;
321 	point.x = _x * m_drawScale + m_drawOffsetX;
322 	point.y = _y * m_drawScale + m_drawOffsetY;
323 	m_pendingPoints.push_back(point);
324 }
325 
drawTo(float _x,float _y)326 void VectorDisplay::drawTo(float _x, float _y)
327 {
328 	PendingPoint point;
329 	point.x = _x * m_drawScale + m_drawOffsetX;
330 	point.y = _y * m_drawScale + m_drawOffsetY;
331 	m_pendingPoints.push_back(point);
332 }
333 
endDraw()334 void VectorDisplay::endDraw()
335 {
336 	if (m_pendingPoints.size() < 2)
337 	{
338 		m_pendingPoints.clear();
339 		return;
340 	}
341 
342 	// from the list of points, build a list of lines
343 	uint32_t nlines = (uint32_t)m_pendingPoints.size() - 1;
344 	Line* lines = (Line*)alloca(nlines * sizeof(Line) );
345 
346 	float t = effectiveThickness();
347 	int first_last_same = true
348 		&& bx::abs(m_pendingPoints[0].x - m_pendingPoints[m_pendingPoints.size() - 1].x) < 0.1
349 		&& bx::abs(m_pendingPoints[0].y - m_pendingPoints[m_pendingPoints.size() - 1].y) < 0.1
350 		;
351 
352 	// compute basics
353 	for (size_t i = 1; i < m_pendingPoints.size(); i++)
354 	{
355 		Line* line = &lines[i - 1];
356 		line->is_first = i == 1;
357 		line->is_last = i == nlines;
358 
359 		// precomputed info for current line
360 		line->x0 = m_pendingPoints[i - 1].x;
361 		line->y0 = m_pendingPoints[i - 1].y;
362 		line->x1 = m_pendingPoints[i].x;
363 		line->y1 = m_pendingPoints[i].y;
364 		line->a     = bx::atan2(line->y1 - line->y0, line->x1 - line->x0); // angle from positive x axis, increasing ccw, [-pi, pi]
365 		line->sin_a = bx::sin(line->a);
366 		line->cos_a = bx::cos(line->a);
367 		line->len   = bx::sqrt( (line->x1 - line->x0) * (line->x1 - line->x0) + (line->y1 - line->y0) * (line->y1 - line->y0) );
368 
369 		// figure out what connections we have
370 		line->has_prev = (!line->is_first
371 		                 || (line->is_first
372 		                    && first_last_same) );
373 		line->has_next = (!line->is_last
374 		                 || (line->is_last
375 		                    && first_last_same) );
376 
377 		// initialize thicknesses/shortens to default values
378 		line->tl0 = line->tl1 = line->tr0 = line->tr1 = t;
379 		line->s0 = line->s1 = 0.0;
380 	}
381 
382 	// compute adjustments for connected line segments
383 	for (size_t i = 0; i < nlines; i++)
384 	{
385 		Line* line = &lines[i], * pline = &lines[(nlines + i - 1) % nlines];
386 
387 		if (line->has_prev)
388 		{
389 			float pa2a = normalizef(pline->a - line->a);
390 			float a2pa = normalizef(line->a - pline->a);
391 			float maxshorten = bx::min(line->len, pline->len) / 2.0f;
392 
393 			if (bx::min(a2pa, pa2a) <= (bx::kPi / 2.0f + FLT_EPSILON) )
394 			{
395 				if (a2pa < pa2a)
396 				{
397 					float shorten = t * bx::sin(a2pa / 2.0f) / bx::cos(a2pa / 2.0f);
398 					float a = (bx::kPi - a2pa) / 2.0f;
399 					if (shorten > maxshorten)
400 					{
401 						line->s0 = pline->s1 = maxshorten;
402 						line->tr0 = pline->tr1 = maxshorten * bx::sin(a) / bx::cos(a);
403 					}
404 					else
405 					{
406 						line->s0 = pline->s1 = shorten;
407 					}
408 
409 					//vector_display_debugf("ad =  %f, shorten by %f (len=%f), rthickness %f (from %f)", a, line->s0, line->len, line->tr0, t);
410 				}
411 				else
412 				{
413 					float shorten = t * bx::sin(pa2a / 2.0f) / bx::cos(pa2a / 2.0f);
414 					float a = (bx::kPi - pa2a) / 2.0f;
415 					if (shorten > maxshorten)
416 					{
417 						line->s0  = pline->s1 = maxshorten;
418 						line->tl0 =
419 							pline->tl1 = maxshorten * bx::sin(a) / bx::cos(a);
420 					}
421 					else
422 					{
423 						line->s0 = pline->s1 = shorten;
424 					}
425 
426 					//vector_display_debugf("ad =  %f, shorten by %f (len=%f), rthickness by %f (from %f)", a, line->s0, line->len, line->tl0, t);
427 				}
428 			}
429 			else
430 			{
431 				line->has_prev = 0;
432 			}
433 		}
434 
435 		if (!line->has_prev)
436 		{
437 			pline->has_next = 0;
438 		}
439 	}
440 
441 	// compute line geometry
442 	for (size_t i = 0; i < nlines; i++)
443 	{
444 		Line* line = &lines[i];
445 
446 		// shorten lines if needed
447 		line->x0 = line->x0 + line->s0 * line->cos_a;
448 		line->y0 = line->y0 + line->s0 * line->sin_a;
449 		line->x1 = line->x1 - line->s1 * line->cos_a;
450 		line->y1 = line->y1 - line->s1 * line->sin_a;
451 
452 		// compute initial values for left,right,leftcenter,rightcenter points
453 		line->xl0 = line->x0 + line->tl0 * line->sin_a;
454 		line->yl0 = line->y0 - line->tl0 * line->cos_a;
455 		line->xr0 = line->x0 - line->tr0 * line->sin_a;
456 		line->yr0 = line->y0 + line->tr0 * line->cos_a;
457 		line->xl1 = line->x1 + line->tl1 * line->sin_a;
458 		line->yl1 = line->y1 - line->tl1 * line->cos_a;
459 		line->xr1 = line->x1 - line->tr1 * line->sin_a;
460 		line->yr1 = line->y1 + line->tr1 * line->cos_a;
461 
462 		// compute tips
463 		line->xlt0 = line->xl0 - t * line->cos_a;
464 		line->ylt0 = line->yl0 - t * line->sin_a;
465 		line->xrt0 = line->xr0 - t * line->cos_a;
466 		line->yrt0 = line->yr0 - t * line->sin_a;
467 		line->xlt1 = line->xl1 + t * line->cos_a;
468 		line->ylt1 = line->yl1 + t * line->sin_a;
469 		line->xrt1 = line->xr1 + t * line->cos_a;
470 		line->yrt1 = line->yr1 + t * line->sin_a;
471 	}
472 
473 	// draw the lines
474 	drawLines(lines, nlines);
475 	m_pendingPoints.clear();
476 }
477 
drawLine(float _x0,float _y0,float _x1,float _y1)478 void VectorDisplay::drawLine(float _x0, float _y0, float _x1, float _y1)
479 {
480 	beginDraw(_x0, _y0);
481 	drawTo(_x1, _y1);
482 	endDraw();
483 }
484 
drawBox(float _x,float _y,float _w,float _h)485 void VectorDisplay::drawBox(float _x, float _y, float _w, float _h)
486 {
487 	beginDraw(_x, _y);
488 	drawTo(_x + _w, _y);
489 	drawTo(_x + _w, _y + _h);
490 	drawTo(_x, _y + _h);
491 	drawTo(_x, _y);
492 	endDraw();
493 }
494 
drawCircle(float _x,float _y,float _radius,float _steps)495 void VectorDisplay::drawCircle(float _x, float _y, float _radius, float _steps)
496 {
497 	float edgeangle = 0.0f;
498 	float angadjust = 0.0f;
499 
500 	float step = bx::kPi * 2.0f / _steps;
501 
502 	beginDraw(_x + _radius * bx::sin(edgeangle + angadjust),
503 	          _y - _radius * bx::cos(edgeangle + angadjust) );
504 	for (edgeangle = 0; edgeangle < 2.0f * bx::kPi - 0.001; edgeangle += step)
505 	{
506 		drawTo(_x + _radius * bx::sin(edgeangle + step - angadjust),
507 		       _y - _radius * bx::cos(edgeangle + step - angadjust) );
508 	}
509 
510 	endDraw();
511 }
512 
drawWheel(float _angle,float _x,float _y,float _radius)513 void VectorDisplay::drawWheel(float _angle, float _x, float _y, float _radius)
514 {
515 	float spokeradius = _radius - 2.0f;
516 	// draw spokes
517 	drawLine(_x + spokeradius * bx::sin(_angle),
518 	         _y - spokeradius * bx::cos(_angle),
519 	         _x - spokeradius * bx::sin(_angle),
520 	         _y + spokeradius * bx::cos(_angle)
521 	         );
522 	drawLine(_x + spokeradius * bx::sin(_angle +        bx::kPi / 4.0f),
523 	         _y - spokeradius * bx::cos(_angle +        bx::kPi / 4.0f),
524 	         _x - spokeradius * bx::sin(_angle +        bx::kPi / 4.0f),
525 	         _y + spokeradius * bx::cos(_angle +        bx::kPi / 4.0f)
526 	         );
527 	drawLine(_x + spokeradius * bx::sin(_angle +        bx::kPi / 2.0f),
528 	         _y - spokeradius * bx::cos(_angle +        bx::kPi / 2.0f),
529 	         _x - spokeradius * bx::sin(_angle +        bx::kPi / 2.0f),
530 	         _y + spokeradius * bx::cos(_angle +        bx::kPi / 2.0f)
531 	         );
532 	drawLine(_x + spokeradius * bx::sin(_angle + 3.0f * bx::kPi / 4.0f),
533 	         _y - spokeradius * bx::cos(_angle + 3.0f * bx::kPi / 4.0f),
534 	         _x - spokeradius * bx::sin(_angle + 3.0f * bx::kPi / 4.0f),
535 	         _y + spokeradius * bx::cos(_angle + 3.0f * bx::kPi / 4.0f)
536 	         );
537 
538 	float edgeangle = 0.0f;
539 	float angadjust = 0.0f;
540 
541 	beginDraw(
542 		  _x + _radius * bx::sin(_angle + edgeangle + angadjust)
543 		, _y - _radius * bx::cos(_angle + edgeangle + angadjust)
544 		);
545 
546 	for (edgeangle = 0; edgeangle < 2.0f * bx::kPi - 0.001f; edgeangle += bx::kPi / 4.0f)
547 	{
548 		drawTo(_x + _radius * bx::sin(_angle + edgeangle + bx::kPi / 4.0f - angadjust),
549 		       _y - _radius * bx::cos(_angle + edgeangle + bx::kPi / 4.0f - angadjust) );
550 	}
551 
552 	endDraw();
553 }
554 
effectiveThickness()555 float VectorDisplay::effectiveThickness()
556 {
557 	if (m_customThicknessEnabled)
558 	{
559 		return m_thickness * m_drawScale / 2.0f;
560 	}
561 
562 	// this makes thickness=16 at 2048x1536
563 	float vv = (0.01f * (m_screenWidth + m_screenHeight) / 2.0f) * m_drawScale / 2.0f;
564 	return bx::max(vv, 6.0f);
565 }
566 
setTransform(float _offsetX,float _offsetY,float _scale)567 void VectorDisplay::setTransform(float _offsetX, float _offsetY, float _scale)
568 {
569 	m_drawOffsetX = _offsetX;
570 	m_drawOffsetY = _offsetY;
571 	m_drawScale   = _scale;
572 }
573 
setInitialDecay(float _initialDecay)574 bool VectorDisplay::setInitialDecay(float _initialDecay)
575 {
576 	if (_initialDecay < 0.0f
577 	   || _initialDecay >= 1.0f)
578 	{
579 		return false;
580 	}
581 
582 	m_initialDecay = _initialDecay;
583 	return true;
584 }
585 
setThickness(float _thickness)586 bool VectorDisplay::setThickness(float _thickness)
587 {
588 	if (_thickness <= 0)
589 	{
590 		return false;
591 	}
592 
593 	m_customThicknessEnabled = true;
594 	m_thickness = _thickness;
595 	return true;
596 }
597 
setDefaultThickness()598 void VectorDisplay::setDefaultThickness()
599 {
600 	m_customThicknessEnabled = false;
601 }
602 
setDrawColor(float _r,float _g,float _b,float _a)603 void VectorDisplay::setDrawColor(float _r, float _g, float _b, float _a)
604 {
605 	m_drawColorR = (uint8_t)(_r * 255);
606 	m_drawColorG = (uint8_t)(_g * 255);
607 	m_drawColorB = (uint8_t)(_b * 255);
608 	m_drawColorA = (uint8_t)(_a * 255);
609 }
610 
appendTexpoint(float _x,float _y,float _u,float _v)611 void VectorDisplay::appendTexpoint(float _x, float _y, float _u, float _v)
612 {
613 	PosColorUvVertex point;
614 	point.m_x = _x;
615 	point.m_y = _y;
616 	point.m_z = 0.0;
617 	point.m_abgr = (m_drawColorA << 24) | (m_drawColorB << 16) | (m_drawColorG << 8) | m_drawColorR;
618 	point.m_u = _u / TEXTURE_SIZE;
619 	point.m_v = 1.0f - _v / TEXTURE_SIZE;
620 	m_points.push_back(point);
621 }
622 
drawFan(float _cx,float _cy,float _pa,float _a,float _t,float _s,float _e)623 void VectorDisplay::drawFan(float _cx, float _cy, float _pa, float _a, float _t, float _s, float _e)
624 {
625 	float* angles;
626 	int nsteps;
627 	float pa2a = normalizef(_a - _pa);
628 	float a2pa = normalizef(_pa - _a);
629 
630 	int i;
631 	if (a2pa < pa2a)
632 	{
633 		_t = -_t;
634 		nsteps = (int32_t)bx::max(1.0f, bx::round(a2pa / (bx::kPi / 8.0f) ) );
635 		angles = (float*)alloca(sizeof(float) * (nsteps + 1) );
636 		for (i = 0; i <= nsteps; i++)
637 		{
638 			angles[i] = _a + i * a2pa / nsteps;
639 		}
640 	}
641 	else
642 	{
643 		nsteps = (int32_t)bx::max(1.0f, bx::round(pa2a / (bx::kPi / 8.0f) ) );
644 		angles = (float*)alloca(sizeof(float) * (nsteps + 1) );
645 		for (i = 0; i <= nsteps; i++)
646 		{
647 			angles[i] = _pa + i * pa2a / nsteps;
648 		}
649 	}
650 
651 	for (i = 1; i <= nsteps; i++)
652 	{
653 		appendTexpoint(_cx + _t * bx::sin(angles[i - 1]), _cy - _t * bx::cos(angles[i - 1]), _e, (float)HALF_TEXTURE_SIZE);
654 		appendTexpoint(_cx, _cy, _s, (float)HALF_TEXTURE_SIZE);
655 		appendTexpoint(_cx + _t * bx::sin(angles[i]), _cy - _t * bx::cos(angles[i]), _e, (float)HALF_TEXTURE_SIZE);
656 	}
657 }
658 
drawLines(Line * _lines,int _numberLines)659 void VectorDisplay::drawLines(Line* _lines, int _numberLines)
660 {
661 	int i;
662 	float t = effectiveThickness();
663 
664 	for (i = 0; i < _numberLines; i++)
665 	{
666 		Line* line = &_lines[i], * pline = &_lines[(_numberLines + i - 1) % _numberLines];
667 
668 		if (line->has_prev)     // draw fan for connection to previous
669 		{
670 			float pa2a = normalizef(pline->a - line->a);
671 			float a2pa = normalizef(line->a - pline->a);
672 			if (a2pa < pa2a)    // inside of fan on right
673 			{
674 				drawFan(line->xr0, line->yr0, pline->a, line->a, line->tl0 + line->tr0, (float)HALF_TEXTURE_SIZE + (line->tr0 / t * (float)HALF_TEXTURE_SIZE), 0);
675 			}
676 			else                // inside of fan on left
677 			{
678 				drawFan(line->xl0, line->yl0, pline->a, line->a, line->tl0 + line->tr0, (float)HALF_TEXTURE_SIZE - (line->tl0 / t * (float)HALF_TEXTURE_SIZE), (float)TEXTURE_SIZE);
679 			}
680 		}
681 
682 		float tl0 = (float)HALF_TEXTURE_SIZE - (line->tl0 / t) * (float)HALF_TEXTURE_SIZE;
683 		float tl1 = (float)HALF_TEXTURE_SIZE - (line->tl1 / t) * (float)HALF_TEXTURE_SIZE;
684 
685 		float tr0 = (float)HALF_TEXTURE_SIZE + (line->tr0 / t) * (float)HALF_TEXTURE_SIZE;
686 		float tr1 = (float)HALF_TEXTURE_SIZE + (line->tr1 / t) * (float)HALF_TEXTURE_SIZE;
687 
688 		appendTexpoint(line->xr0, line->yr0, tr0, (float)HALF_TEXTURE_SIZE);
689 		appendTexpoint(line->xr1, line->yr1, tr1, (float)HALF_TEXTURE_SIZE);
690 		appendTexpoint(line->xl1, line->yl1, tl1, (float)HALF_TEXTURE_SIZE);
691 		appendTexpoint(line->xl0, line->yl0, tl0, (float)HALF_TEXTURE_SIZE);
692 		appendTexpoint(line->xr0, line->yr0, tr0, (float)HALF_TEXTURE_SIZE);
693 		appendTexpoint(line->xl1, line->yl1, tl1, (float)HALF_TEXTURE_SIZE);
694 
695 		if (!line->has_prev)   // draw startcap
696 		{
697 			appendTexpoint(line->xl0, line->yl0, tl0, (float)HALF_TEXTURE_SIZE);
698 			appendTexpoint(line->xlt0, line->ylt0, tl0, 0.0f);
699 			appendTexpoint(line->xr0, line->yr0, tr0, (float)HALF_TEXTURE_SIZE);
700 			appendTexpoint(line->xr0, line->yr0, tr0, (float)HALF_TEXTURE_SIZE);
701 			appendTexpoint(line->xlt0, line->ylt0, tl0, 0.0f);
702 			appendTexpoint(line->xrt0, line->yrt0, tr0, 0.0f);
703 		}
704 
705 		if (!line->has_next)   // draw endcap
706 		{
707 			appendTexpoint(line->xlt1, line->ylt1, tl1, 0.0f);
708 			appendTexpoint(line->xl1, line->yl1, tl1, (float)HALF_TEXTURE_SIZE);
709 			appendTexpoint(line->xr1, line->yr1, tr1, (float)HALF_TEXTURE_SIZE);
710 			appendTexpoint(line->xlt1, line->ylt1, tl1, 0.0f);
711 			appendTexpoint(line->xr1, line->yr1, tr1, (float)HALF_TEXTURE_SIZE);
712 			appendTexpoint(line->xrt1, line->yrt1, tr1, 0.0f);
713 		}
714 	}
715 }
716 
setDecaySteps(int _steps)717 bool VectorDisplay::setDecaySteps(int _steps)
718 {
719 	if (_steps < 0
720 	||  _steps > MAX_DECAY_STEPS)
721 	{
722 		return false;
723 	}
724 
725 	m_numberDecaySteps = _steps;
726 
727 	if (m_vertexBuffers.size() != 0)
728 	{
729 		for (size_t i = 0; i < m_vertexBuffers.size(); ++i)
730 		{
731 			bgfx::destroy(m_vertexBuffers[i]);
732 		}
733 
734 		m_vertexBuffers.clear();
735 		m_vertexBuffersSize.clear();
736 	}
737 
738 	for (int i = 0; i < m_numberDecaySteps; ++i)
739 	{
740 		m_vertexBuffers.push_back(bgfx::createDynamicVertexBuffer(MAX_NUMBER_VERTICES, PosColorUvVertex::ms_layout) );
741 		m_vertexBuffersSize.push_back(0);
742 	}
743 
744 	return true;
745 }
746 
setDecay(float _decay)747 bool VectorDisplay::setDecay(float _decay)
748 {
749 	if (_decay < 0.0f
750 	||  _decay >= 1.0f)
751 	{
752 		return false;
753 	}
754 
755 	m_decayValue = _decay;
756 	return true;
757 }
758 
setBrightness(float _brightness)759 void VectorDisplay::setBrightness(float _brightness)
760 {
761 	m_brightness = _brightness;
762 }
763 
getSize(float * _outWidth,float * _outHeight)764 void VectorDisplay::getSize(float* _outWidth, float* _outHeight)
765 {
766 	*_outWidth = m_screenWidth;
767 	*_outHeight = m_screenHeight;
768 }
769 
screenSpaceQuad(float _textureWidth,float _textureHeight,float _width,float _height)770 void VectorDisplay::screenSpaceQuad(float _textureWidth, float _textureHeight, float _width, float _height)
771 {
772 	if (3 == getAvailTransientVertexBuffer(3, PosColorUvVertex::ms_layout) )
773 	{
774 		bgfx::TransientVertexBuffer vb;
775 		bgfx::allocTransientVertexBuffer(&vb, 3, PosColorUvVertex::ms_layout);
776 		PosColorUvVertex* vertex = (PosColorUvVertex*)vb.data;
777 
778 		const float zz = 0.0f;
779 
780 		const float minx = -_width;
781 		const float maxx = _width;
782 		const float miny = 0.0f;
783 		const float maxy = _height * 2.0f;
784 
785 		const float texelHalfW = m_texelHalf / _textureWidth;
786 		const float texelHalfH = m_texelHalf / _textureHeight;
787 		const float minu = -1.0f + texelHalfW;
788 		const float maxu = 1.0f + texelHalfW;
789 
790 		float minv = texelHalfH;
791 		float maxv = 2.0f + texelHalfH;
792 
793 		if (m_originBottomLeft)
794 		{
795 			float temp = minv;
796 			minv = maxv;
797 			maxv = temp;
798 
799 			minv -= 1.0f;
800 			maxv -= 1.0f;
801 		}
802 
803 		vertex[0].m_x = minx;
804 		vertex[0].m_y = miny;
805 		vertex[0].m_z = zz;
806 		vertex[0].m_abgr = 0xffffffff;
807 		vertex[0].m_u = minu;
808 		vertex[0].m_v = minv;
809 
810 		vertex[1].m_x = maxx;
811 		vertex[1].m_y = miny;
812 		vertex[1].m_z = zz;
813 		vertex[1].m_abgr = 0xffffffff;
814 		vertex[1].m_u = maxu;
815 		vertex[1].m_v = minv;
816 
817 		vertex[2].m_x = maxx;
818 		vertex[2].m_y = maxy;
819 		vertex[2].m_z = zz;
820 		vertex[2].m_abgr = 0xffffffff;
821 		vertex[2].m_u = maxu;
822 		vertex[2].m_v = maxv;
823 
824 		bgfx::setVertexBuffer(0, &vb);
825 	}
826 }
827 
setupResDependent()828 void VectorDisplay::setupResDependent()
829 {
830 	const uint64_t tsFlags = 0
831 		| BGFX_TEXTURE_RT
832 		| BGFX_SAMPLER_MIN_POINT
833 		| BGFX_SAMPLER_MAG_POINT
834 		| BGFX_SAMPLER_MIP_POINT
835 		| BGFX_SAMPLER_U_CLAMP
836 		| BGFX_SAMPLER_V_CLAMP
837 		;
838 	m_sceneFrameBuffer = bgfx::createFrameBuffer(m_screenWidth, m_screenHeight, bgfx::TextureFormat::BGRA8, tsFlags);
839 
840 	m_glowWidth = m_screenWidth / 3;
841 	m_glowHeight = m_screenHeight / 3;
842 
843 	m_glow0FrameBuffer = bgfx::createFrameBuffer(m_glowWidth, m_glowHeight, bgfx::TextureFormat::BGRA8, tsFlags);
844 	m_glow1FrameBuffer = bgfx::createFrameBuffer(m_glowWidth, m_glowHeight, bgfx::TextureFormat::BGRA8, tsFlags);
845 }
846 
teardownResDependent()847 void VectorDisplay::teardownResDependent()
848 {
849 	bgfx::destroy(m_sceneFrameBuffer);
850 	bgfx::destroy(m_glow0FrameBuffer);
851 	bgfx::destroy(m_glow1FrameBuffer);
852 }
853 
genLinetex()854 void VectorDisplay::genLinetex()                                    // generate the texture
855 {
856 	const bgfx::Memory* mem = bgfx::alloc(TEXTURE_SIZE * TEXTURE_SIZE * 4);
857 	unsigned char* texbuf = (unsigned char*)mem->data;
858 
859 	bx::memSet(texbuf, 0xff, mem->size);
860 	int x, y;
861 	for (x = 0; x < TEXTURE_SIZE; x++)
862 	{
863 		for (y = 0; y < TEXTURE_SIZE; y++)
864 		{
865 			float distance = bx::min(1.0f
866 				, bx::sqrt( (float)( (x - HALF_TEXTURE_SIZE) * (x - HALF_TEXTURE_SIZE) + (y - HALF_TEXTURE_SIZE) * (y - HALF_TEXTURE_SIZE) ) ) / (float)HALF_TEXTURE_SIZE
867 				);
868 
869 			float line = bx::pow(16.0f, -2.0f * distance);
870 			float glow = bx::pow( 2.0f, -4.0f * distance) / 10.0f;
871 			glow = 0;
872 			float val = bx::clamp(line + glow, 0.0f, 1.0f);
873 
874 			texbuf[(x + y * TEXTURE_SIZE) * 4 + 0] = 0xff;
875 			texbuf[(x + y * TEXTURE_SIZE) * 4 + 1] = 0xff;
876 			texbuf[(x + y * TEXTURE_SIZE) * 4 + 2] = 0xff;
877 			texbuf[(x + y * TEXTURE_SIZE) * 4 + 3] = (unsigned char)(val * 0xff);
878 		}
879 	}
880 
881 	const uint32_t flags = 0
882 		| BGFX_SAMPLER_U_CLAMP
883 		| BGFX_SAMPLER_V_CLAMP
884 		| BGFX_SAMPLER_MIN_POINT
885 		| BGFX_SAMPLER_MAG_POINT
886 		;
887 
888 	m_lineTexId = bgfx::createTexture2D(TEXTURE_SIZE, TEXTURE_SIZE, false, 1, bgfx::TextureFormat::BGRA8, flags, mem);
889 }
890 
891 static const int8_t simplex[95][112] =
892 {
893 	{
894 		 0, 16, /* Ascii 32 */
895 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
896 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
897 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
898 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
899 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
900 	},
901 	{
902 		 8, 10, /* Ascii 33 */
903 		 5, 21,  5,  7, -1, -1,  5,  2,  4,  1,  5,  0,  6,  1,  5,  2, -1, -1, -1, -1, -1, -1, -1,
904 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
905 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
906 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
907 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
908 	},
909 	{
910 		 5, 16, /* Ascii 34 */
911 		 4, 21,  4, 14, -1, -1, 12, 21, 12, 14, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
912 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
913 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
914 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
915 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
916 	},
917 	{
918 		11, 21, /* Ascii 35 */
919 		11, 25,  4, -7, -1, -1, 17, 25, 10, -7, -1, -1,  4, 12, 18, 12, -1, -1,  3,  6, 17,  6, -1,
920 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
921 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
922 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
923 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
924 	},
925 	{
926 		26, 20, /* Ascii 36 */
927 		 8, 25,  8, -4, -1, -1, 12, 25, 12, -4, -1, -1, 17, 18, 15, 20, 12, 21,  8, 21,  5, 20,  3,
928 		18,  3, 16,  4, 14,  5, 13,  7, 12, 13, 10, 15,  9, 16,  8, 17,  6, 17,  3, 15,  1, 12,  0,
929 		 8,  0,  5,  1,  3,  3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
930 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
931 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
932 	},
933 	{
934 		31, 24, /* Ascii 37 */
935 		21, 21,  3,  0, -1, -1,  8, 21, 10, 19, 10, 17,  9, 15,  7, 14,  5, 14,  3, 16,  3, 18,  4,
936 		20,  6, 21,  8, 21, 10, 20, 13, 19, 16, 19, 19, 20, 21, 21, -1, -1, 17,  7, 15,  6, 14,  4,
937 		14,  2, 16,  0, 18,  0, 20,  1, 21,  3, 21,  5, 19,  7, 17,  7, -1, -1, -1, -1, -1, -1, -1,
938 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
939 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
940 	},
941 	{
942 		34, 26, /* Ascii 38 */
943 		23, 12, 23, 13, 22, 14, 21, 14, 20, 13, 19, 11, 17,  6, 15,  3, 13,  1, 11,  0,  7,  0,  5,
944 		 1,  4,  2,  3,  4,  3,  6,  4,  8,  5,  9, 12, 13, 13, 14, 14, 16, 14, 18, 13, 20, 11, 21,
945 		 9, 20,  8, 18,  8, 16,  9, 13, 11, 10, 16,  3, 18,  1, 20,  0, 22,  0, 23,  1, 23,  2, -1,
946 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
947 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
948 	},
949 	{
950 		 7, 10, /* Ascii 39 */
951 		 5, 19,  4, 20,  5, 21,  6, 20,  6, 18,  5, 16,  4, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1,
952 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
953 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
954 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
955 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
956 	},
957 	{
958 		10, 14, /* Ascii 40 */
959 		11, 25,  9, 23,  7, 20,  5, 16,  4, 11,  4,  7,  5,  2,  7, -2,  9, -5, 11, -7, -1, -1, -1,
960 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
961 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
962 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
963 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
964 	},
965 	{
966 		10, 14, /* Ascii 41 */
967 		 3, 25,  5, 23,  7, 20,  9, 16, 10, 11, 10,  7,  9,  2,  7, -2,  5, -5,  3, -7, -1, -1, -1,
968 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
969 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
970 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
971 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
972 	},
973 	{
974 		 8, 16, /* Ascii 42 */
975 		 8, 21,  8,  9, -1, -1,  3, 18, 13, 12, -1, -1, 13, 18,  3, 12, -1, -1, -1, -1, -1, -1, -1,
976 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
977 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
978 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
979 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
980 	},
981 	{
982 		 5, 26, /* Ascii 43 */
983 		13, 18, 13,  0, -1, -1,  4,  9, 22,  9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
984 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
985 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
986 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
987 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
988 	},
989 	{
990 		 8, 10, /* Ascii 44 */
991 		 6,  1,  5,  0,  4,  1,  5,  2,  6,  1,  6, -1,  5, -3,  4, -4, -1, -1, -1, -1, -1, -1, -1,
992 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
993 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
994 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
995 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
996 	},
997 	{
998 		 2, 26, /* Ascii 45 */
999 		 4,  9, 22,  9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1000 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1001 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1002 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1003 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1004 	},
1005 	{
1006 		 5, 10, /* Ascii 46 */
1007 		 5,  2,  4,  1,  5,  0,  6,  1,  5,  2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1008 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1009 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1010 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1011 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1012 	},
1013 	{
1014 		 2, 22, /* Ascii 47 */
1015 		20, 25,  2, -7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1016 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1017 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1018 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1019 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1020 	},
1021 	{
1022 		17, 20, /* Ascii 48 */
1023 		 9, 21,  6, 20,  4, 17,  3, 12,  3,  9,  4,  4,  6,  1,  9,  0, 11,  0, 14,  1, 16,  4, 17,
1024 		 9, 17, 12, 16, 17, 14, 20, 11, 21,  9, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1025 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1026 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1027 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1028 	},
1029 	{
1030 		 4, 20, /* Ascii 49 */
1031 		 6, 17,  8, 18, 11, 21, 11,  0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1032 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1033 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1034 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1035 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1036 	},
1037 	{
1038 		14, 20, /* Ascii 50 */
1039 		 4, 16,  4, 17,  5, 19,  6, 20,  8, 21, 12, 21, 14, 20, 15, 19, 16, 17, 16, 15, 15, 13, 13,
1040 		10,  3,  0, 17,  0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1041 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1042 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1043 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1044 	},
1045 	{
1046 		15, 20, /* Ascii 51 */
1047 		 5, 21, 16, 21, 10, 13, 13, 13, 15, 12, 16, 11, 17,  8, 17,  6, 16,  3, 14,  1, 11,  0,  8,
1048 		 0,  5,  1,  4,  2,  3,  4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1049 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1050 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1051 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1052 	},
1053 	{
1054 		6, 20, /* Ascii 52 */
1055 		13, 21,  3,  7, 18,  7, -1, -1, 13, 21, 13,  0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1056 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1057 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1058 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1059 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1060 	},
1061 	{
1062 		17, 20, /* Ascii 53 */
1063 		15, 21,  5, 21,  4, 12,  5, 13,  8, 14, 11, 14, 14, 13, 16, 11, 17,  8, 17,  6, 16,  3, 14,
1064 		 1, 11,  0,  8,  0,  5,  1,  4,  2,  3,  4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1065 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1066 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1067 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1068 	},
1069 	{
1070 		23, 20, /* Ascii 54 */
1071 		16, 18, 15, 20, 12, 21, 10, 21,  7, 20,  5, 17,  4, 12,  4,  7,  5,  3,  7,  1, 10,  0, 11,
1072 		 0, 14,  1, 16,  3, 17,  6, 17,  7, 16, 10, 14, 12, 11, 13, 10, 13,  7, 12,  5, 10,  4,  7,
1073 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1074 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1075 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1076 	},
1077 	{
1078 		5, 20, /* Ascii 55 */
1079 		17, 21,  7,  0, -1, -1,  3, 21, 17, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1080 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1081 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1082 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1083 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1084 	},
1085 	{
1086 		29, 20, /* Ascii 56 */
1087 		 8, 21,  5, 20,  4, 18,  4, 16,  5, 14,  7, 13, 11, 12, 14, 11, 16,  9, 17,  7, 17,  4, 16,
1088 		 2, 15,  1, 12,  0,  8,  0,  5,  1,  4,  2,  3,  4,  3,  7,  4,  9,  6, 11,  9, 12, 13, 13,
1089 		15, 14, 16, 16, 16, 18, 15, 20, 12, 21,  8, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1090 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1091 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1092 	},
1093 	{
1094 		23, 20, /* Ascii 57 */
1095 		16, 14, 15, 11, 13,  9, 10,  8,  9,  8,  6,  9,  4, 11,  3, 14,  3, 15,  4, 18,  6, 20,  9,
1096 		21, 10, 21, 13, 20, 15, 18, 16, 14, 16,  9, 15,  4, 13,  1, 10,  0,  8,  0,  5,  1,  4,  3,
1097 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1098 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1099 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1100 	},
1101 	{
1102 		11, 10, /* Ascii 58 */
1103 		 5, 14,  4, 13,  5, 12,  6, 13,  5, 14, -1, -1,  5,  2,  4,  1,  5,  0,  6,  1,  5,  2, -1,
1104 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1105 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1106 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1107 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1108 	},
1109 	{
1110 		14, 10, /* Ascii 59 */
1111 		 5, 14,  4, 13,  5, 12,  6, 13,  5, 14, -1, -1,  6,  1,  5,  0,  4,  1,  5,  2,  6,  1,  6,
1112 		-1,  5, -3,  4, -4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1113 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1114 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1115 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1116 	},
1117 	{
1118 		 3, 24, /* Ascii 60 */
1119 		20, 18,  4,  9, 20,  0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1120 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1121 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1122 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1123 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1124 	},
1125 	{
1126 		 5, 26, /* Ascii 61 */
1127 		 4, 12, 22, 12, -1, -1,  4,  6, 22,  6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1128 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1129 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1130 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1131 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1132 	},
1133 	{
1134 		 3, 24, /* Ascii 62 */
1135 		 4, 18, 20,  9,  4,  0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1136 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1137 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1138 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1139 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1140 	},
1141 	{
1142 		20, 18, /* Ascii 63 */
1143 		 3, 16,  3, 17,  4, 19,  5, 20,  7, 21, 11, 21, 13, 20, 14, 19, 15, 17, 15, 15, 14, 13, 13,
1144 		12,  9, 10,  9,  7, -1, -1,  9,  2,  8,  1,  9,  0, 10,  1,  9,  2, -1, -1, -1, -1, -1, -1,
1145 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1146 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1147 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1148 	},
1149 	{
1150 		55, 27, /* Ascii 64 */
1151 		18, 13, 17, 15, 15, 16, 12, 16, 10, 15,  9, 14,  8, 11,  8,  8,  9,  6, 11,  5, 14,  5, 16,
1152 		 6, 17,  8, -1, -1, 12, 16, 10, 14,  9, 11,  9,  8, 10,  6, 11,  5, -1, -1, 18, 16, 17,  8,
1153 		17,  6, 19,  5, 21,  5, 23,  7, 24, 10, 24, 12, 23, 15, 22, 17, 20, 19, 18, 20, 15, 21, 12,
1154 		21,  9, 20,  7, 19,  5, 17,  4, 15,  3, 12,  3,  9,  4,  6,  5,  4,  7,  2,  9,  1, 12,  0,
1155 		15,  0, 18,  1, 20,  2, 21,  3, -1, -1, 19, 16, 18,  8, 18,  6, 19,  5
1156 	},
1157 	{
1158 		 8, 18, /* Ascii 65 */
1159 		 9, 21,  1,  0, -1, -1,  9, 21, 17,  0, -1, -1,  4,  7, 14,  7, -1, -1, -1, -1, -1, -1, -1,
1160 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1161 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1162 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1163 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1164 	},
1165 	{
1166 		23, 21, /* Ascii 66 */
1167 		 4, 21,  4,  0, -1, -1,  4, 21, 13, 21, 16, 20, 17, 19, 18, 17, 18, 15, 17, 13, 16, 12, 13,
1168 		11, -1, -1,  4, 11, 13, 11, 16, 10, 17,  9, 18,  7, 18,  4, 17,  2, 16,  1, 13,  0,  4,  0,
1169 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1170 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1171 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1172 	},
1173 	{
1174 		18, 21, /* Ascii 67 */
1175 		18, 16, 17, 18, 15, 20, 13, 21,  9, 21,  7, 20,  5, 18,  4, 16,  3, 13,  3,  8,  4,  5,  5,
1176 		 3,  7,  1,  9,  0, 13,  0, 15,  1, 17,  3, 18,  5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1177 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1178 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1179 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1180 	},
1181 	{
1182 		15, 21, /* Ascii 68 */
1183 		 4, 21,  4,  0, -1, -1,  4, 21, 11, 21, 14, 20, 16, 18, 17, 16, 18, 13, 18,  8, 17,  5, 16,
1184 		 3, 14,  1, 11,  0,  4,  0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1185 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1186 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1187 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1188 	},
1189 	{
1190 		11, 19, /* Ascii 69 */
1191 		 4, 21,  4,  0, -1, -1,  4, 21, 17, 21, -1, -1,  4, 11, 12, 11, -1, -1,  4,  0, 17,  0, -1,
1192 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1193 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1194 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1195 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1196 	},
1197 	{
1198 		 8, 18, /* Ascii 70 */
1199 		 4, 21,  4,  0, -1, -1,  4, 21, 17, 21, -1, -1,  4, 11, 12, 11, -1, -1, -1, -1, -1, -1, -1,
1200 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1201 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1202 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1203 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1204 	},
1205 	{
1206 		22, 21, /* Ascii 71 */
1207 		18, 16, 17, 18, 15, 20, 13, 21,  9, 21,  7, 20,  5, 18,  4, 16,  3, 13,  3,  8,  4,  5,  5,
1208 		 3,  7,  1,  9,  0, 13,  0, 15,  1, 17,  3, 18,  5, 18,  8, -1, -1, 13,  8, 18,  8, -1, -1,
1209 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1210 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1211 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1212 	},
1213 	{
1214 		 8, 22, /* Ascii 72 */
1215 		 4, 21,  4,  0, -1, -1, 18, 21, 18,  0, -1, -1,  4, 11, 18, 11, -1, -1, -1, -1, -1, -1, -1,
1216 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1217 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1218 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1219 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1220 	},
1221 	{
1222 		 2,  8, /* Ascii 73 */
1223 		 4, 21,  4,  0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1224 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1225 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1226 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1227 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1228 	},
1229 	{
1230 		10, 16, /* Ascii 74 */
1231 		12, 21, 12,  5, 11,  2, 10,  1,  8,  0,  6,  0,  4,  1,  3,  2,  2,  5,  2,  7, -1, -1, -1,
1232 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1233 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1234 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1235 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1236 	},
1237 	{
1238 		 8, 21, /* Ascii 75 */
1239 		 4, 21,  4,  0, -1, -1, 18, 21,  4,  7, -1, -1,  9, 12, 18,  0, -1, -1, -1, -1, -1, -1, -1,
1240 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1241 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1242 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1243 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1244 	},
1245 	{
1246 		 5, 17, /* Ascii 76 */
1247 		 4, 21,  4,  0, -1, -1,  4,  0, 16,  0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1248 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1249 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1250 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1251 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1252 	},
1253 	{
1254 		11, 24, /* Ascii 77 */
1255 		 4, 21,  4,  0, -1, -1,  4, 21, 12,  0, -1, -1, 20, 21, 12,  0, -1, -1, 20, 21, 20,  0, -1,
1256 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1257 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1258 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1259 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1260 	},
1261 	{
1262 		 8, 22, /* Ascii 78 */
1263 		 4, 21,  4,  0, -1, -1,  4, 21, 18,  0, -1, -1, 18, 21, 18,  0, -1, -1, -1, -1, -1, -1, -1,
1264 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1265 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1266 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1267 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1268 	},
1269 	{
1270 		21, 22, /* Ascii 79 */
1271 		 9, 21,  7, 20,  5, 18,  4, 16,  3, 13,  3,  8,  4,  5,  5,  3,  7,  1,  9,  0, 13,  0, 15,
1272 		 1, 17,  3, 18,  5, 19,  8, 19, 13, 18, 16, 17, 18, 15, 20, 13, 21,  9, 21, -1, -1, -1, -1,
1273 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1274 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1275 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1276 	},
1277 	{
1278 		13, 21, /* Ascii 80 */
1279 		4, 21, 4, 0, -1, -1, 4, 21, 13, 21, 16, 20, 17, 19, 18, 17, 18, 14, 17, 12, 16, 11, 13,
1280 		10, 4, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1281 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1282 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1283 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1284 	},
1285 	{
1286 		24, 22, /* Ascii 81 */
1287 		 9, 21,  7, 20,  5, 18,  4, 16,  3, 13,  3,  8,  4,  5,  5,  3,  7,  1,  9,  0, 13,  0, 15,
1288 		 1, 17,  3, 18,  5, 19,  8, 19, 13, 18, 16, 17, 18, 15, 20, 13, 21,  9, 21, -1, -1, 12,  4,
1289 		18, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1290 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1291 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1292 	},
1293 	{
1294 		16, 21, /* Ascii 82 */
1295 		 4, 21,  4,  0, -1, -1,  4, 21, 13, 21, 16, 20, 17, 19, 18, 17, 18, 15, 17, 13, 16, 12, 13,
1296 		11,  4, 11, -1, -1, 11, 11, 18,  0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1297 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1298 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1299 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1300 	},
1301 	{
1302 		20, 20, /* Ascii 83 */
1303 		17, 18, 15, 20, 12, 21,  8, 21,  5, 20,  3, 18,  3, 16,  4, 14,  5, 13,  7, 12, 13, 10, 15,
1304 		 9, 16,  8, 17,  6, 17,  3, 15,  1, 12,  0,  8,  0,  5,  1,  3,  3, -1, -1, -1, -1, -1, -1,
1305 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1306 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1307 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1308 	},
1309 	{
1310 		 5, 16, /* Ascii 84 */
1311 		 8, 21,  8,  0, -1, -1,  1, 21, 15, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1312 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1313 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1314 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1315 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1316 	},
1317 	{
1318 		10, 22, /* Ascii 85 */
1319 		 4, 21,  4,  6,  5,  3,  7,  1, 10,  0, 12,  0, 15,  1, 17,  3, 18,  6, 18, 21, -1, -1, -1,
1320 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1321 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1322 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1323 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1324 	},
1325 	{
1326 		 5, 18, /* Ascii 86 */
1327 		 1, 21,  9,  0, -1, -1, 17, 21,  9,  0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1328 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1329 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1330 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1331 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1332 	},
1333 	{
1334 		11, 24, /* Ascii 87 */
1335 		 2, 21,  7,  0, -1, -1, 12, 21,  7,  0, -1, -1, 12, 21, 17,  0, -1, -1, 22, 21, 17,  0, -1,
1336 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1337 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1338 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1339 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1340 	},
1341 	{
1342 		 5, 20, /* Ascii 88 */
1343 		 3, 21, 17,  0, -1, -1, 17, 21,  3,  0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1344 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1345 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1346 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1347 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1348 	},
1349 	{
1350 		 6, 18, /* Ascii 89 */
1351 		 1, 21,  9, 11,  9,  0, -1, -1, 17, 21,  9, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1352 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1353 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1354 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1355 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1356 	},
1357 	{
1358 		 8, 20, /* Ascii 90 */
1359 		17, 21,  3,  0, -1, -1,  3, 21, 17, 21, -1, -1,  3,  0, 17,  0, -1, -1, -1, -1, -1, -1, -1,
1360 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1361 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1362 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1363 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1364 	},
1365 	{
1366 		11, 14, /* Ascii 91 */
1367 		 4, 25,  4, -7, -1, -1,  5, 25,  5, -7, -1, -1,  4, 25, 11, 25, -1, -1,  4, -7, 11, -7, -1,
1368 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1369 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1370 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1371 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1372 	},
1373 	{
1374 		 2, 14, /* Ascii 92 */
1375 		 0, 21, 14, -3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1376 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1377 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1378 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1379 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1380 	},
1381 	{
1382 		11, 14, /* Ascii 93 */
1383 		 9, 25,  9, -7, -1, -1, 10, 25, 10, -7, -1, -1,  3, 25, 10, 25, -1, -1,  3, -7, 10, -7, -1,
1384 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1385 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1386 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1387 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1388 	},
1389 	{
1390 		10, 16, /* Ascii 94 */
1391 		 6, 15,  8, 18, 10, 15, -1, -1,  3, 12,  8, 17, 13, 12, -1, -1,  8, 17,  8,  0, -1, -1, -1,
1392 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1393 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1394 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1395 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1396 	},
1397 	{
1398 		 2, 16, /* Ascii 95 */
1399 		 0, -2, 16, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1400 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1401 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1402 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1403 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1404 	},
1405 	{
1406 		 7, 10, /* Ascii 96 */
1407 		 6, 21,  5, 20,  4, 18,  4, 16,  5, 15,  6, 16,  5, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1408 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1409 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1410 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1411 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1412 	},
1413 	{
1414 		17, 19, /* Ascii 97 */
1415 		15, 14, 15,  0, -1, -1, 15, 11, 13, 13, 11, 14,  8, 14,  6, 13,  4, 11,  3,  8,  3,  6,  4,
1416 		 3,  6,  1,  8,  0, 11,  0, 13,  1, 15,  3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1417 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1418 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1419 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1420 	},
1421 	{
1422 		17, 19, /* Ascii 98 */
1423 		 4, 21,  4,  0, -1, -1,  4, 11,  6, 13,  8, 14, 11, 14, 13, 13, 15, 11, 16,  8, 16,  6, 15,
1424 		 3, 13,  1, 11,  0,  8,  0,  6,  1,  4,  3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1425 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1426 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1427 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1428 	},
1429 	{
1430 		14, 18, /* Ascii 99 */
1431 		15, 11, 13, 13, 11, 14,  8, 14,  6, 13,  4, 11,  3,  8,  3,  6,  4,  3,  6,  1,  8,  0, 11,
1432 		 0, 13,  1, 15,  3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1433 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1434 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1435 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1436 	},
1437 	{
1438 		17, 19, /* Ascii 100 */
1439 		15, 21, 15,  0, -1, -1, 15, 11, 13, 13, 11, 14,  8, 14,  6, 13,  4, 11,  3,  8,  3,  6,  4,
1440 		 3,  6,  1,  8,  0, 11,  0, 13,  1, 15,  3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1441 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1442 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1443 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1444 	},
1445 	{
1446 		17, 18, /* Ascii 101 */
1447 		 3,  8, 15,  8, 15, 10, 14, 12, 13, 13, 11, 14,  8, 14,  6, 13,  4, 11,  3,  8,  3,  6,  4,
1448 		 3,  6,  1,  8,  0, 11,  0, 13,  1, 15,  3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1449 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1450 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1451 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1452 	},
1453 	{
1454 		 8, 12, /* Ascii 102 */
1455 		10, 21,  8, 21,  6, 20,  5, 17,  5,  0, -1, -1,  2, 14,  9, 14, -1, -1, -1, -1, -1, -1, -1,
1456 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1457 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1458 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1459 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1460 	},
1461 	{
1462 		22, 19, /* Ascii 103 */
1463 		15, 14, 15, -2, 14, -5, 13, -6, 11, -7,  8, -7,  6, -6, -1, -1, 15, 11, 13, 13, 11, 14,  8,
1464 		14,  6, 13,  4, 11,  3,  8,  3,  6,  4,  3,  6,  1,  8,  0, 11,  0, 13,  1, 15,  3, -1, -1,
1465 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1466 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1467 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1468 	},
1469 	{
1470 		10, 19, /* Ascii 104 */
1471 		 4, 21,  4,  0, -1, -1,  4, 10,  7, 13,  9, 14, 12, 14, 14, 13, 15, 10, 15,  0, -1, -1, -1,
1472 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1473 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1474 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1475 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1476 	},
1477 	{
1478 		 8,  8, /* Ascii 105 */
1479 		 3, 21,  4, 20,  5, 21,  4, 22,  3, 21, -1, -1,  4, 14,  4,  0, -1, -1, -1, -1, -1, -1, -1,
1480 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1481 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1482 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1483 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1484 	},
1485 	{
1486 		11, 10, /* Ascii 106 */
1487 		 5, 21,  6, 20,  7, 21,  6, 22,  5, 21, -1, -1,  6, 14,  6, -3,  5, -6,  3, -7,  1, -7, -1,
1488 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1489 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1490 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1491 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1492 	},
1493 	{
1494 		 8, 17, /* Ascii 107 */
1495 		 4, 21,  4,  0, -1, -1, 14, 14,  4,  4, -1, -1,  8,  8, 15,  0, -1, -1, -1, -1, -1, -1, -1,
1496 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1497 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1498 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1499 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1500 	},
1501 	{
1502 		 2,  8, /* Ascii 108 */
1503 		 4, 21,  4,  0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1504 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1505 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1506 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1507 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1508 	},
1509 	{
1510 		18, 30, /* Ascii 109 */
1511 		 4, 14,  4,  0, -1, -1,  4, 10,  7, 13,  9, 14, 12, 14, 14, 13, 15, 10, 15,  0, -1, -1, 15,
1512 		10, 18, 13, 20, 14, 23, 14, 25, 13, 26, 10, 26,  0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1513 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1514 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1515 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1516 	},
1517 	{
1518 		10, 19, /* Ascii 110 */
1519 		 4, 14,  4,  0, -1, -1,  4, 10,  7, 13,  9, 14, 12, 14, 14, 13, 15, 10, 15,  0, -1, -1, -1,
1520 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1521 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1522 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1523 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1524 	},
1525 	{
1526 		17, 19, /* Ascii 111 */
1527 		 8, 14,  6, 13,  4, 11,  3,  8,  3,  6,  4,  3,  6,  1,  8,  0, 11,  0, 13,  1, 15,  3, 16,
1528 		 6, 16,  8, 15, 11, 13, 13, 11, 14,  8, 14, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1529 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1530 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1531 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1532 	},
1533 	{
1534 		17, 19, /* Ascii 112 */
1535 		 4, 14,  4, -7, -1, -1,  4, 11,  6, 13,  8, 14, 11, 14, 13, 13, 15, 11, 16,  8, 16,  6, 15,
1536 		 3, 13,  1, 11,  0,  8,  0,  6,  1,  4,  3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1537 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1538 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1539 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1540 	},
1541 	{
1542 		17, 19, /* Ascii 113 */
1543 		15, 14, 15, -7, -1, -1, 15, 11, 13, 13, 11, 14,  8, 14,  6, 13,  4, 11,  3,  8,  3,  6,  4,
1544 		 3,  6,  1,  8,  0, 11,  0, 13,  1, 15,  3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1545 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1546 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1547 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1548 	},
1549 	{
1550 		 8, 13, /* Ascii 114 */
1551 		 4, 14,  4,  0, -1, -1,  4,  8,  5, 11,  7, 13,  9, 14, 12, 14, -1, -1, -1, -1, -1, -1, -1,
1552 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1553 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1554 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1555 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1556 	},
1557 	{
1558 		17, 17, /* Ascii 115 */
1559 		14, 11, 13, 13, 10, 14,  7, 14,  4, 13,  3, 11,  4,  9,  6,  8, 11,  7, 13,  6, 14,  4, 14,
1560 		 3, 13,  1, 10,  0,  7,  0,  4,  1,  3,  3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1561 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1562 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1563 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1564 	},
1565 	{
1566 		 8, 12, /* Ascii 116 */
1567 		 5, 21,  5,  4,  6,  1,  8,  0, 10,  0, -1, -1,  2, 14,  9, 14, -1, -1, -1, -1, -1, -1, -1,
1568 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1569 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1570 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1571 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1572 	},
1573 	{
1574 		10, 19, /* Ascii 117 */
1575 		 4, 14,  4,  4,  5,  1,  7,  0, 10,  0, 12,  1, 15,  4, -1, -1, 15, 14, 15,  0, -1, -1, -1,
1576 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1577 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1578 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1579 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1580 	},
1581 	{
1582 		 5, 16, /* Ascii 118 */
1583 		 2, 14,  8,  0, -1, -1, 14, 14,  8,  0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1584 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1585 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1586 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1587 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1588 	},
1589 	{
1590 		11, 22, /* Ascii 119 */
1591 		 3, 14,  7,  0, -1, -1, 11, 14,  7,  0, -1, -1, 11, 14, 15,  0, -1, -1, 19, 14, 15,  0, -1,
1592 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1593 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1594 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1595 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1596 	},
1597 	{
1598 		 5, 17, /* Ascii 120 */
1599 		 3, 14, 14,  0, -1, -1, 14, 14,  3,  0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1600 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1601 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1602 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1603 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1604 	},
1605 	{
1606 		 9, 16, /* Ascii 121 */
1607 		 2, 14,  8,  0, -1, -1, 14, 14,  8,  0,  6, -4,  4, -6,  2, -7,  1, -7, -1, -1, -1, -1, -1,
1608 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1609 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1610 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1611 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1612 	},
1613 	{
1614 		8, 17, /* Ascii 122 */
1615 		14, 14,  3,  0, -1, -1,  3, 14, 14, 14, -1, -1,  3,  0, 14,  0, -1, -1, -1, -1, -1, -1, -1,
1616 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1617 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1618 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1619 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1620 	},
1621 	{
1622 		39, 14, /* Ascii 123 */
1623 		 9, 25,  7, 24,  6, 23,  5, 21,  5, 19,  6, 17,  7, 16,  8, 14,  8, 12,  6, 10, -1, -1,  7,
1624 		24,  6, 22,  6, 20,  7, 18,  8, 17,  9, 15,  9, 13,  8, 11,  4,  9,  8,  7,  9,  5,  9,  3,
1625 		 8,  1,  7,  0,  6, -2,  6, -4,  7, -6, -1, -1,  6,  8,  8,  6,  8,  4,  7,  2,  6,  1,  5,
1626 		-1,  5, -3,  6, -5,  7, -6,  9, -7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1627 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1628 	},
1629 	{
1630 		 2,  8, /* Ascii 124 */
1631 		 4, 25,  4, -7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1632 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1633 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1634 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1635 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1636 	},
1637 	{
1638 		39, 14, /* Ascii 125 */
1639 		 5, 25,  7, 24,  8, 23,  9, 21,  9, 19,  8, 17,  7, 16,  6, 14,  6, 12,  8, 10, -1, -1,  7,
1640 		24,  8, 22,  8, 20,  7, 18,  6, 17,  5, 15,  5, 13,  6, 11, 10,  9,  6,  7,  5,  5,  5,  3,
1641 		 6,  1,  7,  0,  8, -2,  8, -4,  7, -6, -1, -1,  8,  8,  6,  6,  6,  4,  7,  2,  8,  1,  9,
1642 		-1,  9, -3,  8, -5,  7, -6,  5, -7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1643 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1644 	},
1645 	{
1646 		23, 24, /* Ascii 126 */
1647 		 3,  6,  3,  8,  4, 11,  6, 12,  8, 12, 10, 11, 14,  8, 16,  7, 18,  7, 20,  8, 21, 10, -1,
1648 		-1,  3,  8,  4, 10,  6, 11,  8, 11, 10, 10, 14,  7, 16,  6, 18,  6, 20,  7, 21, 10, 21, 12,
1649 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1650 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1651 		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
1652 	}
1653 };
1654 
drawSimplexFont(float _x,float _y,float _scale,const char * _string)1655 void VectorDisplay::drawSimplexFont(float _x, float _y, float _scale, const char* _string)
1656 {
1657 	for (;;)
1658 	{
1659 		char c = *_string++;
1660 		if (!c)
1661 		{
1662 			break;
1663 		}
1664 
1665 		if (c < 32
1666 		||  c > 126)
1667 		{
1668 			continue;
1669 		}
1670 
1671 		const int8_t* chr = simplex[c - 32];
1672 
1673 		int nvertices = chr[0];
1674 		int spacing = chr[1];
1675 
1676 		bool isDrawing = false;
1677 		int i;
1678 		for (i = 0; i < nvertices; i++)
1679 		{
1680 			int vx = chr[2 + i * 2];
1681 			int vy = chr[2 + i * 2 + 1];
1682 			if (vx == -1
1683 			   && vy == -1)
1684 			{
1685 				if (isDrawing)
1686 				{
1687 					endDraw();
1688 					isDrawing = false;
1689 				}
1690 			}
1691 			else if (!isDrawing)
1692 			{
1693 				beginDraw(_x + vx * _scale, _y - vy * _scale);
1694 				isDrawing = true;
1695 			}
1696 			else
1697 			{
1698 				drawTo(_x + vx * _scale, _y - vy * _scale);
1699 			}
1700 		}
1701 
1702 		_x += spacing * _scale;
1703 		if (isDrawing)
1704 		{
1705 			endDraw();
1706 		}
1707 	}
1708 }
1709