diff options
Diffstat (limited to 'src/osd/windows')
-rw-r--r-- | src/osd/windows/d3dcomm.h | 1 | ||||
-rw-r--r-- | src/osd/windows/d3dhlsl.c | 13 | ||||
-rw-r--r-- | src/osd/windows/drawd3d.c | 18 | ||||
-rw-r--r-- | src/osd/windows/drawd3d.h | 4 | ||||
-rw-r--r-- | src/osd/windows/winmain.c | 32 |
5 files changed, 50 insertions, 18 deletions
diff --git a/src/osd/windows/d3dcomm.h b/src/osd/windows/d3dcomm.h index ec3ee2e97c9..c1db074e24e 100644 --- a/src/osd/windows/d3dcomm.h +++ b/src/osd/windows/d3dcomm.h @@ -261,6 +261,7 @@ struct vertex float rhw; // RHW when no HLSL, padding when HLSL D3DCOLOR color; // diffuse color float u0, v0; // texture stage 0 coordinates + float u1, v1; // additional info for vector data }; diff --git a/src/osd/windows/d3dhlsl.c b/src/osd/windows/d3dhlsl.c index f81b8870c26..ff53845498c 100644 --- a/src/osd/windows/d3dhlsl.c +++ b/src/osd/windows/d3dhlsl.c @@ -1075,6 +1075,19 @@ void shaders::init_fsfx_quad(void *vertbuf) fsfx_vertices[5].u0 = 1.0f; fsfx_vertices[5].v0 = 1.0f; + fsfx_vertices[0].u1 = 0.0f; + fsfx_vertices[0].v1 = 0.0f; + fsfx_vertices[1].u1 = 0.0f; + fsfx_vertices[1].v1 = 0.0f; + fsfx_vertices[2].u1 = 0.0f; + fsfx_vertices[2].v1 = 0.0f; + fsfx_vertices[3].u1 = 0.0f; + fsfx_vertices[3].v1 = 0.0f; + fsfx_vertices[4].u1 = 0.0f; + fsfx_vertices[4].v1 = 0.0f; + fsfx_vertices[5].u1 = 0.0f; + fsfx_vertices[5].v1 = 0.0f; + // set the color, Z parameters to standard values for (int i = 0; i < 6; i++) { diff --git a/src/osd/windows/drawd3d.c b/src/osd/windows/drawd3d.c index 686df150f5e..fc0d418e18e 100644 --- a/src/osd/windows/drawd3d.c +++ b/src/osd/windows/drawd3d.c @@ -1621,6 +1621,10 @@ void renderer::batch_vector(const render_primitive *prim, float line_time) m_vectorbatch[m_batchindex + 5].x = b1.x1 + step->xoffs; m_vectorbatch[m_batchindex + 5].y = b1.y1 + step->yoffs; + float dx = b1.x1 - b0.x1; + float dy = b1.y1 - b0.y1; + float line_length = sqrtf(dx * dx + dy * dy); + // determine the color of the line INT32 r = (INT32)(prim->color.r * step->weight * 255.0f); INT32 g = (INT32)(prim->color.g * step->weight * 255.0f); @@ -1649,6 +1653,13 @@ void renderer::batch_vector(const render_primitive *prim, float line_time) m_vectorbatch[m_batchindex + 5].u0 = stop.c.x; m_vectorbatch[m_batchindex + 5].v0 = stop.c.y; + m_vectorbatch[m_batchindex + 0].u1 = line_length; + m_vectorbatch[m_batchindex + 1].u1 = line_length; + m_vectorbatch[m_batchindex + 2].u1 = line_length; + m_vectorbatch[m_batchindex + 3].u1 = line_length; + m_vectorbatch[m_batchindex + 4].u1 = line_length; + m_vectorbatch[m_batchindex + 5].u1 = line_length; + // set the color, Z parameters to standard values for (int i = 0; i < 6; i++) { @@ -1868,6 +1879,7 @@ vertex *renderer::mesh_alloc(int numverts) // if we're going to overflow, flush if (m_lockedbuf != NULL && m_numverts + numverts >= VERTEX_BUFFER_SIZE) { + printf("request for %d verts\n", numverts); primitive_flush_pending(); if(m_shaders->enabled()) @@ -1952,6 +1964,12 @@ void renderer::primitive_flush_pending() // set the blendmode if different set_blendmode(PRIMFLAG_GET_BLENDMODE(flags)); + if (vertnum + m_poly[polynum].get_vertcount() > m_numverts) + { + printf("Error: vertnum (%d) plus poly vertex count (%d) > %d\n", vertnum, m_poly[polynum].get_vertcount(), m_numverts); + fflush(stdout); + } + assert(vertnum + m_poly[polynum].get_vertcount() <= m_numverts); if(m_shaders->enabled() && d3dintf->post_fx_available) diff --git a/src/osd/windows/drawd3d.h b/src/osd/windows/drawd3d.h index 95d34ebb6a0..4a6d9b76582 100644 --- a/src/osd/windows/drawd3d.h +++ b/src/osd/windows/drawd3d.h @@ -50,8 +50,8 @@ // CONSTANTS //============================================================ -#define VERTEX_BASE_FORMAT (D3DFVF_DIFFUSE | D3DFVF_TEX1) -#define VERTEX_BUFFER_SIZE (10240*4+4) +#define VERTEX_BASE_FORMAT (D3DFVF_DIFFUSE | D3DFVF_TEX1 | D3DFVF_TEX2) +#define VERTEX_BUFFER_SIZE (16384*4+4) //============================================================ // TYPE DEFINITIONS diff --git a/src/osd/windows/winmain.c b/src/osd/windows/winmain.c index b57fd4782f6..365f4de3bb2 100644 --- a/src/osd/windows/winmain.c +++ b/src/osd/windows/winmain.c @@ -393,24 +393,24 @@ const options_entry windows_options::s_option_entries[] = /* Vector simulation below this line */ { NULL, NULL, OPTION_HEADER, "VECTOR POST-PROCESSING OPTIONS" }, { WINOPTION_VECTOR_TIME_SCALE";vectime", "0.0", OPTION_FLOAT, "How much the fade rate affects vector fade" }, - { WINOPTION_VECTOR_TIME_PERIOD";vecperiod", "0.1", OPTION_FLOAT, "Vector fade rate versus screen refresh rate" }, - { WINOPTION_VECTOR_LENGTH_SCALE";veclength", "0.9", OPTION_FLOAT, "How much length affects vector fade" }, - { WINOPTION_VECTOR_LENGTH_RATIO";vecsize", "4.0", OPTION_FLOAT, "Vector fade length (4.0 - vectors fade the most at and above 4 pixels, etc.)" }, + { WINOPTION_VECTOR_TIME_PERIOD";vecperiod", "0.0", OPTION_FLOAT, "Vector fade rate versus screen refresh rate" }, + { WINOPTION_VECTOR_LENGTH_SCALE";veclength", "0.8", OPTION_FLOAT, "How much length affects vector fade" }, + { WINOPTION_VECTOR_LENGTH_RATIO";vecsize", "500.0", OPTION_FLOAT, "Vector fade length (4.0 - vectors fade the most at and above 4 pixels, etc.)" }, /* Bloom below this line */ { NULL, NULL, OPTION_HEADER, "BLOOM POST-PROCESSING OPTIONS" }, - { WINOPTION_VECTOR_BLOOM_SCALE, "0.3", OPTION_FLOAT, "Intensity factor for vector bloom" }, - { WINOPTION_RASTER_BLOOM_SCALE, "0.25", OPTION_FLOAT, "Intensity factor for raster bloom" }, - { WINOPTION_BLOOM_LEVEL0_WEIGHT, "1.0", OPTION_FLOAT, "Bloom level 0 (full-size target) weight" }, - { WINOPTION_BLOOM_LEVEL1_WEIGHT, "0.21", OPTION_FLOAT, "Bloom level 1 (half-size target) weight" }, - { WINOPTION_BLOOM_LEVEL2_WEIGHT, "0.19", OPTION_FLOAT, "Bloom level 2 (quarter-size target) weight" }, - { WINOPTION_BLOOM_LEVEL3_WEIGHT, "0.17", OPTION_FLOAT, "Bloom level 3 (.) weight" }, - { WINOPTION_BLOOM_LEVEL4_WEIGHT, "0.15", OPTION_FLOAT, "Bloom level 4 (.) weight" }, - { WINOPTION_BLOOM_LEVEL5_WEIGHT, "0.14", OPTION_FLOAT, "Bloom level 5 (.) weight" }, - { WINOPTION_BLOOM_LEVEL6_WEIGHT, "0.13", OPTION_FLOAT, "Bloom level 6 (.) weight" }, - { WINOPTION_BLOOM_LEVEL7_WEIGHT, "0.12", OPTION_FLOAT, "Bloom level 7 (.) weight" }, - { WINOPTION_BLOOM_LEVEL8_WEIGHT, "0.11", OPTION_FLOAT, "Bloom level 8 (.) weight" }, - { WINOPTION_BLOOM_LEVEL9_WEIGHT, "0.10", OPTION_FLOAT, "Bloom level 9 (.) weight" }, - { WINOPTION_BLOOM_LEVEL10_WEIGHT, "0.09", OPTION_FLOAT, "Bloom level 10 (1x1 target) weight" }, + { WINOPTION_VECTOR_BLOOM_SCALE, "0.3", OPTION_FLOAT, "Intensity factor for vector bloom" }, + { WINOPTION_RASTER_BLOOM_SCALE, "0.225", OPTION_FLOAT, "Intensity factor for raster bloom" }, + { WINOPTION_BLOOM_LEVEL0_WEIGHT, "1.0", OPTION_FLOAT, "Bloom level 0 (full-size target) weight" }, + { WINOPTION_BLOOM_LEVEL1_WEIGHT, "0.21", OPTION_FLOAT, "Bloom level 1 (half-size target) weight" }, + { WINOPTION_BLOOM_LEVEL2_WEIGHT, "0.19", OPTION_FLOAT, "Bloom level 2 (quarter-size target) weight" }, + { WINOPTION_BLOOM_LEVEL3_WEIGHT, "0.17", OPTION_FLOAT, "Bloom level 3 (.) weight" }, + { WINOPTION_BLOOM_LEVEL4_WEIGHT, "0.15", OPTION_FLOAT, "Bloom level 4 (.) weight" }, + { WINOPTION_BLOOM_LEVEL5_WEIGHT, "0.14", OPTION_FLOAT, "Bloom level 5 (.) weight" }, + { WINOPTION_BLOOM_LEVEL6_WEIGHT, "0.13", OPTION_FLOAT, "Bloom level 6 (.) weight" }, + { WINOPTION_BLOOM_LEVEL7_WEIGHT, "0.12", OPTION_FLOAT, "Bloom level 7 (.) weight" }, + { WINOPTION_BLOOM_LEVEL8_WEIGHT, "0.11", OPTION_FLOAT, "Bloom level 8 (.) weight" }, + { WINOPTION_BLOOM_LEVEL9_WEIGHT, "0.10", OPTION_FLOAT, "Bloom level 9 (.) weight" }, + { WINOPTION_BLOOM_LEVEL10_WEIGHT, "0.09", OPTION_FLOAT, "Bloom level 10 (1x1 target) weight" }, // per-window options { NULL, NULL, OPTION_HEADER, "PER-WINDOW VIDEO OPTIONS" }, |