dd_line_width

main
Dominik Madarász 2024-07-29 15:17:47 +02:00
parent 8bf6562f19
commit 64330bbd07
6 changed files with 22 additions and 3 deletions

View File

@ -1494,6 +1494,7 @@ typedef struct lightmap_t {
int ui_fxs();
void* screenshot(int components);
void* screenshot_async(int components);
void ddraw_line_width(float width);
void ddraw_color(unsigned rgb);
void ddraw_color_push(unsigned rgb);
void ddraw_color_pop();

View File

@ -17806,6 +17806,7 @@ API void* screenshot_async(int components); // 3 RGB, 4 RGBA, -3 BGR, -4 BGRA
// [*] (proper) gizmo,
// [ ] camera, light bulb, light probe,
API void ddraw_line_width(float width);
API void ddraw_color(unsigned rgb);
API void ddraw_color_push(unsigned rgb);
API void ddraw_color_pop();
@ -387274,6 +387275,7 @@ void ddraw_flush() {
ddraw_flush_projview(camera_get_active()->proj, camera_get_active()->view);
}
static float dd_line_width = 1.0f;
void ddraw_flush_projview(mat44 proj, mat44 view) {
do_once dd_rs = renderstate();
dd_rs.depth_test_enabled = dd_ontop;
@ -387298,7 +387300,7 @@ void ddraw_flush_projview(mat44 proj, mat44 view) {
for( int i = 0; i < 3; ++i ) { // [0] thin, [1] thick, [2] points
GLenum mode = i < 2 ? GL_LINES : GL_POINTS;
dd_rs.line_width = (i == 1 ? 2 : 0.3); // 0.625);
dd_rs.line_width = (i == 1 ? dd_line_width : 0.3); // 0.625);
renderstate_apply(&dd_rs);
for each_map(dd_lists[dd_ontop][i], unsigned, rgb, array(vec3), list) {
int count = array_count(list);
@ -387372,6 +387374,10 @@ void ddraw_ontop_pop() {
if(pop) dd_ontop = *pop;
}
void ddraw_line_width(float width) {
dd_line_width = width;
}
static array(uint32_t) dd_colors;
void ddraw_color(unsigned rgb) {
dd_color = rgb;

View File

@ -66,6 +66,7 @@ void ddraw_flush() {
ddraw_flush_projview(camera_get_active()->proj, camera_get_active()->view);
}
static float dd_line_width = 1.0f;
void ddraw_flush_projview(mat44 proj, mat44 view) {
do_once dd_rs = renderstate();
dd_rs.depth_test_enabled = dd_ontop;
@ -90,7 +91,7 @@ void ddraw_flush_projview(mat44 proj, mat44 view) {
for( int i = 0; i < 3; ++i ) { // [0] thin, [1] thick, [2] points
GLenum mode = i < 2 ? GL_LINES : GL_POINTS;
dd_rs.line_width = (i == 1 ? 2 : 0.3); // 0.625);
dd_rs.line_width = (i == 1 ? dd_line_width : 0.3); // 0.625);
renderstate_apply(&dd_rs);
for each_map(dd_lists[dd_ontop][i], unsigned, rgb, array(vec3), list) {
int count = array_count(list);
@ -164,6 +165,10 @@ void ddraw_ontop_pop() {
if(pop) dd_ontop = *pop;
}
void ddraw_line_width(float width) {
dd_line_width = width;
}
static array(uint32_t) dd_colors;
void ddraw_color(unsigned rgb) {
dd_color = rgb;

View File

@ -10,6 +10,7 @@
// [*] (proper) gizmo,
// [ ] camera, light bulb, light probe,
API void ddraw_line_width(float width);
API void ddraw_color(unsigned rgb);
API void ddraw_color_push(unsigned rgb);
API void ddraw_color_pop();

View File

@ -21798,6 +21798,7 @@ void ddraw_flush() {
ddraw_flush_projview(camera_get_active()->proj, camera_get_active()->view);
}
static float dd_line_width = 1.0f;
void ddraw_flush_projview(mat44 proj, mat44 view) {
do_once dd_rs = renderstate();
dd_rs.depth_test_enabled = dd_ontop;
@ -21822,7 +21823,7 @@ void ddraw_flush_projview(mat44 proj, mat44 view) {
for( int i = 0; i < 3; ++i ) { // [0] thin, [1] thick, [2] points
GLenum mode = i < 2 ? GL_LINES : GL_POINTS;
dd_rs.line_width = (i == 1 ? 2 : 0.3); // 0.625);
dd_rs.line_width = (i == 1 ? dd_line_width : 0.3); // 0.625);
renderstate_apply(&dd_rs);
for each_map(dd_lists[dd_ontop][i], unsigned, rgb, array(vec3), list) {
int count = array_count(list);
@ -21896,6 +21897,10 @@ void ddraw_ontop_pop() {
if(pop) dd_ontop = *pop;
}
void ddraw_line_width(float width) {
dd_line_width = width;
}
static array(uint32_t) dd_colors;
void ddraw_color(unsigned rgb) {
dd_color = rgb;

View File

@ -3873,6 +3873,7 @@ API void* screenshot_async(int components); // 3 RGB, 4 RGBA, -3 BGR, -4 BGRA
// [*] (proper) gizmo,
// [ ] camera, light bulb, light probe,
API void ddraw_line_width(float width);
API void ddraw_color(unsigned rgb);
API void ddraw_color_push(unsigned rgb);
API void ddraw_color_pop();