ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/Daodan/src/Daodan_Config.c
(Generate patch)

Comparing Daodan/src/Daodan_Config.c (file contents):
Revision 1017 by alloc, Mon Mar 23 23:29:19 2015 UTC vs.
Revision 1163 by rossy, Sun Oct 24 02:50:48 2021 UTC

# Line 251 | Line 251 | ConfigSection_t config[] = {
251                          C_BOOL,
252                          {.intBoolVal = true},
253                          {.intBoolVal = true} },
254 +                { "daodaninput",
255 +                        "New input system that reports input on every frame, supports Raw Input for mice.",
256 +                        C_BOOL,
257 +                        {.intBoolVal = true},
258 +                        {.intBoolVal = true} },
259                  { "directinput",
260                          "Enforces the usage of DirectInput on every system. Should be off for Linux/Wine.",
261                          C_BOOL,
262                          {.intBoolVal = true},
263                          {.intBoolVal = true} },
264 +                { "mousesensitivity",
265 +                        "Multiplier for Oni's mouse sensitivity. 1.0 is Oni's default.",
266 +                        C_FLOAT,
267 +                        {.floatVal = 1.0f},
268 +                        {.floatVal = 1.0f} },
269                  { "disablecmdline",
270                          "Disables Oni's existing command line parser as Daodan has its own.",
271                          C_BOOL,
# Line 299 | Line 309 | void DDrConfig_Print()
309                                          break;
310                                  case C_CMD:
311                                          break;
312 +                                case C_FLOAT:
313 +                                        STARTUPMESSAGE("Option %s.%s = %f (def %f)", config[s].name, co->name, co->value.floatVal, co->defaultValue.floatVal);
314 +                                        break;
315                                  default:
316                                          STARTUPMESSAGE("Option %s.%s = %d (def %d)", config[s].name, co->name, co->value.intBoolVal, co->defaultValue.intBoolVal);
317                          }
# Line 360 | Line 373 | const char* DDrConfig_GetOptionTypeName(
373          switch (type) {
374                  case C_INT:
375                          return "Int";
376 +                case C_FLOAT:
377 +                        return "Float";
378                  case C_BOOL:
379                          return "Bool";
380                  case C_STRING:
# Line 390 | Line 405 | const char* DDrConfig_GetOptionValueStri
405                          return (boolV ? "true" : "false");
406                  case C_CMD:
407                          return 0;
408 +                case C_FLOAT:
409 +                        val = malloc(50);
410 +                        sprintf(val, "%f", optVal->floatVal);
411 +                        return val;
412                  default:
413                          val = malloc(20);
414                          sprintf(val, "%d", boolV);
# Line 410 | Line 429 | char DDrConfig_NonDefaultOptionValue(Con
429                          return 0;
430                  case C_INT:
431                          return opt->defaultValue.intBoolVal != opt->value.intBoolVal;
432 +                case C_FLOAT:
433 +                        return opt->defaultValue.floatVal != opt->value.floatVal;
434          }
435          return 0;
436   }
# Line 526 | Line 547 | void DDrIniCallback(const char* section,
547                          case C_INT:
548                                  co->value.intBoolVal = strtol(value, NULL, 0);
549                                  break;
550 +                        case C_FLOAT:
551 +                                co->value.floatVal = strtof(value, NULL);
552 +                                break;
553                          case C_BOOL:
554                                  co->value.intBoolVal = !_stricmp(value, "true");
555                                  break;

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)