annotate src/ljlocale.c @ 0:c84446dfb3f5

initial add
author paulo@localhost
date Fri, 13 Mar 2009 00:39:12 -0700
parents
children
rev   line source
paulo@0 1 #include "ljlocale.h"
paulo@0 2 #include <stdlib.h>
paulo@0 3 #include <string.h>
paulo@0 4
paulo@0 5
paulo@0 6 static const FourCCLocaleEntry *curLocale = englishLocale;
paulo@0 7
paulo@0 8 void ljSetLocale(const FourCCLocaleEntry *locale) {
paulo@0 9 if (locale) {
paulo@0 10 curLocale = locale;
paulo@0 11 }
paulo@0 12 }
paulo@0 13
paulo@0 14 static const FourCCLocaleEntry *ljGetFourCCEntry(unsigned int i) {
paulo@0 15 const FourCCLocaleEntry *base = curLocale;
paulo@0 16
paulo@0 17 for(; base->code.i != 0; ++base) {
paulo@0 18 if (base->code.i == i) {
paulo@0 19 return base;
paulo@0 20 }
paulo@0 21 }
paulo@0 22 return NULL;
paulo@0 23 }
paulo@0 24
paulo@0 25 const char *ljGetFourCCName(FourCC i) {
paulo@0 26 const FourCCLocaleEntry *ent = ljGetFourCCEntry(i.i);
paulo@0 27 return ent ? ent->name : NULL;
paulo@0 28 }
paulo@0 29
paulo@0 30 const char *ljGetFourCCDesc(FourCC i) {
paulo@0 31 const FourCCLocaleEntry *ent = ljGetFourCCEntry(i.i);
paulo@0 32 return ent ? ent->desc : NULL;
paulo@0 33 }
paulo@0 34
paulo@0 35 const FourCCLocaleEntry englishLocale[] = {
paulo@0 36 /* Page names */
paulo@0 37 /* omitted */
paulo@0 38
paulo@0 39 /* Option names */
paulo@0 40 {{"gimm"}, "Gimmick",
paulo@0 41 "Goal or other game mode" },
paulo@0 42 {{"pfw"}, "Well width",
paulo@0 43 "Amount of space to build in" },
paulo@0 44 {{"pfh"}, "Well height",
paulo@0 45 "Amount of space to build in" },
paulo@0 46 {{"vzsp"}, "Enter above ceiling",
paulo@0 47 "Pieces start below or above top of well" },
paulo@0 48 {{"spdc"}, "Speed curve",
paulo@0 49 "Controls speed of falling piece and delays" },
paulo@0 50 {{"are"}, "Max entry delay",
paulo@0 51 "Time from lockdown to next piece entry" },
paulo@0 52 {{"piec"}, "Piece set",
paulo@0 53 "Which pieces will be used" },
paulo@0 54 {{"rand"}, "Randomizer",
paulo@0 55 "How the pieces are shuffled" },
paulo@0 56 {{"hold"}, "Hold piece",
paulo@0 57 "Press Hold to save a piece for later" },
paulo@0 58 {{"rots"}, "Rotation system",
paulo@0 59 "How pieces turn and react to walls" },
paulo@0 60 {{"upkl"}, "Floor kicks",
paulo@0 61 "Times each piece can rotate upward" },
paulo@0 62 {{"srk"}, "Sub-row kicks",
paulo@0 63 "" },
paulo@0 64 {{"lock"}, "Lockdown",
paulo@0 65 "Start of time when a piece slides around" },
paulo@0 66 {{"sldt"}, "Lock delay",
paulo@0 67 "Amount of time a piece can slide around" },
paulo@0 68 {{"deep"}, "Deep drop",
paulo@0 69 "Hard drop past blocks in the well" },
paulo@0 70 {{"clrd"}, "Line clear delay",
paulo@0 71 "Time for cleared lines to disappear" },
paulo@0 72 {{"grav"}, "Clear gravity",
paulo@0 73 "How blocks above a cleared line fall" },
paulo@0 74 {{"glue"}, "Gluing",
paulo@0 75 "How blocks stick together" },
paulo@0 76 {{"lsco"}, "Line scoring",
paulo@0 77 "Points awarded for lines" },
paulo@0 78 {{"dsco"}, "Drop scoring",
paulo@0 79 "Points awarded for fast play (Up/Down)" },
paulo@0 80 {{"tspn"}, "T-spin detection",
paulo@0 81 "Detect turning a piece into a tight space" },
paulo@0 82 {{"garb"}, "Garbage",
paulo@0 83 "Blocks added to the bottom of the well" },
paulo@0 84 {{"dasd"}, "Max sideways delay",
paulo@0 85 "Hold left/right this long to move fast" },
paulo@0 86 {{"dass"}, "Sideways speed",
paulo@0 87 "How fast piece moves left/right" },
paulo@0 88 {{"idas"}, "Initial sideways motion",
paulo@0 89 "Allow shifting as a piece is coming out?" },
paulo@0 90 {{"irs"}, "Initial rotation",
paulo@0 91 "Hold rotate to turn each piece as it enters" },
paulo@0 92 {{"8way"}, "Allow diagonal motion",
paulo@0 93 "Turn off to prevent accidental hard drops" },
paulo@0 94 {{"sfds"}, "Soft drop speed",
paulo@0 95 "Hold down to drop the piece this fast" },
paulo@0 96 {{"sfdl"}, "Soft drop",
paulo@0 97 "Behavior when a piece lands with down" },
paulo@0 98 {{"hrdl"}, "Hard drop",
paulo@0 99 "Behavior when a piece lands with up" },
paulo@0 100 {{"tls"}, "Shadow",
paulo@0 101 "Shows where the piece will land" },
paulo@0 102 {{"invs"}, "Hide blocks in well",
paulo@0 103 "Invisible challenge tests your memory" },
paulo@0 104 {{"next"}, "Next pieces",
paulo@0 105 "Number of previewed pieces" },
paulo@0 106 {{"srph"}, "Smooth gravity",
paulo@0 107 "Turn off to make the piece fall row-by-row" },
paulo@0 108 {{"inpv"}, "Next above shadow",
paulo@0 109 "Number of previewed pieces inside the well" },
paulo@0 110 {{"mblr"}, "Drop trails",
paulo@0 111 "Makes hard drops look harder" },
paulo@0 112
paulo@0 113 {{"lidp"}, "Pause on task switch",
paulo@0 114 "Makes Alt+Tab or screensaver safe" },
paulo@0 115 {{"rec"}, "Record all games",
paulo@0 116 "Save each game's replay to demo.ljm" },
paulo@0 117 {{"wndw"}, "Display mode",
paulo@0 118 "Shut out distractions" },
paulo@0 119
paulo@0 120 /* Booleans */
paulo@0 121 {{"Off"}, "Off" },
paulo@0 122 {{"On"}, "On" },
paulo@0 123
paulo@0 124 /* Gimmicks */
paulo@0 125 {{"Mara"}, "Marathon",
paulo@0 126 "Play until you top out."},
paulo@0 127 {{"Line"}, "40 lines",
paulo@0 128 "Game ends after you clear this many lines."},
paulo@0 129 {{"Time"}, "180 seconds",
paulo@0 130 "Game ends after this much time."},
paulo@0 131 {{"DrlA"}, "Drill Attack",
paulo@0 132 "Clear the bottom row of garbage to win."},
paulo@0 133 {{"Item"}, "Vs. w/Items",
paulo@0 134 "Three opponents send disabling attacks."},
paulo@0 135 {{"Keys"}, "Baboo!",
paulo@0 136 "What can you do with 300 keystrokes?"},
paulo@0 137
paulo@0 138 /* Garbage */
paulo@0 139 {{"HRD"}, "Home Run Derby",
paulo@0 140 "Clear 1, 2, or 3 lines and get garbage back"},
paulo@0 141 {{"DrlG"}, "Drill",
paulo@0 142 "Well is filled with random garbage"},
paulo@0 143 {{"Zigz"}, "Zigzag",
paulo@0 144 "Well is filled with zigzag garbage"},
paulo@0 145
paulo@0 146 /* Piece set */
paulo@0 147 {{"AllP"}, "All pieces",
paulo@0 148 "Pieces made of two, three, or four blocks" },
paulo@0 149 {{"IJLO"}, "Tetrominoes",
paulo@0 150 "Pieces made of four blocks"},
paulo@0 151 {{"JLOT"}, "Tetrominoes no I",
paulo@0 152 "Four blocks, no straight pieces"},
paulo@0 153 {{"SZSZ"}, "S and Z only" },
paulo@0 154 {{"IIII"}, "iCheat(tm)",
paulo@0 155 "All I (straight) tetrominoes" },
paulo@0 156 {{"TTTT"}, "T-Party",
paulo@0 157 "All T tetrominoes" },
paulo@0 158
paulo@0 159 /* Randomizer */
paulo@0 160 {{"Unif"}, "Memoryless",
paulo@0 161 "Equal probability to deal any piece" },
paulo@0 162 {{"Bag"}, "Bag",
paulo@0 163 "Deals one of each piece before repeats"},
paulo@0 164 {{"Bag+"}, "Bag + 1",
paulo@0 165 "Adds one extra to each set of pieces"},
paulo@0 166 {{"Bag2"}, "Double bag",
paulo@0 167 "Deals two of each piece before repeats"},
paulo@0 168 {{"Hist"}, "Strict history",
paulo@0 169 "Does not deal a recent piece"},
paulo@0 170 {{"His6"}, "History 6 rolls",
paulo@0 171 "Rarely deals a recent piece"},
paulo@0 172
paulo@0 173 /* Speed curve */
paulo@0 174 {{"Exp"}, "Exponential",
paulo@0 175 "Game gradually gets faster"},
paulo@0 176 {{"Rh20"}, "Rhythm 20G",
paulo@0 177 "Slide pieces into place to the beat"},
paulo@0 178 {{"Rhy0"}, "Rhythm 0G",
paulo@0 179 "Drop pieces into place to the beat"},
paulo@0 180 {{"TGM2"}, "Master" },
paulo@0 181 {{"TAPD"}, "Death" },
paulo@0 182 {{"TAD3"}, "Death 300+" },
paulo@0 183 {{"NESc"}, "NES" },
paulo@0 184 {{"GBc"}, "Game Boy" },
paulo@0 185 {{"GBHL"}, "Game Boy Heart" },
paulo@0 186
paulo@0 187 /* Hold */
paulo@0 188 {{"HldE"}, "On, empty",
paulo@0 189 "First held piece brings out next"},
paulo@0 190 {{"HldR"}, "On, random",
paulo@0 191 "Random piece in hold box at start"},
paulo@0 192 {{"HldN"}, "Hold to next",
paulo@0 193 "Hold swaps falling and next (like Radica)"},
paulo@0 194
paulo@0 195 /* Rotation systems */
paulo@0 196 {{"SRS"}, "SRS",
paulo@0 197 "LOL T-spin triples"},
paulo@0 198 {{"Sega"}, "Sega 1988" },
paulo@0 199 {{"ARS"}, "Arika",
paulo@0 200 "The rotation system of grandmasters"},
paulo@0 201 {{"Tngn"}, "Tengen",
paulo@0 202 "Unlicensed" },
paulo@0 203 {{"NRSL"}, "Game Boy",
paulo@0 204 "Left-handed system"},
paulo@0 205 {{"NRSR"}, "NES",
paulo@0 206 "Right-handed system"},
paulo@0 207 {{"TOD4"}, "TOD M4",
paulo@0 208 "Like SRS but less radical" },
paulo@0 209 {{"TDX"}, "Climbing",
paulo@0 210 "Spider-Man's favorite Tetris game is DX"},
paulo@0 211
paulo@0 212 /* Lockdown */
paulo@0 213 {{"OLD"}, "Classic",
paulo@0 214 "Lock when piece lands" },
paulo@0 215 {{"EntR"}, "Entry reset",
paulo@0 216 "Lock delay resets for each new piece" },
paulo@0 217 {{"StpR"}, "Step reset",
paulo@0 218 "Lock delay resets when piece moves down" },
paulo@0 219 {{"MovR"}, "Move reset",
paulo@0 220 "Lock delay resets when piece moves" },
paulo@0 221
paulo@0 222 /* Lock/line delay and floor kicks */
paulo@0 223 {{"SBSC"}, "Set by speed curve" },
paulo@0 224 {{"Inf"}, "Unlimited" },
paulo@0 225
paulo@0 226 /* Sub-row kick */
paulo@0 227 {{"srkN"}, "Unchanged" },
paulo@0 228 {{"srkM"}, "Kick minimal distance" },
paulo@0 229 {{"srkU"}, "Always kick up" },
paulo@0 230
paulo@0 231 /* Gluing and gravity */
paulo@0 232 {{"Naiv"}, "Naive",
paulo@0 233 "Can result in floating blocks"},
paulo@0 234 {{"Squ"}, "Square",
paulo@0 235 "Form a 4x4 square from complete pieces" },
paulo@0 236 {{"Stky"}, "Sticky",
paulo@0 237 "Blocks stick together"},
paulo@0 238 {{"byCo"}, "Sticky by color",
paulo@0 239 "Blocks of each color stick together"},
paulo@0 240 {{"Casc"}, "Cascade",
paulo@0 241 "Each piece falls separately" },
paulo@0 242
paulo@0 243 /* Line scoring */
paulo@0 244 {{"LJ"}, "LJ",
paulo@0 245 "100, 400, 700, 1200, B2B=200, T=500*n" },
paulo@0 246 {{"Fibo"}, "Fibonacci",
paulo@0 247 "100, 200, 300, 500 (800, 1300, ...)" },
paulo@0 248 {{"HotL"}, "Hotline",
paulo@0 249 "100-600 for clearing lines on specific rows" },
paulo@0 250 {{"TDSl"}, "Guideline",
paulo@0 251 "Level * 100, 300, 500, 800, B2B=50%, T=?" },
paulo@0 252 {{"NESl"}, "8-bit",
paulo@0 253 "Level * 40, 100, 300, 1200" },
paulo@0 254 {{"LJns"}, "LJ (nerfed spin)",
paulo@0 255 "100, 400, 700, 1200, B2B=200, T=300*n" },
paulo@0 256
paulo@0 257 /* Drop scoring */
paulo@0 258 {{"ConD"}, "Continuous drop",
paulo@0 259 "1 point per row dropped without stopping"},
paulo@0 260 {{"S1H1"}, "Drop",
paulo@0 261 "1 point per row soft or hard dropped"},
paulo@0 262 {{"S1H2"}, "Soft x1, Hard x2",
paulo@0 263 "1 pt/row for soft drop, 2 for hard drop"},
paulo@0 264
paulo@0 265 /* T-spin */
paulo@0 266 {{"Imob"}, "Immobile",
paulo@0 267 "Rotate any piece so it can't move up"},
paulo@0 268 {{"CrnT"}, "3-corner T",
paulo@0 269 "Rotate T with 3 corners filled" },
paulo@0 270 {{"WKT"}, "3-corner T no kick",
paulo@0 271 "Rotate T with 3 corners filled, without kick" },
paulo@0 272
paulo@0 273 /* sideways speed, soft drop speed, zangi */
paulo@0 274
paulo@0 275 /* Zangi */
paulo@0 276 {{"Slid"}, "Slide",
paulo@0 277 "The piece can be dropped and then moved"},
paulo@0 278 {{"Lock"}, "Lock",
paulo@0 279 "The piece locks immediately"},
paulo@0 280 {{"LocU"}, "Lock on release",
paulo@0 281 "Can be moved while drop key is pressed"},
paulo@0 282
paulo@0 283 /* Shadow */
paulo@0 284 {{"tl25"}, "Fainter color" },
paulo@0 285 {{"tl50"}, "Faint color" },
paulo@0 286 {{"tlsC"}, "Color" },
paulo@0 287 {{"tlsM"}, "Monochrome" },
paulo@0 288 {{"invF"}, "Off, hide falling piece too"},
paulo@0 289
paulo@0 290 #ifdef HAS_FPU
paulo@0 291 {{"FulS"}, "Full screen",
paulo@0 292 "Try to run the game in the full screen."},
paulo@0 293 {{"Wind"}, "Windowed",
paulo@0 294 "Run the game in a window."},
paulo@0 295 #endif
paulo@0 296
paulo@0 297 /* list terminator */
paulo@0 298 { {.i=0}, NULL }
paulo@0 299 };