コード例 #1
0
ファイル: game_draw.c プロジェクト: Aeggy/neverball
static void game_shadow_conf(int pose, int enable)
{
    if (enable && config_get_d(CONFIG_SHADOW))
    {
        switch (pose)
        {
        case POSE_LEVEL:
            /* No shadow. */
            tex_env_active(&tex_env_default);
            break;

        case POSE_BALL:
            /* Shadow only. */
            tex_env_select(&tex_env_pose,
                           &tex_env_default,
                           NULL);
            break;

        default:
            /* Regular shadow. */
            tex_env_select(&tex_env_shadow_clip,
                           &tex_env_shadow,
                           &tex_env_default,
                           NULL);
            break;
        }
    }
    else
    {
        tex_env_active(&tex_env_default);
    }
}
コード例 #2
0
ファイル: game.c プロジェクト: rlk/neverball
static void game_shadow_conf(int enable)
{
    if (enable && config_get_d(CONFIG_SHADOW))
    {
        tex_env_select(&tex_env_shadow_clip,
                       &tex_env_shadow,
                       &tex_env_default,
                       NULL);
    }
    else
    {
        tex_env_active(&tex_env_default);
    }
}
コード例 #3
0
ファイル: geom.c プロジェクト: Cheeseness/neverball
/*
 * Select an appropriate texture pipeline out of several.
 */
void tex_env_select(const struct tex_env *first, ...)
{
    const struct tex_env *sel = &tex_env_default;
    const struct tex_env *env;

    va_list ap;

    va_start(ap, first);

    for (env = first; env; env = va_arg(ap, const struct tex_env *))
        if (env->count <= gli.max_texture_units && env->count >= sel->count)
            sel = env;

    va_end(ap);

    tex_env_active(sel);
}