Changeset 1873


Ignore:
Timestamp:
Sep 4, 2012, 12:25:16 AM (7 years ago)
Author:
rez
Message:

added char number w/h in setup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/neercs/video/render.cpp

    r1862 r1873  
    116116ivec2 map_size(256,256);   // texture map size
    117117ivec2 font_size(8,8);      // font size
    118 ivec2 canvas_char(0,0);    // canvas char number
     118ivec2 canvas_char(45,16);  // canvas char number
    119119ivec2 canvas_size(0,0);    // caca size
    120120/* setup variable */
     
    172172    "screen",
    173173        "enable",
     174        "char number w",
     175        "char number h",
    174176        "deform ratio",
    175177        "zoom base",
     
    177179        "corner blur",
    178180        "vignetting",
    179         "",
    180         "",
    181181    "color",
    182182        "filter red",
     
    264264    vec4(0), /* screen */
    265265        vec4( 0, 1, 1, 1),
     266        vec4( 0.0f, 80.0f, 1.0f, canvas_char.x),
     267        vec4( 0.0f, 50.0f, 1.0f, canvas_char.y),
    266268        vec4( 0.0f, 1.0f, 0.05f, postfx_deform.x),
    267269        vec4( 0.5f, 0.7f, 0.01f, postfx_deform.y),
     
    269271        vec4( 0.0f, 1.0f, 0.05f, postfx_corner.y),
    270272        vec4(-1.0f, 1.0f, 0.10f, postfx_vignetting),
    271         vec4(0),
    272         vec4(0),
    273273    vec4(0), /* color */
    274274        vec4(0.0f, 1.0f, 0.05f, color_filter.x),
     
    336336    k += 6; /* screen */
    337337    m_shader_postfx = (setup_var[k].w == 1) ? true : false; k++;
     338    canvas_char = vec2(setup_var[k].w, setup_var[k + 1].w); k += 2;
    338339    postfx_deform = vec2(setup_var[k].w, setup_var[k + 1].w); k += 2;
    339340    postfx_corner = vec2(setup_var[k].w, setup_var[k + 1].w); k += 2;
    340341    postfx_vignetting = setup_var[k].w; k++;
    341     k += 3; /* color */
     342    k += 1; /* color */
    342343    color_filter = vec3(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w); k += 3;
    343344    color_color = vec3(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w); k += 3;
     
    354355    postfx_moire_h = vec4(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w, setup_var[k + 3].w); k += 4;
    355356    postfx_moire_v = vec4(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w, setup_var[k + 3].w); k += 4;
    356     k++; /* scanline */
     357    k += 1; /* scanline */
    357358    postfx_scanline_h = vec4(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w, setup_var[k + 3].w); k += 4;
    358359    postfx_scanline_v = vec4(setup_var[k].w, setup_var[k + 1].w, setup_var[k + 2].w, setup_var[k + 3].w); k += 4;
     360
     361    caca_set_canvas_size(m_caca, canvas_char.x, canvas_char.y);
    359362}
    360363
     
    876879            }
    877880        }
     881    /* informations */
     882    int w = caca_get_canvas_width(m_caca);
     883    int h = caca_get_canvas_height(m_caca);
     884    caca_set_color_argb(m_caca, 0xfff, 0x000);
     885    caca_printf(m_caca, 1, 1, "W=%i*%i", w, h);
    878886    }
    879887
Note: See TracChangeset for help on using the changeset viewer.