-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathXenonScreen.hpp
More file actions
836 lines (774 loc) · 46.8 KB
/
XenonScreen.hpp
File metadata and controls
836 lines (774 loc) · 46.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
#pragma once
#include <algorithm>
#include <array>
#include <cstdint>
#include <cstring>
#include <string>
#include <string_view>
#include <vector>
#include <cmath>
#define XENONCODE_COLOR(r,g,b,a) ((uint32_t(a) << 24) | (uint32_t(b) << 16) | (uint32_t(g) << 8) | uint32_t(r))
#define XENONCODE_COLOR_R(color) (uint32_t(color) & 0xFF)
#define XENONCODE_COLOR_G(color) ((uint32_t(color) >> 8) & 0xFF)
#define XENONCODE_COLOR_B(color) ((uint32_t(color) >> 16) & 0xFF)
#define XENONCODE_COLOR_A(color) ((uint32_t(color) >> 24) & 0xFF)
#define XENONCODE_DEFAULT_COLOR XENONCODE_COLOR(8,255,255,255)
#define XENONCODE_NONE uint32_t(0b00000)
#define XENONCODE_LEFT uint32_t(0b00001)
#define XENONCODE_RIGHT uint32_t(0b00010)
#define XENONCODE_TOP uint32_t(0b00100)
#define XENONCODE_BOTTOM uint32_t(0b01000)
#define XENONCODE_CENTER uint32_t(0b10000)
#define XENONCODE_TOP_LEFT (XENONCODE_TOP | XENONCODE_LEFT)
#define XENONCODE_TOP_RIGHT (XENONCODE_TOP | XENONCODE_RIGHT)
#define XENONCODE_BOTTOM_LEFT (XENONCODE_BOTTOM | XENONCODE_LEFT)
#define XENONCODE_BOTTOM_RIGHT (XENONCODE_BOTTOM | XENONCODE_RIGHT)
class XenonFontRenderer {
static constexpr std::size_t kMaxGlyphPixels = 49;
static constexpr uint32_t kFirstCodepoint = 32;
static constexpr uint32_t kLastCodepoint = 255;
struct XenonGlyph {
uint16_t codepoint;
uint8_t width;
uint8_t height;
int8_t top;
int8_t left;
std::array<uint8_t, kMaxGlyphPixels> bitmap;
};
static constexpr XenonGlyph xenonGlyphs[] = {
{ 32, 0, 0, 0, 0, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} }, // (space)
{ 33, 1, 7, 7, 2, {1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} }, // !
{ 34, 3, 3, 7, 1, {1,0,1,1,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} }, // "
{ 35, 5, 7, 7, 0, {0,1,0,1,0,0,1,0,1,0,1,1,1,1,1,0,1,0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,0,0,0,0,0} }, // ú (0xFA)
{ 251, 5, 7, 7, 0, {0,0,1,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,1,1,0,0,0,1,1,0,0,1,1,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0} }, // û (0xFB)
{ 252, 5, 7, 7, 0, {0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0,0,1,1,0,0,1,1,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0} }, // ü (0xFC)
{ 253, 5, 7, 7, 0, {0,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,1,0,0,1,0,0,1,1,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} }, // ý (0xFD)
{ 254, 5, 6, 6, 0, {1,0,0,0,0,1,1,1,1,0,1,0,0,0,1,1,1,1,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} }, // þ (0xFE)
{ 255, 5, 7, 7, 0, {0,1,0,1,0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,1,0,0,1,1,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} }, // ÿ (0xFF)
};
static constexpr std::size_t kGlyphCount = sizeof(xenonGlyphs) / sizeof(xenonGlyphs[0]);
public:
struct Glyph {
uint32_t width = 0;
uint32_t height = 0;
int32_t top = 0;
int32_t left = 0;
std::vector<uint8_t> data;
uint8_t operator[](size_t index) const {return data.at(index);}
};
static const XenonGlyph* FindGlyph(uint32_t codepoint) {
if (codepoint < kFirstCodepoint || codepoint > kLastCodepoint) {
return nullptr;
}
const std::size_t index = static_cast<std::size_t>(codepoint - kFirstCodepoint);
return &xenonGlyphs[index];
}
static const XenonGlyph* ResolveGlyph(char32_t codepoint) {
if (const auto* glyph = FindGlyph(static_cast<uint32_t>(codepoint))) {
return glyph;
}
return FindGlyph(static_cast<uint32_t>('?'));
}
inline Glyph operator[](char32_t codepoint) const {
Glyph glyph;
if (const auto* data = ResolveGlyph(codepoint)) {
glyph.width = data->width;
glyph.height = data->height;
glyph.top = data->top;
glyph.left = data->left;
glyph.data.reserve(static_cast<size_t>(glyph.width) * glyph.height);
const size_t total = static_cast<size_t>(glyph.width) * glyph.height;
for (size_t i = 0; i < total; ++i) {
glyph.data.push_back(data->bitmap[i] ? 1 : 0);
}
}
return glyph;
}
inline std::vector<Glyph> operator[](const std::string_view& text) const {
std::vector<Glyph> glyphs;
glyphs.reserve(text.size());
for (size_t i = 0; i < text.size(); ) {
unsigned char c = static_cast<unsigned char>(text[i++]);
char32_t codepoint = 0;
if (c < 0x80) {
codepoint = c;
} else if ((c >> 5) == 0x6) {
if (i >= text.size()) {codepoint = '?';}
else {
codepoint = ((c & 0x1F) << 6) | (static_cast<unsigned char>(text[i++]) & 0x3F);
}
} else if ((c >> 4) == 0xE) {
if (i + 1 >= text.size()) {codepoint = '?';}
else {
codepoint = ((c & 0xF) << 12);
codepoint |= (static_cast<unsigned char>(text[i++]) & 0x3F) << 6;
codepoint |= static_cast<unsigned char>(text[i++]) & 0x3F;
}
} else if ((c >> 3) == 0x1E) {
if (i + 2 >= text.size()) {codepoint = '?';}
else {
codepoint = ((c & 0x7) << 18);
codepoint |= (static_cast<unsigned char>(text[i++]) & 0x3F) << 12;
codepoint |= (static_cast<unsigned char>(text[i++]) & 0x3F) << 6;
codepoint |= static_cast<unsigned char>(text[i++]) & 0x3F;
}
} else {
codepoint = '?';
}
glyphs.emplace_back(operator[](codepoint));
}
return glyphs;
}
};
namespace {
static inline int EdgeFunction(int x1, int y1, int x2, int y2, int x3, int y3) {
int twoarea = ((x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1));
if (twoarea == 0) return 0;
return twoarea < 0? -1 : 1;
}
static inline size_t Utf8Length(const std::string_view& str) {
size_t len = 0;
for (size_t i = 0; i < str.length(); ++i) {
if ((str[i] & 0xC0) != 0x80) {
++len;
}
}
return len;
}
}
class XenonScreen {
// constant values
const unsigned int _textSizeX = 6;
const unsigned int _textSizeY = 8;
// configuration
const uint32_t _width;
const uint32_t _height;
uint32_t _bgColor;
uint32_t _fgColor;
// state machine
uint32_t _textSizeMultiplier = 1;
uint32_t _textAlign = XENONCODE_NONE;
uint32_t _newlineSpacing = 1;
void ResetState() {
_textSizeMultiplier = 1;
_textAlign = XENONCODE_NONE;
_newlineSpacing = 1;
}
// data
std::vector<uint32_t> _pixels;
std::vector<uint32_t> _stagingBuffer;
bool _dirty = false;
uint32_t _click_x = 0;
uint32_t _click_y = 0;
bool _clicked = false;
bool _clickHold = false;
int _scroll = 0;
XenonFontRenderer fontRenderer;
public:
virtual ~XenonScreen() = default;
virtual bool Update();
virtual void ResetClick() {
_clicked = false;
_click_x = 0;
_click_y = 0;
_clickHold = false;
}
virtual void ClickHold(uint32_t x, uint32_t y) {
_click_x = x;
_click_y = y;
_clickHold = true;
}
virtual void Click(uint32_t x, uint32_t y) {
_click_x = x;
_click_y = y;
_clickHold = true;
_clicked = true;
}
virtual bool GetClick() const {
return _clicked;
}
virtual bool ConsumeClickHold() {
if (_clickHold) {
_clickHold = false;
return true;
}
return false;
}
uint32_t GetClickX() {return _click_x;}
uint32_t GetClickY() {return _click_y;}
virtual void Scroll(int scroll) {
_scroll = scroll;
}
virtual void ResetScroll() {
_scroll = 0;
}
int GetScroll() const {return _scroll;}
uint32_t GetWidth() const {return _width;}
uint32_t GetHeight() const {return _height;}
uint32_t GetCharWidth() const {return _textSizeX * _textSizeMultiplier;}
uint32_t GetCharHeight() const {return _textSizeY * _textSizeMultiplier;}
void SetBgColor(uint32_t color) {
_bgColor = color;
Blank();
}
uint32_t GetBgColor() const {
return _bgColor;
}
void SetFgColor(uint32_t color) {
_fgColor = color;
}
uint32_t GetFgColor() const {
return _fgColor;
}
void SetTextSize(uint32_t multiplier) {
_textSizeMultiplier = std::clamp(multiplier, 1u, 64u);
}
uint32_t GetTextSize() const {
return _textSizeMultiplier;
}
void SetTextAlign(uint32_t align) {
_textAlign = align;
}
uint32_t GetTextAlign() const {
return _textAlign;
}
void SetNewlineSpacing(uint32_t spacing) {
_newlineSpacing = std::clamp(spacing, 0u, 2048u);
}
uint32_t GetNewlineSpacing() const {
return _newlineSpacing;
}
uint8_t* data() {return reinterpret_cast<uint8_t*>(_pixels.data());}
const uint8_t* data() const {return reinterpret_cast<const uint8_t*>(_pixels.data());}
size_t size() const {return _pixels.size() * sizeof(uint32_t);}
void Dirty() {
_dirty = true;
}
XenonScreen(uint32_t width, uint32_t height, const std::vector<uint32_t>& pixels, uint32_t bgColor = XENONCODE_COLOR(0,0,0,255), uint32_t fgColor = XENONCODE_DEFAULT_COLOR)
: _width(width)
, _height(height)
, _bgColor(bgColor)
, _fgColor(fgColor)
, _pixels(pixels)
, _stagingBuffer(pixels)
{}
XenonScreen(uint32_t width, uint32_t height, uint32_t bgColor = XENONCODE_COLOR(0,0,0,255), uint32_t fgColor = XENONCODE_DEFAULT_COLOR)
: _width(width)
, _height(height)
, _bgColor(bgColor)
, _fgColor(fgColor)
, _pixels(_width * _height, bgColor)
, _stagingBuffer(_width * _height, bgColor)
{}
// Public functions
void Blank() {Blank(_bgColor);}
void Blank(uint32_t color);
void Write(uint32_t color, const std::string_view& text) {Write(0,0, color, text);}
void Write(const std::string_view& text) {Write(_fgColor, text);}
void Write(int x, int y, uint32_t color, const std::string_view& text);
void WriteLine(int x, int y, uint32_t color, const std::string_view& text);
void Draw(int x, int y, uint32_t color, int rectWidth = 1, int rectHeight = 1);
uint32_t GetPixel(int x, int y) const;
void DrawPoint(int x, int y, uint32_t color);
void DrawLine(int x1, int y1, int x2, int y2, uint32_t color);
void DrawRect(int x1, int y1, int x2, int y2, uint32_t color, uint32_t fillColor = 0);
void DrawTriangle(int x1, int y1, int x2, int y2, int x3, int y3, uint32_t color, uint32_t fillColor = 0);
void DrawCircle(int x, int y, int radius, uint32_t color, uint32_t fillColor = 0);
void DrawPoly(uint32_t color, const std::vector<int>& args);
};
inline void XenonScreen::Blank(uint32_t color) {
std::fill(_pixels.begin(), _pixels.end(), color);
_dirty = true;
}
inline void XenonScreen::WriteLine(int x, int y, uint32_t color, const std::string_view& text) {
uint8_t r = XENONCODE_COLOR_R(color);
uint8_t g = XENONCODE_COLOR_G(color);
uint8_t b = XENONCODE_COLOR_B(color);
uint8_t a = XENONCODE_COLOR_A(color);
const auto glyphs = fontRenderer[text.substr(0, 1024)];
int glyphHeight = (_textSizeY-1)*_textSizeMultiplier;
for (const auto& glyph : glyphs) {
for (int yy = 0; yy < int(glyph.height); ++yy) {
if (yy + y >= int(_height)) break;
for (int xx = 0; xx < int(glyph.width); ++xx) {
if (xx + x >= int(_width)) break;
if (glyph[yy * int(glyph.width) + xx]) {
for (int ix = 0; ix < int(_textSizeMultiplier); ++ix) {
for (int iy = 0; iy < int(_textSizeMultiplier); ++iy) {
int xxx = x + xx*_textSizeMultiplier + ix + glyph.left*_textSizeMultiplier;
int yyy = y + yy*_textSizeMultiplier + iy + glyphHeight - glyph.top*_textSizeMultiplier;
if (xxx >= 0 && xxx < int(_width) && yyy >= 0 && yyy < int(_height)) {
size_t index = yyy * _width + xxx;
if (index < _pixels.size()) {
if (a == 255) {
_pixels[index] = color;
} else {
uint32_t prev = _pixels[index];
uint8_t prev_r = XENONCODE_COLOR_R(prev);
uint8_t prev_g = XENONCODE_COLOR_G(prev);
uint8_t prev_b = XENONCODE_COLOR_B(prev);
uint8_t prev_a = XENONCODE_COLOR_A(prev);
_pixels[index] = XENONCODE_COLOR(
((r * a + prev_r * (255 - a)) / 255),
((g * a + prev_g * (255 - a)) / 255),
((b * a + prev_b * (255 - a)) / 255),
uint8_t(std::clamp(int32_t(prev_a) + a, 0, 255))
);
}
}
}
}
}
}
}
}
x += _textSizeX*_textSizeMultiplier;
}
_dirty = true;
}
inline void XenonScreen::Write(int x, int y, uint32_t color, const std::string_view& text) {
if (!color) return;
std::vector<std::string_view> lines;{
size_t pos = 0;
for (size_t i = 0; int(i) < int(text.size())-1; ++i) {
if (text[i] == '\\' && text[i+1] == 'n') {
lines.emplace_back(text.data() + pos, i - pos);
pos = i + 2;
++i;
} else if (text[i] == '\n') {
lines.emplace_back(text.data() + pos, i - pos);
pos = i + 1;
}
}
if (pos < text.size()) {
lines.emplace_back(text.data() + pos, text.back() == '\n'? (text.size() - pos - 1) : (text.size() - pos));
}
}
uint32_t lineHeight = (_textSizeY + _newlineSpacing - 1) * _textSizeMultiplier;
if (_textAlign & XENONCODE_TOP) {
y += 1;
} else if (_textAlign & XENONCODE_BOTTOM) {
y += GetHeight() - lines.size()*lineHeight + _newlineSpacing * _textSizeMultiplier - 1;
} else if (_textAlign & XENONCODE_CENTER) {
y += std::max(1, int(GetHeight() / 2 - lines.size()*lineHeight / 2 + _newlineSpacing * _textSizeMultiplier / 2));
}
int x0 = x;
for (const auto& line : lines) {
x = x0;
if (_textAlign & XENONCODE_LEFT) {
x += 1;
} else if (_textAlign & XENONCODE_RIGHT) {
x += GetWidth() - Utf8Length(line)*_textSizeX*_textSizeMultiplier - 1 + _textSizeMultiplier;
} else if (_textAlign & XENONCODE_CENTER) {
x += std::max(1, int(GetWidth() / 2 - Utf8Length(line)*_textSizeX*_textSizeMultiplier / 2));
}
if (line.size() > 0) WriteLine(x, y, color, line);
y += lineHeight;
}
}
inline void XenonScreen::Draw(int x, int y, uint32_t color, int rectWidth, int rectHeight) {
rectWidth = std::clamp(rectWidth, 0, std::max(0, int(_width - x)));
rectHeight = std::clamp(rectHeight, 0, std::max(0, int(_height - y)));
if (rectWidth <= 0 || rectHeight <= 0 || !color) return;
uint32_t a = XENONCODE_COLOR_A(color);
uint32_t r = XENONCODE_COLOR_R(color) * a;
uint32_t g = XENONCODE_COLOR_G(color) * a;
uint32_t b = XENONCODE_COLOR_B(color) * a;
for (int yy = 0; yy < rectHeight; ++yy) {
unsigned int yyy = std::max(0, y + yy);
if (yyy >= _height) break;
for (int xx = 0; xx < rectWidth; ++xx) {
unsigned int xxx = std::max(0, x + xx);
if (xxx >= _width) break;
size_t index = yyy * _width + xxx;
if (xxx < _width && yyy < _height) {
if (index < _pixels.size()) {
if (a == 255) {
_pixels[index] = color;
} else {
uint32_t prev = _pixels[index];
uint32_t prev_r = XENONCODE_COLOR_R(prev);
uint32_t prev_g = XENONCODE_COLOR_G(prev);
uint32_t prev_b = XENONCODE_COLOR_B(prev);
uint32_t prev_a = XENONCODE_COLOR_A(prev);
_pixels[index] = XENONCODE_COLOR(
((r + prev_r * (255 - a)) / 255),
((g + prev_g * (255 - a)) / 255),
((b + prev_b * (255 - a)) / 255),
uint8_t(std::clamp(int32_t(prev_a) + int32_t(a), 0, 255))
);
}
}
}
}
}
_dirty = true;
}
inline uint32_t XenonScreen::GetPixel(int x, int y) const {
size_t index = y * _width + x;
if (index < _pixels.size()) {
return _pixels[index];
}
return 0;
}
inline void XenonScreen::DrawPoint(int x, int y, uint32_t color) {
if (!color) return;
if (x < 0 || y < 0 || x >= int(_width) || y >= int(_height)) return;
size_t index = y * _width + x;
if (index < _pixels.size()) {
uint8_t a = XENONCODE_COLOR_A(color);
if (a == 255) {
_pixels[index] = color;
} else {
uint32_t prev = _pixels[index];
_pixels[index] = XENONCODE_COLOR(
((XENONCODE_COLOR_R(color) * a + XENONCODE_COLOR_R(prev) * (255 - a)) / 255),
((XENONCODE_COLOR_G(color) * a + XENONCODE_COLOR_G(prev) * (255 - a)) / 255),
((XENONCODE_COLOR_B(color) * a + XENONCODE_COLOR_B(prev) * (255 - a)) / 255),
uint8_t(std::clamp(int32_t(XENONCODE_COLOR_A(prev)) + a, 0, 255))
);
}
_dirty = true;
}
}
inline void XenonScreen::DrawLine(int x1, int y1, int x2, int y2, uint32_t color) {
float dx = float(x2 - x1);
float dy = float(y2 - y1);
float steps = std::max(std::abs(dx), std::abs(dy));
if (steps > 10000) return; // avoid bad values causing near-infinite loops
if (steps/8 > _width + _height) return;
dx /= steps;
dy /= steps;
float x = float(x1) + 0.5f;
float y = float(y1) + 0.5f;
for (int i = 0; i < steps; ++i) {
DrawPoint(int(x), int(y), color);
x += dx;
y += dy;
}
}
inline void XenonScreen::DrawRect(int x1, int y1, int x2, int y2, uint32_t color, uint32_t fillColor) {
if (x1 > x2) std::swap(x1, x2);
if (y1 > y2) std::swap(y1, y2);
if (color && color != fillColor) {
DrawLine(x1, y1, x2, y1, color); // top
DrawLine(x1, y2-1, x2, y2-1, color); // bottom
DrawLine(x1, y1, x1, y2, color); // left
DrawLine(x2-1, y1, x2-1, y2, color); // right
++x1;
++y1;
--x2;
--y2;
}
if (fillColor) {
Draw(x1, y1, fillColor, x2-x1, y2-y1);
}
}
inline void XenonScreen::DrawTriangle(int x1, int y1, int x2, int y2, int x3, int y3, uint32_t color, uint32_t fillColor) {
if (fillColor) {
int sign = EdgeFunction(x1, y1, x2, y2, x3, y3);
int minX = std::min({x1, x2, x3});
int minY = std::min({y1, y2, y3});
int maxX = std::max({x1, x2, x3});
int maxY = std::max({y1, y2, y3});
for (int y = minY; y <= maxY; ++y) {
for (int x = minX; x <= maxX; ++x) {
if (EdgeFunction(x2, y2, x3, y3, x, y) == sign && EdgeFunction(x3, y3, x1, y1, x, y) == sign && EdgeFunction(x1, y1, x2, y2, x, y) == sign) {
DrawPoint(x, y, fillColor);
}
}
}
}
if (color) {
DrawLine(x1, y1, x2, y2, color);
DrawLine(x2, y2, x3, y3, color);
DrawLine(x3, y3, x1, y1, color);
}
}
inline void XenonScreen::DrawCircle(int x, int y, int radius, uint32_t color, uint32_t fillColor) {
int radiusMinusOne = radius - 1;
int minY = std::max(0, y - radius) - y;
int minX = std::max(0, x - radius) - x;
int maxY = std::min(int(_height), y + radius) - y;
int maxX = std::min(int(_width), x + radius) - x;
for (int yy = minY; yy <= maxY; ++yy) {
for (int xx = minX; xx <= maxX; ++xx) {
int len2 = xx*xx + yy*yy;
if (len2 < radius*radius) {
if (color && len2 >= radiusMinusOne*radiusMinusOne) {
DrawPoint(x + xx, y + yy, color);
} else if (fillColor) {
DrawPoint(x + xx, y + yy, fillColor);
}
}
}
}
}
inline void XenonScreen::DrawPoly(uint32_t color, const std::vector<int>& args) {
Dirty();
if (args.size() < 6 || args.size() % 2 != 0) {
return;
}
int numPoints = args.size() / 2;
std::vector<int> polyX(numPoints);
std::vector<int> polyY(numPoints);
for (int i = 0; i < numPoints; i++) {
polyX[i] = args[i * 2];
polyY[i] = args[i * 2 + 1];
}
int minY = *std::min_element(polyY.begin(), polyY.end());
int maxY = *std::max_element(polyY.begin(), polyY.end());
minY = std::max(0, minY);
maxY = std::min(static_cast<int>(_height) - 1, maxY);
for (int y = minY; y <= maxY; y++) {
std::vector<int> intersections;
for (int i = 0; i < numPoints; i++) {
int j = (i + 1) % numPoints;
if ((polyY[i] <= y && polyY[j] > y) ||
(polyY[j] <= y && polyY[i] > y)) {
int x = polyX[i] + (y - polyY[i]) * (polyX[j] - polyX[i]) / (polyY[j] - polyY[i]);
intersections.push_back(x);
}
}
std::sort(intersections.begin(), intersections.end());
for (size_t i = 0; i < intersections.size(); i += 2) {
if (i + 1 < intersections.size()) {
int startX = std::max(0, intersections[i]);
int endX = std::min(static_cast<int>(_width) - 1, intersections[i + 1]);
for (int x = startX; x <= endX; x++) {
DrawPoint(x, y, color);
}
}
}
}
for (int i = 0; i < numPoints; i++) {
int j = (i + 1) % numPoints;
DrawLine(polyX[i], polyY[i], polyX[j], polyY[j], color);
}
}
inline bool XenonScreen::Update() {
ResetState();
if (_dirty) {
_dirty = false;
if (std::memcmp(_stagingBuffer.data(), _pixels.data(), _pixels.size() * sizeof(uint32_t))) {
std::memcpy(_stagingBuffer.data(), _pixels.data(), _pixels.size() * sizeof(uint32_t));
return true;
}
}
return false;
}