patched rendering bug

This commit is contained in:
2026-05-02 00:18:12 +03:00
parent 59d3764825
commit cd10093673

View File

@@ -6,6 +6,7 @@
#include "neonucleus.h" #include "neonucleus.h"
#include "ncomplib.h" #include "ncomplib.h"
#include "glyphcache.h" #include "glyphcache.h"
#include <ctype.h>
#include <math.h> #include <math.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@@ -550,8 +551,17 @@ int main(int argc, char **argv) {
offX + (x - 1) * cwidth, offX + (x - 1) * cwidth,
offY + (y - 1) * cheight, offY + (y - 1) * cheight,
}; };
ncl_needGlyph(gc, p.codepoint);
DrawRectangle(pos.x, pos.y, cwidth, cheight, ne_processColor(p.bgColor, scrbright)); DrawRectangle(pos.x, pos.y, cwidth, cheight, ne_processColor(p.bgColor, scrbright));
}
}
for(int y = 1; y <= scrh; y++) {
for(int x = 1; x <= scrw; x++) {
ncl_Pixel p = ncl_getScreenPixel(scrbuf, x, y);
Vector2 pos = {
offX + (x - 1) * cwidth,
offY + (y - 1) * cheight,
};
ncl_needGlyph(gc, p.codepoint);
if(p.codepoint != 0) { if(p.codepoint != 0) {
ncl_drawGlyph(gc, p.codepoint, pos, cheight, ne_processColor(p.fgColor, scrbright)); ncl_drawGlyph(gc, p.codepoint, pos, cheight, ne_processColor(p.fgColor, scrbright));
} }
@@ -639,9 +649,8 @@ int main(int argc, char **argv) {
if(keycode == KEY_TAB) unicode = '\t'; if(keycode == KEY_TAB) unicode = '\t';
bool isCtrlPressed = keybuf[KEY_LEFT_CONTROL].key != 0; bool isCtrlPressed = keybuf[KEY_LEFT_CONTROL].key != 0;
if(isCtrlPressed) { if(isCtrlPressed && isalpha(keycode)) {
if(keycode == KEY_C) unicode = 3; unicode = keycode - 'A' + 1;
if(keycode == KEY_D) unicode = 4;
} }
} }