diff src/ljlocale.c @ 0:c84446dfb3f5

initial add
author paulo@localhost
date Fri, 13 Mar 2009 00:39:12 -0700
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/ljlocale.c	Fri Mar 13 00:39:12 2009 -0700
     1.3 @@ -0,0 +1,299 @@
     1.4 +#include "ljlocale.h"
     1.5 +#include <stdlib.h>
     1.6 +#include <string.h>
     1.7 +
     1.8 +
     1.9 +static const FourCCLocaleEntry *curLocale = englishLocale;
    1.10 +
    1.11 +void ljSetLocale(const FourCCLocaleEntry *locale) {
    1.12 +  if (locale) {
    1.13 +    curLocale = locale;
    1.14 +  }
    1.15 +}
    1.16 +
    1.17 +static const FourCCLocaleEntry *ljGetFourCCEntry(unsigned int i) {
    1.18 +  const FourCCLocaleEntry *base = curLocale;
    1.19 +
    1.20 +  for(; base->code.i != 0; ++base) {
    1.21 +    if (base->code.i == i) {
    1.22 +      return base;
    1.23 +    }
    1.24 +  }
    1.25 +  return NULL;
    1.26 +}
    1.27 +
    1.28 +const char *ljGetFourCCName(FourCC i) {
    1.29 +  const FourCCLocaleEntry *ent = ljGetFourCCEntry(i.i);
    1.30 +  return ent ? ent->name : NULL;
    1.31 +}
    1.32 +
    1.33 +const char *ljGetFourCCDesc(FourCC i) {
    1.34 +  const FourCCLocaleEntry *ent = ljGetFourCCEntry(i.i);
    1.35 +  return ent ? ent->desc : NULL;
    1.36 +}
    1.37 +
    1.38 +const FourCCLocaleEntry englishLocale[] = {
    1.39 +  /* Page names */
    1.40 +  /* omitted */
    1.41 +
    1.42 +  /* Option names */
    1.43 +  {{"gimm"}, "Gimmick",
    1.44 +             "Goal or other game mode" },
    1.45 +  {{"pfw"},  "Well width",
    1.46 +             "Amount of space to build in" },
    1.47 +  {{"pfh"},  "Well height",
    1.48 +             "Amount of space to build in" },
    1.49 +  {{"vzsp"}, "Enter above ceiling",
    1.50 +             "Pieces start below or above top of well" },
    1.51 +  {{"spdc"}, "Speed curve",
    1.52 +             "Controls speed of falling piece and delays" },
    1.53 +  {{"are"},  "Max entry delay",
    1.54 +             "Time from lockdown to next piece entry" },
    1.55 +  {{"piec"}, "Piece set",
    1.56 +             "Which pieces will be used" },
    1.57 +  {{"rand"}, "Randomizer",
    1.58 +             "How the pieces are shuffled" },
    1.59 +  {{"hold"}, "Hold piece",
    1.60 +             "Press Hold to save a piece for later" },
    1.61 +  {{"rots"}, "Rotation system",
    1.62 +             "How pieces turn and react to walls" },
    1.63 +  {{"upkl"}, "Floor kicks",
    1.64 +             "Times each piece can rotate upward" },
    1.65 +  {{"srk"},  "Sub-row kicks",
    1.66 +             "" },
    1.67 +  {{"lock"}, "Lockdown",
    1.68 +             "Start of time when a piece slides around" },
    1.69 +  {{"sldt"}, "Lock delay",
    1.70 +             "Amount of time a piece can slide around" },
    1.71 +  {{"deep"}, "Deep drop",
    1.72 +             "Hard drop past blocks in the well" },
    1.73 +  {{"clrd"}, "Line clear delay",
    1.74 +             "Time for cleared lines to disappear" },
    1.75 +  {{"grav"}, "Clear gravity",
    1.76 +             "How blocks above a cleared line fall" },
    1.77 +  {{"glue"}, "Gluing",
    1.78 +             "How blocks stick together" },
    1.79 +  {{"lsco"}, "Line scoring",
    1.80 +             "Points awarded for lines" },
    1.81 +  {{"dsco"}, "Drop scoring",
    1.82 +             "Points awarded for fast play (Up/Down)" },
    1.83 +  {{"tspn"}, "T-spin detection",
    1.84 +             "Detect turning a piece into a tight space" },
    1.85 +  {{"garb"}, "Garbage",
    1.86 +             "Blocks added to the bottom of the well" },
    1.87 +  {{"dasd"}, "Max sideways delay",
    1.88 +             "Hold left/right this long to move fast" },
    1.89 +  {{"dass"}, "Sideways speed",
    1.90 +             "How fast piece moves left/right" },
    1.91 +  {{"idas"}, "Initial sideways motion",
    1.92 +             "Allow shifting as a piece is coming out?" },
    1.93 +  {{"irs"},  "Initial rotation",
    1.94 +             "Hold rotate to turn each piece as it enters" },
    1.95 +  {{"8way"}, "Allow diagonal motion",
    1.96 +             "Turn off to prevent accidental hard drops" },
    1.97 +  {{"sfds"}, "Soft drop speed",
    1.98 +             "Hold down to drop the piece this fast" },
    1.99 +  {{"sfdl"}, "Soft drop",
   1.100 +             "Behavior when a piece lands with down" },
   1.101 +  {{"hrdl"}, "Hard drop",
   1.102 +             "Behavior when a piece lands with up" },
   1.103 +  {{"tls"},  "Shadow",
   1.104 +             "Shows where the piece will land" },
   1.105 +  {{"invs"}, "Hide blocks in well",
   1.106 +             "Invisible challenge tests your memory" },
   1.107 +  {{"next"}, "Next pieces",
   1.108 +             "Number of previewed pieces" },
   1.109 +  {{"srph"}, "Smooth gravity",
   1.110 +             "Turn off to make the piece fall row-by-row" },
   1.111 +  {{"inpv"}, "Next above shadow",
   1.112 +             "Number of previewed pieces inside the well" },
   1.113 +  {{"mblr"}, "Drop trails",
   1.114 +             "Makes hard drops look harder" },
   1.115 +  
   1.116 +  {{"lidp"}, "Pause on task switch",
   1.117 +             "Makes Alt+Tab or screensaver safe" },
   1.118 +  {{"rec"},  "Record all games",
   1.119 +             "Save each game's replay to demo.ljm" },
   1.120 +  {{"wndw"}, "Display mode",
   1.121 +             "Shut out distractions" },
   1.122 +
   1.123 +  /* Booleans */
   1.124 +  {{"Off"}, "Off" },
   1.125 +  {{"On"}, "On" },
   1.126 +  
   1.127 +  /* Gimmicks */
   1.128 +  {{"Mara"}, "Marathon",
   1.129 +             "Play until you top out."},
   1.130 +  {{"Line"}, "40 lines",
   1.131 +             "Game ends after you clear this many lines."},
   1.132 +  {{"Time"}, "180 seconds",
   1.133 +             "Game ends after this much time."},
   1.134 +  {{"DrlA"}, "Drill Attack",
   1.135 +             "Clear the bottom row of garbage to win."},
   1.136 +  {{"Item"}, "Vs. w/Items",
   1.137 +             "Three opponents send disabling attacks."},
   1.138 +  {{"Keys"}, "Baboo!",
   1.139 +             "What can you do with 300 keystrokes?"},
   1.140 +
   1.141 +  /* Garbage */
   1.142 +  {{"HRD"},  "Home Run Derby",
   1.143 +             "Clear 1, 2, or 3 lines and get garbage back"},
   1.144 +  {{"DrlG"}, "Drill",
   1.145 +             "Well is filled with random garbage"},
   1.146 +  {{"Zigz"}, "Zigzag",
   1.147 +             "Well is filled with zigzag garbage"},
   1.148 +
   1.149 +  /* Piece set */
   1.150 +  {{"AllP"}, "All pieces",
   1.151 +             "Pieces made of two, three, or four blocks"  },
   1.152 +  {{"IJLO"}, "Tetrominoes",
   1.153 +             "Pieces made of four blocks"},
   1.154 +  {{"JLOT"}, "Tetrominoes no I",
   1.155 +             "Four blocks, no straight pieces"},
   1.156 +  {{"SZSZ"}, "S and Z only" },
   1.157 +  {{"IIII"}, "iCheat(tm)",
   1.158 +             "All I (straight) tetrominoes" },
   1.159 +  {{"TTTT"}, "T-Party",
   1.160 +             "All T tetrominoes" },
   1.161 +  
   1.162 +  /* Randomizer */
   1.163 +  {{"Unif"}, "Memoryless",
   1.164 +             "Equal probability to deal any piece" },
   1.165 +  {{"Bag"},  "Bag",
   1.166 +             "Deals one of each piece before repeats"},
   1.167 +  {{"Bag+"}, "Bag + 1",
   1.168 +             "Adds one extra to each set of pieces"},
   1.169 +  {{"Bag2"}, "Double bag",
   1.170 +             "Deals two of each piece before repeats"},
   1.171 +  {{"Hist"}, "Strict history",
   1.172 +             "Does not deal a recent piece"},
   1.173 +  {{"His6"}, "History 6 rolls",
   1.174 +             "Rarely deals a recent piece"},
   1.175 +
   1.176 +  /* Speed curve */
   1.177 +  {{"Exp"},  "Exponential",
   1.178 +             "Game gradually gets faster"},
   1.179 +  {{"Rh20"}, "Rhythm 20G",
   1.180 +             "Slide pieces into place to the beat"},
   1.181 +  {{"Rhy0"}, "Rhythm 0G",
   1.182 +             "Drop pieces into place to the beat"},
   1.183 +  {{"TGM2"}, "Master" },
   1.184 +  {{"TAPD"}, "Death" },
   1.185 +  {{"TAD3"}, "Death 300+" },
   1.186 +  {{"NESc"}, "NES" },
   1.187 +  {{"GBc"},  "Game Boy" },
   1.188 +  {{"GBHL"}, "Game Boy Heart" },
   1.189 +
   1.190 +  /* Hold */
   1.191 +  {{"HldE"}, "On, empty",
   1.192 +             "First held piece brings out next"},
   1.193 +  {{"HldR"}, "On, random",
   1.194 +             "Random piece in hold box at start"},
   1.195 +  {{"HldN"}, "Hold to next",
   1.196 +             "Hold swaps falling and next (like Radica)"},
   1.197 +
   1.198 +  /* Rotation systems */
   1.199 +  {{"SRS"},  "SRS",
   1.200 +             "LOL T-spin triples"},
   1.201 +  {{"Sega"}, "Sega 1988" },
   1.202 +  {{"ARS"},  "Arika",
   1.203 +             "The rotation system of grandmasters"},
   1.204 +  {{"Tngn"}, "Tengen",
   1.205 +             "Unlicensed" },
   1.206 +  {{"NRSL"}, "Game Boy",
   1.207 +             "Left-handed system"},
   1.208 +  {{"NRSR"}, "NES",
   1.209 +             "Right-handed system"},
   1.210 +  {{"TOD4"}, "TOD M4",
   1.211 +             "Like SRS but less radical" },
   1.212 +  {{"TDX"},  "Climbing",
   1.213 +             "Spider-Man's favorite Tetris game is DX"},
   1.214 +
   1.215 +  /* Lockdown */
   1.216 +  {{"OLD"},  "Classic",
   1.217 +             "Lock when piece lands" },
   1.218 +  {{"EntR"}, "Entry reset",
   1.219 +             "Lock delay resets for each new piece" },
   1.220 +  {{"StpR"}, "Step reset",
   1.221 +             "Lock delay resets when piece moves down" },
   1.222 +  {{"MovR"}, "Move reset",
   1.223 +             "Lock delay resets when piece moves" },
   1.224 +
   1.225 +  /* Lock/line delay and floor kicks */
   1.226 +  {{"SBSC"}, "Set by speed curve" },
   1.227 +  {{"Inf"},  "Unlimited" },
   1.228 +
   1.229 +  /* Sub-row kick */
   1.230 +  {{"srkN"}, "Unchanged" },
   1.231 +  {{"srkM"}, "Kick minimal distance" },
   1.232 +  {{"srkU"}, "Always kick up" },
   1.233 +
   1.234 +  /* Gluing and gravity */
   1.235 +  {{"Naiv"}, "Naive",
   1.236 +             "Can result in floating blocks"},
   1.237 +  {{"Squ"},  "Square",
   1.238 +             "Form a 4x4 square from complete pieces" },
   1.239 +  {{"Stky"}, "Sticky",
   1.240 +             "Blocks stick together"},
   1.241 +  {{"byCo"}, "Sticky by color",
   1.242 +             "Blocks of each color stick together"},
   1.243 +  {{"Casc"}, "Cascade",
   1.244 +             "Each piece falls separately" },
   1.245 +
   1.246 +  /* Line scoring */
   1.247 +  {{"LJ"},   "LJ",
   1.248 +             "100, 400, 700, 1200, B2B=200, T=500*n" },
   1.249 +  {{"Fibo"}, "Fibonacci",
   1.250 +             "100, 200, 300, 500 (800, 1300, ...)" },
   1.251 +  {{"HotL"}, "Hotline",
   1.252 +             "100-600 for clearing lines on specific rows" },
   1.253 +  {{"TDSl"}, "Guideline",
   1.254 +             "Level * 100, 300, 500, 800, B2B=50%, T=?" },
   1.255 +  {{"NESl"}, "8-bit",
   1.256 +             "Level * 40, 100, 300, 1200" },
   1.257 +  {{"LJns"}, "LJ (nerfed spin)",
   1.258 +             "100, 400, 700, 1200, B2B=200, T=300*n" },
   1.259 +
   1.260 +  /* Drop scoring */
   1.261 +  {{"ConD"}, "Continuous drop",
   1.262 +             "1 point per row dropped without stopping"},
   1.263 +  {{"S1H1"}, "Drop",
   1.264 +             "1 point per row soft or hard dropped"},
   1.265 +  {{"S1H2"}, "Soft x1, Hard x2",
   1.266 +             "1 pt/row for soft drop, 2 for hard drop"},
   1.267 +
   1.268 +  /* T-spin */
   1.269 +  {{"Imob"}, "Immobile",
   1.270 +             "Rotate any piece so it can't move up"},
   1.271 +  {{"CrnT"}, "3-corner T",
   1.272 +             "Rotate T with 3 corners filled" },
   1.273 +  {{"WKT"},  "3-corner T no kick",
   1.274 +             "Rotate T with 3 corners filled, without kick" },
   1.275 +
   1.276 +  /* sideways speed, soft drop speed, zangi */
   1.277 +  
   1.278 +  /* Zangi */
   1.279 +  {{"Slid"}, "Slide",
   1.280 +             "The piece can be dropped and then moved"},
   1.281 +  {{"Lock"}, "Lock",
   1.282 +             "The piece locks immediately"},
   1.283 +  {{"LocU"}, "Lock on release",
   1.284 +             "Can be moved while drop key is pressed"},
   1.285 +
   1.286 +  /* Shadow */
   1.287 +  {{"tl25"}, "Fainter color" },
   1.288 +  {{"tl50"}, "Faint color" },
   1.289 +  {{"tlsC"}, "Color" },
   1.290 +  {{"tlsM"}, "Monochrome" },
   1.291 +  {{"invF"}, "Off, hide falling piece too"},
   1.292 +  
   1.293 +#ifdef HAS_FPU
   1.294 +  {{"FulS"}, "Full screen",
   1.295 +             "Try to run the game in the full screen."},
   1.296 +  {{"Wind"}, "Windowed",
   1.297 +             "Run the game in a window."},
   1.298 +#endif
   1.299 +
   1.300 +  /* list terminator */
   1.301 +  { {.i=0}, NULL }
   1.302 +};