Subversion Repositories eduke32

Rev

Rev 4993 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4993 Rev 5065
Line 862... Line 862...
862
    Net_SendClientInfo();
862
    Net_SendClientInfo();
863
863
864
    return OSDCMD_OK;
864
    return OSDCMD_OK;
865
}
865
}
866
866
-
 
867
867
static int32_t osdcmd_button(const osdfuncparm_t *parm)
868
static int32_t osdcmd_button(const osdfuncparm_t *parm)
868
{
869
{
869
    char *p = (char *)parm->name+9;  // skip "gamefunc_"
870
    char *p = (char *)parm->name+9;  // skip "gamefunc_"
870
//    if (g_player[myconnectindex].ps->gm == MODE_GAME) // only trigger these if in game
871
//    if (g_player[myconnectindex].ps->gm == MODE_GAME) // only trigger these if in game
871
    CONTROL_OSDInput[CONFIG_FunctionNameToNum(p)] = 1; // FIXME
872
    CONTROL_OSDInput[CONFIG_FunctionNameToNum(p)] = 1; // FIXME
Line 1400... Line 1401...
1400
1401
1401
    if (!Bstrcasecmp(parm->name, "r_size"))
1402
    if (!Bstrcasecmp(parm->name, "r_size"))
1402
    {
1403
    {
1403
        ud.statusbarmode = (ud.screen_size < 8);
1404
        ud.statusbarmode = (ud.screen_size < 8);
1404
        G_UpdateScreenArea();
1405
        G_UpdateScreenArea();
1405
-
 
1406
        return r;
-
 
1407
    }
1406
    }
1408
    else if (!Bstrcasecmp(parm->name, "r_maxfps"))
1407
    else if (!Bstrcasecmp(parm->name, "r_maxfps"))
1409
    {
1408
    {
1410
        g_frameDelay = r_maxfps ? Blrintf(1000.f/(float)r_maxfps) : 0;
1409
        g_frameDelay = r_maxfps ? Blrintf(1000.f/(float)r_maxfps) : 0;
1411
-
 
1412
        return r;
-
 
1413
    }
1410
    }
1414
    else if (!Bstrcasecmp(parm->name, "r_ambientlight"))
1411
    else if (!Bstrcasecmp(parm->name, "r_ambientlight"))
1415
    {
1412
    {
1416
        if (r_ambientlight == 0)
1413
        if (r_ambientlight == 0)
1417
            r_ambientlightrecip = 256.f;
1414
            r_ambientlightrecip = 256.f;
1418
        else r_ambientlightrecip = 1.f/r_ambientlight;
1415
        else r_ambientlightrecip = 1.f/r_ambientlight;
1419
-
 
1420
        return r;
-
 
1421
    }
1416
    }
1422
    else if (!Bstrcasecmp(parm->name, "in_mouse"))
1417
    else if (!Bstrcasecmp(parm->name, "in_mouse"))
1423
    {
1418
    {
1424
        CONTROL_MouseEnabled = (ud.config.UseMouse && CONTROL_MousePresent);
1419
        CONTROL_MouseEnabled = (ud.config.UseMouse && CONTROL_MousePresent);
1425
-
 
1426
        return r;
-
 
1427
    }
1420
    }
1428
    else if (!Bstrcasecmp(parm->name, "in_joystick"))
1421
    else if (!Bstrcasecmp(parm->name, "in_joystick"))
1429
    {
1422
    {
1430
        CONTROL_JoystickEnabled = (ud.config.UseJoystick && CONTROL_JoyPresent);
1423
        CONTROL_JoystickEnabled = (ud.config.UseJoystick && CONTROL_JoyPresent);
1431
-
 
1432
        return r;
-
 
1433
    }
1424
    }
1434
    else if (!Bstrcasecmp(parm->name, "vid_gamma"))
1425
    else if (!Bstrcasecmp(parm->name, "vid_gamma"))
1435
    {
1426
    {
1436
        ud.brightness = GAMMA_CALC;
1427
        ud.brightness = GAMMA_CALC;
1437
        ud.brightness <<= 2;
1428
        ud.brightness <<= 2;
1438
        setbrightness(ud.brightness>>2,g_player[myconnectindex].ps->palette,0);
1429
        setbrightness(ud.brightness>>2,g_player[myconnectindex].ps->palette,0);
1439
-
 
1440
        return r;
-
 
1441
    }
1430
    }
1442
    else if (!Bstrcasecmp(parm->name, "vid_brightness") || !Bstrcasecmp(parm->name, "vid_contrast"))
1431
    else if (!Bstrcasecmp(parm->name, "vid_brightness") || !Bstrcasecmp(parm->name, "vid_contrast"))
1443
    {
1432
    {
1444
        setbrightness(ud.brightness>>2,g_player[myconnectindex].ps->palette,0);
1433
        setbrightness(ud.brightness>>2,g_player[myconnectindex].ps->palette,0);
1445
-
 
1446
        return r;
-
 
1447
    }
1434
    }
1448
    else if (!Bstrcasecmp(parm->name, "hud_scale")
1435
    else if (!Bstrcasecmp(parm->name, "hud_scale")
1449
             || !Bstrcasecmp(parm->name, "hud_statusbarmode")
1436
             || !Bstrcasecmp(parm->name, "hud_statusbarmode")
1450
             || !Bstrcasecmp(parm->name, "r_rotatespritenowidescreen"))
1437
             || !Bstrcasecmp(parm->name, "r_rotatespritenowidescreen"))
1451
    {
1438
    {
1452
        G_UpdateScreenArea();
1439
        G_UpdateScreenArea();
1453
-
 
1454
        return r;
-
 
1455
    }
1440
    }
1456
    else if (!Bstrcasecmp(parm->name, "skill"))
1441
    else if (!Bstrcasecmp(parm->name, "skill"))
1457
    {
1442
    {
1458
        if (numplayers > 1)
1443
        if (numplayers > 1)
1459
            return r;
1444
            return r;
1460
1445
1461
        ud.player_skill = ud.m_player_skill;
1446
        ud.player_skill = ud.m_player_skill;
1462
-
 
1463
        return r;
-
 
1464
    }
1447
    }
1465
    else if (!Bstrcasecmp(parm->name, "color"))
1448
    else if (!Bstrcasecmp(parm->name, "color"))
1466
    {
1449
    {
1467
        G_CheckPlayerColor((int32_t *)&ud.color,-1);
1450
        G_CheckPlayerColor((int32_t *)&ud.color,-1);
1468
        g_player[0].ps->palookup = g_player[0].pcolor = ud.color;
1451
        g_player[0].ps->palookup = g_player[0].pcolor = ud.color;
1469
-
 
1470
        return r;
-
 
1471
    }
1452
    }
1472
    else if (!Bstrcasecmp(parm->name, "osdscale"))
1453
    else if (!Bstrcasecmp(parm->name, "osdscale"))
1473
    {
1454
    {
1474
        osdrscale = 1.f/osdscale;
1455
        osdrscale = 1.f/osdscale;
1475
1456
1476
        if (xdim && ydim)
1457
        if (xdim && ydim)
1477
            OSD_ResizeDisplay(xdim, ydim);
1458
            OSD_ResizeDisplay(xdim, ydim);
-
 
1459
    }
-
 
1460
    else if (!Bstrcasecmp(parm->name, "wchoice"))
-
 
1461
    {
-
 
1462
        if (parm->numparms == 1)
-
 
1463
        {
-
 
1464
            if (g_forceWeaponChoice) // rewrite ud.wchoice because osdcmd_cvar_set already changed it
-
 
1465
            {
-
 
1466
                int j = 0;
1478
1467
-
 
1468
                while (j < 10)
-
 
1469
                {
-
 
1470
                    ud.wchoice[j] = g_player[myconnectindex].wchoice[j] + '0';
-
 
1471
                    j++;
1479
        return r;
1472
                }
-
 
1473
-
 
1474
                ud.wchoice[j] = 0;
-
 
1475
            }
-
 
1476
            else
-
 
1477
            {
-
 
1478
                char const *c = parm->parms[0];
-
 
1479
-
 
1480
                if (*c)
-
 
1481
                {
-
 
1482
                    int j = 0;
-
 
1483
-
 
1484
                    while (*c && j < 10)
-
 
1485
                    {
-
 
1486
                        g_player[myconnectindex].wchoice[j] = *c - '0';
-
 
1487
                        c++;
-
 
1488
                        j++;
-
 
1489
                    }
-
 
1490
-
 
1491
                    while (j < 10)
-
 
1492
                    {
-
 
1493
                        if (j == 9)
-
 
1494
                            g_player[myconnectindex].wchoice[9] = 1;
-
 
1495
                        else
-
 
1496
                            g_player[myconnectindex].wchoice[j] = 2;
-
 
1497
-
 
1498
                        j++;
-
 
1499
                    }
-
 
1500
                }
-
 
1501
            }
-
 
1502
-
 
1503
            g_forceWeaponChoice = 0;
-
 
1504
        }
-
 
1505
-
 
1506
        /*    Net_SendClientInfo();*/
1480
    }
1507
    }
1481
1508
1482
    return r;
1509
    return r;
1483
}
1510
}
1484
1511
Line 1607... Line 1634...
1607
        { "snd_reversestereo", "reverses the stereo channels", (void *)&ud.config.ReverseStereo, CVAR_BOOL, 0, 16 },
1634
        { "snd_reversestereo", "reverses the stereo channels", (void *)&ud.config.ReverseStereo, CVAR_BOOL, 0, 16 },
1608
1635
1609
        { "team","change team in multiplayer", (void *)&ud.team, CVAR_INT|CVAR_MULTI, 0, 3 },
1636
        { "team","change team in multiplayer", (void *)&ud.team, CVAR_INT|CVAR_MULTI, 0, 3 },
1610
1637
1611
#ifdef EDUKE32_TOUCH_DEVICES
1638
#ifdef EDUKE32_TOUCH_DEVICES
1612
        { "touch_sens_move_x","touch input sensitivity for moving froward/back", (void *)&droidinput.forward_sens, CVAR_FLOAT, 0, 10 },
1639
        { "touch_sens_move_x","touch input sensitivity for moving froward/back", (void *)&droidinput.forward_sens, CVAR_FLOAT, 1, 9 },
1613
        { "touch_sens_move_y","touch input sensitivity for strafing", (void *)&droidinput.strafe_sens, CVAR_FLOAT, 0, 10 },
1640
        { "touch_sens_move_y","touch input sensitivity for strafing", (void *)&droidinput.strafe_sens, CVAR_FLOAT, 1, 9 },
1614
        { "touch_sens_look_x", "touch input sensitivity for turning left/right", (void *) &droidinput.yaw_sens, CVAR_FLOAT, 0, 10 },
1641
        { "touch_sens_look_x", "touch input sensitivity for turning left/right", (void *) &droidinput.yaw_sens, CVAR_FLOAT, 1, 9 },
1615
        { "touch_sens_move_y", "touch input sensitivity for looking up/down", (void *) &droidinput.pitch_sens, CVAR_FLOAT, 0, 10 },
1642
        { "touch_sens_look_y", "touch input sensitivity for looking up/down", (void *) &droidinput.pitch_sens, CVAR_FLOAT, 1, 9 },
1616
        { "touch_invert", "invert look up/down touch input", (void *) &droidinput.invertLook, CVAR_INT, 0, 1 },
1643
        { "touch_invert", "invert look up/down touch input", (void *) &droidinput.invertLook, CVAR_INT, 0, 1 },
1617
#endif
1644
#endif
1618
1645
1619
        { "vid_gamma","adjusts gamma component of gamma ramp",(void *)&vid_gamma, CVAR_FLOAT|CVAR_FUNCPTR, 0, 10 },
1646
        { "vid_gamma","adjusts gamma component of gamma ramp",(void *)&vid_gamma, CVAR_FLOAT|CVAR_FUNCPTR, 0, 10 },
1620
        { "vid_contrast","adjusts contrast component of gamma ramp",(void *)&vid_contrast, CVAR_FLOAT|CVAR_FUNCPTR, 0, 10 },
1647
        { "vid_contrast","adjusts contrast component of gamma ramp",(void *)&vid_contrast, CVAR_FLOAT|CVAR_FUNCPTR, 0, 10 },
1621
        { "vid_brightness","adjusts brightness component of gamma ramp",(void *)&vid_brightness, CVAR_FLOAT|CVAR_FUNCPTR, 0, 10 },
1648
        { "vid_brightness","adjusts brightness component of gamma ramp",(void *)&vid_brightness, CVAR_FLOAT|CVAR_FUNCPTR, 0, 10 },
-
 
1649
        { "wchoice","sets weapon autoselection order", (void *)ud.wchoice, CVAR_STRING|CVAR_FUNCPTR, 0, MAX_WEAPONS },
1622
    };
1650
    };
1623
1651
1624
    osdcmd_cheatsinfo_stat.cheatnum = -1;
1652
    osdcmd_cheatsinfo_stat.cheatnum = -1;
1625
1653
1626
    for (i=0; i<ARRAY_SIZE(cvars_game); i++)
1654
    for (i=0; i<ARRAY_SIZE(cvars_game); i++)