From: xolatile Date: Wed, 16 Jul 2025 21:08:07 +0000 (+0200) Subject: Data files, broken... X-Git-Url: https://git.xolatile.top/?a=commitdiff_plain;h=c79e16f394a027db7cc5b6d1ea1e27da0b24bbb6;p=xolatile-badassbug.git Data files, broken... --- diff --git a/data/background.png b/data/background.png new file mode 100755 index 0000000..23477b2 Binary files /dev/null and b/data/background.png differ diff --git a/data/background_decal.png b/data/background_decal.png new file mode 100755 index 0000000..fc772b1 Binary files /dev/null and b/data/background_decal.png differ diff --git a/data/background_detail.png b/data/background_detail.png new file mode 100755 index 0000000..5c0dbe6 Binary files /dev/null and b/data/background_detail.png differ diff --git a/data/blendbrush.cfg b/data/blendbrush.cfg new file mode 100644 index 0000000..506193c --- /dev/null +++ b/data/blendbrush.cfg @@ -0,0 +1,31 @@ +////////////////////////////////////////////////////////////////// +//Texture blending + +addblendbrush "Circle 8px soft" "packages/blendbrush/circle_8_soft.png" +addblendbrush "Circle 8px hard" "packages/blendbrush/circle_8_hard.png" +addblendbrush "Circle 8px solid" "packages/blendbrush/circle_8_solid.png" +addblendbrush "Circle 16px soft" "packages/blendbrush/circle_16_soft.png" +addblendbrush "Circle 16px hard" "packages/blendbrush/circle_16_hard.png" +addblendbrush "Circle 16px solid" "packages/blendbrush/circle_16_solid.png" +addblendbrush "Circle 32px soft" "packages/blendbrush/circle_32_soft.png" +addblendbrush "Circle 32px hard" "packages/blendbrush/circle_32_hard.png" +addblendbrush "Circle 32px solid" "packages/blendbrush/circle_32_solid.png" +addblendbrush "Circle 64px soft" "packages/blendbrush/circle_64_soft.png" +addblendbrush "Circle 64px hard" "packages/blendbrush/circle_64_hard.png" +addblendbrush "Circle 64px solid" "packages/blendbrush/circle_64_solid.png" +addblendbrush "Circle 128px soft" "packages/blendbrush/circle_128_soft.png" +addblendbrush "Circle 128px hard" "packages/blendbrush/circle_128_hard.png" +addblendbrush "Circle 128px solid" "packages/blendbrush/circle_128_solid.png" +addblendbrush "Noise 64px" "packages/blendbrush/noise_64.png" +addblendbrush "Noise 128px" "packages/blendbrush/noise_128.png" +addblendbrush "Square 16px hard" "packages/blendbrush/square_16_hard.png" +addblendbrush "Square 16px solid" "packages/blendbrush/square_16_solid.png" +addblendbrush "Square 32px hard" "packages/blendbrush/square_32_hard.png" +addblendbrush "Square 32px solid" "packages/blendbrush/square_32_solid.png" +addblendbrush "Square 64px hard" "packages/blendbrush/square_64_hard.png" +addblendbrush "Square 64px solid" "packages/blendbrush/square_64_solid.png" +addblendbrush "Gradient 16px" "packages/blendbrush/gradient_16.png" +addblendbrush "Gradient 32px" "packages/blendbrush/gradient_32.png" +addblendbrush "Gradient 64px" "packages/blendbrush/gradient_64.png" +addblendbrush "Gradient 128px" "packages/blendbrush/gradient_128.png" + diff --git a/data/crosshair.png b/data/crosshair.png new file mode 100644 index 0000000..178b861 Binary files /dev/null and b/data/crosshair.png differ diff --git a/data/crosshair_hit.png b/data/crosshair_hit.png new file mode 100644 index 0000000..ff50c94 Binary files /dev/null and b/data/crosshair_hit.png differ diff --git a/data/cube.png b/data/cube.png new file mode 100755 index 0000000..97f52d6 Binary files /dev/null and b/data/cube.png differ diff --git a/data/cube2badge.png b/data/cube2badge.png new file mode 100644 index 0000000..978058e Binary files /dev/null and b/data/cube2badge.png differ diff --git a/data/default_map_models.cfg b/data/default_map_models.cfg new file mode 100644 index 0000000..20cd1eb --- /dev/null +++ b/data/default_map_models.cfg @@ -0,0 +1,412 @@ +mapmodelreset // start counting from 0 again + +mmodel "tree1" // 0 + +mmodel "dcp/tree2" // 1 +mmodel "dcp/tree3" // 2 +mmodel "dcp/palmtree" // 3 +mmodel "dcp/thorns" // 4 +mmodel "dcp/plant1" // 5 +mmodel "dcp/grass" // 6 +mmodel "dcp/ivy" // 7 + +mmodel "dcp/barrel" // 8 +mmodel "dcp/streetlamp" // 9 +mmodel "dcp/bench" // 10 +mmodel "dcp/pillar" // 11 +mmodel "dcp/waterbowl" // 12 +mmodel "dcp/jumppad2" // 13 + +mmodel "dcp/leafs" // 14 +mmodel "dcp/valve" // 15 +mmodel "dcp/palette" // 16 + +mmodel "dcp/vent" // 17 +mmodel "dcp/mushroom" // 18 +mmodel "dcp/biotank" // 19 + +mmodel "dcp/groundlamp" // 20 +mmodel "dcp/console" // 21 +mmodel "dcp/turret" // 22 + +// for use as triggers: + +mmodel "carrot" // 23 +mmodel "switch1" // 24 +mmodel "switch2" // 25 + +mmodel "doors/door_01" // 26 +mmodel "doors/door_02" // 27 +mmodel "doors/door_03" // 28 + +// useful default triggers to use with these: + +level_trigger_1 = [ + if (= $triggerstate -1) [echo "This door is opened elsewhere."] +] + +mmodel "dcp/cask" // 29 +mmodel "dcp/cart" // 30 +mmodel "dcp/candle" // 31 +mmodel "dcp/vase" // 32 +mmodel "dcp/sack" // 33 +mmodel "dcp/chandelier" // 34 +mmodel "dcp/chest" // 35 +mmodel "dcp/firebowl" // 36 +mmodel "dcp/smplant" // 37 +mmodel "dcp/insect" // 38 +mmodel "dcp/reed" // 39 + +mmodel "makke/nocamp" // 40 +mmodel "makke/strahler" // 41 + +mmodel "tentus/food-drink/goblet" // 42 +mmodel "tentus/food-drink/apple" // 43 +mmodel "tentus/food-drink/pear" // 44 +mmodel "tentus/food-drink/appleslice" // 45 +mmodel "tentus/food-drink/meat" // 46 +mmodel "tentus/food-drink/bowl" // 47 +mmodel "tentus/food-drink/pieslice" // 48 +mmodel "tentus/food-drink/mug" // 49 +mmodel "tentus/food-drink/winebottle" // 50 +mmodel "tentus/food-drink/pie" // 51 + +mmodel "tentus/books/flat" // 52 +mmodel "tentus/books/multi" // 53 +mmodel "tentus/chains/chain" // 54 +mmodel "tentus/chains/curvechain" // 55 + +mmodel "tentus/barrel" // 56 +mmodel "tentus/sidebarrel" // 57 +mmodel "tentus/pot1" // 58 +mmodel "tentus/rope" // 59 +mmodel "tentus/ropelamp" // 60 +mmodel "tentus/ladder" // 61 + +mmodel "tentus/fattree" // 62 +mmodel "tentus/moneybag" // 63 +mmodel "tentus/woodbench" // 64 +mmodel "tentus/hammer" // 65 +mmodel "tentus/anvil" // 66 +mmodel "tentus/spear" // 67 +mmodel "tentus/key" // 68 +mmodel "tentus/redshield" // 69 +mmodel "tentus/greenshield" // 70 +mmodel "tentus/bombs" // 71 + +mmodel "objects/window01" // 72 +mmodel "objects/sign01" // 73 +mmodel "objects/lamp01" // 74 +mmodel "objects/chair01" // 75 +mmodel "objects/bed01" // 76 +mmodel "vegetation/tree00" // 77 +mmodel "vegetation/tree01" // 78 +mmodel "vegetation/bush01" // 79 +mmodel "vegetation/tree02" // 80 +mmodel "vegetation/tree04" // 81 +mmodel "vegetation/tree05" // 82 +mmodel "vegetation/tree06" // 83 +mmodel "vegetation/tree07" // 84 +mmodel "vegetation/tree03" // 85 +mmodel "objects/window02/window02_1" // 86 +mmodel "objects/window02/window02_2" // 87 +mmodel "objects/bench01" // 88 +mmodel "objects/lantern01" // 89 +mmodel "objects/lantern02" // 90 +mmodel "objects/woodchop" // 91 +mmodel "objects/table01" // 92 +mmodel "objects/torch" // 93 +mmodel "objects/torch_cold" // 94 +mmodel "objects/fire" // 95 +mmodel "objects/sail01" // 96 +mmodel "objects/well_base" // 97 +mmodel "objects/well_roof" // 98 +mmodel "objects/lamp02" // 99 +mmodel "objects/med_chand" // 100 + +mmodel "objects/axe" // 101 +mmodel "xeno/box1" // 102 +mmodel "xeno/box2" // 103 +mmodel "vegetation/tree08" // 104 +mmodel "vegetation/tree09" // 105 +mmodel "vegetation/tree10" // 106 +mmodel "vegetation/tree11" // 107 +mmodel "vegetation/tree12" // 108 +mmodel "vegetation/weeds" // 109 +mmodel "psionic/barrel2" // 110 +mmodel "psionic/crate4" // 111 +mmodel "aftas/machina/machina1" // 112 +mmodel "aftas/machina/machina2" // 113 +mmodel "mitaman/chainlinkfence" // 114 +mmodel "mitaman/floorgrate1" // 115 +mmodel "mitaman/floorgrate3" // 116 +mmodel "mitaman/locker1" // 117 +mmodel "mitaman/locker3" // 118 +mmodel "objects/minekart" // 119 +mmodel "objects/oillamp" // 120 +mmodel "objects/millblade" // 121 +mmodel "makke/mugs/mug01" // 122 +mmodel "makke/mugs/mug02" // 123 +mmodel "makke/mugs/mug03" // 124 +mmodel "aftas/caixa" // 125 +mmodel "aftas/lampada" // 126 +mmodel "aftas/arvores/arg" // 127 +mmodel "aftas/arvores/arp" // 128 +mmodel "makke/arch" // 129 +mmodel "makke/fork" // 130 +mmodel "makke/moon" // 131 +mmodel "makke/planet" // 132 +mmodel "makke/spoon" // 133 +mmodel "makke/tricky/sign1" // 134 +mmodel "makke/tricky/sign2" // 135 +mmodel "makke/tricky/sign3" // 136 +mmodel "makke/tricky/sign4" // 137 +mmodel "dcp/hanginlamp" // 138 +mmodel "tentus/magic" // 139 + +mmodel "dcp/bin" // 140 +mmodel "dcp/bulb" // 141 +mmodel "dcp/cbbox" // 142 +mmodel "dcp/grate" // 143 +mmodel "dcp/switch2a" // 144 +mmodel "dcp/ventflap" // 145 +mmodel "mitaman/door_06" // 146 +mmodel "mitaman/door_07" // 147 +mmodel "mitaman/door_08" // 148 +mmodel "mitaman/door_09" // 149 +mmodel "mitaman/door_10" // 150 +mmodel "mitaman/plat01" // 151 +mmodel "mitaman/wirefence" // 152 +mmodel "mitaman/woodboard" // 153 +mmodel "steve_e/doors/trapdoor" // 154 +mmodel "steve_e/doors/trapdoor/trapdoor_150" // 155 +mmodel "steve_e/doors/trapdoor/trapdoor_200" // 156 +mmodel "doors/door_04" // 157 +mmodel "dcp/blade_x" // 158 +mmodel "dcp/blade_y" // 159 + +//Justice +mmodel "mapmodels/justice/pad/jump" // 160 +mmodel "mapmodels/justice/pad/teleport" // 161 +mmodel "mapmodels/justice/pad/teledest" // 162 +mmodel "mapmodels/justice/block" // 163 +mmodel "mapmodels/justice/exit-sign" // 164 +mmodel "mapmodels/justice/vending" // 165 +mmodel "mapmodels/justice/railings/01" // 166 +mmodel "mapmodels/justice/railings/02" // 167 + +mmodel "angel" // 168 +mmodel "crow" // 169 + +mmodel "mapmodels/nieb/tree_dead" // 170 +mmodel "mapmodels/nieb/shark_sign" // 171 +mmodel "mapmodels/nieb/torso" // 172 +mmodel "mapmodels/nieb/sandcastle" // 173 +mmodel "mapmodels/nieb/plant01" // 174 +mmodel "mapmodels/nieb/plant02" // 175 +mmodel "mapmodels/nieb/sign_no-exit" // 176 + +mmodel "skull" // 177 + +mmodel "mapmodels/sitters/gothic/skelet1" // 178 +mmodel "mapmodels/sitters/gothic/skelet2" // 179 +mmodel "mapmodels/sitters/gothic/skelet3" // 180 + +mmodel "mapmodels/quakish/grim_reaper/adam" // 181 +mmodel "mapmodels/quakish/grim_reaper/grim" // 182 +mmodel "mapmodels/quakish/grim_reaper/vehementi" // 183 + +mmodel "mapmodels/yves_allaire/e6/e6fanblade/horizontal" // 184 +mmodel "mapmodels/yves_allaire/e6/e6fanblade/vertical" // 185 + +mmodel "mapmodels/nieb/bush_dead1" // 186 +mmodel "mapmodels/nieb/bush_dead2" // 187 + +mmodel "mapmodels/justice/cannon_copter" // 188 + +mmodel "mapmodels/ard/vegetation/bigtree" // 189 +mmodel "mapmodels/ard/vegetation/mediumtree1" // 190 +mmodel "mapmodels/ard/vegetation/mediumtree2" // 191 +mmodel "mapmodels/ard/vegetation/smalltree" // 192 + +mmodel "mapmodels/simonoc/effect/blue" // 193 +mmodel "mapmodels/simonoc/effect/cyan" // 194 +mmodel "mapmodels/simonoc/effect/green" // 195 +mmodel "mapmodels/simonoc/effect/red" // 196 +mmodel "mapmodels/simonoc/effect/violet" // 197 +mmodel "mapmodels/simonoc/effect/yellow" // 198 +mmodel "mapmodels/simonoc/effect/blue_v" // 199 +mmodel "mapmodels/simonoc/effect/cyan_v" // 200 +mmodel "mapmodels/simonoc/effect/green_v" // 201 +mmodel "mapmodels/simonoc/effect/red_v" // 202 +mmodel "mapmodels/simonoc/effect/violet_v" // 203 +mmodel "mapmodels/simonoc/effect/yellow_v" // 204 + +mmodel "ao1/e_station" // 205 +mmodel "ao1/e_station/horiz" // 206 +mmodel "ao1/e_station/small" // 207 +mmodel "ao1/metro/graffiti/aracari" // 208 +mmodel "ao1/metro/graffiti/ironmetro" // 209 +mmodel "ao1/metro/graffiti/necedemalis" // 210 +mmodel "ao1/metro/graffiti/see" // 211 +mmodel "ao1/metro/graffiti/warning" // 212 +mmodel "ao1/metro/sign/citymap" // 213 +mmodel "ao1/metro/sign/flyingcar" // 214 +mmodel "ao1/metro/sign/player" // 215 +mmodel "checkpoint" // 216 +mmodel "cleaner/gutter_45_big" // 217 +mmodel "dcp/blade_x/big" // 218 +mmodel "dcp/blade_x/fast" // 219 +mmodel "dcp/blade_x/mid" // 220 +mmodel "dcp/blade_y/big" // 221 +mmodel "dcp/blade_y/collide" // 222 +mmodel "dcp/blade_y/fast" // 223 +mmodel "dcp/blade_y/giant" // 224 +mmodel "dcp/firebowl_no_fire" // 225 +mmodel "mapmodels/a_slow_old_man/rat_sitting" // 226 +mmodel "mapmodels/gibc" // 227 +mmodel "mapmodels/gibh" // 228 +mmodel "mapmodels/justice/cabinet" // 229 +mmodel "mapmodels/justice/cc_screen" // 230 +mmodel "mapmodels/justice/cc_table" // 231 +mmodel "mapmodels/justice/console1/01" // 232 +mmodel "mapmodels/justice/console1/02" // 233 +mmodel "mapmodels/justice/decals/01" // 234 +mmodel "mapmodels/justice/decals/02" // 235 +mmodel "mapmodels/justice/poster/1" // 236 +mmodel "mapmodels/justice/poster/2" // 237 +mmodel "mapmodels/justice/poster/3" // 238 +mmodel "mapmodels/justice/switch" // 239 +mmodel "mapmodels/justice/vent" // 240 +mmodel "mapmodels/makke/gutter_h_big" // 241 +mmodel "mapmodels/makke/gutter_h_big/trak5" // 242 +mmodel "mapmodels/makke/gutter_v_big" // 243 +mmodel "mapmodels/memoria/decals" // 244 +mmodel "mapmodels/nieb/clockhand/long" // 245 +mmodel "mapmodels/nieb/clockhand/short" // 246 +mmodel "mapmodels/nieb/ladder45" // 247 +mmodel "mapmodels/nieb/tree_dead_nocollide" // 248 +mmodel "mapmodels/nieb/waterfall/1" // 249 +mmodel "mapmodels/nieb/waterfall/2" // 250 +mmodel "mapmodels/nieb/waterfall/3" // 251 +mmodel "mapmodels/nieb/waterfall/4" // 252 +mmodel "mapmodels/ow/flowerfield" // 253 +mmodel "mapmodels/ow/head/head_1" // 254 +mmodel "mapmodels/ow/head/head_2" // 255 +mmodel "mapmodels/ow/jump" // 256 +mmodel "mapmodels/ow/moss" // 257 +mmodel "mapmodels/ow/pad" // 258 +mmodel "mapmodels/ow/tarp" // 259 +mmodel "mapmodels/ow/tree" // 260 +mmodel "mapmodels/ow/tree2" // 261 +mmodel "mapmodels/ow/tree3" // 262 +mmodel "mapmodels/ow/tree4" // 263 +mmodel "mapmodels/quakish/tombstones/tombstone01" // 264 +mmodel "mapmodels/quakish/tombstones/tombstone02" // 265 +mmodel "mapmodels/quakish/tombstones/tombstone03" // 266 +mmodel "mapmodels/quakish/tombstones/tombstone04" // 267 +mmodel "mapmodels/quakish/tombstones/tombstone05" // 268 +mmodel "mapmodels/toca/industrialpipes/horz" // 269 +mmodel "mapmodels/toca/industrialpipes/ldwn" // 270 +mmodel "mapmodels/toca/industrialpipes/lleft" // 271 +mmodel "mapmodels/toca/industrialpipes/lright" // 272 +mmodel "mapmodels/toca/industrialpipes/lup" // 273 +mmodel "mapmodels/toca/industrialpipes/vert" // 274 +mmodel "mapmodels/toca/radioactivedrum" // 275 +mmodel "mapmodels/toca/radioactivedrum2" // 276 +mmodel "mapmodels/toca/signs/radioactive" // 277 +mmodel "mapmodels/toca/signs/restricted" // 278 +mmodel "mapmodels/tubes/ladder" // 279 +mmodel "mapmodels/yves_allaire/e7/e7wgrate/32x64_h" // 280 +mmodel "mapmodels/yves_allaire/e7/e7wgrate/32x64_v" // 281 +mmodel "mapmodels/yves_allaire/e7/e7wgrate/64x32_v" // 282 +mmodel "meister/coclea" // 283 +mmodel "meister/gear" // 284 +mmodel "meister/grinder" // 285 +mmodel "meister/puleggia" // 286 +mmodel "meister/silos" // 287 +mmodel "mitaman/floorgrate1/crnsp1" // 288 +mmodel "monster/bauul" // 289 +mmodel "monster/goblin" // 290 +mmodel "monster/hellpig" // 291 +mmodel "monster/knight" // 292 +mmodel "monster/rat" // 293 +mmodel "monster/rhino" // 294 +mmodel "monster/slith" // 295 +mmodel "monster/spider" // 296 +mmodel "pyccna/toxicity/tendril" // 297 +mmodel "pyccna/toxicity/testtube" // 298 +mmodel "pyccna/toxicity/testtube_mutated" // 299 +mmodel "pyccna/toxicity/testtube_severe" // 300 +mmodel "razgriz/effects/magic/blue_h" // 301 +mmodel "razgriz/effects/magic/blue_h_large" // 302 +mmodel "razgriz/effects/magic/blue_h_small" // 303 +mmodel "razgriz/effects/magic/blue_v" // 304 +mmodel "razgriz/effects/magic/blue_v_large" // 305 +mmodel "razgriz/effects/magic/blue_v_small" // 306 +mmodel "razgriz/effects/magic/red_h" // 307 +mmodel "razgriz/effects/magic/red_h_large" // 308 +mmodel "razgriz/effects/magic/red_h_small" // 309 +mmodel "razgriz/effects/magic/red_v" // 310 +mmodel "razgriz/effects/magic/red_v_large" // 311 +mmodel "razgriz/effects/magic/red_v_small" // 312 +mmodel "razgriz/flora/bushes/medium_bush1" // 313 +mmodel "razgriz/flora/bushes/medium_bush2" // 314 +mmodel "razgriz/flora/bushes/medium_bush3" // 315 +mmodel "razgriz/flora/bushes/medium_bush4" // 316 +mmodel "razgriz/flora/bushes/medium_bush5" // 317 +mmodel "razgriz/flora/bushes/tall_bush1" // 318 +mmodel "razgriz/flora/bushes/tall_bush2" // 319 +mmodel "razgriz/flora/bushes/tall_bush3" // 320 +mmodel "razgriz/flora/bushes/tall_bush4" // 321 +mmodel "razgriz/flora/log1" // 322 +mmodel "razgriz/flora/plant1" // 323 +mmodel "razgriz/flora/plant2" // 324 +mmodel "razgriz/flora/shroom1" // 325 +mmodel "razgriz/flora/shroom2" // 326 +mmodel "razgriz/flora/shroom3" // 327 +mmodel "razgriz/insects/butterfly/blue" // 328 +mmodel "razgriz/insects/butterfly/brown" // 329 +mmodel "razgriz/insects/butterfly/green" // 330 +mmodel "razgriz/insects/butterfly/orange" // 331 +mmodel "razgriz/insects/butterfly/pink" // 332 +mmodel "razgriz/insects/butterfly/red" // 333 +mmodel "razgriz/insects/butterfly/yellow" // 334 +mmodel "razgriz/insects/firefly" // 335 +mmodel "razgriz/objects/gem_cap/blue_h" // 336 +mmodel "razgriz/objects/gem_cap/blue_v" // 337 +mmodel "razgriz/objects/gem_cap/red_h" // 338 +mmodel "razgriz/objects/gem_cap/red_v" // 339 +mmodel "razgriz/objects/torch" // 340 +mmodel "razgriz/rocks/set1/1" // 341 +mmodel "razgriz/rocks/set1/2" // 342 +mmodel "razgriz/rocks/set1/3" // 343 +mmodel "razgriz/rocks/set1/4" // 344 +mmodel "razgriz/rocks/set1/5" // 345 +mmodel "razgriz/rocks/set1/6" // 346 +mmodel "razgriz/rocks/set1/7" // 347 +mmodel "razgriz/rocks/set1/8" // 348 +mmodel "razgriz/rocks/set1/9" // 349 +mmodel "razgriz/rocks/set2/1" // 350 +mmodel "razgriz/rocks/set2/2" // 351 +mmodel "razgriz/rocks/set2/3" // 352 +mmodel "razgriz/rocks/set2/4" // 353 +mmodel "razgriz/rocks/set2/5" // 354 +mmodel "rpg/characters/dragon" // 355 +mmodel "rpg/characters/grizzly" // 356 +mmodel "rpg/characters/horse" // 357 +mmodel "rpg/characters/mman" // 358 +mmodel "rpg/characters/npcman" // 359 +mmodel "rpg/characters/rat" // 360 +mmodel "rpg/characters/wolf" // 361 +mmodel "rpg/objects/coin" // 362 +mmodel "skull/blue" // 363 +mmodel "skull/red" // 364 +mmodel "vegetation/tree03_sprite" // 365 +mmodel "vurt/flora/aspen1" // 366 +mmodel "vurt/flora/aspen2" // 367 +mmodel "vurt/flora/pine1" // 368 +mmodel "vurt/flora/pine2" // 369 +mmodel "vurt/flora/pine3" // 370 +mmodel "vurt/flora/pine4" // 371 +mmodel "wohsiesta/tree" // 372 diff --git a/data/default_map_settings.cfg b/data/default_map_settings.cfg new file mode 100644 index 0000000..ab077dd --- /dev/null +++ b/data/default_map_settings.cfg @@ -0,0 +1,135 @@ +// default settings for maps + +// on every map load, this file will be executed, followed by +// "package.cfg" in the package dir of the map, and ".cfg", +// which you can use to override the settings in this file. + +exec "data/default_map_models.cfg" + +// the skybox for this map: +if (strcmp $skybox "") [ + skybox "skyboxes/remus/sky01" +] + +materialreset +texture water "golgotha/water2.jpg" // water surface +texture 1 "textures/waterfall.jpg" // waterfall +texture 1 "textures/watern.jpg" // water normals +texture 1 "textures/waterdudv.jpg" // water distortion +texture 1 "textures/waterfalln.jpg" // waterfall normals +texture 1 "textures/waterfalldudv.jpg" // waterfall distortion + +texture lava "dg/floor_lava2.jpg" 0 0 0 2 // lava surface +texture 1 "dg/floor_lava2.jpg" 0 0 0 2 // falling lava + +// texture definitions for the map: +texturereset // starts the texture slot/index at 0 + setshader stdworld // use default world shader unless specified otherwise + texture 0 "textures/sky.png" // dummy sky texture + texture 0 "textures/default.png" // default geometry texture + + texture 0 "aard/aardograss_1.jpg" + autograss "textures/grass_aard.png" + texture 0 "ik2k/ik_floor_brick128a.jpg" + texture 0 "ik2k/ik_floor_wood128b.jpg" + texture 0 "ik2k/ik_ground_cobbles128.jpg" + texture 0 "ik2k/ik_brick_3216d.jpg" + texture 0 "ik2k/ik_brick_6464c.jpg" + + exec "packages/dg/package.cfg" + exec "packages/tech1soc/package.cfg" + exec "packages/ik2k/package.cfg" + exec "packages/ikbase/package.cfg" + exec "packages/payne/package.cfg" + exec "packages/than_ind/package.cfg" + exec "packages/jf1/package.cfg" + + // misc textures (mine/schwenz/some tech1soc) + setshader stdworld + texture 0 "aard/aardfdry256_1.jpg" + texture 0 "tech1soc/spring3.jpg" + texture 0 "tech1soc/sqrlig02wb.jpg" + texture 0 "tech1soc/sqrlig03bc.jpg" + texture 0 "tech1soc/zdetlig01bb.jpg" + texture 0 "tech1soc/zdetlig02bb.jpg" + texture 0 "aard/aardmbr16_2.jpg" + texture 0 "tech1soc/zdetlig04bb.jpg" + texture 0 "tech1soc/zdet_trim2a.jpg" + texture 0 "aard/aardmmet32_1.jpg" + texture 0 "tech1soc/zdet_trim5b.jpg" + texture 0 "schwenz/dt_tile_check.01.jpg" + + exec "packages/egyptsoc/package.cfg" + exec "packages/rorschach/package2.cfg" + exec "packages/subverse/package.cfg" + exec "packages/g_pack/package.cfg" + + // missing jf & tech1soc textures + setshader stdworld + texture 0 "jf1/jfsquare.jpg" + texture 0 "jf1/jfyellow.jpg" + texture 0 "tech1soc/jp11a.jpg" + texture 0 "tech1soc/flr_tmtl_drk.jpg" + + exec "packages/lunaran/package.cfg" + exec "packages/gibbie/package.cfg" + exec "packages/philipk/package.cfg" + exec "packages/gor/package.cfg" + exec "packages/aftas/package.cfg" + exec "packages/mitaman/package.cfg" + exec "packages/noctua/package.cfg" + exec "packages/loopix/package.cfg" + exec "packages/g_pack/package2.cfg" + + // Misc textures + setshader stdworld + texture 0 "textures/nieb/rock01.jpg" + setshader bumpspecmapworld + setshaderparam "specscale" 0.25 0.25 0.25 + texture 0 "ikbase/specialbrick.jpg" + texture n "ikbase/specialbrick_normal.jpg" + + exec "packages/painkillah/package.cfg" + exec "packages/tomek/package.cfg" + exec "packages/textures/nieb/package.cfg" + exec "packages/trak5/package.cfg" + exec "packages/textures/nieb/garden/package.cfg" + exec "packages/textures/medieval_soc/package.cfg" + exec "packages/textures/terrain_soc/package.cfg" + exec "packages/textures/nieb/autumn/package.cfg" + exec "packages/textures/nieb/clone/package.cfg" + exec "packages/textures/nieb/suite/package.cfg" + + // Blikje bier + exec "packages/blikjebier/akaritori/package2.cfg" + exec "packages/blikjebier/concrete/package.cfg" + exec "packages/blikjebier/metal/package.cfg" + + setshader stdworld + texture 0 "blikjebier/ground/ground1.jpg" + texture 0 "blikjebier/ground/ground2.jpg" + texture 0 "blikjebier/ground/ground3.jpg" + texture 0 "blikjebier/ground/ground4.jpg" + texture 0 "blikjebier/ground/ground5.jpg" + texture 0 "blikjebier/ground/g1mm.jpg" + + texture 0 "blikjebier/snow/clear_snow.jpg" + texture 0 "blikjebier/snow/dirty_snow.jpg" + + exec "packages/egyptsoc/package2.cfg" + exec "packages/textures/fatum/package.cfg" + exec "packages/textures/philipk/pk02/package.cfg" + exec "packages/textures/yves_allaire/ex/package.cfg" + exec "packages/dg/package2.cfg" + + setshader stdworld + texture 0 "makke/dirt01.jpg" + texture 0 "makke/dirt02.jpg" + texture 0 "makke/platten.jpg" + texture 0 "makke/platten_var1.jpg" + texture 0 "textures/nieb/bonepile.jpg" + + exec "packages/textures/swatllama/package.cfg" + + // for cfgs that don't set shaders... + setshader stdworld diff --git a/data/defaults.cfg b/data/defaults.cfg new file mode 100644 index 0000000..41b978f --- /dev/null +++ b/data/defaults.cfg @@ -0,0 +1,248 @@ +// these default settings get executed whenever "config.cfg" is not available +// do not modify anything below, instead change settings in game, or add to autoexec.cfg + +name "unnamed" + +invmouse 0 // 1 for flightsim mode +sensitivity 3 // similar number to quake +fov 100 // 90 is default in other games + +musicvol 60 // set higher if you want (max 255) +soundvol 255 // sounds average volume is actually set per sound, average 100 + +gamma 100 // set to your liking, 100 = default + +fullbrightmodels 60 // make player models a bit easier to see + +// console + +consize 5 // console is 5 lines +miniconsize 5 // mini-console is 5 lines +miniconwidth 40 // mini-console is 40% of screen width +fullconsize 75 // full console is 75% of screen height +miniconfilter 0x300 // display chat and team chat in mini-console +confilter (&~ 0x2FFF $miniconfilter) // don't display other player frags or mini-console stuff in console +fullconfilter 0xFFFF // display all messages in full console + +// WASD + +bind W forward +bind A left +bind S backward +bind D right + +bind UP "forward" +bind DOWN "backward" +bind RIGHT "right" +bind LEFT "left" + +// old style weapon binds +//bind 0 "weapon 0 1 2" +//bind 1 "weapon 1 2 4" +//bind 2 "weapon 2 1 4" +//bind 3 "weapon 3 4 2" +//bind 4 "weapon 4 3 2" +//bind 5 "weapon 5 3 1" +//bind 6 "weapon 6 2 4" + +// new style weapon binds +bind 0 "setweapon FI" +bind 1 "setweapon SG" +bind 2 "setweapon CG" +bind 3 "setweapon RL" +bind 4 "setweapon RI" +bind 5 "setweapon GL" +bind 6 "setweapon PI" +bind 7 "setweapon FI" + +bind SPACE "jump" +bind MOUSE2 "jump" +bind MOUSE1 "attack" +bind MOUSE3 "weapon" +specbind MOUSE1 "nextfollow" +specbind MOUSE2 "nextfollow -1" +specbind MOUSE3 "follow" +specbind SPACE "follow" + +bind R dropflag + +bind TAB "showscores" + +bind T "saycommand" +bind Y "sayteamcommand" +bind BACKQUOTE "saycommand /" +bind SLASH "saycommand /" + +bind I taunt + +bind E edittoggle +bind LCTRL "allowspedit" +bind RCTRL "allowspedit" + +bind KP_MINUS "conskip 5" +bind KP_PLUS "conskip -1000" + +bindvarquiet F1 paused +bindvarquiet PAUSE paused + +bind F11 "toggleconsole" +bind F12 "screenshot" + +bind INSERT "addbot" +bind DELETE "delbot" + +hudgun 1 + +////////////////////////////////// +// universal scrollwheel + modifier commands: + +defaultmodifier = 0 +modifier = $defaultmodifier +domodifier = [ modifier = $arg1; onrelease [ modifier = $defaultmodifier ] ] + +universaldelta = [ + do [delta_@(if $editing [ result edit ] [ result game ])_@modifier @arg1] +] + +bind MOUSE4 [ universaldelta 1 ] // also used for editing, see below +bind MOUSE5 [ universaldelta -1 ] + +////////////////////////////////// + +delta_game_0 = [ if (= $arg1 1) [ weapon 2 3 5 4 1 6 0 ] [ weapon 4 1 6 2 3 5 0 ] ] + +//zfov = 120 +//delta_game_1 = [ +// zfov = (+ $zfov (* $arg1 (div $zfov -5))) +// if (< $zfov 10) [ zfov = 10 ] +// if (> $zfov 120) [ zfov = 120 ] +// fov $zfov +//] + +//bind G [ domodifier 1 ] + +bind G [ togglezoom ] +bind Z [ togglezoom ] + +////////////////////////////////// +// Sauerbraten Editing related bindings +// found in autoexec.cfg in your sauerbraten directory + +editbind SPACE [ cancelsel ] +editbind MOUSE1 [ if $blendpaintmode [paintblendmap] [editdrag] ] +editbind MOUSE3 [ selcorners ] +editbind MOUSE2 [ if $blendpaintmode [rotateblendbrush] [editextend] ] + +editbind J [ gotosel ] + +editbind KP_ENTER [ entselect insel ] +editbind N [ selentfindall ] + +editbind LSHIFT [ editcut ] +editbindmod LCTRL [ passthrough ] +editbindmod LALT [ hmapedit ] +editbind DELETE [ editdel ] + +editbind T [ saycommand ] +editbind X [ editflip ] +editbind C [ editcopy ] +editbind V [ editpaste ] +editbind Z [ undo; passthroughsel 0] +editbind U [ undo; passthroughsel 0] +editbind I [ redo ] +editbind H [ if $hmapedit [ editface 1 -1 ] [ hmapedit 1 ] ] + +editbind O [ domodifier 15 ] // vSlot: offset H +editbind P [ domodifier 16 ] // vSlot: offset V + +editbindvar 5 hidehud +editbindvar 6 entselsnap +editbindvar 7 outline +editbindvar 8 wireframe +bindvar 9 thirdperson allowthirdperson +editbindvar 0 allfaces +editbind K calclight +editbindvar L fullbright +editbindvar M showmat + +editbind PERIOD selentedit + +editbind F2 showtexgui +editbind F3 [if (cleargui 1) [] [showentgui]] +editbind F4 [if (cleargui 1) [] [showgui mapmodels]] +editbind F5 savemap +editbind F6 [ notepad (mapcfgname) ] +editbind F9 [echo (getseltex) : (gettexname (getseltex))] // echo texture info + +// commands below are used with scroll wheel (and universaldelta). +// if you have no scroll wheel or don't want to use it, +// you can either change the binds of universaldelta +// ex: bind MOUSE4 [ universaldelta 1 ] +// bind MOUSE5 [ universaldelta -1 ] +// can be changed to: +// bind PAGEUP [ universaldelta 1 ] +// bind PAGEDOWN [ universaldelta -1 ] +// so that the PAGEUP and PAGEDOWN key act just like a scroll wheel +// +// or you can rebind all the commands to seperate keys +// ex: bind T [ domodifier 6 ] +// can be changed to: +// bind HOME [ edittex 1 ] +// bind END [ edittex -1 ] + + +editbind G [ domodifier 1 ] // domodifier 1 -> executes delta_edit_1 +editbind F [ domodifier 2 ] // etc... +editbind Q [ domodifier 3 ] +editbind R [ domodifier 4 ] +editbind Y [ domodifier 6 ] +editbind B [ domodifier 9 ] +editbind COMMA [ domodifier 10; onrelease entautoview ] + +delta_edit_0 = [ + if $blendpaintmode [ + scrollblendbrush $arg1 + ] [ + editfacewentpush $arg1 1 // Fill and Empty cube + ] +] +delta_edit_1 = [ nodebug [ gridpower (+ $arg1 $gridpower) ] ] +delta_edit_2 = [ editfacewentpush $arg1 0 ] // push face/corners selected +delta_edit_3 = [ editfacewentpush $arg1 2 ] // push corner pointed at by cursor +delta_edit_4 = [ if $blendpaintmode [rotateblendbrush $arg1] [editrotate $arg1] ] // rotate 90 degrees +delta_edit_5 = [ entproperty 0 $arg1 ] // and the others +delta_edit_6 = [ edittex $arg1 ] // change textures +delta_edit_9 = [ selectbrush $arg1 ] // change heightmap brushes +delta_edit_10 = [ entautoview $arg1 ] + +editbind 1 [ domodifier 11 ] +editbind 2 [ domodifier 12 ] +editbind 3 [ domodifier 13 ] +editbind 4 [ domodifier 14 ] + +delta_edit_11 = [ entproperty 0 (* $arg1 $multiplier) ] +delta_edit_12 = [ entproperty 1 (* $arg1 $multiplier) ] +delta_edit_13 = [ entproperty 2 (* $arg1 $multiplier) ] +delta_edit_14 = [ entproperty 3 (* $arg1 $multiplier) ] + +delta_edit_15 = [ vdelta [voffset (* $arg1 $multiplier2) 0] ] // vSlot: offset H +delta_edit_16 = [ vdelta [voffset 0 (* $arg1 $multiplier2)] ] // vSlot: offset V +delta_edit_17 = [ vdelta [vrotate $arg1] ] // vSlot: rotate +delta_edit_18 = [ vdelta [vscale (if (< $arg1 0) 0.5 2)] ] // vSlot: scale + +//editbind LALT [multiplier = 10;onrelease [multiplier = 1]] +//editbind RALT [multiplier2 = 32;onrelease [multiplier2 = 16]] +multiplier = 1 +multiplier2 = 16 + +//Blendmap Painting +editbind KP0 [setblendpaintmode 0] +editbind KP1 [setblendpaintmode 1] +editbind KP2 [setblendpaintmode 2] +editbind KP3 [setblendpaintmode 3] +editbind KP4 [setblendpaintmode 4] +editbind KP5 [setblendpaintmode 5] + +editbind KP8 [scrollblendbrush -1] +editbind KP9 [scrollblendbrush 1] + diff --git a/data/font.cfg b/data/font.cfg new file mode 100644 index 0000000..64723ea --- /dev/null +++ b/data/font.cfg @@ -0,0 +1,3 @@ +exec "packages/fonts/default.cfg" +exec "packages/hud/digit_font.cfg" + diff --git a/data/game_fps.cfg b/data/game_fps.cfg new file mode 100644 index 0000000..87fdcd3 --- /dev/null +++ b/data/game_fps.cfg @@ -0,0 +1,73 @@ +// fps specific cfg stuff goes here + +togglezoom = [ zoom (if (= $zoom 1) -1 1) ] +sayteamcommand = [inputcommand (if (>= $numargs 1) [result $arg1] [result ""]) [sayteam $commandbuf] "[team]"] + +mapcomplete = [ complete $arg1 packages/base ogz ] +mapcomplete map + +modenames = "ffa coop teamplay insta instateam effic efficteam tac tacteam capture regencapture ctf instactf protect instaprotect hold instahold efficctf efficprotect effichold collect instacollect efficcollect" +loop i (listlen $modenames) [ + mname = (at $modenames $i) + alias $mname [ if (mode @i) [if (> $numargs 0) [map $arg1] [map]] ] + mapcomplete $mname +] + +spmodenames = "sp dmsp" +loop i (listlen $spmodenames) [ + mname = (at $spmodenames $i) + alias $mname [ if (mode (- @i 3)) [if (> $numargs 0) [map $arg1] [map]] ] + mapcomplete $mname +] + +complete importcube packages/cube cgz + +demo = [ stopdemo; if (mode -1) [if (> $numargs 0) [map $arg1] [map]] ] +varcomplete demo demodir dmo + +speditlock = 1 +allowspedit = [ speditlock = 0; onrelease [speditlock = 1] ] + +allowedittoggle = [ + if (&& (m_sp (getmode)) $speditlock) [ + error "you must hold" (prettylist (searchbinds "allowspedit") "or") "to toggle editing in single player modes" + result 0 + ] [ + result 1 + ] +] + +playermodelnum = 5 + +playermodeldir0 = "mrfixit" +playermodelicon0 = "mrfixit" +playermodelname0 = "Mr. Fixit" +playermodelstory0 = [Which orc do you choose when the mission calls for an all-purpose wrecking machine? Who do you call when the odds are stacked against you? Mr. Fixit, that's who. Gifted with the ability to perform deconstructive surgery with any weapon, this orc gets the job done fast and with extreme prejudice.] + +playermodeldir1 = "snoutx10k" +playermodelicon1 = "snoutx10k" +playermodelname1 = "IronSnout X10K" +playermodelstory1 = [IronSnout X10K is a hybrid model of the IronSnout series. Bred in the bowels of a top secret underground facility, this walking fragging machine is for one purpose: to annihilate the opposition. Part pig, part machine, IronSnout X10K knows no fear and fears no fragger.] + +playermodeldir2 = "ogro2" +playermodelicon2 = "ogro" +playermodelname2 = "Ogro" +playermodelstory2 = [Ogro is smaller than a normal ogre, but just as fat and only slightly less stupid. As opposed to common belief, he is not an evil creature, only killing as is absolutely necessary.] + +playermodeldir3 = "inky" +playermodelicon3 = "inky" +playermodelname3 = "Inky" +playermodelstory3 = [Inky is the aspiring younger sibling of an infamous transdimensional celebrity. Often teased as being only the "Lesser Evil", Inky searches the battlefields for infamy of his own, claiming it one fragger at a time.] + +playermodeldir4 = "captaincannon" +playermodelicon4 = "captaincannon" +playermodelname4 = "Captain Cannon" +playermodelstory4 = [Cannon Jones dared to imbibe the old imported beer can that had languished at the bottom of his refrigerator. Unbeknownst to Cannon, it had been bombarded with stray gamma radiation. After some serious indigestion, the mild-mannered Cannon Jones became the mighty Captain Cannon! Captain Cannon now has only one known weakness: his overbearingly righteous sense of justice.] + +playermodeldir = [getalias (concatword "playermodeldir" (if (> $numargs 0) [result $arg1] [result $playermodel]))] +playermodelicon = [getalias (concatword "playermodelicon" (if (> $numargs 0) [result $arg1] [result $playermodel]))] +playermodelname = [getalias (concatword "playermodelname" (if (> $numargs 0) [result $arg1] [result $playermodel]))] +playermodelstory = [getalias (concatword "playermodelstory" (if (> $numargs 0) [result $arg1] [result $playermodel]))] + +playsong = [ music (concatword "fanatic/" (+ 1 (rnd 8)) ".ogg") playsong ] + diff --git a/data/glsl.cfg b/data/glsl.cfg new file mode 100644 index 0000000..5726392 --- /dev/null +++ b/data/glsl.cfg @@ -0,0 +1,2802 @@ +// standard shader definitions + +lazyshader = [ + defershader $arg1 $arg2 [ + shader @arg1 @arg2 [@@arg3] [@@arg4] + ] +] + +lmcoordscale = (divf 1 32767) + +shader 0 "null" [ + attribute vec4 vvertex; + void main(void) + { + gl_Position = vvertex; + } +] [ + void main(void) + { + gl_FragColor = vec4(1.0, 0.0, 1.0, 1.0); + } +] + +/////////////////////////////////////////////////// +// +// used for rendering to the HUD +// +/////////////////////////////////////////////////// + +screentexcoord = [ + result [ + uniform vec4 screentexcoord@arg1; + #define vtexcoord@arg1 (vvertex.xy * screentexcoord@arg1.xy + screentexcoord@arg1.zw) + ] +] + +shader 0 "hud" [ + attribute vec4 vvertex, vcolor; + attribute vec2 vtexcoord0; + uniform mat4 hudmatrix; + varying vec2 texcoord0; + varying vec4 color; + void main(void) + { + gl_Position = hudmatrix * vvertex; + texcoord0 = vtexcoord0; + color = vcolor; + } +] [ + varying vec2 texcoord0; + varying vec4 color; + uniform sampler2D tex0; + void main(void) + { + gl_FragColor = color * texture2D(tex0, texcoord0); + } +] + +shader 0 "hudnotexture" [ + attribute vec4 vvertex, vcolor; + uniform mat4 hudmatrix; + varying vec4 color; + void main(void) + { + gl_Position = hudmatrix * vvertex; + color = vcolor; + } +] [ + varying vec4 color; + void main(void) + { + gl_FragColor = color; + } +] + +shader 0 "hudrgb" [ + attribute vec4 vvertex, vcolor; + attribute vec2 vtexcoord0; + uniform mat4 hudmatrix; + varying vec2 texcoord0; + varying vec4 color; + void main(void) + { + gl_Position = hudmatrix * vvertex; + texcoord0 = vtexcoord0; + color = vcolor; + } +] [ + varying vec2 texcoord0; + varying vec4 color; + uniform sampler2D tex0; + void main(void) + { + gl_FragColor.rgb = color.rgb * texture2D(tex0, texcoord0).rgb; + gl_FragColor.a = color.a; + } +] + +/////////////////////////////////////////////////// +// +// miscellaneous default shaders +// +/////////////////////////////////////////////////// + +shader 0 "texture" [ + attribute vec4 vvertex, vcolor; + attribute vec2 vtexcoord0; + uniform mat4 camprojmatrix; + varying vec2 texcoord0; + varying vec4 color; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + texcoord0 = vtexcoord0; + color = vcolor; + } +] [ + varying vec2 texcoord0; + varying vec4 color; + uniform sampler2D tex0; + void main(void) + { + gl_FragColor = color * texture2D(tex0, texcoord0); + } +] + +shader 0 "notexture" [ + attribute vec4 vvertex, vcolor; + uniform mat4 camprojmatrix; + varying vec4 color; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + color = vcolor; + } +] [ + varying vec4 color; + void main(void) + { + gl_FragColor = color; + } +] + +shader 0 "cubemap" [ + attribute vec4 vvertex, vcolor; + attribute vec3 vtexcoord0; + varying vec3 texcoord0; + varying vec4 color; + void main(void) + { + gl_Position = vvertex; + texcoord0 = vtexcoord0; + color = vcolor; + } +] [ + varying vec3 texcoord0; + varying vec4 color; + uniform samplerCube tex0; + void main(void) + { + gl_FragColor = color * textureCube(tex0, texcoord0); + } +] + +////////////////////////////////////////////////////////////////////// +// +// fogged variants of default shaders +// +////////////////////////////////////////////////////////////////////// + +shader 0 "fogged" [ + //:fog + attribute vec4 vvertex, vcolor; + attribute vec2 vtexcoord0; + uniform mat4 camprojmatrix; + varying vec2 texcoord0; + varying vec4 color; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + texcoord0 = vtexcoord0; + color = vcolor; + } +] [ + varying vec2 texcoord0; + varying vec4 color; + uniform sampler2D tex0; + void main(void) + { + gl_FragColor = color * texture2D(tex0, texcoord0); + } +] + +shader 0 "foggednotexture" [ + //:fog + attribute vec4 vvertex, vcolor; + uniform mat4 camprojmatrix; + varying vec4 color; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + color = vcolor; + } +] [ + varying vec4 color; + void main(void) + { + gl_FragColor = color; + } +] + +shader 0 "fogoverlay" [ + attribute vec4 vvertex, vcolor; + varying vec4 color; + void main(void) + { + gl_Position = vvertex; + color = vcolor; + } +] [ + varying vec4 color; + void main(void) + { + gl_FragColor = color; + } +] + +////////////////////////////////////////////////////////////////////// +// +// for filling the z-buffer only (i.e. multi-pass rendering, OQ) +// +////////////////////////////////////////////////////////////////////// + +shader 0 "nocolor" [ + attribute vec4 vvertex; + uniform mat4 camprojmatrix; + void main() { gl_Position = camprojmatrix * vvertex; } +] [ + void main() {} +] + +shader 0 "bbquery" [ + attribute vec4 vvertex; + uniform mat4 camprojmatrix; + uniform vec3 bborigin, bbsize; + void main() { gl_Position = camprojmatrix * vec4(bborigin + vvertex.xyz*bbsize, vvertex.w); } +] [ + void main() {} +] + +//////////////////////////////////////////////////////// +// +// default lightmapped world shader.. does texcoord gen +// +/////////////////////////////////////////////////////// + +worldshader = [ + stype = 0 + if (>= (strstr $arg1 "env") 0) [stype = (+ $stype 2)] + shader $stype $arg1 [ + //:fog + //:water + @(if (>= $numargs 5) [result $arg5]) + attribute vec4 vvertex; + attribute vec3 vnormal; + attribute vec2 vtexcoord0, vtexcoord1; + uniform mat4 camprojmatrix; + uniform vec2 texgenscroll; + varying vec2 texcoord0, texcoord1; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + texcoord0 = vtexcoord0 + texgenscroll; + texcoord1 = vtexcoord1 * @lmcoordscale; + + @arg2 + + //:shadowmap + //:dynlight + } + ] [ + @(if (>= $numargs 5) [result $arg5]) + @(if (>= $numargs 6) [result $arg6]) + uniform vec4 colorparams; + varying vec2 texcoord0, texcoord1; + uniform sampler2D diffusemap, lightmap; + void main(void) + { + @(? (>= (strstr $arg1 "alpha") 0) [ + vec4 diffuse = texture2D(diffusemap, texcoord0); + diffuse.rgb *= diffuse.a; + //:fog fogcolor * diffuse.a + ] [ + vec4 diffuse = vec4(texture2D(diffusemap, texcoord0).rgb, 1.0); + ]) + vec4 lm = texture2D(lightmap, texcoord1); + + //:shadowmap lm + //:dynlight lm + + @arg3 + + diffuse *= colorparams; + @(if (|| (< $numargs 4) [=s $arg4 []]) [result [gl_FragColor = diffuse * lm;]] [result $arg4]) + } + ] +] + +glareworldshader = [ + variantshader (if (< (strstr $arg1 "env") 0) 4 6) $arg1 4 [ + //:fog + @(if (>= $numargs 4) [result $arg4]) + attribute vec4 vvertex; + attribute vec3 vnormal; + attribute vec2 vtexcoord0, vtexcoord1; + uniform mat4 camprojmatrix; + uniform vec2 texgenscroll; + varying vec2 texcoord0, texcoord1; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + texcoord0 = vtexcoord0 + texgenscroll; + texcoord1 = vtexcoord1 * @lmcoordscale; + + @arg2 + } + ] [ + @(if (>= $numargs 4) [result $arg4]) + @(if (>= $numargs 5) [result $arg5]) + uniform vec4 colorparams; + varying vec2 texcoord0, texcoord1; + void main(void) + { + @arg3 + } + ] +] + +worldshader "stdworld" [] [] +worldshader "alphaworld" [] [] + +defershader 0 "decalworld" [ + worldshader "decalworld" [] [ + vec4 diffuse2 = texture2D(decal, texcoord0); + diffuse.rgb = mix(diffuse.rgb, diffuse2.rgb, diffuse2.a); + ] [] [] [uniform sampler2D decal;] +] + +glowshader = [ + defershader 0 $arg1 [ + defuniformparam "glowcolor" 1 1 1 // glow color + worldshader @arg1 [] [] [ + vec3 glow = texture2D(glowmap, texcoord0).rgb; + glow *= glowcolor.rgb; + gl_FragColor = diffuse*lm + vec4(glow, 0.0); + ] [] [uniform sampler2D glowmap;] + glareworldshader @arg1 [] [ + vec3 glow = texture2D(glowmap, texcoord0).rgb; + glow *= glowcolor.rgb; + float k = max(glow.r, max(glow.g, glow.b)); + gl_FragColor.rgb = min(k*k*32.0, 1.0) * glow; + gl_FragColor.a = + //:variantoverride texture2D(lightmap, texcoord1).a + colorparams.a + ; + ] [] [ + uniform sampler2D glowmap; + //:variant uniform sampler2D lightmap; + ] + ] +] +glowshader "glowworld" +glowshader "glowalphaworld" + +defershader 0 "pulseworld" [ + defuniformparam "pulsespeed" 1 // pulse frequency (Hz) + worldshader "pulseworld" [ + pulse = abs(fract(millis * pulsespeed.x)*2.0 - 1.0); + ] [ + vec3 diffuse2 = texture2D(decal, texcoord0).rgb; + diffuse.rgb = mix(diffuse.rgb, diffuse2, pulse); + ] [] [uniform float millis; varying float pulse;] [uniform sampler2D decal;] +] + +pulseglowshader = [ + defershader 0 $arg1 [ + defuniformparam "glowcolor" 1 1 1 // glow color + defuniformparam "pulseglowspeed" 1 // pulse frequency (Hz) + defuniformparam "pulseglowcolor" 0 0 0 // pulse glow color + worldshader @arg1 [ + pulse = mix(glowcolor.rgb, pulseglowcolor.rgb, abs(fract(millis * pulseglowspeed.x)*2.0 - 1.0)); + ] [] [ + vec3 glow = texture2D(glowmap, texcoord0).rgb; + gl_FragColor = diffuse*lm + vec4(glow*pulse, 0.0); + ] [uniform float millis; varying vec3 pulse;] [uniform sampler2D glowmap;] + glareworldshader @arg1 [ + pulse = mix(glowcolor.rgb, pulseglowcolor.rgb, abs(fract(millis * pulseglowspeed.x)*2.0 - 1.0)); + ] [ + vec3 glow = texture2D(glowmap, texcoord0).rgb; + glow *= pulse; + float k = max(glow.r, max(glow.g, glow.b)); + gl_FragColor.rgb = min(k*k*32.0, 1.0) * glow; + gl_FragColor.a = + //:variantoverride texture2D(lightmap, texcoord1).a + colorparams.a + ; + ] [uniform float millis; varying vec3 pulse;] [ + uniform sampler2D glowmap; + //:variant uniform sampler2D lightmap; + ] + ] +] +pulseglowshader "pulseglowworld" +pulseglowshader "pulseglowalphaworld" + +shader 0 "fogworld" [ + //:water + attribute vec4 vvertex; + uniform mat4 camprojmatrix; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + } +] [ + uniform vec3 fogcolor; + void main(void) + { + gl_FragColor = vec4(fogcolor, 1.0); + } +] + +shader 0 "noglareworld" [ + attribute vec4 vvertex; + uniform mat4 camprojmatrix; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + } +] [ + void main(void) + { + gl_FragColor = vec4(0.0); + } +] + +shader 0 "noglareblendworld" [ + attribute vec4 vvertex; + attribute vec2 vtexcoord1; + uniform mat4 camprojmatrix; + varying vec2 texcoord0; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + texcoord0 = vtexcoord1 * @lmcoordscale; + } +] [ + varying vec2 texcoord0; + uniform sampler2D lightmap; + void main(void) + { + gl_FragColor.rgb = vec3(0.0); + gl_FragColor.a = texture2D(lightmap, texcoord0).a; + } +] + +shader 0 "noglarealphaworld" [ + attribute vec4 vvertex; + uniform mat4 camprojmatrix; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + } +] [ + uniform vec4 colorparams; + uniform sampler2D lightmap; + void main(void) + { + gl_FragColor.rgb = vec3(0.0); + gl_FragColor.a = colorparams.a; + } +] + +defershader 2 "envworld" [ + defuniformparam "envscale" 0.2 0.2 0.2 // reflectivity + worldshader "envworld" [ + normal = vnormal; + camvec = camera - vvertex.xyz; + ] [ + vec3 reflect = textureCube(envmap, 2.0*normal*dot(camvec, normal) - camvec).rgb; + ] [ + diffuse *= lm; + gl_FragColor.rgb = mix(diffuse.rgb, reflect, envscale.rgb); + gl_FragColor.a = diffuse.a; + ] [uniform vec3 camera; varying vec3 normal, camvec;] [uniform samplerCube envmap;] + + defuniformparam "envscale" 0.2 0.2 0.2 // reflectivity + worldshader "envworldfast" [ + vec3 camvec = camera - vvertex.xyz; + rvec = 2.0*vnormal*dot(camvec, vnormal) - camvec; + ] [ + vec3 reflect = textureCube(envmap, rvec).rgb; + ] [ + diffuse *= lm; + gl_FragColor.rgb = mix(diffuse.rgb, reflect, envscale.rgb); + gl_FragColor.a = diffuse.a; + ] [uniform vec3 camera; varying vec3 rvec;] [uniform samplerCube envmap;] + + defuniformparam "envscale" 0.2 0.2 0.2 // reflectivity + worldshader "envworldalt" [] [] + + altshader envworld envworldalt + fastshader envworld envworldfast 2 + fastshader envworld envworldalt 1 +] + +shader 0 "depthfxworld" [ + attribute vec4 vvertex; + uniform mat4 camprojmatrix; + uniform vec4 depthscale, depthoffsets; + varying vec4 depthranges; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + depthranges = depthoffsets + gl_Position.w*depthscale; + } +] [ + varying vec4 depthranges; + void main(void) + { + gl_FragColor = depthranges; + } +] + +shader 0 depthfxsplitworld [ + attribute vec4 vvertex; + uniform mat4 camprojmatrix; + uniform vec4 depthscale, depthoffsets; + varying vec4 depthranges; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + depthranges = depthoffsets + gl_Position.w*depthscale; + } +] [ + varying vec4 depthranges; + void main(void) + { + vec4 ranges = vec4(depthranges.x, fract(depthranges.yzw)); + ranges.xy -= ranges.yz*vec2(0.00390625, 0.00390625); + gl_FragColor = ranges; + } +] + +// bumptype: +// e -> reserve envmap texture slot +// o -> orthonormalize +// t -> tangent space cam +// r -> envmap reflection +// R -> modulate envmap reflection with spec map +// s -> spec +// S -> spec map +// p -> parallax +// P -> steep parallax (7 steps) +// g -> glow +// G -> pulse glow +// i -> glare intensity +// a -> alpha map + +btopt = [ >= (strstr $bumptype $arg1) 0 ] + +bumpvariantshader = [ + bumptype = $arg2 + stype = (? (btopt "e") 3 1) + if (! (btopt "i")) [ + if (btopt "G") [ + defuniformparam "glowcolor" 1 1 1 // glow color + defuniformparam "pulseglowspeed" 1 // pulse frequency (Hz) + defuniformparam "pulseglowcolor" 0 0 0 // pulse glow color + ] [if (btopt "g") [ + defuniformparam "glowcolor" 1 1 1 // glow color + ]] + if (btopt "S") [ + defuniformparam "specscale" 6 6 6 // spec map multiplier + ] [if (btopt "s") [ + defuniformparam "specscale" 1 1 1 // spec multiplier + ]] + if (|| (btopt "p") (btopt "P")) [ + defuniformparam "parallaxscale" 0.06 -0.03 // parallax scaling + ] + if (btopt "R") [ + defuniformparam "envscale" 1 1 1 // reflectivity map multiplier + ] [if (btopt "r") [ + defuniformparam "envscale" 0.2 0.2 0.2 // reflectivity + ]] + ] [ + if (btopt "s") [stype = (+ $stype 8)] + ] + variantshader $stype $arg1 (? (btopt "i") 4 -1) [ + //:fog + attribute vec4 vvertex; + attribute vec3 vnormal; + attribute vec2 vtexcoord0, vtexcoord1; + @(? (btopt "o") [attribute vec4 vtangent;]) + uniform mat4 camprojmatrix; + uniform vec2 texgenscroll; + varying vec2 texcoord0, texcoord1; + @(if (|| (btopt "t") (btopt "r")) [result [uniform vec3 camera; varying vec3 camvec;]]) + @(if (btopt "G") [result [uniform float millis; varying float pulse;]]) + @(if (btopt "r") [result [varying mat3 world;]]) + void main(void) + { + gl_Position = camprojmatrix * vvertex; + texcoord0 = vtexcoord0 + texgenscroll; + texcoord1 = vtexcoord1 * @lmcoordscale; + + @(if (btopt "o") [result [ + vec3 bitangent = cross(vnormal, vtangent.xyz) * vtangent.w; + @@(if (btopt "t") [result [ + // trans eye vector into TS + vec3 camobj = camera - vvertex.xyz; + camvec = vec3(dot(camobj, vtangent.xyz), dot(camobj, bitangent), dot(camobj, vnormal)); + ]]) + @@(if (btopt "r") [result [ + @@(if (! (btopt "t")) [result [ + camvec = camera - vvertex.xyz; + ]]) + // calculate tangent -> world transform + world = mat3(vtangent.xyz, bitangent, vnormal); + ]]) + ]]) + + @(if (btopt "G") [result [ + pulse = abs(fract(millis*pulseglowspeed.x)*2.0 - 1.0); + ]]) + + @(if (|| (! (btopt "i")) (btopt "s")) [result [ + //:dynlight + ]]) + @(if (! (btopt "i")) [result [ + //:shadowmap + //:water + ]]) + } + ] [ + uniform vec4 colorparams; + varying vec2 texcoord0, texcoord1; + uniform sampler2D diffusemap, lmcolor, lmdir; + @(if (|| (! (btopt "i")) (btopt "s") (btopt "p") (btopt "P")) [result [uniform sampler2D normalmap;]]) + @(if (|| (btopt "t") (btopt "r")) [result [varying vec3 camvec;]]) + @(if (btopt "g") [result [uniform sampler2D glowmap;]]) + @(if (btopt "G") [result [varying float pulse;]]) + @(if (btopt "r") [result [uniform samplerCube envmap; varying mat3 world;]]) + @(if (|| (! (btopt "i")) (btopt "s")) [result [uniform vec4 ambient;]]) + void main(void) + { + @(if (|| (! (btopt "i")) (btopt "s")) [result [ + vec4 lmc = texture2D(lmcolor, texcoord1); + gl_FragColor.a = colorparams.a * lmc.a; + vec3 lmlv = texture2D(lmdir, texcoord1).rgb*2.0 - 1.0; + ]]) + @(if (btopt "t") [result [vec3 camdir = normalize(camvec);]]) + @(if (btopt "p") [result [ + float height = texture2D(normalmap, texcoord0).a; + vec2 dtc = texcoord0 + camdir.xy*(height*parallaxscale.x + parallaxscale.y); + ]]) + @(if (btopt "P") [result [ + const float step = -1.0/7.0; + vec3 duv = vec3((step*parallaxscale.x/camdir.z)*camdir.xy, step); + vec3 htc = vec3(texcoord0 + duv.xy*parallaxscale.y, 1.0); + vec4 height = texture2D(normalmap, htc.xy); + @@(loopconcat i 7 [concatword [ + htc += height.w < htc.z ? duv : vec3(0.0); + height = texture2D(normalmap, htc.xy); + ]]) + #define dtc htc.xy + #define bump height.xyz + ]]) + @(if (|| (btopt "p") (btopt "P")) [] [result [#define dtc texcoord0]]) + + @(if (|| (! (btopt "i")) (btopt "S") (btopt "a")) [result [ + vec4 diffuse = texture2D(diffusemap, dtc); + @(if (&& (btopt "a") (! (btopt "S"))) [result [ + #define alpha diffuse.a + ]]) + ]]) + @(if (! (btopt "i")) [result [ + diffuse.rgb *= colorparams.rgb; + ]]) + @(if (|| (! (btopt "i")) (btopt "s") (btopt "a")) [result [ + @(if (! (btopt "P")) [ + if (&& (btopt "a") (btopt "S")) [result [ + vec4 normal = texture2D(normalmap, dtc); + #define alpha normal.a + #define bump normal.rgb + ]] [result [ + vec3 bump = texture2D(normalmap, dtc).rgb; + ]] + ]) + bump = bump*2.0 - 1.0; + ]]) + + @(if (btopt "s") [result [ + vec3 halfangle = normalize(camdir + lmlv); + float spec = pow(clamp(dot(halfangle, bump), 0.0, 1.0), @(? (btopt "i") "128.0" "32.0")); + @(if (btopt "i") [result [spec = min(spec*64.0, 1.0);]]) + @(if (btopt "S") [result [spec *= diffuse.a;]]) + @(if (btopt "i") [result [ + @(? (btopt "S") "diffuse.rgb" "vec3 diffuse") = specscale.xyz*spec; + ]] [result [ + diffuse.rgb += specscale.xyz*spec; + ]]) + ]]) + + @(if (|| (! (btopt "i")) (btopt "s")) [result [ + lmc.rgb = max(lmc.rgb*clamp(dot(lmlv, bump), 0.0, 1.0), ambient.xyz); + @(if (btopt "i") [result [ + //:dynlight lmc + + @(? (btopt "g") "diffuse.rgb" "gl_FragColor.rgb") = diffuse.rgb * lmc.rgb; + ]] [result [ + //:shadowmap lmc + //:dynlight lmc + + @(? (|| (btopt "g") (btopt "r")) "diffuse.rgb" "gl_FragColor.rgb") = diffuse.rgb * lmc.rgb; + ]]) + ]]) + + @(if (btopt "r") [result [ + vec3 rvec; + @(if (btopt "t") [result [ + vec3 rvects = 2.0*bump*dot(camvec, bump) - camvec; + rvec = world * rvects; + ]] [result [ + vec3 bumpw = world * bump; + rvec = 2.0*bumpw*dot(camvec, bumpw) - camvec; + ]]) + vec3 reflect = textureCube(envmap, rvec).rgb; + @@(if (btopt "R") [result [ + vec3 rmod = envscale.xyz*diffuse.a; + ]] [result [ + #define rmod envscale.xyz + ]]) + @(? (btopt "g") "diffuse.rgb" "gl_FragColor.rgb") = mix(diffuse.rgb, reflect, rmod); + ]]) + + @(if (btopt "a") [result [ + @(? (btopt "g") "diffuse.rgb" "gl_FragColor.rgb") *= alpha; + ]]) + + @(if (btopt "g") [result [ + vec3 glow = texture2D(glowmap, dtc).rgb; + @@(if (btopt "G") [result [ + vec3 pulsecol = mix(glowcolor.xyz, pulseglowcolor.xyz, pulse); + ]]) + @@(if (btopt "i") [result [ + glow *= @(? (btopt "G") "pulsecol" "glowcolor.xyz"); + float k = max(glow.r, max(glow.g, glow.b)); + k = min(k*k*32.0, 1.0); + @(if (btopt "s") [result [ + gl_FragColor.rgb = glow*k + diffuse.rgb; + ]] [result [ + gl_FragColor.rgb = glow*k; + gl_FragColor.a = + //:variantoverride texture2D(lmcolor, texcoord1).a + colorparams.a + ; + ]]) + ]] [result [ + gl_FragColor.rgb = glow * @(? (btopt "G") "pulsecol" "glowcolor.xyz") + diffuse.rgb; + ]]) + ]]) + + @(if (btopt "a") [result [ + gl_FragColor.a *= alpha; + //:fog fogcolor * alpha + ]]) + } + ] +] + +bumpshader = [ + defershader (? (>= (strstr $arg2 "e") 0) 3 1) $arg1 [ + bumpvariantshader @arg1 @arg2 + if (|| (btopt "g") (btopt "s")) [ + bumpvariantshader @@arg1 (strreplace (concatword @@arg2 "i") "r") + ] + ] +] + +bumpshader "bumpworld" "" +bumpshader "bumpspecworld" "ots" +fastshader bumpspecworld bumpworld 2 +altshader bumpspecworld bumpworld +bumpshader "bumpspecmapworld" "otsS" +fastshader bumpspecmapworld bumpworld 2 +altshader bumpspecmapworld bumpworld + +bumpshader "bumpalphaworld" "a" +bumpshader "bumpspecalphaworld" "otsa" +fastshader bumpspecalphaworld bumpalphaworld 1 +altshader bumpspecalphaworld bumpalphaworld +bumpshader "bumpspecmapalphaworld" "otsSa" +fastshader bumpspecmapalphaworld bumpalphaworld 1 +altshader bumpspecmapalphaworld bumpalphaworld + +bumpshader "bumpglowworld" "g" +bumpshader "bumpspecglowworld" "otsg" +altshader bumpspecglowworld bumpglowworld +bumpshader "bumpspecmapglowworld" "otsSg" +fastshader bumpspecmapglowworld bumpglowworld 2 +altshader bumpspecmapglowworld bumpglowworld + +bumpshader "bumppulseglowworld" "gG" +bumpshader "bumpspecpulseglowworld" "otsgG" +altshader bumpspecpulseglowworld bumppulseglowworld +bumpshader "bumpspecmappulseglowworld" "otsSgG" +fastshader bumpspecmappulseglowworld bumppulseglowworld 2 +altshader bumpspecmappulseglowworld bumppulseglowworld + +bumpshader "bumpparallaxworld" "pot" +fastshader bumpparallaxworld bumpworld 1 +altshader bumpparallaxworld bumpworld +bumpshader "bumpspecparallaxworld" "pots" +fastshader bumpspecparallaxworld bumpparallaxworld 2 +fastshader bumpspecparallaxworld bumpworld 1 +altshader bumpspecparallaxworld bumpworld +bumpshader "bumpspecmapparallaxworld" "potsS" +fastshader bumpspecmapparallaxworld bumpparallaxworld 2 +fastshader bumpspecmapparallaxworld bumpworld 1 +altshader bumpspecmapparallaxworld bumpworld + +bumpshader "bumpparallaxglowworld" "potg" +fastshader bumpparallaxglowworld bumpglowworld 1 +altshader bumpparallaxglowworld bumpglowworld +bumpshader "bumpspecparallaxglowworld" "potsg" +fastshader bumpspecparallaxglowworld bumpparallaxglowworld 2 +fastshader bumpspecparallaxglowworld bumpglowworld 1 +altshader bumpspecparallaxglowworld bumpglowworld +bumpshader "bumpspecmapparallaxglowworld" "potsSg" +fastshader bumpspecmapparallaxglowworld bumpparallaxglowworld 2 +fastshader bumpspecmapparallaxglowworld bumpglowworld 1 +altshader bumpspecmapparallaxglowworld bumpglowworld + +bumpshader "bumpparallaxpulseglowworld" "potgG" +fastshader bumpparallaxpulseglowworld bumppulseglowworld 1 +altshader bumpparallaxpulseglowworld bumppulseglowworld +bumpshader "bumpspecparallaxpulseglowworld" "potsgG" +fastshader bumpspecparallaxpulseglowworld bumpparallaxpulseglowworld 2 +fastshader bumpspecparallaxpulseglowworld bumppulseglowworld 1 +altshader bumpspecparallaxpulseglowworld bumppulseglowworld +bumpshader "bumpspecmapparallaxpulseglowworld" "potsSgG" +fastshader bumpspecmapparallaxpulseglowworld bumpparallaxpulseglowworld 2 +fastshader bumpspecmapparallaxpulseglowworld bumppulseglowworld 1 +altshader bumpspecmapparallaxpulseglowworld bumppulseglowworld + +bumpshader "bumpenvworldalt" "e" +bumpshader "bumpenvworld" "eor" +altshader bumpenvworld bumpenvworldalt +fastshader bumpenvworld bumpenvworldalt 2 +bumpshader "bumpenvspecworld" "eotsr" +altshader bumpenvspecworld bumpenvworldalt +fastshader bumpenvspecworld bumpenvworldalt 2 +bumpshader "bumpenvspecmapworld" "eotsSrR" +altshader bumpenvspecmapworld bumpenvworldalt +fastshader bumpenvspecmapworld bumpenvworldalt 2 + +bumpshader "bumpenvglowworldalt" "eg" +bumpshader "bumpenvglowworld" "eorg" +altshader bumpenvglowworld bumpenvglowworldalt +fastshader bumpenvglowworld bumpenvglowworldalt 2 +bumpshader "bumpenvspecglowworld" "eotsrg" +altshader bumpenvspecglowworld bumpenvglowworldalt +fastshader bumpenvspecglowworld bumpenvglowworldalt 2 +bumpshader "bumpenvspecmapglowworld" "eotsSrRg" +altshader bumpenvspecmapglowworld bumpenvglowworldalt +fastshader bumpenvspecmapglowworld bumpenvglowworldalt 2 + +bumpshader "bumpenvpulseglowworldalt" "egG" +bumpshader "bumpenvpulseglowworld" "eorgG" +altshader bumpenvpulseglowworld bumpenvpulseglowworldalt +fastshader bumpenvpulseglowworld bumpenvpulseglowworldalt 2 +bumpshader "bumpenvspecpulseglowworld" "eotsrgG" +altshader bumpenvspecpulseglowworld bumpenvpulseglowworldalt +fastshader bumpenvspecpulseglowworld bumpenvpulseglowworldalt 2 +bumpshader "bumpenvspecmappulseglowworld" "eotsSrRgG" +altshader bumpenvspecmappulseglowworld bumpenvpulseglowworldalt +fastshader bumpenvspecmappulseglowworld bumpenvpulseglowworldalt 2 + +bumpshader "bumpenvparallaxworldalt" "epot" +altshader bumpenvparallaxworldalt bumpenvworldalt +bumpshader "bumpenvparallaxworld" "epotr" +altshader bumpenvparallaxworld bumpenvparallaxworldalt +fastshader bumpenvparallaxworld bumpenvparallaxworldalt 2 +fastshader bumpenvparallaxworld bumpenvworldalt 1 +bumpshader "bumpenvspecparallaxworld" "epotsr" +altshader bumpenvspecparallaxworld bumpenvparallaxworldalt +fastshader bumpenvspecparallaxworld bumpenvparallaxworldalt 2 +fastshader bumpenvspecparallaxworld bumpenvworldalt 1 +bumpshader "bumpenvspecmapparallaxworld" "epotsSrR" +altshader bumpenvspecmapparallaxworld bumpenvparallaxworldalt +fastshader bumpenvspecmapparallaxworld bumpenvparallaxworldalt 2 +fastshader bumpenvspecmapparallaxworld bumpenvworldalt 1 + +bumpshader "bumpenvparallaxglowworldalt" "epotg" +altshader bumpenvparallaxglowworldalt bumpenvglowworldalt +bumpshader "bumpenvparallaxglowworld" "epotrg" +altshader bumpenvparallaxglowworld bumpenvparallaxglowworldalt +fastshader bumpenvparallaxglowworld bumpenvparallaxglowworldalt 2 +fastshader bumpenvparallaxglowworld bumpenvglowworldalt 1 +bumpshader "bumpenvspecparallaxglowworld" "epotsrg" +altshader bumpenvspecparallaxglowworld bumpenvparallaxglowworldalt +fastshader bumpenvspecparallaxglowworld bumpenvparallaxglowworldalt 2 +fastshader bumpenvspecparallaxglowworld bumpenvglowworldalt 1 +bumpshader "bumpenvspecmapparallaxglowworld" "epotsSrRg" +altshader bumpenvspecmapparallaxglowworld bumpenvparallaxglowworldalt +fastshader bumpenvspecmapparallaxglowworld bumpenvparallaxglowworldalt 2 +fastshader bumpenvspecmapparallaxglowworld bumpenvglowworldalt 1 + +bumpshader "bumpenvparallaxpulseglowworldalt" "epotgG" +altshader bumpenvparallaxpulseglowworldalt bumpenvpulseglowworldalt +bumpshader "bumpenvparallaxpulseglowworld" "epotrgG" +altshader bumpenvparallaxpulseglowworld bumpenvparallaxpulseglowpulseglowworldalt +fastshader bumpenvparallaxpulseglowworld bumpenvparallaxpulseglowpulseglowworldalt 2 +fastshader bumpenvparallaxpulseglowworld bumpenvpulseglowworldalt 1 +bumpshader "bumpenvspecparallaxpulseglowworld" "epotsrgG" +altshader bumpenvspecparallaxpulseglowworld bumpenvparallaxpulseglowworldalt +fastshader bumpenvspecparallaxpulseglowworld bumpenvparallaxpulseglowworldalt 2 +fastshader bumpenvspecparallaxpulseglowworld bumpenvpulseglowworldalt 1 +bumpshader "bumpenvspecmapparallaxpulseglowworld" "epotsSrRgG" +altshader bumpenvspecmapparallaxpulseglowworld bumpenvparallaxpulseglowworldalt +fastshader bumpenvspecmapparallaxpulseglowworld bumpenvparallaxpulseglowworldalt 2 +fastshader bumpenvspecmapparallaxpulseglowworld bumpenvpulseglowworldalt 1 + +//bumpshader "steepworld" "Pot" + +//////////////////////////////////////////////// +// +// model shaders +// +//////////////////////////////////////////////// + +// skeletal animation for dual quaternions + +qtangentdecode = [ + ? $arg1 [ + vec4 qxyz = mquat.xxyy*mquat.yzyz, qxzw = vec4(mquat.xzw, -mquat.w); + vec3 mtangent = (qxzw.yzw*mquat.zzy + qxyz.zxy)*vec3(-2.0, 2.0, 2.0) + vec3(1.0, 0.0, 0.0); + vec3 mnormal = (qxzw.zwx*mquat.yxx + qxyz.ywz)*vec3(2.0, 2.0, -2.0) + vec3(0.0, 0.0, 1.0); + // vec3 mtangent = cross(mquat.xyz, vec3(mquat.wz, -mquat.y))*2.0 + vec3(1.0, 0.0, 0.0); + // vec3 mnormal = cross(mquat.xyz, vec3(mquat.y, -mquat.x, mquat.w))*2.0 + vec3(0.0, 0.0, 1.0); + ] [ + vec3 mnormal = cross(mquat.xyz, vec3(mquat.y, -mquat.x, mquat.w))*2.0 + vec3(0.0, 0.0, 1.0); + ] +] + +skelanimdefs = [ + skelanimlength = (min (- $maxvsuniforms (+ $reservevpparams 10)) $maxskelanimdata) + result [ + attribute vec4 vboneweight; + attribute vec4 vboneindex; + //:uniform animdata + uniform vec4 animdata[@@skelanimlength]; + ] +] + +skelanim = [ + result [ + int index = int(vboneindex.x); + @(if (= $arg1 1) [result [ + vec4 dqreal = animdata[index]; + vec4 dqdual = animdata[index+1]; + ]] [result [ + vec4 dqreal = animdata[index] * vboneweight.x; + vec4 dqdual = animdata[index+1] * vboneweight.x; + index = int(vboneindex.y); + dqreal += animdata[index] * vboneweight.y; + dqdual += animdata[index+1] * vboneweight.y; + @(if (>= $arg1 3) [result [ + index = int(vboneindex.z); + dqreal += animdata[index] * vboneweight.z; + dqdual += animdata[index+1] * vboneweight.z; + ]]) + @(if (>= $arg1 4) [result [ + index = int(vboneindex.w); + dqreal += animdata[index] * vboneweight.w; + dqdual += animdata[index+1] * vboneweight.w; + ]]) + float len = length(dqreal); + dqreal /= len; + dqdual /= len; + ]]) + + vec4 mpos = vec4((cross(dqreal.xyz, cross(dqreal.xyz, vvertex.xyz) + vvertex.xyz*dqreal.w + dqdual.xyz) + dqdual.xyz*dqreal.w - dqreal.xyz*dqdual.w)*2.0 + vvertex.xyz, vvertex.w); + + @(if $arg2 [result [ + vec4 mquat = vec4(cross(dqreal.xyz, vtangent.xyz) + dqreal.xyz*vtangent.w + vtangent.xyz*dqreal.w, dqreal.w*vtangent.w - dot(dqreal.xyz, vtangent.xyz)); + @(qtangentdecode $arg3) + ]] [if (>= $numargs 2) [result [ + vec3 mnormal = cross(dqreal.xyz, cross(dqreal.xyz, vnormal) + vnormal*dqreal.w)*2.0 + vnormal; + ]]]) + ] +] + +// model shadowmapping + +shadowmapcastervertexshader = [ + result [ + @(if (>= $numargs 2) [result $arg1]) + attribute vec4 vvertex; + uniform mat4 modelmatrix; + uniform vec4 shadowintensity; + varying vec4 shadowmapvals; + void main(void) + { + @(if (>= $numargs 2) [result $arg2] [result [ + #define mpos vvertex + ]]) + gl_Position = modelmatrix * mpos; + shadowmapvals = vec4(1.0 - gl_Position.z, 1.0, 0.0, shadowintensity.x); + } + ] +] + +shader 0 shadowmapcaster (shadowmapcastervertexshader) [ + varying vec4 shadowmapvals; + void main(void) + { + gl_FragColor = shadowmapvals; + } +] +loop i 4 [ + variantshader 0 shadowmapcaster 0 (shadowmapcastervertexshader (skelanimdefs (+ $i 1)) (skelanim (+ $i 1))) [] +] + +shader 0 "shadowmapreceiver" [ + attribute vec4 vvertex; + uniform mat4 shadowmatrix; + uniform vec2 shadowmapbias; + varying vec4 shadowmapvals; + void main(void) + { + gl_Position = shadowmatrix * vvertex; + shadowmapvals = vec4(0.0, 0.0, shadowmapbias.y - gl_Position.z, 0.0); + } +] [ + varying vec4 shadowmapvals; + void main(void) + { + gl_FragColor = shadowmapvals; + } +] + +// model stenciling + +notexturemodelvertexshader = [ + result [ + attribute vec4 vvertex, vcolor; + uniform mat4 modelmatrix; + varying vec4 color; + @(if (>= $numargs 2) [result $arg1]) + //:fog + void main(void) + { + @(if (>= $numargs 2) [result $arg2] [result [ + #define mpos vvertex + ]]) + gl_Position = modelmatrix * mpos; + color = vcolor; + } + ] +] + +shader 0 notexturemodel (notexturemodelvertexshader) [ + varying vec4 color; + void main(void) + { + gl_FragColor = color; + } +] +loop i 4 [ + variantshader 0 notexturemodel 0 (notexturemodelvertexshader (skelanimdefs (+ $i 1)) (skelanim (+ $i 1))) [] +] + +// mdltype: +// e -> envmap +// n -> normalmap +// s -> spec +// m -> masks +// b -> dual-quat skeletal animation +// a -> alpha-tested +// q -> qtangents +// i -> glare intensity + +mdlopt = [ >= (strstr $modeltype $arg1) 0 ] + +modelvertexshader = [ + modeltype = $arg1 + result [ + @(if (mdlopt "b") [skelanimdefs $arg2 (mdlopt "q") (mdlopt "n")]) + //:fog + attribute vec4 vvertex, vcolor; + attribute vec2 vtexcoord0; + @(if (mdlopt "q") [result [ + attribute vec4 vtangent; + ]] [result [ + attribute vec3 vnormal; + ]]) + uniform mat4 modelmatrix; + uniform vec3 modelcamera, lightdir, lightscale; + uniform vec2 texscroll; + varying vec2 texcoord0; + varying vec4 color; + @(if (mdlopt "n") [result [ + @(if (mdlopt "e") [result [ + uniform mat3 modelworld; + varying vec3 camvec; + varying mat3 world; + ]] [result [ + varying vec3 lightvec, halfangle; + ]]) + ]] [result [ + @(if (mdlopt "s") [result [ + varying vec3 nvec, halfangle; + ]]) + @(if (mdlopt "e") [result [ + uniform mat3 modelworld; + uniform vec2 envmapscale; + varying vec3 rvec; + varying float rmod; + ]]) + ]]) + void main(void) + { + @(if (mdlopt "b") [result [ + @(skelanim $arg2 (mdlopt "q") (mdlopt "n")) + ]] [result [ + #define mpos vvertex + @(if (mdlopt "q") [result [ + #define mquat vtangent + @(qtangentdecode (mdlopt "n")) + ]] [result [ + #define mnormal vnormal + ]]) + ]]) + + gl_Position = modelmatrix * mpos; + + @(if (|| (mdlopt "n") (mdlopt "s") (mdlopt "i")) [result [ + color = vcolor; + ]]) + texcoord0 = vtexcoord0 + texscroll; + + @(if (|| (mdlopt "e") (mdlopt "s")) [result [ + vec3 camdir = normalize(modelcamera - mpos.xyz); + ]]) + + @(if (mdlopt "n") [ + if (mdlopt "e") [result [ + camvec = modelworld * camdir; + // composition of tangent -> object and object -> world transforms + // becomes tangent -> world + vec3 wnormal = modelworld * mnormal; + vec3 wtangent = modelworld * mtangent; + vec3 wbitangent = cross(wnormal, wtangent) * (vtangent.w < 0.0 ? -1.0 : 1.0); + world = mat3(wtangent, wbitangent, wnormal); + ]] [result [ + vec3 mbitangent = cross(mnormal, mtangent) * (vtangent.w < 0.0 ? -1.0 : 1.0); + lightvec = vec3(dot(lightdir, mtangent), dot(lightdir, mbitangent), dot(lightdir, mnormal)); + @(if (mdlopt "s") [result [ + vec3 halfdir = lightdir + camdir; + halfangle = vec3(dot(halfdir, mtangent), dot(halfdir, mbitangent), dot(halfdir, mnormal)); + ]]) + ]] + ] [result [ + @(if (mdlopt "s") [result [ + nvec = mnormal; + halfangle = lightdir + camdir; + ]] [if (! (mdlopt "i")) [result [ + float intensity = dot(mnormal, lightdir); + color = vec4(vcolor.rgb*clamp(intensity*(intensity*lightscale.x + lightscale.y) + lightscale.z, 0.0, 1.0), vcolor.a); + ]]]) + @(if (mdlopt "e") [result [ + float invfresnel = dot(camdir, mnormal); + rvec = modelworld * (2.0*invfresnel*mnormal - camdir); + rmod = envmapscale.x*max(invfresnel, 0.0) + envmapscale.y; + ]]) + ]]) + } + ] +] + +modelfragmentshader = [ + modeltype = $arg1 + result [ + varying vec2 texcoord0; + varying vec4 color; + @(if (mdlopt "n") [result [ + @(if (mdlopt "e") [result [ + #define lightvec lightdirworld + uniform vec3 lightdirworld; + uniform vec2 envmapscale; + varying vec3 camvec; + varying mat3 world; + ]] [result [ + varying vec3 lightvec, halfangle; + ]]) + ]] [result [ + @(if (mdlopt "s") [result [ + #define lightvec lightdir + uniform vec3 lightdir; + varying vec3 nvec, halfangle; + ]]) + @(if (mdlopt "e") [result [ + varying vec3 rvec; + varying float rmod; + ]]) + ]]) + @(if (&& (|| (mdlopt "s") (mdlopt "n")) (! (mdlopt "i"))) [result [uniform vec3 lightscale;]]) + @(if (|| (mdlopt "s") (mdlopt "m")) [result [uniform vec4 maskscale;]]) + uniform sampler2D tex0; + @(if (mdlopt "m") [result [uniform sampler2D tex1;]]) + @(if (mdlopt "e") [result [uniform samplerCube tex2;]]) + @(if (mdlopt "n") [result [uniform sampler2D tex3;]]) + @(? (mdlopt "a") [uniform float alphatest;]) + void main(void) + { + vec4 light = texture2D(tex0, texcoord0); + + @(? (mdlopt "a") [ + if(light.a <= alphatest) + discard; + ]) + + light.rgb *= 2.0; + + @(if (mdlopt "m") [result [ + vec3 masks = texture2D(tex1, texcoord0).rgb; + vec3 glow = light.rgb * maskscale.y; + ]]) + + @(if (mdlopt "n") [result [ + vec3 normal = texture2D(tex3, texcoord0).rgb - 0.5; + @(if (mdlopt "e") [result [ + normal = world * normal; + ]]) + normal = normalize(normal); + ]]) + + @(if (mdlopt "s") [result [ + @(if (mdlopt "n") [ + if (mdlopt "e") [result [ + vec3 halfangle = lightvec + camvec; + ]] + ] [result [ + vec3 normal = normalize(nvec); + ]]) + float spec = maskscale.x * pow(clamp(dot(normalize(halfangle), normal), 0.0, 1.0), @(? (mdlopt "i") "256.0" "128.0")); + @(if (mdlopt "m") [result [spec *= masks.r;]]) // specmap in red channel + ]]) + + @(if (mdlopt "i") [ + if (mdlopt "s") [result [ + spec *= maskscale.z; + @(? (mdlopt "m") "light.rgb" "gl_FragColor.rgb") = spec * color.rgb; + ]] [ + if (! (mdlopt "m")) [result [gl_FragColor.rgb = vec3(0.0);]] + ] + ] [result [ + @(if (|| (mdlopt "s") (mdlopt "n")) [result [ + float intensity = dot(normal, lightvec); + light.rgb *= clamp(intensity*(intensity*lightscale.x + lightscale.y) + lightscale.z, 0.0, 1.0); + ]]) + @(if (mdlopt "s") [result [ + light.rgb += spec; + ]]) + @(if (|| (mdlopt "m") (mdlopt "e")) [result [ + light.rgb *= color.rgb; + ]] [result [ + gl_FragColor = light * color; + ]]) + ]]) + + @(if (mdlopt "e") [result [ + @(if (mdlopt "n") [result [ + vec3 camn = normalize(camvec); + float invfresnel = dot(camn, normal); + vec3 rvec = 2.0*invfresnel*normal - camn; + float rmod = envmapscale.x*max(invfresnel, 0.0) + envmapscale.y; + ]]) + vec3 reflect = textureCube(tex2, rvec).rgb; + @(if (! (mdlopt "m")) [result [ + gl_FragColor.rgb = mix(light.rgb, reflect, rmod); + ]]) + ]]) + + @(if (mdlopt "m") [result [ + @(if (mdlopt "e") [result [ + light.rgb = mix(light.rgb, glow, masks.g); // glow mask in green channel + gl_FragColor.rgb = mix(light.rgb, reflect, rmod*masks.b); // envmap mask in blue channel + ]] [if (mdlopt "i") [result [ + float k = min(masks.g*masks.g*maskscale.w, 1.0); // glow mask in green channel + gl_FragColor.rgb = @(? (mdlopt "s") "glow*k + light.rgb" "glow*k"); + ]] [result [ + gl_FragColor.rgb = mix(light.rgb, glow, masks.g); // glow mask in green channel + ]]]) + ]]) + + @(if (|| (mdlopt "i") (mdlopt "m") (mdlopt "e")) [result [ + gl_FragColor.a = light.a * color.a; + ]]) + } + ] +] + +modelshader = [ + local shadername + shadername = (concatword model $arg1) + if (! (isshaderdefined $shadername)) [ + shader 0 $shadername (modelvertexshader $arg1) (modelfragmentshader $arg1) + loop i 4 [ + variantshader 0 $shadername 0 (modelvertexshader (concatword $arg1 "b") (+ $i 1)) [] + ] + glaremodeltype = (strreplace (concatword $arg1 "i") "e") + if (< (strstr $glaremodeltype "s") 0) [glaremodeltype = (strreplace $glaremodeltype "n")] + variantshader 0 $shadername 1 (modelvertexshader $glaremodeltype) (modelfragmentshader $glaremodeltype) + loop i 4 [ + variantshader 0 $shadername 1 (modelvertexshader (concatword $glaremodeltype "b") (+ $i 1)) 1 + ] + if (>= (strstr $arg1 "e") 0) [ + altshader $shadername (modelshader (strreplace $arg1 "e")) + ] + if (>= (strstr $arg1 "s") 0) [ + fastshader $shadername (modelshader (strreplace $arg1 "s")) 1 + ] + ] + result $shadername +] + +//////////////////////////////////////////////// +// +// separable blur with up to 7 taps +// +//////////////////////////////////////////////// + +blurshader = [ + shader 0 $arg1 [ + attribute vec4 vvertex; + @(screentexcoord 0) + uniform float offsets[8]; + varying vec2 texcoord0, texcoordp1, texcoordn1; + @(loopconcat i (min (- $arg2 1) 2) [result [ + varying vec2 texcoordp@(+ $i 2), texcoordn@(+ $i 2); + ]]) + void main(void) + { + gl_Position = vvertex; + texcoord0 = vtexcoord0; + vec2 tcp = vtexcoord0, tcn = vtexcoord0; + tcp.@arg3 += offsets[1]; + tcn.@arg3 -= offsets[1]; + texcoordp1 = tcp; + texcoordn1 = tcn; + @(loopconcat i (min (- $arg2 1) 2) [result [ + tcp.@arg3 = vtexcoord0.@arg3 + offsets[@@(+ $i 2)]; + tcn.@arg3 = vtexcoord0.@arg3 - offsets[@@(+ $i 2)]; + texcoordp@(+ $i 2) = tcp; + texcoordn@(+ $i 2) = tcn; + ]]) + } + ] [ + uniform float weights[8]; + uniform float offsets[8]; + varying vec2 texcoord0, texcoordp1, texcoordn1; + @(loopconcat i (min (- $arg2 1) 2) [result [ + varying vec2 texcoordp@(+ $i 2), texcoordn@(+ $i 2); + ]]) + uniform sampler2D tex0; + void main(void) + { + #define texval(coords) texture2D(tex0, (coords)) + vec4 val = texval(texcoord0) * weights[0]; + @(loopconcat i $arg2 [ + if (< $i 3) [result [ + val += weights[@@(+ $i 1)] * (texval(texcoordp@(+ $i 1)) + texval(texcoordn@(+ $i 1))); + ]] [result [ + val += weights[@@(+ $i 1)] * + @(if (=s $arg3 "x") [result [ + (texval(vec2(texcoord0.x + offsets[@@(+ $i 1)], texcoord0.y)) + + texval(vec2(texcoord0.x - offsets[@@(+ $i 1)], texcoord0.y))); + ]] [result [ + (texval(vec2(texcoord0.x, texcoord0.y + offsets[@@(+ $i 1)])) + + texval(vec2(texcoord0.x, texcoord0.y - offsets[@@(+ $i 1)]))); + ]]) + ]] + ]) + gl_FragColor = val; + } + ] +] + +loop i 7 [ + blurshader (format "blurx%1" (+ $i 1)) (+ $i 1) x + blurshader (format "blury%1" (+ $i 1)) (+ $i 1) y + if (> $i 0) [ + altshader (format "blurx%1" (+ $i 1)) (format "blurx%1" $i) + altshader (format "blury%1" (+ $i 1)) (format "blury%1" $i) + ] +] + +//////////////////////////////////////////////// +// +// full screen shaders: +// +//////////////////////////////////////////////// + +fsvs = [result [ + attribute vec4 vvertex; + @(screentexcoord 0) + uniform vec2 postfxscale; + varying vec2 texcoord0; + @arg2 + void main(void) + { + gl_Position = vvertex; // woohoo, no mvp :) + texcoord0 = vtexcoord0; + @arg1 + } +]] + +fsps = [result [ + uniform sampler2D tex0; + varying vec2 texcoord0; + @arg2 + void main(void) + { + vec4 color = texture2D(tex0, texcoord0); + @arg1 + } +]] + +fsvs4 = [ + fsvs [ + texcoord1 = vtexcoord0 + vec2(-1.5, -1.5)*postfxscale; + texcoord2 = vtexcoord0 + vec2( 1.5, -1.5)*postfxscale; + texcoord3 = vtexcoord0 + vec2(-1.5, 1.5)*postfxscale; + texcoord4 = vtexcoord0 + vec2( 1.5, 1.5)*postfxscale; + @arg1 + ] [ + varying vec2 texcoord1, texcoord2, texcoord3, texcoord4; + ] +] + +fsps4 = [ + fsps [ + vec4 s00 = texture2D(tex0, texcoord1); + vec4 s02 = texture2D(tex0, texcoord2); + vec4 s20 = texture2D(tex0, texcoord3); + vec4 s22 = texture2D(tex0, texcoord4); + @arg1 + ] [ + varying vec2 texcoord1, texcoord2, texcoord3, texcoord4; + ] +] + +// some simple ones that just do an effect on the RGB value... + +lazyshader 0 "invert" (fsvs) (fsps [gl_FragColor = 1.0 - color;]) +lazyshader 0 "gbr" (fsvs) (fsps [gl_FragColor = color.yzxw;]) +lazyshader 0 "bw" (fsvs) (fsps [gl_FragColor = vec4(dot(color.xyz, vec3(0.333)));]) + +// sobel + +lazyshader 0 "sobel" (fsvs4) (fsps4 [ + vec4 t = s00 + s20 - s02 - s22; + vec4 u = s00 + s02 - s20 - s22; + gl_FragColor = color + t*t + u*u; +]) + +// rotoscope + +lazyshader 0 "rotoscope" [ + attribute vec4 vvertex; + @(screentexcoord 0) + uniform vec2 postfxscale; + uniform vec4 params; + varying vec2 t11, t00, t12, t01, t20, t02, t21, t10, t22; + void main(void) + { + gl_Position = vvertex; + t11 = vtexcoord0; + vec2 scale = postfxscale*params.x; + t00 = vec2(-1.0, -1.0)*scale + vtexcoord0; + t12 = vec2( 0.0, 1.0)*scale + vtexcoord0; + t01 = vec2(-1.0, 0.0)*scale + vtexcoord0; + t20 = vec2( 1.0, -1.0)*scale + vtexcoord0; + t02 = vec2(-1.0, 1.0)*scale + vtexcoord0; + t21 = vec2( 1.0, 0.0)*scale + vtexcoord0; + t10 = vec2( 0.0, -1.0)*scale + vtexcoord0; + t22 = vec2( 1.0, 1.0)*scale + vtexcoord0; + } +] [ + uniform sampler2D tex0; + varying vec2 t11, t00, t12, t01, t20, t02, t21, t10, t22; + void main(void) + { + vec4 c00 = texture2D(tex0, t00); + vec4 c01 = texture2D(tex0, t01); + vec4 c02 = texture2D(tex0, t02); + vec4 c10 = texture2D(tex0, t10); + vec4 c11 = texture2D(tex0, t11); + vec4 c12 = texture2D(tex0, t12); + vec4 c20 = texture2D(tex0, t20); + vec4 c21 = texture2D(tex0, t21); + vec4 c22 = texture2D(tex0, t22); + + vec4 diag1 = c00 - c22; + vec4 diag2 = c02 - c20; + vec4 xedge = (c01 - c21)*2.0 + diag1 + diag2; + vec4 yedge = (c10 - c12)*2.0 + diag1 - diag2; + xedge *= xedge; + yedge *= yedge; + + vec4 xyedge = xedge + yedge; + float sobel = step(max(xyedge.x, max(xyedge.y, xyedge.z)), 0.1); + + float hue = dot(c11.xyz, vec3(1.0)); + c11 /= hue; + vec3 cc = step(vec3(0.2, 0.8, 1.5), vec3(hue)); + c11 *= dot(cc, vec3(0.5, 0.5, 1.5)); + + gl_FragColor = c11 * max(cc.z, sobel); + } +] + +blur3shader = [ + lazyshader 0 $arg1 [ + attribute vec4 vvertex; + @(screentexcoord 0) + uniform vec2 postfxscale; + varying vec2 texcoord0, texcoord1; + void main(void) + { + gl_Position = vvertex; + texcoord0 = vtexcoord0 + vec2(@(if $arg2 -0.5 0.0), @(if $arg3 -0.5 0.0))*postfxscale; + texcoord1 = vtexcoord0 + vec2(@(if $arg2 0.5 0.0), @(if $arg3 0.5 0.0))*postfxscale; + } + ] [ + varying vec2 texcoord0, texcoord1; + uniform sampler2D tex0; + void main(void) + { + gl_FragColor = 0.5*(texture2D(tex0, texcoord0) + texture2D(tex0, texcoord1)); + } + ] +] +blur3shader hblur3 1 0 +blur3shader vblur3 0 1 + +blur5shader = [ + lazyshader 0 $arg1 [ + attribute vec4 vvertex; + @(screentexcoord 0) + uniform vec2 postfxscale; + varying vec2 texcoord0, texcoord1, texcoord2; + void main(void) + { + gl_Position = vvertex; + texcoord0 = vtexcoord0; + texcoord1 = vtexcoord0 + vec2(@(? $arg2 -1.333 0.0), @(? $arg3 -1.333 0.0))*postfxscale; + texcoord2 = vtexcoord0 + vec2(@(? $arg2 1.333 0.0), @(? $arg3 1.333 0.0))*postfxscale; + } + ] [ + uniform sampler2D tex0; + varying vec2 texcoord0, texcoord1, texcoord2; + void main(void) + { + gl_FragColor = 0.4*texture2D(tex0, texcoord0) + 0.3*(texture2D(tex0, texcoord1) + texture2D(tex0, texcoord2)); + } + ] +] +blur5shader hblur5 1 0 +blur5shader vblur5 0 1 + +rotoscope = [ + clearpostfx + if (>= $numargs 1) [addpostfx rotoscope 0 0 0 $arg1] + if (>= $numargs 2) [ + if (= $arg2 1) [addpostfx hblur3; addpostfx vblur3] + if (= $arg2 2) [addpostfx hblur5; addpostfx vblur5] + ] +] + +shader 0 "screenrect" [ + attribute vec4 vvertex, vcolor; + @(screentexcoord 0) + varying vec2 texcoord0; + varying vec4 color; + void main(void) + { + gl_Position = vvertex; + texcoord0 = vtexcoord0; + color = vcolor; + } +] [ + varying vec2 texcoord0; + varying vec4 color; + uniform sampler2D tex0; + void main(void) + { + gl_FragColor = color * texture2D(tex0, texcoord0); + } +] + +// bloom-ish + +lazyshader 0 "bloom_scale" (fsvs4) (fsps4 [ + gl_FragColor = 0.2 * (s02 + s00 + s22 + s20 + color); +]) + +lazyshader 0 "bloom_init" (fsvs) (fsps [ + float t = max(color.r, max(color.g, color.b)); + gl_FragColor = t*t*color; +]) + +bloomshader = [ + defershader 0 $arg1 [ + forceshader "bloom_scale" + forceshader "bloom_init" + shader 0 @arg1 [ + attribute vec4 vvertex; + @(screentexcoord 0) + varying vec2 texcoord0; + void main(void) + { + gl_Position = vvertex; + texcoord0 = vtexcoord0; + } + ] [ + uniform vec4 params; + varying vec2 texcoord0; + uniform sampler2D tex0 @@(loopconcat i $arg2 [result [, tex@(+ $i 1)]]); + void main(void) + { + vec4 sample = texture2D(tex0, texcoord0); + @@(loopconcat i $arg2 [result [ + @(? $i "bloom +=" "vec4 bloom =") texture2D(tex@(+ $i 1), texcoord0); + ]]) + gl_FragColor = bloom*params.x + sample; + } + ] + ] +] + +bloomshader bloom1 1 +bloomshader bloom2 2 +bloomshader bloom3 3 +bloomshader bloom4 4 +bloomshader bloom5 5 +bloomshader bloom6 6 + +setupbloom = [ + addpostfx bloom_init 1 1 "+0" + loop i (- $arg1 1) [ + addpostfx bloom_scale (+ $i 2) (+ $i 2) (concatword "+" (+ $i 1)) + ] + addpostfx (concatword bloom $arg1) 0 0 (loopconcat i (+ $arg1 1) [result $i]) $arg2 +] + +bloom = [ + clearpostfx + if (>= $numargs 1) [setupbloom 6 $arg1] +] + +//////////////////////////////////////////////// +// +// miscellaneous effect shaders: +// +//////////////////////////////////////////////// + +// wobbles the vertices of an explosion sphere +// and generates all texcoords +// and blends the edge color +// and modulates the texture +explosionshader = [ + shader 0 $arg1 [ + //:fog + attribute vec4 vvertex, vcolor; + attribute vec2 vtexcoord0; + uniform mat4 explosionmatrix; + uniform vec3 center; + uniform float millis; + uniform vec3 texgenS, texgenT; + varying vec4 color; + varying vec2 texcoord0, texcoord1, texcoord2; + @(if (>= (strstr $arg1 "soft") 0) [result [uniform vec4 depthfxparams; varying vec4 texcoord3; ]]) + void main(void) + { + vec4 wobble = vec4(vvertex.xyz*(1.0 + 0.5*abs(fract(dot(vvertex.xyz, center) + millis*2.0) - 0.5)), vvertex.w); + @(if (>= (strstr $arg1 "soft") 0) [result [ + gl_Position = explosionmatrix * wobble; + + texcoord3 = vec4(0.5*(gl_Position.xy + gl_Position.w), gl_Position.w, depthfxparams.y + gl_Position.w*depthfxparams.x); + ]] [result [ + gl_Position = explosionmatrix * wobble; + ]]) + + color = vcolor; + + texcoord0 = vtexcoord0; + vec2 texgen = vec2(dot(texgenS, vvertex.xyz), dot(texgenT, vvertex.xyz)); + texcoord1 = texgen; + texcoord2 = 0.5*texgen - millis*0.5; + } + ] [ + @(if (>= (strstr $arg1 "soft") 0) [result [ + uniform sampler2D tex2; + ]]) + uniform sampler2D tex0, tex1; + uniform vec2 blendparams; + varying vec4 color; + varying vec2 texcoord0, texcoord1, texcoord2; + @(if (>= (strstr $arg1 "soft") 0) [result [uniform vec4 depthfxparams; varying vec4 texcoord3; ]]) + @(if (>= (strstr $arg1 "soft8") 0) [result [uniform vec4 depthfxselect;]]) + void main(void) + { + vec2 dtc = texcoord0 + texture2D(tex0, texcoord2).xy*0.1; // use color texture as noise to distort texcoords + vec4 diffuse = texture2D(tex0, dtc); + float blend = max(pow(clamp(1.0 - dot(texcoord1, texcoord1), 0.0, 1.0), blendparams.x), blendparams.y); + @(if (>= (strstr $arg1 "glare") 0) [result [ + float k = blend*blend; + diffuse.rgb *= k*8.0; + diffuse.a *= k; + diffuse.b += k*k; + ]] [result [ + diffuse *= blend*4.0; // dup alpha into RGB channels + intensify and over saturate + diffuse.b += 0.5 - blend*0.5; // blue tint + ]]) + + @(if (>= (strstr $arg1 "soft") 0) [result [ + gl_FragColor.rgb = diffuse.rgb * color.rgb; + + #define depthvals texture2DProj(tex2, texcoord3.xyz) + @(if (>= (strstr $arg1 "soft8") 0) [result [ + float depth = dot(depthvals, depthfxselect); + ]] [result [ + float depth = depthvals.x*depthfxparams.z; + ]]) + gl_FragColor.a = diffuse.a * max(clamp(depth - texcoord3.w, 0.0, 1.0) * color.a, depthfxparams.w); + ]] [result [ + gl_FragColor = diffuse * color; + ]]) + } + ] +] + +looplist i ["" "glare" "soft" "soft8"] [ + explosionshader [explosion@i] +] + +shader 0 "particlenotexture" [ + //:fog + attribute vec4 vvertex, vcolor; + uniform mat4 camprojmatrix; + uniform vec4 colorscale; + varying vec4 color; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + color = vcolor * colorscale; + } +] [ + varying vec4 color; + void main(void) + { + gl_FragColor = color; + } +] + +particleshader = [ + shader 0 $arg1 [ + //:fog + attribute vec4 vvertex, vcolor; + attribute vec2 vtexcoord0; + uniform mat4 camprojmatrix; + uniform vec4 colorscale; + varying vec2 texcoord0; + varying vec4 color; + @(if (>= (strstr $arg1 "soft") 0) [result [uniform vec4 depthfxparams; varying vec3 texcoord1, surface; ]]) + void main(void) + { + gl_Position = camprojmatrix * vvertex; + texcoord0 = vtexcoord0; + color = vcolor * colorscale; + + @(if (>= (strstr $arg1 "soft") 0) [result [ + texcoord1 = vec3(0.5*(gl_Position.xy + gl_Position.w), gl_Position.w); + + vec2 offset = vtexcoord0*2.82842712474619 - 1.4142135623731; + surface = vec3(offset, depthfxparams.y + gl_Position.w*depthfxparams.x); + ]]) + } + ] [ + @(if (>= (strstr $arg1 "soft") 0) [result [ + uniform sampler2D tex2; + ]]) + uniform sampler2D tex0; + varying vec2 texcoord0; + varying vec4 color; + @(if (>= (strstr $arg1 "soft") 0) [result [uniform vec4 depthfxparams; varying vec3 texcoord1, surface;]]) + @(if (>= (strstr $arg1 "soft8") 0) [result [uniform vec4 depthfxselect;]]) + void main(void) + { + vec4 diffuse = texture2D(tex0, texcoord0); + + @(if (>= (strstr $arg1 "soft") 0) [result [ + #define depthvals texture2DProj(tex2, texcoord1) + @(if (>= (strstr $arg1 "soft8") 0) [result [ + float depth = dot(depthvals, depthfxselect); + ]] [result [ + float depth = depthvals.x*depthfxparams.z; + ]]) + diffuse.a *= clamp(depth - dot(surface.xy, surface.xy) - surface.z, 0.0, 1.0); + ]]) + + gl_FragColor = diffuse * color; + } + ] +] + +looplist i ["" "soft" "soft8"] [ + particleshader [particle@i] +] + +shader 0 "blendbrush" [ + attribute vec4 vvertex, vcolor; + uniform mat4 camprojmatrix; + uniform vec4 texgenS, texgenT; + varying vec4 color; + varying vec2 texcoord0; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + color = vcolor; + texcoord0 = vec2(dot(texgenS, vvertex), dot(texgenT, vvertex)); + } +] [ + varying vec4 color; + varying vec2 texcoord0; + uniform sampler2D tex0; + void main(void) + { + gl_FragColor = texture2D(tex0, texcoord0).r * color; + } +] + +lazyshader 0 "prefab" [ + attribute vec4 vvertex, vcolor; + attribute vec3 vnormal; + uniform mat4 prefabmatrix; + uniform mat3 prefabworld; + varying vec4 color; + + void main(void) + { + gl_Position = prefabmatrix * vvertex; + color = vcolor; + color.rgb *= dot(prefabworld * vnormal, vec3(0.0, -0.447213595, 0.894427191)); + } +] [ + varying vec4 color; + void main(void) + { + gl_FragColor = color; + } +] + +lazyshader 0 "moviergb" [ + attribute vec4 vvertex; + @(screentexcoord 0) + varying vec2 texcoord0; + void main(void) + { + gl_Position = vvertex; + texcoord0 = vtexcoord0; + } +] [ + varying vec2 texcoord0; + uniform sampler2D tex0; + void main(void) + { + gl_FragColor = texture2D(tex0, texcoord0); + } +] + +lazyshader 0 "movieyuv" [ + attribute vec4 vvertex; + @(screentexcoord 0) + varying vec2 texcoord0; + void main(void) + { + gl_Position = vvertex; + texcoord0 = vtexcoord0; + } +] [ + varying vec2 texcoord0; + uniform sampler2D tex0; + void main(void) + { + vec3 sample = texture2D(tex0, texcoord0).rgb; + gl_FragColor = vec4(dot(sample, vec3(0.439216, -0.367788, -0.071427)) + 0.501961, + dot(sample, vec3(-0.148224, -0.290992, 0.439216)) + 0.501961, + dot(sample, vec3(0.256788, 0.504125, 0.097905)) + 0.062745, + 0.0); + } +] + +lazyshader 0 "moviey" [ + attribute vec4 vvertex; + @(screentexcoord 0) + uniform vec2 moviescale; + varying vec2 texcoord0, texcoord1, texcoord2, texcoord3; + void main(void) + { + gl_Position = vvertex; + texcoord0 = vtexcoord0 + vec2(-1.5, 0.0)*moviescale; + texcoord1 = vtexcoord0 + vec2(-0.5, 0.0)*moviescale; + texcoord2 = vtexcoord0 + vec2( 0.5, 0.0)*moviescale; + texcoord3 = vtexcoord0 + vec2( 1.5, 0.0)*moviescale; + } +] [ + varying vec2 texcoord0, texcoord1, texcoord2, texcoord3; + uniform sampler2D tex0; + void main(void) + { + vec3 sample1 = texture2D(tex0, texcoord0).rgb; + vec3 sample2 = texture2D(tex0, texcoord1).rgb; + vec3 sample3 = texture2D(tex0, texcoord2).rgb; + vec3 sample4 = texture2D(tex0, texcoord3).rgb; + gl_FragColor = vec4(dot(sample3, vec3(0.256788, 0.504125, 0.097905)) + 0.062745, + dot(sample2, vec3(0.256788, 0.504125, 0.097905)) + 0.062745, + dot(sample1, vec3(0.256788, 0.504125, 0.097905)) + 0.062745, + dot(sample4, vec3(0.256788, 0.504125, 0.097905)) + 0.062745); + } +] + +lazyshader 0 "movieu" [ + attribute vec4 vvertex; + @(screentexcoord 0) + uniform vec2 moviescale; + varying vec2 texcoord0, texcoord1, texcoord2, texcoord3; + void main(void) + { + gl_Position = vvertex; + texcoord0 = vtexcoord0 + vec2(-3.0, 0.0)*moviescale; + texcoord1 = vtexcoord0 + vec2(-1.0, 0.0)*moviescale; + texcoord2 = vtexcoord0 + vec2( 1.0, 0.0)*moviescale; + texcoord3 = vtexcoord0 + vec2( 3.0, 0.0)*moviescale; + } +] [ + varying vec2 texcoord0, texcoord1, texcoord2, texcoord3; + uniform sampler2D tex0; + void main(void) + { + vec3 sample1 = texture2D(tex0, texcoord0).rgb; + vec3 sample2 = texture2D(tex0, texcoord1).rgb; + vec3 sample3 = texture2D(tex0, texcoord2).rgb; + vec3 sample4 = texture2D(tex0, texcoord3).rgb; + gl_FragColor = vec4(dot(sample3, vec3(-0.148224, -0.290992, 0.43921)) + 0.501961, + dot(sample2, vec3(-0.148224, -0.290992, 0.43921)) + 0.501961, + dot(sample1, vec3(-0.148224, -0.290992, 0.43921)) + 0.501961, + dot(sample4, vec3(-0.148224, -0.290992, 0.43921)) + 0.501961); + } +] + +lazyshader 0 "moviev" [ + attribute vec4 vvertex; + @(screentexcoord 0) + uniform vec2 moviescale; + varying vec2 texcoord0, texcoord1, texcoord2, texcoord3; + void main(void) + { + gl_Position = vvertex; + texcoord0 = vtexcoord0 + vec2(-3.0, 0.0)*moviescale; + texcoord1 = vtexcoord0 + vec2(-1.0, 0.0)*moviescale; + texcoord2 = vtexcoord0 + vec2( 1.0, 0.0)*moviescale; + texcoord3 = vtexcoord0 + vec2( 3.0, 0.0)*moviescale; + } +] [ + varying vec2 texcoord0, texcoord1, texcoord2, texcoord3; + uniform sampler2D tex0; + void main(void) + { + vec3 sample1 = texture2D(tex0, texcoord0).rgb; + vec3 sample2 = texture2D(tex0, texcoord1).rgb; + vec3 sample3 = texture2D(tex0, texcoord2).rgb; + vec3 sample4 = texture2D(tex0, texcoord3).rgb; + gl_FragColor = vec4(dot(sample3, vec3(0.439216, -0.367788, -0.071427)) + 0.501961, + dot(sample2, vec3(0.439216, -0.367788, -0.071427)) + 0.501961, + dot(sample1, vec3(0.439216, -0.367788, -0.071427)) + 0.501961, + dot(sample4, vec3(0.439216, -0.367788, -0.071427)) + 0.501961); + } +] + +/////////////////////////////////////////////////// +// +// reflective/refractive water shaders: +// +/////////////////////////////////////////////////// + +watershader = [ + specular = $arg2 + rgbfog = $arg3 + distort = $arg4 + combine = $arg5 + lazyshader 0 $arg1 [ + attribute vec4 vvertex; + attribute vec3 vcolor; + uniform mat4 camprojmatrix; + uniform vec3 camera; + uniform mat4 watermatrix; + uniform float waterheight; + uniform float millis; + @(if $specular [result [uniform vec3 lightpos; varying vec3 lightdir;]]) + varying vec3 camdir, color; + varying vec4 texcoord0; + varying vec2 texcoord1, texcoord2; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + color = vcolor; + texcoord0 = watermatrix * vvertex; + @(if (>= (strstr $arg1 "underwater") 0) [result [ + texcoord0.z = waterheight - vvertex.z; + ]] [result [ + texcoord0.z = vvertex.z - waterheight; + ]]) + vec2 tc = vvertex.xy * 0.02; + texcoord1 = tc + millis*0.05; + texcoord2 = tc - millis*0.03; + camdir = camera - vvertex.xyz; + @(if $specular [result [ + lightdir = lightpos - vvertex.xyz; + ]]) + } + ] [ + @(if $rgbfog [result [ + //:fog + ]] [result [ + //:fogrgba vec4(vec3(0.0), 1.0) + ]]) + uniform vec2 depth; + @(if $specular [result [uniform vec3 lightcolor; uniform float lightradius; varying vec3 lightdir;]]) + varying vec3 camdir, color; + varying vec4 texcoord0; + varying vec2 texcoord1, texcoord2; + @(if (>= (strstr $arg1 "env") 0) [result [ + uniform samplerCube tex0; + ]] [result [ + uniform sampler2D tex0; + ]]) + uniform sampler2D tex1, tex2, tex3; + void main(void) + { + vec3 camvec = normalize(camdir); + @(if $specular [result [ + vec3 lightvec = normalize(lightdir); + vec3 halfangle = normalize(camvec + lightvec); + ]]) + + vec2 dudv = texture2D(tex2, texcoord1).xy*2.0 - 1.0; + + @distort + + @(if $specular [result [ + float spec = pow(clamp(dot(halfangle, bump), 0.0, 1.0), 96.0); + vec3 light = lightcolor * (1.0 - clamp(length(lightdir)/lightradius, 0.0, 1.0)); + ]]) + + @combine + } + ] +] + +watershader "waterglare" 1 1 [ + vec3 bump = texture2D(tex1, texcoord2 + 0.025*dudv).rgb*2.0 - 1.0; +] [ + gl_FragColor = vec4(light*spec*spec*32.0, 0.0); +] +lazyshader 0 "waterglarefast" [ + //:fog + attribute vec4 vvertex; + uniform mat4 camprojmatrix; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + } +] [ + void main(void) + { + gl_FragColor = vec4(0.0); + } +] +fastshader waterglare waterglarefast 2 +altshader waterglare waterglarefast + +lazyshader 0 "underwater" [ + attribute vec4 vvertex; + attribute vec3 vcolor; + uniform mat4 camprojmatrix; + varying vec3 color; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + color = vcolor; + } +] [ + //:fogrgba vec4(vec3(0.0), 1.0) + uniform vec2 depth; + varying vec3 color; + void main(void) + { + gl_FragColor.rgb = 0.8*depth.x*color; + gl_FragColor.a = 0.5*depth.y; + } +] + +watershader "underwaterrefract" 0 1 [ + dudv = texture2D(tex2, texcoord2 + 0.025*dudv).xy*2.0 - 1.0; + + gl_FragColor = texture2D(tex3, texcoord0.xy/texcoord0.w + 0.007*dudv); +] [] +watershader "underwaterrefractfast" 0 1 [ + gl_FragColor = texture2DProj(tex3, texcoord0 + vec4(0.3*dudv, 0.0, 0.0)); +] [] +fastshader underwaterrefract underwaterrefractfast 2 +altshader underwaterrefract underwaterrefractfast + +watershader "underwaterfade" 0 1 [ + dudv = texture2D(tex2, texcoord2 + 0.025*dudv).xy*2.0 - 1.0; + + vec2 projtc = texcoord0.xy/texcoord0.w; + float fade = texcoord0.z + 4.0*texture2D(tex3, projtc).a; + gl_FragColor.a = fade * clamp(gl_FragCoord.z, 0.0, 1.0); + gl_FragColor.rgb = texture2D(tex3, projtc + 0.007*dudv).rgb; +] [] +watershader "underwaterfadefast" 0 1 [ + gl_FragColor.rgb = texture2DProj(tex3, texcoord0 + vec4(0.3*dudv, 0.0, 0.0)).rgb; + gl_FragColor.a = texcoord0.z + 4.0*texture2DProj(tex3, texcoord0).a; +] [] +fastshader underwaterfade underwaterfadefast 2 +altshader underwaterfade underwaterfadefast + +watershader "water" 1 0 [ + vec3 bump = texture2D(tex1, texcoord2 + 0.025*dudv).rgb*2.0 - 1.0; +] [ + float invfresnel = clamp(dot(camvec, bump), 0.0, 1.0); + gl_FragColor.rgb = color*depth.x*mix(0.6, 1.0, invfresnel*0.5+0.5) + spec*light; + gl_FragColor.a = invfresnel*depth.y; +] +watershader "waterfast" 0 0 [ + vec3 bump = texture2D(tex1, texcoord2 + 0.025*dudv).rgb*2.0 - 1.0; +] [ + float invfresnel = clamp(dot(camvec, bump), 0.0, 1.0); + gl_FragColor.rgb = color*depth.x*mix(0.6, 1.0, invfresnel*0.5+0.5); + gl_FragColor.a = invfresnel*depth.y; +] +fastshader water waterfast 1 +altshader water waterfast + +watershader "waterreflect" 1 0 [ + vec3 reflect = texture2DProj(tex0, texcoord0 + vec4(0.3*dudv, 0.0, 0.0)).rgb; + vec3 bump = texture2D(tex1, texcoord2 + 0.025*dudv).rgb*2.0 - 1.0; +] [ + float invfresnel = clamp(dot(camvec, bump), 0.0, 1.0); + gl_FragColor.rgb = mix(reflect, color*depth.x, invfresnel*0.5+0.5) + spec*light; + gl_FragColor.a = invfresnel*depth.y; +] +watershader "waterreflectfast" 0 0 [ + vec3 reflect = texture2DProj(tex0, texcoord0 + vec4(0.3*dudv, 0.0, 0.0)).rgb; + vec3 bump = texture2D(tex1, texcoord2 + 0.025*dudv).rgb*2.0 - 1.0; +] [ + float invfresnel = clamp(dot(camvec, bump), 0.0, 1.0); + gl_FragColor.rgb = mix(reflect, color*depth.x, invfresnel*0.5+0.5); + gl_FragColor.a = invfresnel*depth.y; +] +fastshader waterreflect waterreflectfast 2 +altshader waterreflect waterreflectfast + +watershader "waterrefract" 1 1 [ + vec2 dtc = texcoord2 + 0.025*dudv; + vec3 bump = texture2D(tex1, dtc).rgb*2.0 - 1.0; + dudv = texture2D(tex2, dtc).xy*2.0 - 1.0; + + vec2 rtc = texcoord0.xy/texcoord0.w + 0.007*dudv; + vec3 reflect = texture2D(tex0, rtc).rgb; + vec3 refract = texture2D(tex3, rtc).rgb; +] [ + float invfresnel = clamp(dot(camvec, bump), 0.0, 1.0); + gl_FragColor = vec4(mix(reflect, refract, invfresnel*0.5+0.5) + spec*light, 0.0); +] +watershader "waterrefractfast" 0 1 [ + vec4 rtc = texcoord0 + vec4(0.3*dudv, 0.0, 0.0); + vec3 reflect = texture2DProj(tex0, rtc).rgb; + vec3 refract = texture2DProj(tex3, rtc).rgb; + vec3 bump = texture2D(tex1, texcoord2 + 0.025*dudv).rgb*2.0 - 1.0; +] [ + float invfresnel = clamp(dot(camvec, bump), 0.0, 1.0); + gl_FragColor = vec4(mix(reflect, refract, invfresnel*0.5+0.5), 0.0); +] +fastshader waterrefract waterrefractfast 2 +altshader waterrefract waterrefractfast + +watershader "waterfade" 1 1 [ + vec2 dtc = texcoord2 + 0.025*dudv; + vec3 bump = texture2D(tex1, dtc).rgb*2.0 - 1.0; + dudv = texture2D(tex2, dtc).xy*2.0 - 1.0; + + vec2 projtc = texcoord0.xy/texcoord0.w; + vec2 rtc = projtc + 0.007*dudv; + vec3 reflect = texture2D(tex0, rtc).rgb; + vec3 refract = texture2D(tex3, rtc).rgb; + float fade = texcoord0.z + 4.0*texture2D(tex3, projtc).a; + gl_FragColor.a = fade * clamp(gl_FragCoord.z, 0.0, 1.0); +] [ + float invfresnel = clamp(dot(camvec, bump), 0.0, 1.0); + gl_FragColor.rgb = mix(reflect, refract, invfresnel*0.5+0.5) + spec*light; +] +watershader "waterfadefast" 0 1 [ + vec4 rtc = texcoord0 + vec4(0.3*dudv, 0.0, 0.0); + vec3 reflect = texture2DProj(tex0, rtc).rgb; + vec3 refract = texture2DProj(tex3, rtc).rgb; + gl_FragColor.a = texcoord0.z + 4.0*texture2DProj(tex3, texcoord0).a; + vec3 bump = texture2D(tex1, texcoord2 + 0.025*dudv).rgb*2.0 - 1.0; +] [ + float invfresnel = clamp(dot(camvec, bump), 0.0, 1.0); + gl_FragColor.rgb = mix(reflect, refract, invfresnel*0.5+0.5); +] +fastshader waterfade waterfadefast 2 +altshader waterfade waterrefract + +watershader "waterenv" 1 0 [ + vec3 bump = texture2D(tex1, texcoord2 + 0.025*dudv).rgb*2.0 - 1.0; + float invfresnel = clamp(dot(camvec, bump), 0.0, 1.0); + vec3 reflect = textureCube(tex0, camvec - 2.0*invfresnel*bump).rgb; +] [ + gl_FragColor.rgb = mix(reflect, color*depth.x, invfresnel*0.5+0.5) + spec*light; + gl_FragColor.a = invfresnel*depth.y; +] +watershader "waterenvfast" 0 0 [ + vec3 bump = texture2D(tex1, texcoord2 + 0.025*dudv).rgb*2.0 - 1.0; + float invfresnel = clamp(dot(camvec, bump), 0.0, 1.0); + vec3 reflect = textureCube(tex0, camvec - 2.0*invfresnel*bump).rgb; +] [ + gl_FragColor.rgb = mix(reflect, color*depth.x, invfresnel*0.5+0.5); + gl_FragColor.a = invfresnel*depth.y; +] +fastshader waterenv waterenvfast 2 +altshader waterenv waterenvfast + +watershader "waterenvrefract" 1 1 [ + vec2 dtc = texcoord2 + 0.025*dudv; + vec3 bump = texture2D(tex1, dtc).rgb*2.0 - 1.0; + dudv = texture2D(tex2, dtc).xy*2.0 - 1.0; + + vec3 refract = texture2D(tex3, texcoord0.xy/texcoord0.w + 0.007*dudv).rgb; + float invfresnel = clamp(dot(camvec, bump), 0.0, 1.0); + vec3 reflect = textureCube(tex0, camvec - 2.0*invfresnel*bump).rgb; +] [ + gl_FragColor = vec4(mix(reflect, refract, invfresnel*0.5+0.5) + spec*light, 0.0); +] +watershader "waterenvrefractfast" 0 1 [ + vec3 refract = texture2DProj(tex3, texcoord0 + vec4(0.3*dudv, 0.0, 0.0)).rgb; + vec3 bump = texture2D(tex1, texcoord2 + 0.025*dudv).rgb*2.0 - 1.0; + float invfresnel = clamp(dot(camvec, bump), 0.0, 1.0); + vec3 reflect = textureCube(tex0, camvec - 2.0*invfresnel*bump).rgb; +] [ + gl_FragColor = vec4(mix(reflect, refract, invfresnel*0.5+0.5), 0.0); +] +fastshader waterenvrefract waterenvrefractfast 2 +altshader waterenvrefract waterenvrefractfast + +watershader "waterenvfade" 1 1 [ + vec2 dtc = texcoord2 + 0.025*dudv; + vec3 bump = texture2D(tex1, dtc).rgb*2.0 - 1.0; + dudv = texture2D(tex2, dtc).xy*2.0 - 1.0; + + vec2 projtc = texcoord0.xy/texcoord0.w; + vec3 refract = texture2D(tex3, projtc + 0.007*dudv).rgb; + float fade = texcoord0.z + 4.0*texture2D(tex3, projtc).a; + gl_FragColor.a = fade * clamp(gl_FragCoord.z, 0.0, 1.0); + + float invfresnel = clamp(dot(camvec, bump), 0.0, 1.0); + vec3 reflect = textureCube(tex0, camvec - 2.0*invfresnel*bump).rgb; +] [ + gl_FragColor.rgb = mix(reflect, refract, invfresnel*0.5+0.5) + spec*light; +] +watershader "waterenvfadefast" 0 1 [ + vec3 refract = texture2DProj(tex3, texcoord0 + vec4(0.3*dudv, 0.0, 0.0)).rgb; + gl_FragColor.a = texcoord0.z + 4.0*texture2DProj(tex3, texcoord0).a; + vec3 bump = texture2D(tex1, texcoord2 + 0.025*dudv).rgb*2.0 - 1.0; + float invfresnel = clamp(dot(camvec, bump), 0.0, 1.0); + vec3 reflect = textureCube(tex0, camvec - 2.0*invfresnel*bump).rgb; +] [ + gl_FragColor.rgb = mix(reflect, refract, invfresnel*0.5+0.5); +] +fastshader waterenvfade waterenvfadefast 2 +altshader waterenvfade waterenvrefract + +causticshader = [ + lazyshader 0 $arg1 [ + attribute vec4 vvertex; + uniform mat4 camprojmatrix; + uniform vec3 texgenS, texgenT; + varying vec2 texcoord0; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + texcoord0 = vec2(dot(texgenS, vvertex.xyz), dot(texgenT, vvertex.xyz)); + } + ] [ + //:fog vec3(1.0) + uniform vec4 frameblend; + varying vec2 texcoord0; + uniform sampler2D tex0, tex1; + void main(void) + { + @arg2 + } + ] +] +causticshader caustic [ + gl_FragColor = vec4(vec3(frameblend.x*texture2D(tex0, texcoord0).r + frameblend.y*texture2D(tex1, texcoord0).r + frameblend.w), 1.0); +] + +lazyshader 0 "lava" [ + //:fog + attribute vec4 vvertex, vcolor; + attribute vec3 vnormal; + uniform mat4 camprojmatrix; + varying vec4 color; + uniform vec4 lavatexgen; + varying vec2 texcoord0; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + color = vcolor; + vec2 tc = mix(vvertex.xz, vvertex.yy, abs(vnormal.xz)); + texcoord0 = (tc + lavatexgen.zw) * lavatexgen.xy; + } +] [ + uniform sampler2D tex0; + varying vec4 color; + varying vec2 texcoord0; + void main(void) + { + gl_FragColor = color * texture2D(tex0, texcoord0) * 2.0; + } +] + +lazyshader 0 "lavaglare" [ + //:fog + attribute vec4 vvertex, vcolor; + attribute vec3 vnormal; + uniform mat4 camprojmatrix; + varying vec4 color; + uniform vec4 lavatexgen; + varying vec2 texcoord0; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + color = vec4(vcolor.rgb*2.0 - 1.0, vcolor.a); + vec2 tc = mix(vvertex.xz, vvertex.yy, abs(vnormal.xz)); + texcoord0 = (tc + lavatexgen.zw) * lavatexgen.xy; + } +] [ + uniform sampler2D tex0; + varying vec4 color; + varying vec2 texcoord0; + void main(void) + { + vec4 glow = texture2D(tex0, texcoord0) * color; + float k = max(glow.r, max(glow.g, glow.b)); + gl_FragColor = glow*k*k*32.0; + } +] + +lazyshader 0 "waterfall" [ + //:fog + attribute vec4 vvertex, vcolor; + attribute vec3 vnormal; + uniform mat4 camprojmatrix; + varying vec4 color; + uniform vec4 waterfalltexgen; + varying vec2 texcoord0; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + color = vcolor; + vec2 tc = mix(vvertex.xz, vvertex.yy, abs(vnormal.xz)); + texcoord0 = (tc + waterfalltexgen.zw) * waterfalltexgen.xy; + } +] [ + uniform sampler2D tex0; + varying vec4 color; + varying vec2 texcoord0; + void main(void) + { + gl_FragColor = color * texture2D(tex0, texcoord0); + } +] + +lazyshader 0 "waterfallrefract" [ + //:fog + attribute vec4 vvertex, vcolor; + attribute vec3 vnormal; + uniform mat4 camprojmatrix; + uniform mat4 watermatrix; + varying vec4 color; + uniform vec4 waterfalltexgen; + varying vec2 texcoord0; + varying vec4 texcoord1; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + color = vcolor; + vec2 tc = mix(vvertex.xz, vvertex.yy, abs(vnormal.xz)); + texcoord0 = (tc + waterfalltexgen.zw) * waterfalltexgen.xy; + texcoord1 = watermatrix * vvertex; + } +] [ + uniform vec2 dudvoffset; + uniform sampler2D tex0, tex2, tex4; + varying vec4 color; + varying vec2 texcoord0; + varying vec4 texcoord1; + void main(void) + { + vec4 diffuse = texture2D(tex0, texcoord0); + vec2 dudv = texture2D(tex2, texcoord0 + 0.2*diffuse.xy + dudvoffset).xy; + vec4 refract = texture2DProj(tex4, texcoord1 + vec4(4.0*dudv, 0.0, 0.0)); + gl_FragColor = mix(refract, color, diffuse); + } +] + +lazyshader 0 "waterfallenvrefract" [ + //:fog + attribute vec4 vvertex, vcolor; + attribute vec3 vnormal; + uniform mat4 camprojmatrix; + uniform mat4 watermatrix; + uniform vec3 camera; + varying vec4 color; + uniform vec4 waterfalltexgen; + varying vec2 texcoord0; + varying vec4 texcoord1; + varying vec3 camdir; + varying mat3 world; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + color = vcolor; + camdir = camera - vvertex.xyz; + vec3 absnorm = abs(vnormal); + world = mat3(absnorm.yzx, -absnorm.zxy, vnormal); + vec2 tc = mix(vvertex.xz, vvertex.yy, absnorm.xz); + texcoord0 = (tc + waterfalltexgen.zw) * waterfalltexgen.xy; + texcoord1 = watermatrix * vvertex; + } +] [ + uniform vec2 dudvoffset; + uniform sampler2D tex0, tex1, tex2, tex4; + uniform samplerCube tex3; + varying vec4 color; + varying vec2 texcoord0; + varying vec4 texcoord1; + varying vec3 camdir; + varying mat3 world; + void main(void) + { + vec4 diffuse = texture2D(tex0, texcoord0); + vec2 dudv = texture2D(tex2, texcoord0 + 0.2*diffuse.xy + dudvoffset).xy; + vec3 normal = world * (texture2D(tex1, texcoord0 + 0.1*dudv).rgb*2.0 - 1.0); + vec4 refract = texture2DProj(tex4, texcoord1 + vec4(4.0*dudv, 0.0, 0.0)); + vec3 camvec = normalize(camdir); + float invfresnel = dot(normal, camvec); + vec4 reflect = textureCube(tex3, 2.0*invfresnel*normal - camvec); + gl_FragColor = mix(mix(reflect, refract, 1.0 - 0.4*step(0.0, invfresnel)), color, diffuse); + } +] +altshader waterfallenvrefract waterfallrefract + +lazyshader 0 "waterfallenv" [ + //:fog + attribute vec4 vvertex; + attribute vec3 vcolor, vnormal; + uniform mat4 camprojmatrix; + uniform vec3 camera; + uniform vec4 waterfalltexgen; + varying vec2 texcoord0; + varying vec3 color, camdir; + varying mat3 world; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + color = vcolor; + camdir = camera - vvertex.xyz; + vec3 absnorm = abs(vnormal); + world = mat3(absnorm.yzx, -absnorm.zxy, vnormal); + vec2 tc = mix(vvertex.xz, vvertex.yy, absnorm.xz); + texcoord0 = (tc + waterfalltexgen.zw) * waterfalltexgen.xy; + } +] [ + uniform vec2 dudvoffset; + uniform sampler2D tex0, tex1, tex2; + uniform samplerCube tex3; + varying vec2 texcoord0; + varying vec3 color, camdir; + varying mat3 world; + void main(void) + { + vec4 diffuse = texture2D(tex0, texcoord0); + vec2 dudv = texture2D(tex2, texcoord0 + 0.2*diffuse.xy + dudvoffset).xy; + vec3 normal = world * (texture2D(tex1, texcoord0 + 0.1*dudv).rgb*2.0 - 1.0); + vec3 camvec = normalize(camdir); + vec4 reflect = textureCube(tex3, 2.0*dot(normal, camvec)*normal - camvec); + gl_FragColor.rgb = mix(reflect.rgb, color, diffuse.rgb); + gl_FragColor.a = 0.25 + 0.75*diffuse.r; + } +] + +lazyshader 0 "glass" [ + attribute vec4 vvertex; + attribute vec3 vcolor, vnormal; + uniform mat4 camprojmatrix; + uniform vec3 camera; + varying vec3 color, rvec, camdir, normal; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + color = vcolor; + normal = vnormal; + camdir = camera - vvertex.xyz; + rvec = 2.0*dot(camdir, vnormal) * vnormal - camdir; + } +] [ + //:fogrgba vec4(vec3(0.0), 1.0) + uniform samplerCube tex0; + varying vec3 color, rvec, camdir, normal; + void main(void) + { + vec3 camvec = normalize(camdir); + vec3 reflect = textureCube(tex0, rvec).rgb; + + float invfresnel = max(dot(camvec, normal), 0.70); + gl_FragColor.rgb = mix(reflect, color*0.05, invfresnel); + gl_FragColor.a = invfresnel * 0.95; + } +] +lazyshader 0 "glassfast" [ + attribute vec4 vvertex; + attribute vec3 vcolor, vnormal; + uniform mat4 camprojmatrix; + uniform vec3 camera; + varying vec3 color, rvec; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + color = vcolor; + vec3 camdir = camera - vvertex.xyz; + rvec = 2.0*dot(camdir, vnormal) * vnormal - camdir; + } +] [ + //:fogrgba vec4(vec3(0.0), 1.0) + uniform samplerCube tex0; + varying vec3 color, rvec; + void main(void) + { + vec3 reflect = textureCube(tex0, rvec).rgb; + const float invfresnel = 0.75; + gl_FragColor.rgb = mix(reflect, color*0.05, invfresnel); + gl_FragColor.a = invfresnel * 0.95; + } +] +fastshader glass glassfast 2 +altshader glass glassfast + +lazyshader 0 "grass" [ + attribute vec4 vvertex, vcolor; + attribute vec2 vtexcoord0, vtexcoord1; + attribute vec4 vtangent; + uniform mat4 camprojmatrix; + uniform vec3 camera; + uniform vec3 grassmargin; + varying vec4 color; + varying vec2 texcoord0, texcoord1; + varying vec2 bounds; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + color = vcolor; + texcoord0 = vtexcoord0; + texcoord1 = vtexcoord1 * @lmcoordscale; + vec2 camdir = (camera.xy - vvertex.xy) * grassmargin.y; + bounds = vec2(dot(camdir, vtangent.xy), dot(camdir, vtangent.zw)) + grassmargin.z; + } +] [ + //:fogrgba vec4(0.0) + varying vec4 color; + varying vec2 texcoord0, texcoord1; + varying vec2 bounds; + uniform sampler2D tex0, tex1; + void main(void) + { + vec4 diffuse = texture2D(tex0, texcoord0); + diffuse.rgb *= 2.0; + vec4 lm = texture2D(tex1, texcoord1) * color; + lm.rgb *= lm.a; + float margin = clamp(min(bounds.x, bounds.y), 0.0, 1.0); + gl_FragColor = diffuse * lm * margin; + } +] + +shader 0 "overbrightdecal" [ + attribute vec4 vvertex, vcolor; + attribute vec2 vtexcoord0; + uniform mat4 camprojmatrix; + varying vec4 color; + varying vec2 texcoord0; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + color = vcolor; + texcoord0 = vtexcoord0; + } +] [ + //:fog vec3(0.5) + varying vec4 color; + varying vec2 texcoord0; + uniform sampler2D tex0; + void main(void) + { + vec4 diffuse = texture2D(tex0, texcoord0); + gl_FragColor = mix(color, diffuse, color.a); + } +] + +shader 0 "saturatedecal" [ + //:fog + attribute vec4 vvertex, vcolor; + attribute vec2 vtexcoord0; + uniform mat4 camprojmatrix; + varying vec4 color; + varying vec2 texcoord0; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + color = vcolor; + texcoord0 = vtexcoord0; + } +] [ + varying vec4 color; + varying vec2 texcoord0; + uniform sampler2D tex0; + void main(void) + { + vec4 diffuse = texture2D(tex0, texcoord0); + diffuse.rgb *= 2.0; + gl_FragColor = diffuse * color; + } +] + +shader 0 "skybox" [ + attribute vec4 vvertex, vcolor; + attribute vec2 vtexcoord0; + uniform mat4 skymatrix; + varying vec2 texcoord0; + varying vec4 color; + void main(void) + { + gl_Position = skymatrix * vvertex; + texcoord0 = vtexcoord0; + color = vcolor; + } +] [ + varying vec2 texcoord0; + varying vec4 color; + uniform sampler2D tex0; + void main(void) + { + gl_FragColor = color * texture2D(tex0, texcoord0); + } +] + +shader 0 "skyboxglare" [ + attribute vec4 vvertex, vcolor; + attribute vec2 vtexcoord0; + uniform mat4 skymatrix; + varying vec4 color; + varying vec2 texcoord0; + void main(void) + { + gl_Position = skymatrix * vvertex; + color = vcolor; + texcoord0 = vtexcoord0; + } +] [ + varying vec4 color; + varying vec2 texcoord0; + uniform sampler2D tex0; + void main(void) + { + vec4 glare = texture2D(tex0, texcoord0) * color; + gl_FragColor.rgb = vec3(dot(glare.rgb, vec3(10.56, 10.88, 10.56)) - 30.4); + gl_FragColor.a = glare.a; + } +] + +shader 0 "skyfog" [ + attribute vec4 vvertex, vcolor; + uniform mat4 skymatrix; + varying vec4 color; + void main(void) + { + gl_Position = skymatrix * vvertex; + color = vcolor; + } +] [ + varying vec4 color; + void main(void) + { + gl_FragColor = color; + } +] + +loop i 2 [ + lazyshader 0 (? $i "atmosphereglare" "atmosphere") [ + attribute vec4 vvertex; + uniform mat4 skymatrix; + varying vec3 camvec; + void main(void) + { + gl_Position = skymatrix * vvertex; + + camvec = vvertex.xyz; + } + ] [ + uniform vec4 sunlight; + uniform vec3 sundir; + uniform vec3 sunweight; + uniform vec3 sundiskcolor; + uniform vec2 sundiskparams; + uniform vec4 opticaldepthparams; + uniform vec3 mieparams; + uniform vec3 betarayleigh, betamie, betaozone; + varying vec3 camvec; + + void main(void) + { + vec3 camdir = normalize(camvec); + float costheta = dot(camdir, sundir); + + // sun disk + float edgeoffset = max(1.0 - (1.0 - max(costheta, 0.0)*costheta)*sundiskparams.x, 0.0); + // limb darken with distance to edge + float limbdarken = sqrt(edgeoffset); + // lighten edges for corona, but limit it to not interfere with limb darkening + float corona = min(edgeoffset * sundiskparams.y, 1.0); + corona = max(0.75 / (1.5 - corona * corona) - 0.5, 0.0); + // apply limb darkening and corona to clamped sunlight color + vec3 sundisk = sundiskcolor * limbdarken * corona; + + // optical depth along view ray + float offset = camdir.z*opticaldepthparams.w; + vec3 depth = sqrt(offset*offset + opticaldepthparams.xyz) - offset; + vec3 rayleighweight = betarayleigh * depth.x; + vec3 mieweight = betamie * depth.y; + vec3 ozoneweight = betaozone * (depth.z - depth.x); + + // extinction of light along view ray + vec3 viewweight = sunweight - (rayleighweight + mieweight + ozoneweight); + vec3 extinction = (exp2(viewweight) - 1.0) / viewweight; + + @(? $i [ + // only glare sundisk, excluding other scattering + // squared (by skipping gamma encode) to limit it + gl_FragColor = vec4(sundisk * extinction, sunlight.a); + ] [ + // calculate in-scattering + float rphase = (1.5 + 0.5*costheta*costheta) * (3.0 / (16.0 * 3.14159265)); + float mphase = inversesqrt(mieparams.x + mieparams.y*min(costheta, mieparams.z)); + vec3 scatter = rayleighweight * rphase + mieweight * (mphase * mphase * mphase); + + // combine scattering and extinction with sundisk + vec3 inscatter = (sunlight.rgb * scatter + sundisk) * extinction; + + // gamma encode + gl_FragColor = vec4(sqrt(inscatter), sunlight.a); + ]) + } + ] +] + diff --git a/data/guicursor.png b/data/guicursor.png new file mode 100644 index 0000000..b392f2f Binary files /dev/null and b/data/guicursor.png differ diff --git a/data/guioverlay.png b/data/guioverlay.png new file mode 100755 index 0000000..d694cad Binary files /dev/null and b/data/guioverlay.png differ diff --git a/data/guiskin.png b/data/guiskin.png new file mode 100644 index 0000000..3ff0052 Binary files /dev/null and b/data/guiskin.png differ diff --git a/data/guislider.png b/data/guislider.png new file mode 100755 index 0000000..14cf7bc Binary files /dev/null and b/data/guislider.png differ diff --git a/data/heightmap.cfg b/data/heightmap.cfg new file mode 100644 index 0000000..1bb72fb --- /dev/null +++ b/data/heightmap.cfg @@ -0,0 +1,138 @@ +// this config defines various heightmap brushes + +// a brush has two parts: the brushmap and the brushhandle + +// the brushmap is a 2D field that defines how the brush affects a heightmap + +// the brushhandle is a 2D vertex on the brushmap. +// this handle is a reference point on the brushmap which represents +// where the editing cursor is pointed at. + +// clearbrush : resets the brushmap +// brushvert : set a point on the brushmap +// brushx : the x coordinate of the brushhandle +// brushy : the y coordinate of the brushhandle + +brushhandle = [ + brushx $arg1 + brushy $arg2 +] + +brushindex = -1 +brushmax = -1 // make sure to bump this up if you add more brushes + +selectbrush = [ + brushindex = ( + $brushindex $arg1 ) + if (< $brushindex 0) [ brushindex = $brushmax ] + if (> $brushindex $brushmax) [ brushindex = 0 ] + do [brush_@brushindex] + echo "heightmap brush set to:" $brushname +] + +brushverts = [ + loop y (listlen $arg1) [ + bv = (at $arg1 $y) + loop x (listlen $bv) [ + brushvert $x $y (at $bv $x) + ] + ] +] + +newbrush = [ + brushmax = (+ $brushmax 1) + do [ + brush_@brushmax = [ + brushname = [@@@arg1] + clearbrush + @@(if (> $numargs 1) [result [brushhandle @arg2 @arg3; brushverts [@@arg4]]]) + ] + ] +] + +newbrush "Circle 1-0" 0 0 [1] +newbrush "Circle 2-1" 2 2 [ + "" + "0 0 1 " + "0 1 2 1 " + "0 0 1 " +] +newbrush "Circle 4-2-1" 2 2 [ + "0 0 1 " + "0 1 2 1 " + "1 2 4 2 1 " + "0 1 2 1 " + "0 0 1 " +] +newbrush "Square 3x3" 1 1 [ + "1 1 1 " + "1 1 1 " + "1 1 1 " +] +newbrush "Square 5x5" 2 2 [ + "1 1 1 1 1 " + "1 1 1 1 1 " + "1 1 1 1 1 " + "1 1 1 1 1 " + "1 1 1 1 1 " +] +newbrush "Square 7x7" 3 3 [ + "1 1 1 1 1 1 1 " + "1 1 1 1 1 1 1 " + "1 1 1 1 1 1 1 " + "1 1 1 1 1 1 1 " + "1 1 1 1 1 1 1 " + "1 1 1 1 1 1 1 " + "1 1 1 1 1 1 1 " +] + +newbrush "Smooth 3x3" 1 1 [ + "0 0 0 " + "0 " + "0 " +] +newbrush "Smooth 5x5" 2 2 [ + "0 0 0 0 0 " + "0 " + "0 " + "0 " + "0 " +] +newbrush "Smooth 7x7" 3 3 [ + "0 0 0 0 0 0 0" + "0 " + "0 " + "0 " + "0 " + "0 " + "0 " +] + +newbrush "Noise 25x25" 12 12 [ + "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 " + "" + "0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 1 " + "0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 0 1 0 0 1 0 0 2 2 " + "0 0 0 0 1 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 " + "0 0 0 0 0 1 0 0 0 0 0 2 0 0 0 0 1 0 0 0 1 1 0 0 1 " + "0 0 1 0 0 0 1 0 1 1 0 0 0 0 1 0 0 1 0 0 0 0 2 " + "0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 2 " + "0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 1 1 " + "0 0 0 0 1 1 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 1 " + "0 1 0 2 0 1 1 1 1 0 0 1 0 0 0 0 1 " + "0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 " + "1 0 1 0 0 0 0 0 1 0 0 0 1 0 1 " + "0 0 0 0 0 0 0 1 1 0 1 1 0 0 1 0 0 1 0 0 0 0 1 0 0 1 " + "0 1 1 1 0 3 0 2 0 0 0 1 1 0 0 0 1 1 " + "0 0 1 0 0 1 0 0 1 0 1 1 0 1 0 0 0 0 0 1 " + "0 0 1 1 0 0 0 0 2 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 1 " + "0 1 1 0 1 0 0 1 0 0 0 0 0 1 0 0 1 1 0 0 0 0 1 " + "1 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 1 0 1 " + "0 0 0 1 0 0 1 0 1 1 0 0 0 0 0 0 0 1 " + "0 0 0 0 0 0 1 1 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 1 " + "0 0 0 0 1 0 1 1 0 2 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 " + "0 0 0 0 0 0 0 0 0 1 0 1 " + "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 " +] + +do [ brush_2 ] // 421 + diff --git a/data/hit.png b/data/hit.png new file mode 100644 index 0000000..3f590d8 Binary files /dev/null and b/data/hit.png differ diff --git a/data/keymap.cfg b/data/keymap.cfg new file mode 100644 index 0000000..83e183b --- /dev/null +++ b/data/keymap.cfg @@ -0,0 +1,133 @@ +// do not modify, use "bind" in autoexec.cfg instead + +keymap -1 MOUSE1 +keymap -3 MOUSE2 +keymap -2 MOUSE3 +keymap -4 MOUSE4 +keymap -5 MOUSE5 +keymap -6 MOUSE6 +keymap -7 MOUSE7 +keymap 8 BACKSPACE +keymap 9 TAB +keymap 13 RETURN +keymap 27 ESCAPE +keymap 32 SPACE +keymap 33 EXCLAIM +keymap 34 QUOTEDBL +keymap 35 HASH +keymap 36 DOLLAR +keymap 38 AMPERSAND +keymap 39 QUOTE +keymap 40 LEFTPAREN +keymap 41 RIGHTPAREN +keymap 42 ASTERISK +keymap 43 PLUS +keymap 44 COMMA +keymap 45 MINUS +keymap 46 PERIOD +keymap 47 SLASH +keymap 48 0 +keymap 49 1 +keymap 50 2 +keymap 51 3 +keymap 52 4 +keymap 53 5 +keymap 54 6 +keymap 55 7 +keymap 56 8 +keymap 57 9 +keymap 58 COLON +keymap 59 SEMICOLON +keymap 60 LESS +keymap 61 EQUALS +keymap 62 GREATER +keymap 63 QUESTION +keymap 64 AT +keymap 91 LEFTBRACKET +keymap 92 BACKSLASH +keymap 93 RIGHTBRACKET +keymap 94 CARET +keymap 95 UNDERSCORE +keymap 96 BACKQUOTE +keymap 97 A +keymap 98 B +keymap 99 C +keymap 100 D +keymap 101 E +keymap 102 F +keymap 103 G +keymap 104 H +keymap 105 I +keymap 106 J +keymap 107 K +keymap 108 L +keymap 109 M +keymap 110 N +keymap 111 O +keymap 112 P +keymap 113 Q +keymap 114 R +keymap 115 S +keymap 116 T +keymap 117 U +keymap 118 V +keymap 119 W +keymap 120 X +keymap 121 Y +keymap 122 Z +keymap 127 DELETE +keymap 0x40000059 KP1 +keymap 0x4000005a KP2 +keymap 0x4000005b KP3 +keymap 0x4000005c KP4 +keymap 0x4000005d KP5 +keymap 0x4000005e KP6 +keymap 0x4000005f KP7 +keymap 0x40000060 KP8 +keymap 0x40000061 KP9 +keymap 0x40000062 KP0 +keymap 0x40000063 KP_PERIOD +keymap 0x40000054 KP_DIVIDE +keymap 0x40000055 KP_MULTIPLY +keymap 0x40000056 KP_MINUS +keymap 0x40000057 KP_PLUS +keymap 0x40000058 KP_ENTER +keymap 0x40000067 KP_EQUALS +keymap 0x40000052 UP +keymap 0x40000051 DOWN +keymap 0x4000004f RIGHT +keymap 0x40000050 LEFT +keymap 0x40000048 PAUSE +keymap 0x40000049 INSERT +keymap 0x4000004a HOME +keymap 0x4000004d END +keymap 0x4000004b PAGEUP +keymap 0x4000004e PAGEDOWN +keymap 0x4000003a F1 +keymap 0x4000003b F2 +keymap 0x4000003c F3 +keymap 0x4000003d F4 +keymap 0x4000003e F5 +keymap 0x4000003f F6 +keymap 0x40000040 F7 +keymap 0x40000041 F8 +keymap 0x40000042 F9 +keymap 0x40000043 F10 +keymap 0x40000044 F11 +keymap 0x40000045 F12 +keymap 0x40000053 NUMLOCK +keymap 0x40000039 CAPSLOCK +keymap 0x40000047 SCROLLOCK +keymap 0x400000e5 RSHIFT +keymap 0x400000e1 LSHIFT +keymap 0x400000e4 RCTRL +keymap 0x400000e0 LCTRL +keymap 0x400000e6 RALT +keymap 0x400000e2 LALT +keymap 0x400000e7 RMETA +keymap 0x400000e3 LMETA +keymap 0x40000065 COMPOSE +keymap 0x40000075 HELP +keymap 0x40000046 PRINT +keymap 0x4000009a SYSREQ +keymap 0x40000076 MENU diff --git a/data/leftdown.png b/data/leftdown.png new file mode 100644 index 0000000..fc9a32d Binary files /dev/null and b/data/leftdown.png differ diff --git a/data/license.txt b/data/license.txt new file mode 100644 index 0000000..067da9f --- /dev/null +++ b/data/license.txt @@ -0,0 +1,11 @@ +These files: + +guioverlay.png +guiskin.png +guislider.png + +have been licensed under the + +"Creative Commons Deed / Attribution Non-commercial Share-Alike ( at-nc-sa )" + +(c) 2006-2007 Markus "makkE" Bekel diff --git a/data/loading_bar.png b/data/loading_bar.png new file mode 100755 index 0000000..e9d4626 Binary files /dev/null and b/data/loading_bar.png differ diff --git a/data/loading_frame.png b/data/loading_frame.png new file mode 100755 index 0000000..2a3bfc1 Binary files /dev/null and b/data/loading_frame.png differ diff --git a/data/logo.png b/data/logo.png new file mode 100755 index 0000000..b3cab10 Binary files /dev/null and b/data/logo.png differ diff --git a/data/logo_1024.png b/data/logo_1024.png new file mode 100755 index 0000000..36dce0c Binary files /dev/null and b/data/logo_1024.png differ diff --git a/data/mapshot_frame.png b/data/mapshot_frame.png new file mode 100755 index 0000000..bf69dba Binary files /dev/null and b/data/mapshot_frame.png differ diff --git a/data/menus.cfg b/data/menus.cfg new file mode 100644 index 0000000..7fbdf38 --- /dev/null +++ b/data/menus.cfg @@ -0,0 +1,2020 @@ +// standard menu definitions +// don't modify, add personal menus to autoexec.cfg instead + +// Only for testing. This will break stuff, delete config.cfg after use. +reui = [exec data/menus.cfg; echo "Menus Reinitialized"] + +togglemainmenu = [ + || (cleartexgui) [cleargui 1] [showgui main] +] + +bind ESCAPE [togglemainmenu] + +checkrolloveraction = [ + if (>= (strstr $guirolloveraction $arg1) 0) [ + if (>= $numargs 2) [arg2] [result $guirolloveraction] + ] +] + +chooseplayermodel = [guirolloveraction = (playermodelbutton $playermodel); showgui playermodel] + +newgui main [ + guilist [ + guiimage (concatword "packages/icons/" (playermodelicon) ".jpg") [chooseplayermodel] 1.15 + guistrut 0.25 + guilist [ + newname = (getname) + guifield newname 15 [name $newname] + guispring + guilist [ + guibutton (playermodelname) [chooseplayermodel] 0 + guistrut 1 + guiimage (getcrosshair) [showgui crosshair] 0.5 + ] + ] + ] + guibar + guibutton "server browser.." "showgui servers" + if (isconnected) [ + guibar + if (|| $editing (m_edit (getmode))) [ + guibutton "editing.." "showgui editing" + ] + guibutton "vote game mode / map.." "showgui gamemode" + // guibutton "lanconnect" + // guibutton "connect localhost" + guibutton "switch team" [if (strcmp (getteam) "good") [team evil] [team good]] + guibutton "toggle spectator" [spectator (! (isspectator (getclientnum)))] "spectator" + guibutton "master.." [showgui master] + guibar + guibutton "options.." "showgui options" + guibutton "disconnect" "disconnect" "exit" + ] [ + guibutton "bot match.." "showgui botmatch" + guibutton "campaign.." "showgui campaign" + guibar + guibutton "options.." "showgui options" + guibutton "about.." "showgui about" + guibutton "quit" "quit" "exit" + ] +] 0 + +newgui about [ + guitext "Cube 2: Sauerbraten" 0 + guitext [by Wouter "Aardappel" van Oortmerssen, Lee "eihrul" Salzman,] 0 + guitext [Mike "Gilt" Dysart, Robert "baby-rabbit" Pointon,] 0 + guitext [John "geartrooper" Siar, Quinton "Quin" Reeves, and others] 0 + guitext "(for a full list of contributors see the readme)" 0 + guitext "http://sauerbraten.org/" 0 +] + +genmapitems = [ + looplist curmap $arg1 [ + guibutton $curmap (concat map $curmap) "cube" + ] +] +//17 + +ffamaps1 = "aard3c abyss academy access albatross akaritori akimiski alithia alloy antel anubis aod aqueducts arbana asenatra asthma averas" +ffamaps2 = "awoken bvdm_01 carbide cartel castle_trap catacombs cavefire church51 clash collusion colony complex conflict corruption crypta curvedm curvy_castle" +ffamaps3 = "darkdeath deathtek depot dirtndust dispute DM_BS1 dock dopamine douze duel5 duel7 duel8 dune elegy exist exo fallen" +ffamaps4 = "fanatic_quake fdm6 ferguson force frag-lab frag2 fragplaza frostbyte frozen fubuki fury ghetto gorge gothic-df guacamole gubo hades" +ffamaps5 = "hashi hator haze hdm3 headroom helligsted hektik hillfort hog2 horus idyll3 imhotep industry infernal injustice insipid island" +ffamaps6 = "janela justice kalking1 kastro katrez_d kffa killfactory kmap5 konkuri-to ksauer1 legacy legazzo lost_soul lost_world lostinspace maple masdm" +ffamaps7 = "mbt2 mbt9 mbt10 memento memoria metl2 metl3 metl4 mood moonlite neondevastation neonpanic nessus nmp8 nmp10 nucleus oasis" +ffamaps8 = "oddworld ognjen ogrosupply oldschool orbe orion osiris ot outpost paradigm pariah park pgdm phosgene phrantic pitch_black powerplant" +ffamaps9 = "purgatory refuge renegade rm1 rm5 roughinery ruby ruine saffier sandstorm sauerowalk sauerstruck sdm1 shadowed shindou shinmei1 shiva" +ffamaps10 = "simplicity skrdm1 skycastle-r slingshot souls spcr2 stahlbox stemple stronghold suburb suisei tartech teahupoo tejen thetowers thor torment" +ffamaps11 = "toxicity tumwalk turbine turmoil unworld unworld2 ventania waltz wake5 wdcd zamak zavial zdm2 ztn" +capturemaps1 = "aastha abbey access akimiski akroseum alithia anubis aod arabic asenatra asgard asteroids averas bklyn c_egypt c_lone c_valley" +capturemaps2 = "campo capture_night caribbean casa collide collusion core_refuge core_transfer corruption croma cwcastle damnation destiny dirtndust disc disruption donya" +capturemaps3 = "duomo dust2 earthstation eris eternal_valley evilness face-capture fallen fb_capture fc3 fc4 fc5 forge fragnostic frostbyte fusion genesis" +capturemaps4 = "ghetto gorge gothic-df hades hallo harbor haste hidden imhotep infamy infernal killcore3 kopenhagen laucin lostinspace luna mbt12" +capturemaps5 = "mc-lab meltdown2 mercury metro monastery nevil_c new_energy nitro nmp4 nmp9 nucleus ogrosupply overdrive ow pandora paradigm pariah" +capturemaps6 = "ph-capture pul1ctf reissen relic risk river_c river_keep ruby ruebli rust serenity skycastle-r snapper_rocks spcr stadium stronghold subterra" +capturemaps7 = "suburb surge tempest tortuga triforts turbulence turmoil twinforts urban_c valhalla venice waltz xenon zamak" +ctfmaps1 = "aastha abbey akimiski akroseum arbana asgard authentic autumn bad_moon berlin_wall bklyn breakout bt_falls campo capture_night casa catch22" +ctfmaps2 = "collide core_refuge core_transfer croma ctf_suite daemex damnation desecration destiny disc disruption divine duomo dust2 earthsea earthstation enigma" +ctfmaps3 = "eris eternal_valley europium evilness face-capture fire_keep flagstone forge forgotten fortress fragnostic fusion garden hallo harbor haste hidden" +ctfmaps4 = "idris infamy kiryu kopenhagen l_ctf laucin luna mach2 mbt1 mbt4 mbt12 mc-lab meltdown2 mercury metro mill new_energy" +ctfmaps5 = "nitro nucleus overdrive ow pandora pul1ctf ra recovery redemption regal reissen risk river_keep ruebli rust sacrifice shellshock2" +ctfmaps6 = "shipwreck siberia snapper_rocks spcr stadium stronghold subterra suburb surge tatooine tectonic tejen tempest tortuga triforts tubes turbulence" +ctfmaps7 = "twinforts unworld3 urban_c valhalla warlock wdcd xenon" +conceptmaps = "box_demo canyon door_demo firstevermap ladder platform_demo sauerbraten secondevermap spiralz" +spmaps = "mpsp6a mpsp6b mpsp6c mpsp9a mpsp9b mpsp9c mpsp10 lost level9 skrsp1 crnsp1" +rpgmaps = "k_rpg1 rpg_01" +allffamaps = (concat $ffamaps1 $ffamaps2 $ffamaps3 $ffamaps4 $ffamaps5 $ffamaps6 $ffamaps7 $ffamaps8 $ffamaps9 $ffamaps10 $ffamaps11) +allcapturemaps = (concat $capturemaps1 $capturemaps2 $capturemaps3 $capturemaps4 $capturemaps5 $capturemaps6 $capturemaps7) +allctfmaps = (concat $ctfmaps1 $ctfmaps2 $ctfmaps3 $ctfmaps4 $ctfmaps5 $ctfmaps6 $ctfmaps7) +allmaps = (concat $allffamaps $allcapturemaps $allctfmaps $conceptmaps $spmaps $rpgmaps) + +guirollovername = "" +guirolloveraction = "" +guirolloverimgpath = "" +guirolloverimgaction = "" +guirolloverpreviewname = "" +guirolloverpreviewaction = "" + +showmapshot = [ + guibar + mname = (checkrolloveraction "map " [if (> $numargs 0) [result $arg1] [at $guirollovername 0]]) + guilist [ + guiimage (concatword "packages/base/" $mname ".jpg") (checkrolloveraction "map ") 4 1 "data/cube.png" $mname + ] +] + +newgui maps [ + guilist [ + guistrut 17 1 + guilist [ guistrut 15 1; genmapitems $ffamaps1 ] + guilist [ guistrut 15 1; genmapitems $ffamaps2 ] + guilist [ guistrut 15 1; genmapitems $ffamaps3 ] + showmapshot + ] + guitab 2 + guilist [ + guistrut 17 1 + guilist [ guistrut 15 1; genmapitems $ffamaps4 ] + guilist [ guistrut 15 1; genmapitems $ffamaps5 ] + guilist [ guistrut 15 1; genmapitems $ffamaps6 ] + showmapshot + ] + guitab 3 + guilist [ + guistrut 17 1 + guilist [ guistrut 15 1; genmapitems $ffamaps7 ] + guilist [ guistrut 15 1; genmapitems $ffamaps8 ] + guilist [ guistrut 15 1; genmapitems $ffamaps9 ] + showmapshot + ] + guitab 4 + guilist [ + guistrut 17 1 + guilist [ guistrut 15 1; genmapitems $ffamaps10 ] + guilist [ guistrut 15 1; genmapitems $ffamaps11 ] + guilist [ guistrut 15 1 ] + showmapshot + ] + guitab capture + guilist [ + guistrut 17 1 + guilist [ guistrut 15 1; genmapitems $capturemaps1 ] + guilist [ guistrut 15 1; genmapitems $capturemaps2 ] + guilist [ guistrut 15 1; genmapitems $capturemaps3 ] + showmapshot + ] + guitab 2 + guilist [ + guistrut 17 1 + guilist [ guistrut 15 1; genmapitems $capturemaps4 ] + guilist [ guistrut 15 1; genmapitems $capturemaps5 ] + guilist [ guistrut 15 1; genmapitems $capturemaps6 ] + showmapshot + ] + guitab 3 + guilist [ + guistrut 17 1 + guilist [ guistrut 15 1; genmapitems $capturemaps7 ] + guilist [ guistrut 15 1 ] + guilist [ guistrut 15 1 ] + showmapshot + ] + guitab ctf + guilist [ + guistrut 17 1 + guilist [ guistrut 15 1; genmapitems $ctfmaps1 ] + guilist [ guistrut 15 1; genmapitems $ctfmaps2 ] + guilist [ guistrut 15 1; genmapitems $ctfmaps3 ] + showmapshot + ] + guitab 2 + guilist [ + guistrut 17 1 + guilist [ guistrut 15 1; genmapitems $ctfmaps4 ] + guilist [ guistrut 15 1; genmapitems $ctfmaps5 ] + guilist [ guistrut 15 1; genmapitems $ctfmaps6 ] + showmapshot + ] + guitab 3 + guilist [ + guistrut 17 1 + guilist [ guistrut 15 1; genmapitems $ctfmaps7 ] + guilist [ guistrut 15 1 ] + guilist [ guistrut 15 1 ] + showmapshot + ] + + guitab concept + guilist [ + guistrut 17 1 + guilist [ guistrut 15 1; genmapitems $conceptmaps ] + guilist [ guistrut 15 1 ] + guilist [ guistrut 15 1 ] + showmapshot + ] +] + +newgui capturemaps [ + guilist [ + guistrut 17 1 + guilist [ guistrut 15 1; genmapitems $capturemaps1 ] + guilist [ guistrut 15 1; genmapitems $capturemaps2 ] + guilist [ guistrut 15 1; genmapitems $capturemaps3 ] + showmapshot + ] + guitab 2 + guilist [ + guistrut 17 1 + guilist [ guistrut 15 1; genmapitems $capturemaps4 ] + guilist [ guistrut 15 1; genmapitems $capturemaps5 ] + guilist [ guistrut 15 1; genmapitems $capturemaps6 ] + showmapshot + ] + guitab 3 + guilist [ + guistrut 17 1 + guilist [ guistrut 15 1; genmapitems $capturemaps7 ] + guilist [ guistrut 15 1 ] + guilist [ guistrut 15 1 ] + showmapshot + ] +] "capture maps" + +newgui ctfmaps [ + guilist [ + guistrut 17 1 + guilist [ guistrut 15 1; genmapitems $ctfmaps1 ] + guilist [ guistrut 15 1; genmapitems $ctfmaps2 ] + guilist [ guistrut 15 1; genmapitems $ctfmaps3 ] + showmapshot + ] + guitab 2 + guilist [ + guistrut 17 1 + guilist [ guistrut 15 1; genmapitems $ctfmaps4 ] + guilist [ guistrut 15 1; genmapitems $ctfmaps5 ] + guilist [ guistrut 15 1; genmapitems $ctfmaps6 ] + showmapshot + ] + guitab 3 + guilist [ + guistrut 17 1 + guilist [ guistrut 15 1; genmapitems $ctfmaps7 ] + guilist [ guistrut 15 1 ] + guilist [ guistrut 15 1 ] + showmapshot + ] +] "ctf maps" + +custommaps = "" +newgui custommaps [ + looplist curmap $custommaps [ + guibutton $curmap (concat map $curmap) "cube" + ] +] "custom maps" +showcustommaps = [ + custommaps = "" + loopfiles curmap "packages/base" "ogz" [ + if (< (indexof $allmaps $curmap) 0) [ + custommaps = (concat $custommaps (escape $curmap)) + ] + ] + custommaps = (sortlist $custommaps x y [naturalsort $x $y]) + showgui custommaps +] +macro playermodelbutton [cleargui 1; playermodel %1] + +newgui playermodel [ + guilist [ + guilist [ + loop i $playermodelnum [ + guibutton (playermodelname $i) (playermodelbutton $i) (playermodelicon $i) + ] + ] + guibar + pmidx = (substr $guirolloveraction (strlen (playermodelbutton ""))) + pmidx = (max 0 (min (- $playermodelnum 1) $pmidx)) + guilist [ + guilist [ + guispring + guiplayerpreview $pmidx 0 6 (checkrolloveraction "playermodel ") 4 1 (playermodelname $pmidx) + guispring + ] + guitextbox (playermodelstory $pmidx) 40 9 + ] + ] +] + +crosshairs = [ +"data/crosshair.png data/crosshair_hit.png" +"packages/crosshairs/crosshair_0.png packages/crosshairs/crosshair_hit_0.png" +"packages/crosshairs/crosshair_1.png packages/crosshairs/crosshair_hit_1.png" +"packages/crosshairs/crosshair_2.png packages/crosshairs/crosshair_hit_2.png" +"packages/crosshairs/crosshair_3.png packages/crosshairs/crosshair_hit_3.png" +"packages/crosshairs/crosshair_4.png packages/crosshairs/crosshair_hit_4.png" +"packages/crosshairs/crosshair_5.png packages/crosshairs/crosshair_hit_5.png" +"packages/crosshairs/crosshair_6.png packages/crosshairs/crosshair_hit_6.png" +"packages/crosshairs/crosshair_7.png packages/crosshairs/crosshair_hit_7.png" +"packages/crosshairs/crosshair_8.png packages/crosshairs/crosshair_hit_8.png" +"packages/crosshairs/crosshair_9.png packages/crosshairs/crosshair_hit_9.png" +"packages/crosshairs/crosshair_10.png packages/crosshairs/crosshair_hit_10.png" +"packages/crosshairs/crosshair_11.png packages/crosshairs/crosshair_hit_11.png" +"packages/crosshairs/crosshair_12.png packages/crosshairs/crosshair_hit_12.png" +"packages/crosshairs/crosshair_13.png packages/crosshairs/crosshair_hit_13.png" +"packages/crosshairs/crosshair_14.png packages/crosshairs/crosshair_hit_14.png" +"packages/crosshairs/crosshair_15.png packages/crosshairs/crosshair_hit_15.png" +"packages/crosshairs/crosshair_16.png packages/crosshairs/crosshair_hit_16.png" +"packages/crosshairs/crosshair_17.png packages/crosshairs/crosshair_hit_17.png" +"packages/crosshairs/crosshair_18.png packages/crosshairs/crosshair_hit_18.png" +"packages/crosshairs/crosshair_19.png packages/crosshairs/crosshair_hit_19.png" +"packages/crosshairs/crosshair_20.png packages/crosshairs/crosshair_hit_20.png" +"packages/crosshairs/crosshair_21.png packages/crosshairs/crosshair_hit_21.png" +"packages/crosshairs/crosshair_22.png packages/crosshairs/crosshair_hit_22.png" +"packages/crosshairs/crosshair_23.png packages/crosshairs/crosshair_hit_23.png" +"packages/crosshairs/crosshair_24.png packages/crosshairs/crosshair_hit_24.png" +"packages/crosshairs/crosshair_25.png packages/crosshairs/crosshair_hit_25.png" +"packages/crosshairs/crosshair_26.png packages/crosshairs/crosshair_hit_26.png" +] + +newgui crosshair [ + guitext "crosshair size" + guislider crosshairsize + loop row (div (+ (listlen $crosshairs) 6) 7) [ + guilist [ + loop col 7 [ + ch = (at $crosshairs (+ (* $row 7) $col)) + if (!=s $ch "") [ + guiimage (at $ch 0) [ + cleargui 1 + loadcrosshair @(at $ch 0) 0 + loadcrosshair @(at $ch (if (> (listlen $ch) 1) 1 0)) 2 + ] 0.5 + ] + ] + ] + ] +] + +newgui master [ + guistayopen [ + if (ismaster (getclientnum)) [ + guibutton "relinquish master" "setmaster 0" + ] [ + guibutton "claim master" "setmaster 1" + ] + guilist [ + guitext "mastermode: " + mm = (getmastermode) + guiradio "open (0) " mm 0 "mastermode 0" + guiradio "veto (1) " mm 1 "mastermode 1" + guiradio "locked (2) " mm 2 "mastermode 2" + guiradio "private (3) " mm 3 "mastermode 3" + ] + guibar + looplist cn (listclients 0 0) [ + guilist [ + guitext (concatword (getclientname $cn) ": ") (getclienticon $cn) + guibutton "kick " [kick @cn] + guibutton "toggle spectator " [spectator @(= (isspectator $cn) 0) @cn] + if (m_teammode (getmode)) [ + guibutton "switch team " [setteam @cn @(? (=s (getclientteam $cn) "good") "evil" "good")] + ] + if (ismaster $cn) [ + guibutton "take master" [setmaster 0 @cn] + ] [ + guibutton "give master" [setmaster 1 @cn] + ] + ] + ] + ] +] + +botmatchcount = 5 +botmatchminskill = 50 +botmatchmaxskill = 100 + +startbotmatch = [ + if (isconnected 0 0) [ + echo "You must disconnect from the current multiplayer game before starting a bot match." + ] [ + loop i $botmatchcount [addbot (rnd (+ $botmatchmaxskill 1) $botmatchminskill)] + ] +] + +newgui botmatch [ + guitext "bot amount" + guislider botmatchcount 0 32 + guitext "bot minimum skill" + guislider botmatchminskill 50 101 [if (< $botmatchmaxskill $botmatchminskill) [botmatchmaxskill = $botmatchminskill]] + guitext "bot maximum skill" + guislider botmatchmaxskill 50 101 [if (> $botmatchminskill $botmatchmaxskill) [botmatchminskill = $botmatchmaxskill]] + guibutton "start match.." [guionclear [startbotmatch]; showgui gamemode] +] "bot match" + +newgui campaign [ + guibutton "start Private Stan Sauer" "showgui privatestansauer" + guibutton "start An Army Of One" "showgui armyofone" + guibutton "start Lost" "sp lost" "cube" + guibutton "start Meltdown" "sp skrsp1" "cube" + guibutton "start Missile Pass" "sp crnsp1" "cube" + guibutton "start Level 9" "sp level9" "cube" + guibar + guibutton "start DMSP map.." "mode -2; showgui maps" + guicheckbox "slow motion" "slowmosp" + guitext "skill (default: 3)" + guislider skill +] + +newgui armyofone [ + guilist [ + guilist [ + guibutton "Part I" "sp mpsp6a" "cube" + guibutton "Part II" "sp mpsp6b" "cube" + guibutton "Part III" "sp mpsp6c" "cube" + ] + showmapshot (substr $guirolloveraction 3) + ] +] "An Army Of One" + +newgui privatestansauer [ + guilist [ + guilist [ + guibutton "Run N' Gun Part I" "sp mpsp9a" "cube" + guibutton "Run N' Gun Part II" "sp mpsp9b" "cube" + guibutton "Run N' Gun Part III" "sp mpsp9c" "cube" + guibutton "THE SERIOUSLY BIG VALLEY" "sp mpsp10" "cube" + ] + showmapshot (substr $guirolloveraction 3) + ] +] "Private Stan Sauer" + +newgui servers [ + guistayopen [ + guiservers [ + guilist [ + guibutton "update from master server" "updatefrommaster" + guibar + guicheckbox "search LAN" searchlan + guibar + guicheckbox "auto-update" autoupdateservers + guibar + guicheckbox "auto-sort" autosortservers + if (= $autosortservers 0) [ + guibar + guibutton "sort" "sortservers" + ] + ] + guibar + ] 17 + ] +] "" [initservers] + +newgui gamemode [ + guilist [ + guilist [ + guibutton "ffa" "mode 0; showgui maps" + guibutton "coop-edit" "mode 1; showgui maps" + guibutton "teamplay" "mode 2; showgui maps" + guibutton "instagib" "mode 3; showgui maps" + guibutton "instagib team" "mode 4; showgui maps" + guibutton "efficiency" "mode 5; showgui maps" + guibutton "efficiency team" "mode 6; showgui maps" + guibutton "tactics" "mode 7; showgui maps" + guibutton "tactics team" "mode 8; showgui maps" + guibutton "capture" "mode 9; showgui capturemaps" + guibutton "regen capture" "mode 10; showgui capturemaps" + ] + guibar + guilist [ + guibutton "ctf" "mode 11; showgui ctfmaps" + guibutton "insta ctf" "mode 12; showgui ctfmaps" + guibutton "efficiency ctf" "mode 17; showgui ctfmaps" + guibutton "protect" "mode 13; showgui ctfmaps" + guibutton "insta protect" "mode 14; showgui ctfmaps" + guibutton "efficiency protect" "mode 18; showgui ctfmaps" + guibutton "hold" "mode 15; showgui capturemaps" + guibutton "insta hold" "mode 16; showgui capturemaps" + guibutton "efficiency hold" "mode 19; showgui capturemaps" + guibutton "collect" "mode 20; showgui ctfmaps" + guibutton "insta collect" "mode 21; showgui ctfmaps" + guibutton "efficiency collect" "mode 22; showgui ctfmaps" + ] + ] +] + +showfileeditor = [ + guinoautotab [ + guieditor $arg1 $arg2 $arg3 + textinit $arg1 $arg1 + guistayopen [ + guilist [ + guibutton "load" [textfocus @arg1; textload @arg1] + guibar + guibutton "save" [textfocus @arg1; textsave @arg1] + guibar + guibutton "exec" [textfocus @arg1; textexec] + guibar + guibutton "copy" [textfocus @arg1; textcopy] + guibar + guibutton "paste" [textfocus @arg1; textpaste] + guibar + guibutton "select" [textfocus @arg1; textselectall] + guibar + guibutton "clear" [textfocus @arg1; textclear] + ] + ] + ] +] + +notepadfile = "untitled.txt" + +newgui notepad [ + guifield notepadfile -30 + showfileeditor $notepadfile -80 20 +] + +notepad = [ + if (> $numargs 0) [notepadfile = $arg1] + showgui notepad +] + +newgui pastebuffer [ + guinoautotab [ + guieditor "#pastebuffer" -80 20 + guistayopen [ + guilist [ + guibutton "exec" [textfocus "#pastebuffer"; textexec] + guibar + guibutton "clear" [textfocus "#pastebuffer"; textclear] + ] + ] + ] +] + +pastebuffer = [showgui pastebuffer] + +newgui scratchpad [ + guinoautotab [ + guieditor "#scratchpad" -80 20 + guistayopen [ + guilist [ + guibutton "exec" [textfocus "#scratchpad"; textexec] + guibar + guibutton "copy" [textfocus "#scratchpad"; textcopy] + guibar + guibutton "paste" [textfocus "#scratchpad"; textpaste] + guibar + guibutton "select" [textfocus "#scratchpad"; textselectall] + guibar + guibutton "clear" [textfocus "#scratchpad"; textclear] + ] + ] + ] +] + +scratchpad = [showgui scratchpad] + +newmapsize = 12 +savemap_name = temp + +newgui "editing" [ //////////////////////////////////////////////////////////////////////////////////////////////////////////// + guikeeptab 1 + + guibutton "toggle edit mode^t^t^f2[E]" "edittoggle" + guibar //------------------------------------------------------------------------- + guilist [ + guilist [ + guitext "select^t^t^t^t^f2[mouse-left *drag]^t" + guitext "extend selection^t^t^f2[mouse-right]" + guitext "move selection^t^t^t^f2[mouse-right *drag]" + guitext "deselect^t^t^t^t^f2[SPACE]" + guitext "select all ents in box^t^f2[keypad-ENTER]" + ] + guilist [ + guitext "select corners^t^t^t^f2[mouse-middle *drag]" + guitext "reorient^t^t^t^t^f2[mouse-right]" + guitext "passthrough^t^t^t^f2[LCTRL *hold]" + guitext "center view on ent^t^t^f2[COMMA + mousewheel]" + guitext "select all ents matching^t^f2[N]" + ] + ] + guibar //------------------------------------------------------------------------- + guilist [ + guilist [ + guitext "push/pull selection^t^t^f2[mousewheel]^t^t" + guitext "change gridsize^t^t^f2[G + mousewheel]" + guitext "mirror on selected axis^t^f2[X]" + ] + guilist [ + guitext "push cube face^t^t^f2[F + mousewheel]" + guitext "push corner with cursor^t^f2[Q + mousewheel]" + guitext "rotate^t^t^t^t^f2[R + mousewheel]" + ] + ] + guibar //------------------------------------------------------------------------- + guilist [ + guilist [ + guitext "undo^t^t^t^t^t^f2[U] [Z]^t^t^t" + guitext "copy^t^t^t^t^t^f2[C]" + guitext "delete^t^t^t^t^f2[DELETE]" + ] + guilist [ + guitext "redo^t^t^t^t^t^f2[I]" + guitext "paste^t^t^t^t^f2[V]" + ] + ] + guibar //------------------------------------------------------------------------- + guilist [ + guilist [ + guitext "change textures^t^t^f2[Y + mousewheel]^t" + guicheckbox "texture all faces^t^t^f2[0]" "allfaces" + guicheckbox "toggle outline^t^t^t^f2[7]" "outline" + ] + guilist [ + guibutton "texture palette..^t^t^f2[F2]" "showtexgui" + guibutton "materials.." "showgui materials" + guicheckbox "toggle wireframe^t^t^f2[8]" "wireframe" + ] + ] + +guitab "ents" //////////////////////////////////////////////////////////////////////////////////////////////////////////// + guilist [ + guilist [ + guibutton "edit selected ent..^t^t^f2[F3]^t^t^t" "showentgui" + guicheckbox "entity snap-to-grid^t^t^f2[6]" "entselsnap" + ] + guilist [ + guibutton "edit selected entity in console^t^f2[PERIOD]" "selentedit" + guicheckbox "entity selection" "entediting" + ] + ] + guibar //------------------------------------------------------------------------- + guitext "drop entities" + guilist [ + guilist [ + guiradio "at selection^t^t^t^t^t^t" entdrop 2 + guiradio "at selection & to the floor" entdrop 3 + ] + guilist [ + guiradio "at current position" entdrop 0 + guiradio "at current position & to the floor" entdrop 1 + ] + ] + guibar //------------------------------------------------------------------------- + guitext "newent *" + guilist [ + guilist [ + guibutton "light..^t^t^t^t^t" "resetlight;showgui newlight" + guibutton "playerstart" "newent playerstart" + guibutton "base" "newent base" + guibutton "trigger.." "showgui triggers" + ] + guilist [ + guibutton "mapmodel..^t^t^f2[F4]^t^t" "showgui mapmodels" + guibutton "playerstart team-1" "newent playerstart 1" + guibutton "flag team-1" "newent flag 1" + guibutton "monster.." "showgui monsters" + ] + guilist [ + guibutton "teleport.." "showgui newteleport" + guibutton "playerstart team-2" "newent playerstart 2" + guibutton "flag team-2" "newent flag 2" + ] + ] + guitext "pickup entities:" + guilist [ + guilist [ + guibutton "shells^t^t^t^t^t^t^t" "newent shells" + guibutton "bullets" "newent bullets" + guibutton "rockets" "newent rockets" + guibutton "riflerounds" "newent riflerounds" + guibutton "grenades" "newent grenades" + guibutton "cartridges" "newent cartridges" + ] + guilist [ + guibutton "health" "newent health" + guibutton "healthboost" "newent healthboost" + guibutton "greenarmour" "newent greenarmour" + guibutton "yellowarmour" "newent yellowarmour" + guibutton "quaddamage" "newent quaddamage" + guibutton "select all pickup ents ^f2/findpickupents" "findpickupents" + ] + ] + +guitab "lighting" //////////////////////////////////////////////////////////////////////////////////////////////////////////// + guibutton "maplighting.. ^f2/maplighting" "showgui _maplighting" + guibar //------------------------------------------------------------------------- + lightingstuff + +guitab "skybox" //////////////////////////////////////////////////////////////////////////////////////////////////////////// + guilist [ + guistayopen [ + guilist [ genskyitems $skies1 ] + guilist [ genskyitems $skies2 ] + guilist [ genskyitems $skies3 ] + showskyshot + ] + ] + +guitab "sky" //////////////////////////////////////////////////////////////////////////////////////////////////////////// + _skyboxcolour_r = (& (>> $skyboxcolour 16) 0xFF) + _skyboxcolour_g = (& (>> $skyboxcolour 8) 0xFF) + _skyboxcolour_b = (& (>> $skyboxcolour 0) 0xFF) + guilist [ + guitext "skyboxcolour " + guicolor $skyboxcolour + ] + guislider _skyboxcolour_r 0 255 [skyboxcolour $_skyboxcolour_r $_skyboxcolour_g $_skyboxcolour_b] + guislider _skyboxcolour_g 0 255 [skyboxcolour $_skyboxcolour_r $_skyboxcolour_g $_skyboxcolour_b] + guislider _skyboxcolour_b 0 255 [skyboxcolour $_skyboxcolour_r $_skyboxcolour_g $_skyboxcolour_b] + guibar //------------------------------------------------------------------------- + guilist [ + guitext "spinsky " + guifield spinsky 5 + guistayopen [ guibutton "- " [spinsky (+fround $spinsky -0.1)] ] + guistayopen [ guibutton "+" [spinsky (+fround $spinsky 0.1)] ] + ] + guibar //------------------------------------------------------------------------- + guitext "yawsky" + guislider yawsky + + +guitab "cloudlayer" //////////////////////////////////////////////////////////////////////////////////////////////////////////// + guistayopen [ + guilist [ + guilist [ + guitext "cloudlayer^t^t^t^t^t^t" + guibutton "skyboxes/clouds01.png" [cloudlayer "skyboxes/clouds01.png"] + guibutton "skyboxes/clouds02.png" [cloudlayer "skyboxes/clouds02.png"] + guibutton "skyboxes/clouds03.png" [cloudlayer "skyboxes/clouds03.png"] + guibutton "skyboxes/white_bk.jpg" [cloudlayer "skyboxes/white_bk.jpg"] + ] + guilist [ + guibutton "*no clouds*" [cloudlayer ""] + guibutton "blindabuser/blindaclouds.png" [cloudlayer "blindabuser/blindaclouds.png"] + guibutton "skyboxes/cloud_ring.png" [cloudlayer "skyboxes/cloud_ring.png"] + guibutton "textures/razgriz/cloud03.png" [cloudlayer "textures/razgriz/cloud03.png"] + guibutton "textures/razgriz/cloud04.png" [cloudlayer "textures/razgriz/cloud04.png"] + ] + ] + ] + guibar //------------------------------------------------------------------------- + _cloudcolour_r = (& (>> $cloudcolour 16) 0xFF) + _cloudcolour_g = (& (>> $cloudcolour 8) 0xFF) + _cloudcolour_b = (& (>> $cloudcolour 0) 0xFF) + guilist [ + guitext "cloudcolour " + guicolor $cloudcolour + ] + guislider _cloudcolour_r 0 255 [cloudcolour $_cloudcolour_r $_cloudcolour_g $_cloudcolour_b] + guislider _cloudcolour_g 0 255 [cloudcolour $_cloudcolour_r $_cloudcolour_g $_cloudcolour_b] + guislider _cloudcolour_b 0 255 [cloudcolour $_cloudcolour_r $_cloudcolour_g $_cloudcolour_b] + guibar //------------------------------------------------------------------------- + guilist [ + guilist [ + guilist [ + guitext "cloudalpha^t" + guifield cloudalpha 5 + guistayopen [ guibutton "- " [cloudalpha (+fround $cloudalpha -0.05)] ] + guistayopen [ guibutton "+^t^t" [cloudalpha (+fround $cloudalpha 0.05)] ] + ] + + guilist [ + guitext "cloudfade^t^t" + guifield cloudfade 5 + guistayopen [ guibutton "- " [cloudfade (+fround $cloudfade -0.05)] ] + guistayopen [ guibutton "+^t^t" [cloudfade (+fround $cloudfade 0.05)] ] + ] + ] + guilist [ + guilist [ + guitext "cloudheight^t" + guifield cloudheight 5 + guistayopen [ guibutton "- " [cloudheight (+fround $cloudheight -0.01)] ] + guistayopen [ guibutton "+^t^t" [cloudheight (+fround $cloudheight 0.01)] ] + ] + + guilist [ + guitext "cloudscale^t^t" + guifield cloudscale 5 + guistayopen [ guibutton "- " [cloudscale (+fround $cloudscale -0.0625)] ] + guistayopen [ guibutton "+^t^t" [cloudscale (+fround $cloudscale 0.0625)] ] + ] + ] + ] + guibar //------------------------------------------------------------------------- + guilist [ + guilist [ + guilist [ + guitext "cloudoffsetx^t" + guifield cloudoffsetx 5 + guistayopen [ guibutton "- " [cloudoffsetx (+fround $cloudoffsetx -0.01)] ] + guistayopen [ guibutton "+^t^t" [cloudoffsetx (+fround $cloudoffsetx 0.01)] ] + ] + guilist [ + guitext "cloudoffsety^t" + guifield cloudoffsety 5 + guistayopen [ guibutton "- " [cloudoffsety (+fround $cloudoffsety -0.01)] ] + guistayopen [ guibutton "+" [cloudoffsety (+fround $cloudoffsety 0.01)] ] + ] + ] + guilist [ + guilist [ + guitext "cloudscrollx^t" + guifield cloudscrollx 5 + guistayopen [ guibutton "- " [cloudscrollx (+fround $cloudscrollx -0.01)] ] + guistayopen [ guibutton "+^t^t" [cloudscrollx (+fround $cloudscrollx 0.01)] ] + ] + guilist [ + guitext "cloudscrolly^t" + guifield cloudscrolly 5 + guistayopen [ guibutton "- " [cloudscrolly (+fround $cloudscrolly -0.01)] ] + guistayopen [ guibutton "+" [cloudscrolly (+fround $cloudscrolly 0.01)] ] + ] + guilist [ + guitext "spincloudlayer^t" + guifield spincloudlayer 5 + guistayopen [ guibutton "- " [spincloudlayer (+fround $spincloudlayer -0.1)] ] + guistayopen [ guibutton "+" [spincloudlayer (+fround $spincloudlayer 0.1)] ] + ] + ] + ] + +guitab "fog" //////////////////////////////////////////////////////////////////////////////////////////////////////////// + guitext "fog" + guislider fog 128 8192 + _fogcolour_r = (& (>> $fogcolour 16) 0xFF) + _fogcolour_g = (& (>> $fogcolour 8) 0xFF) + _fogcolour_b = (& (>> $fogcolour 0) 0xFF) + guilist [ + guitext "fogcolour " + guicolor $fogcolour + ] + guislider _fogcolour_r 0 255 [fogcolour $_fogcolour_r $_fogcolour_g $_fogcolour_b] + guislider _fogcolour_g 0 255 [fogcolour $_fogcolour_r $_fogcolour_g $_fogcolour_b] + guislider _fogcolour_b 0 255 [fogcolour $_fogcolour_r $_fogcolour_g $_fogcolour_b] + guibar //------------------------------------------------------------------------- + _fogdomecolour_r = (& (>> $fogdomecolour 16) 0xFF) + _fogdomecolour_g = (& (>> $fogdomecolour 8) 0xFF) + _fogdomecolour_b = (& (>> $fogdomecolour 0) 0xFF) + guilist [ + guitext "fogdomecolour (0 = use fogcolour) " + guicolor $fogdomecolour + ] + guislider _fogdomecolour_r 0 255 [fogdomecolour $_fogdomecolour_r $_fogdomecolour_g $_fogdomecolour_b] + guislider _fogdomecolour_g 0 255 [fogdomecolour $_fogdomecolour_r $_fogdomecolour_g $_fogdomecolour_b] + guislider _fogdomecolour_b 0 255 [fogdomecolour $_fogdomecolour_r $_fogdomecolour_g $_fogdomecolour_b] + guilist [ + guilist [ + guilist [ + guitext "fogdomemax^t" + guifield fogdomemax 5 + guistayopen [ guibutton "- " [fogdomemax (+fround $fogdomemax -0.01)] ] + guistayopen [ guibutton "+^t^t" [fogdomemax (+fround $fogdomemax 0.01)] ] + ] + guilist [ + guitext "fogdomemin^t" + guifield fogdomemin 5 + guistayopen [ guibutton "- " [fogdomemin (+fround $fogdomemin -0.01)] ] + guistayopen [ guibutton "+" [fogdomemin (+fround $fogdomemin 0.01)] ] + ] + ] + guilist [ + guilist [ + guitext "fogdomeclip^t" + guifield fogdomeclip 5 + guistayopen [ guibutton "- " [fogdomeclip (+fround $fogdomeclip -0.01)] ] + guistayopen [ guibutton "+" [fogdomeclip (+fround $fogdomeclip 0.01)] ] + ] + + guilist [ + guitext "fogdomeheight^t" + guifield fogdomeheight 5 + guistayopen [ guibutton "- " [fogdomeheight (+fround $fogdomeheight -0.01)] ] + guistayopen [ guibutton "+" [fogdomeheight (+fround $fogdomeheight 0.01)] ] + ] + ] + ] + guilist [ + guicheckbox "fogdomecap^t^t^t^t^t^t" "fogdomecap" + guicheckbox "fogdomeclouds" "fogdomeclouds" + ] + +guitab "height&blendmap" //////////////////////////////////////////////////////////////////////////////////////////////////////////// + guilist [ + guilist [ + guitext "toggle heightmap mode^t^t^f2[H]^t^t^t" + guitext "push/pull heightmap^t^t^t^f2[mousewheel]" + ] + guilist [ + guitext "select heightmap brush^t^f2[B + mousewheel]" + ] + ] + guibar //------------------------------------------------------------------------- + guitext "blend paint mode" + guilist [ + guilist [ + guiradio "off^t^t^t^t^t^t^f2[keypad 0]^t" blendpaintmode 0 + guiradio "dig^t^t^t^t^t^t^f2[keypad 2]" blendpaintmode 2 + guiradio "inverted dig^t^t^t^t^f2[keypad 4]" blendpaintmode 4 + ] + guilist [ + guiradio "replace^t^t^t^t^f2[keypad 1]" blendpaintmode 1 + guiradio "fill^t^t^t^t^t^f2[keypad 3]" blendpaintmode 3 + guiradio "inverted fill^t^t^t^f2[keypad 5]" blendpaintmode 5 + ] + ] + guitext "paint blendmap^t^t^t^f2[mouse-left]" + guibutton "change blend brush^t^t^t^f2[mousewheel]" "nextblendbrush" + guibutton "rotate blend brush^t^t^t^f2[mouse-right]" "rotateblendbrush" + guibutton "clear entire blendmap^t^t^f2/clearblendmap" "clearblendmap" + guibutton "clear blendmap in selection^t^f2/clearblendmapsel" "clearblendmapsel" + +guitab "map" //////////////////////////////////////////////////////////////////////////////////////////////////////////// + guitext "save map:" + guifield savemap_name 20 [ savemap $savemap_name ] + guibutton [load @savemap_name map] "map $savemap_name" + guibutton "newmap (default size: 12)" "newmap $newmapsize" + guislider "newmapsize" 10 16 + guibutton "increase mapsize (2x)" "mapenlarge" + guitext "max undo size (default: 8 MB)" + guislider "undomegs" 1 20 + guibutton "optimize geometry" "remip" + guibutton "set map title/author" "saycommand [/maptitle @maptitle]" + guibutton "show custom maps" "showcustommaps" + +guitab "cfg" //////////////////////////////////////////////////////////////////////////////////////////////////////////// + guitext (mapcfgname) + showfileeditor (mapcfgname) -80 17 +] + +skies1 = [ + aftas/sky/orbe + blindabuser/blindasky + blindabuser/blindasky2 + darc/forge + dash/moon + hazel/green + humus/meadow + ik2k/env/iklake + jon/prarie + mayhem/duomo + mayhem/eclipse + meister/uzze + penguins/arid + penguins/arid2 + penguins/cocoa + penguins/divine + penguins/harmony + penguins/mellow + penguins/mystic +] +skies2 = [ + penguins/violence + penguins/wrath + penguins/yonder + penguins/zeus + ratboy/skyboxes/coward + shmutzwurst/london + skyboxes/black + skyboxes/bbk/d + skyboxes/bbk/dark2 + skyboxes/bbk/n1 + skyboxes/bbk/t + skyboxes/clearsky052 + skyboxes/darkness + skyboxes/evilsky + skyboxes/morning + skyboxes/remus/sky01 + skyboxes/turbulent + skyboxes/ulukai/corona + skyboxes/white +] +skies3 = [ + socksky/barren + socksky/desert + socksky/devpun + socksky/emerald + socksky/frozen + socksky/frozendusk + socksky/grave + socksky/mars + socksky/nightball + socksky/stratosphere + socksky/valley + staffy/staffy +] + +genskyitems = [ + looplist cursky $arg1 [ + guibutton $cursky (concat skybox $cursky) //"cube" + ] +] + +showskyshot = [ + guibar + skyshotname = (checkrolloveraction "skybox " [if (> $numargs 0) [result $arg1] [at $guirollovername 0]]) + guiimage (concatword "packages/" $skyshotname "_ft") (checkrolloveraction "skybox ") 4 1 "data/cube.png" (chopstr $skyshotname -16 "..") +] + +lightingstuff = [ + guitext "lightprecision" + guilistslider lightprecision "8 16 32 48 64 128 256" + guitext "lightlod (>= use lightprecision, < use lightprecision/2)" + guislider lightlod + guitext "lighterror" + guislider lighterror + guitext "lightthreads" + guislider lightthreads + guilist [ + guitext "blurskylight^t" + guiradio "0 " blurskylight 0 + guiradio "1 " blurskylight 1 + guiradio "2 " blurskylight 2 + ] + guilist [ + guitext "blurlightmaps^t" + guiradio "0 " blurlms 0 + guiradio "1 " blurlms 1 + guiradio "2 " blurlms 2 + ] + guibar //------------------------------------------------------------------------- + guibutton "calclight 1 (slow: 8xAA)" "calclight 1" + guibutton "calclight -1 (quick: no AA, no model shadows)" "calclight -1" + guicheckbox "fullbright ^f2[L]" fullbright +] + +maplighting = [showgui _maplighting] +newgui _maplighting [ //////////////////////////////////////////////////////////////////////////////////////////////////////////// + _sunlight_r = (& (>> $sunlight 16) 0xFF) + _sunlight_g = (& (>> $sunlight 8) 0xFF) + _sunlight_b = (& (>> $sunlight 0) 0xFF) + guilist [ + guitext "sunlight^t^t^t^t^t^t^t^t" + guicolor $sunlight + ] + guislider _sunlight_r 0 255 [sunlight $_sunlight_r $_sunlight_g $_sunlight_b] + guislider _sunlight_g 0 255 [sunlight $_sunlight_r $_sunlight_g $_sunlight_b] + guislider _sunlight_b 0 255 [sunlight $_sunlight_r $_sunlight_g $_sunlight_b] + + guilist [ + guitext "sunlightscale " + guifield sunlightscale 8 + ] + guitext "sunlightpitch " + guislider sunlightpitch + guitext "sunlightyaw " + guislider sunlightyaw + guibutton "Get sun pitch & yaw from camera. ^f2/getsundir" "getsundir" + + guibar //------------------------------------------------------------------------- + + _skylight_r = (& (>> $skylight 16) 0xFF) + _skylight_g = (& (>> $skylight 8) 0xFF) + _skylight_b = (& (>> $skylight 0) 0xFF) + guilist [ + guitext "skylight^t^t^t^t^t^t^t^t" + guicolor $skylight + ] + guislider _skylight_r 0 255 [skylight $_skylight_r $_skylight_g $_skylight_b] + guislider _skylight_g 0 255 [skylight $_skylight_r $_skylight_g $_skylight_b] + guislider _skylight_b 0 255 [skylight $_skylight_r $_skylight_g $_skylight_b] + + guibar //------------------------------------------------------------------------- + + _ambient_r = (& (>> $ambient 16) 0xFF) + _ambient_g = (& (>> $ambient 8) 0xFF) + _ambient_b = (& (>> $ambient 0) 0xFF) + guilist [ + guitext "ambient^t^t^t^t^t^t^t^t" + guicolor $ambient + ] + guislider _ambient_r 0 255 [ambient $_ambient_r $_ambient_g $_ambient_b] + guislider _ambient_g 0 255 [ambient $_ambient_r $_ambient_g $_ambient_b] + guislider _ambient_b 0 255 [ambient $_ambient_r $_ambient_g $_ambient_b] + +guitab "settings" //////////////////////////////////////////////////////////////////////////////////////////////////////////// + lightingstuff + +] "maplighting" + +newgui materials [ + guibutton "air" "editmat air" + guibutton "water" "editmat water" + guibutton "lava" "editmat lava" + guibutton "clip" "editmat clip" + guibutton "glass" "editmat glass" + guibutton "noclip" "editmat noclip" + guibutton "gameclip" "editmat gameclip" + guibutton "death" "editmat death" + guibutton "alpha" "editmat alpha" + + guicheckbox "show material volumes" showmat + + //guibutton "waterlod very high (3)" "waterlod 3" + //guibutton "waterlod high (2)" "waterlod 2" + //guibutton "waterlod default (1)" "waterlod 1" + //guibutton "waterlod low (0)" "waterlod 0" + + //guibutton "watersubdiv very fine (0)" "watersubdiv 0" + //guibutton "watersubdiv fine (1)" "watersubdiv 1" + //guibutton "watersubdiv default (2)" "watersubdiv 2" + //guibutton "watersubdiv coarse (3)" "watersubdiv 3" + + //guibutton "water waves on" "waterwaves 1" + //guibutton "water waves off" "waterwaves 0" +] + +newgui triggers [ + guibutton [invisible] [BTmm = -1; showgui trigger2] + guibutton [a carrot] [BTmm = 23; showgui trigger2] + guibutton [switch #1] [BTmm = 24; showgui trigger2] + guibutton [switch #2] [BTmm = 25; showgui trigger2] + guibutton [door #1] [BTmm = 26; showgui trigger2] + guibutton [door #2] [BTmm = 27; showgui trigger2] + guibutton [door #3] [BTmm = 28; showgui trigger2] +] + +newgui trigger2 [ + guibutton [animation loop] [BTtt = 0; showgui trigger3] + guibutton [trigger once (popback)] [BTtt = 1; showgui trigger3] + guibutton [trigger once (popback & rumble)] [BTtt = 2; showgui trigger3] + guibutton [trigger once] [BTtt = 3; showgui trigger3] + guibutton [trigger once (rumble)] [BTtt = 4; showgui trigger3] + guibutton [trigger multiple (popback)] [BTtt = 5; showgui trigger3] + guibutton [trigger multiple (popback & rumble)] [BTtt = 6; showgui trigger3] + guibutton [trigger multiple] [BTtt = 7; showgui trigger3] + guibutton [trigger multiple (rumble)] [BTtt = 8; showgui trigger3] + guibutton [door (open once)] [BTtt = 9; showgui trigger3] + guibutton [door (auto close)] [BTtt = 10; showgui trigger3] + guibutton [door (locked)] [BTtt = 11; showgui trigger3] + guibutton [vanishing trigger] [BTtt = 12; showgui trigger3] + guibutton [vanishing trigger (rumble)] [BTtt = 13; showgui trigger3] + guibutton [End Of Level Trigger] [BTtt = 29; showgui trigger3] +] + +build_trigger = [newent mapmodel $BTmm $BTtt $BTti] + +newgui trigger3 [ + loop i 9 [ + tjt = (concat tag (concatword # $i)) + tjc = (concat BTti "=" $i ";" "build_trigger") + guibutton $tjt $tjc + ] +] + +resetlight = [ + lightcolour = 0 + lightbright = 1 + lightset 255 255 255 + lightradius = 128 +] + +lightset = [ + lightr = $arg1 + lightg = $arg2 + lightb = $arg3 + if (= $lightbright 0) lightscale +] + +lightscale = [ + if (= $lightbright 0) [ + lightr = (div $lightr 2); lightg = (div $lightg 2); lightb = (div $lightb 2) + ] [ + lightr = (min 255 (* $lightr 2)); lightg = (min 255 (* $lightg 2)); lightb = (min 255 (* $lightb 2)) + ] +] + +lightcmd = [ + result (concat newent light $lightradius $lightr $lightg $lightb) +] + +newgui newlight [ + guibutton (lightcmd) + guibar + guitext "color:" + guicolor (+ (* (+ (* $lightr 256) $lightg) 256) $lightb) + guislider lightr 0 255 + guislider lightg 0 255 + guislider lightb 0 255 + guilist [ + guicheckbox "bright" lightbright 1 0 [lightscale] + guibar + guiradio "white" lightcolour 0 [lightset 255 255 255] + guiradio "blue" lightcolour 1 [lightset 192 192 255] + guiradio "red" lightcolour 2 [lightset 255 192 192] + guiradio "green" lightcolour 3 [lightset 192 255 192] + guiradio "yellow" lightcolour 4 [lightset 255 255 192] + guiradio "purple" lightcolour 5 [lightset 255 192 255] + guiradio "turquoise" lightcolour 6 [lightset 192 255 255] + ] + guitext "radius:" + guislider lightradius 0 512 +] + +newgui newteleport [ + guibutton "newent teleport 1" + guibutton "newent teledest 1" + guibutton "newent teleport 2" + guibutton "newent teledest 2" + guibutton "newent teleport 3" + guibutton "newent teledest 3" + guibutton "newent teleport 4" + guibutton "newent teledest 4" +] + +getmapmodels = [ + loopconcat i $nummapmodels [ + if $arg2 [ if (mapmodelloaded $i) [ $arg1 $i ] ] [ $arg1 $i ] + ] +] + +mmguiwidth = 7 +mmguiheight = 4 + +newgui mapmodels [ + guikeeptab 1 + + local mmarea mmid + + mmguiarea = (* $mmguiwidth $mmguiheight) + + guinoautotab [ + loop n (div (+ $nummapmodels (- $mmguiarea 1)) $mmguiarea) [ + if $n [guitab (+ $n 1)] + if (= $guitabnum (+ $n 1)) [ + loop y $mmguiheight [ + guilist [ + loop x $mmguiwidth [ + mmid = (+ (* $n $mmguiarea) (+ (* $y $mmguiwidth) $x)) + guimodelpreview (mapmodelname $mmid) "mapmodel" [newent mapmodel @mmid] 3 1 $mmid 1 + ] + ] + ] + guistrut 0.2 + guititle (concatword "^f7" (strreplace (strreplace $guirolloverpreviewname "\" "/") "/" "^fc/^f7")) + ] + ] + ] +] + +newgui monsters [ + guibutton "ogro / fireball" "newent monster 0" + guibutton "rhino / chaingun" "newent monster 1" + guibutton "ratamahatta / shotgun" "newent monster 2" + guibutton "slith / rifle" "newent monster 3" + guibutton "bauul / RL" "newent monster 4" + guibutton "hellpig / bite" "newent monster 5" + guibutton "knight / iceball" "newent monster 6" + guibutton "goblin / slimeball" "newent monster 7" + guibutton "spider / grenade" "newent monster 8" +] + +newgui postfx [ + guibutton "(effect OFF)" "clearpostfx" + guibutton "bloom (subtle: 30%)" "bloom 0.3" + guibutton "bloom (bright: 55%)" "bloom 0.55" + guibutton "bloom (intense: 80%)" "bloom 0.8" + guibutton "rotoscope" "rotoscope 1" + guibutton "rotoscope + blur3" "rotoscope 1 1" + guibutton "rotoscope + blur5" "rotoscope 1 2" + guibutton "sobel" "setpostfx sobel" + guibutton "invert" "setpostfx invert" + guibutton "gbr" "setpostfx gbr" + guibutton "bw" "setpostfx bw" + guibutton "blur3" "setpostfx hblur3; addpostfx vblur3" + guibutton "blur5" "setpostfx hblur5; addpostfx vblur5" +] + +macro resbutton [ + guibutton "%1x%2" "screenres %1 %2" (if (&& (= $scr_w %1) (= $scr_h %2)) [result "radio_on"] [result "radio_off"]) +] + +newgui options [ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + guilist [ + guicheckbox "2D menus" gui2d + guibar + guicheckbox "click tab" guiclicktab + guibar + guicheckbox "menu fade in" guifadein + ] + guicheckbox "show scoreboard at death" deathscore + guicheckbox "blood" blood + guilist [ + guicheckbox "ragdoll deaths" ragdoll + if $ragdoll [ + guibar + guicheckbox "keep after respawn" ragdollmillis 10000 + ] + guibar + guicheckbox "hide dead players" hidedead + ] + guitext "ragdoll velocity multiplier" + guislider deadpush + guilist [ + guicheckbox "fullbright player models" fullbrightmodels 60 0 + if $fullbrightmodels [ + guibar + guiradio "subtle" fullbrightmodels 60 + guibar + guiradio "bright" fullbrightmodels 100 + guibar + guiradio "overbright" fullbrightmodels 150 + guibar + guiradio "max" fullbrightmodels 200 + ] + ] + guilist [ + guicheckbox "force matching player models" forceplayermodels + guibar + guicheckbox "always use team skins" teamskins + ] + guicheckbox "hit sound" hitsound + guibar + guibutton "restore defaults (clears ALL settings)" "exec restore.cfg" + + guitab "hud" //////////////////////////////////////////////////////////////////////////////////////////////////////////// + guicheckbox "show FPS" showfps + guilist [ + guicheckbox "wall clock" wallclock + if $wallclock [ + guibar + guicheckbox "24 hour" wallclock24 + guibar + guicheckbox "seconds" wallclocksecs + ] + ] + guilist [ + guicheckbox "damage screen" damagescreen + guibar + guicheckbox "damage compass" damagecompass + ] + guilist [ + guicheckbox "hudguns" hudgun + if $hudgun [ + guibar + guicheckbox "sway" hudgunsway + guibar + guicheckbox "muzzle flash" muzzleflash + guibar + guicheckbox "muzzle light" muzzlelight + ] + ] + guilist [ + guicheckbox "crosshair effects" crosshairfx + if $crosshairfx [ + guibar + guicheckbox "health colors" crosshaircolors + guibar + guicheckbox "teammates" teamcrosshair + guibar + guicheckbox "hits" hitcrosshair 425 + ] + ] + guilist [ + guicheckbox "outline capture meters" outlinemeters + guibar + guicheckbox "numbered capture bases" basenumbers + guibar + guicheckbox "show teammates" radarteammates 1 + ] + guibar + guilist [ + guicheckbox "ammobar^t^t" ammobar + guibutton "adjust ammobar" [showgui ammobar] + ] + guilist [ + guicheckbox "gameclock^t" gameclock + guibutton "adjust gameclock" [showgui gameclock] + ] + guilist [ + guicheckbox "hudscore^t^t" hudscore + guibutton "adjust hudscore" [showgui hudscore] + ] + + guitab "gfx" //////////////////////////////////////////////////////////////////////////////////////////////////////////// + guitext "performance key: ^f0fast^f~, ^f2moderate^f~, ^f3slow and pretty^f~" + guibar + guilist [ + guitext "shaders^t^t" + guibar + guiradio "^f0low detail" shaderdetail 1 + guibar + guiradio "^f2high detail" shaderdetail 3 + ] + guilist [ + guitext "water^t^t" + guibar + guicheckbox "^f2refraction" waterrefract + guibar + guicheckbox "^f3reflection" waterreflect + guibar + guicheckbox "^f0caustics" caustics + guibar + guicheckbox "^f2animation" vertwater + ] + guilist [ + guitext "waterfalls^t^t" + guibar + guicheckbox "^f2refraction" waterfallrefract + guibar + guicheckbox "^f0reflection" waterfallenv + ] + guilist [ + guicheckbox "^f3soft shadows^t" shadowmap + if $shadowmap [ + guibar + guiradio "^f2medium quality" shadowmapsize 9 [blurshadowmap 1] + guibar + guiradio "^f3high quality" shadowmapsize 10 [blurshadowmap 2] + ] [ + guibar + guicheckbox "^f2blob shadows" blobs + ] + ] + if $glare [ + glarepreset = 0 + if (= $glarescale 1) [ + if (= $blurglare 4) [glarepreset = 1] + if (= $blurglare 7) [glarepreset = 3] + ] + if (= $glarescale 2) [ + if (= $blurglare 3) [glarepreset = 2] + if (= $blurglare 7) [glarepreset = 4] + ] + guilist [ + guicheckbox "^f3glare^t^t^t" glare + guibar + guiradio "^f2subtle" glarepreset 1 [blurglare 4; glarescale 1] + guibar + guiradio "^f2glowy" glarepreset 2 [blurglare 3; glarescale 2] + guibar + guiradio "^f3soft" glarepreset 3 [blurglare 7; glarescale 1] + guibar + guiradio "^f3intense" glarepreset 4 [blurglare 7; glarescale 2] + ] + ] [ + guicheckbox "^f3glare" glare + ] + guilist [ + guicheckbox "^f3motion blur^t" motionblur + if $motionblur [ + guibar + guiradio "^f3subtle" motionblurscale 0.5 + guibar + guiradio "^f3moderate" motionblurscale 0.65 + guibar + guiradio "^f3intense" motionblurscale 0.8 + ] + ] + guilist [ + guicheckbox "^f3grass^t^t^t" grass + if $grass [ + guibar + guiradio "^f2quick fade" grassdist 128 + guibar + guiradio "^f2moderate fade" grassdist 256 + guibar + guiradio "^f3slow fade" grassdist 512 + ] + ] + guilist [ + guicheckbox "^f0dynamic lights^t" maxdynlights 3 0 + if $maxdynlights [ + guibar + guiradio "^f0medium quality" maxdynlights 3 + guibar + guiradio "^f2high quality" maxdynlights 5 + ] + ] + guilist [ + guicheckbox "^f0soft particles^t" depthfx + if $depthfx [ + guibar + guiradio "^f0low quality" depthfxsize 7 [blurdepthfx 1] + guibar + guiradio "^f2medium quality" depthfxsize 10 [blurdepthfx 0] + guibar + guiradio "^f3high quality" depthfxsize 12 [blurdepthfx 0] + ] + ] + guicheckbox "^f0glass reflection" glassenv + guilist [ + guicheckbox "^f0decals^t^t" decals + if $decals [ + guibar + guiradio "^f0quick fade" decalfade 10000 [maxdecaltris 1024] + guibar + guiradio "^f2slow fade" decalfade 60000 [maxdecaltris 4096] + ] + ] + guilist [ + guitext "textures^t^t" + guibar + guiradio "^f0low quality" maxtexsize 256 + guibar + guiradio "^f0medium quality" maxtexsize 512 + guibar + guiradio "^f2high quality" maxtexsize 0 + ] + guilist [ + guitext "models^t^t" + guibar + guicheckbox "^f0reflection" envmapmodels + guibar + guicheckbox "^f2bumpmap" bumpmodels + ] + + guitab "display" //////////////////////////////////////////////////////////////////////////////////////////////////////////// + guitext "field of view (default: 100)" + guislider fov + guicheckbox "v-sync" vsync 1 0 + guicheckbox "fullscreen" fullscreen + guitext "gamma (default: 100)" + guislider gamma + guitext "full-scene anti-aliasing (default: -1)" + guilistslider fsaa "-1 0 2 4 8 16" + guitext "z-buffer depth (default: 0)" + guilistslider depthbits "0 16 24 32" + guitext "anisotropic filtering (default: 0)" + guilistslider aniso "0 2 4 8 16" + guilist [ + guicheckbox "bilinear filtering" bilinear + guibar + guicheckbox "trilinear filtering (mipmaps)" trilinear + ] + + guitab "res" //////////////////////////////////////////////////////////////////////////////////////////////////////////// + guistayopen [ + guilist [ + guilist [ + guitext "4:3" + @@@@(resbutton 320 240) + @@@@(resbutton 640 480) + @@@@(resbutton 800 600) + @@@@(resbutton 1024 768) + @@@@(resbutton 1152 864) + @@@@(resbutton 1280 960) + @@@@(resbutton 1400 1050) + @@@@(resbutton 1600 1200) + @@@@(resbutton 1792 1344) + @@@@(resbutton 1856 1392) + @@@@(resbutton 1920 1440) + @@@@(resbutton 2048 1536) + @@@@(resbutton 2800 2100) + @@@@(resbutton 3200 2400) + ] + guibar + guilist [ + guitext "16:10" + @@@@(resbutton 320 200) + @@@@(resbutton 640 400) + @@@@(resbutton 1024 640) + @@@@(resbutton 1280 800) + @@@@(resbutton 1440 900) + @@@@(resbutton 1600 1000) + @@@@(resbutton 1680 1050) + @@@@(resbutton 1920 1200) + @@@@(resbutton 2048 1280) + @@@@(resbutton 2560 1600) + @@@@(resbutton 2880 1800) + @@@@(resbutton 3200 2000) + @@@@(resbutton 3840 2400) + ] + guibar + guilist [ + guitext "16:9" + @@@@(resbutton 1024 600) + @@@@(resbutton 1280 720) + @@@@(resbutton 1366 768) + @@@@(resbutton 1600 900) + @@@@(resbutton 1920 1080) + @@@@(resbutton 2048 1152) + @@@@(resbutton 2560 1440) + @@@@(resbutton 2880 1620) + @@@@(resbutton 3200 1800) + @@@@(resbutton 3840 2160) + ] + guibar + guilist [ + guitext "5:4" + @@@@(resbutton 600 480) + @@@@(resbutton 1280 1024) + @@@@(resbutton 1600 1280) + @@@@(resbutton 2560 2048) + ] + guibar + guilist [ + guitext "5:3" + @@@@(resbutton 800 480) + @@@@(resbutton 1280 768) + + guibar + guitext "Custom" + guilist [ + customw = $scr_w + customh = $scr_h + guifield customw 4 [scr_w $customw] + guifield customh 4 [scr_h $customh] + ] + ] + ] + ] + + guitab "sound" //////////////////////////////////////////////////////////////////////////////////////////////////////////// + guitext "sound volume" + guislider soundvol + guitext "music volume" + guislider musicvol + guitext "sound channels" + guislider soundchans + guitext "sound frequency" + guilistslider soundfreq "11025 22050 44100" + guitext "sound buffer length" + guislider soundbufferlen + guicheckbox "Mumble positional audio" mumble + + guitab "mouse" //////////////////////////////////////////////////////////////////////////////////////////////////////////// + guicheckbox "invert mouse" invmouse + + guilist [ + guitext "mouse sensitivity: " + newsens = $sensitivity + guifield newsens 8 [sensitivity $newsens] + ] + + guilist [ + guitext "mouse UI sensitivity: " + newguisens = $guisens + guifield newguisens 8 [guisens $newguisens] + ] + + guilist [ + guibutton "crosshair: " [showgui crosshair] + guiimage (getcrosshair) [showgui crosshair] 0.5 + ] + guitext "crosshair size" + guislider crosshairsize + + guitab "keys" //////////////////////////////////////////////////////////////////////////////////////////////////////////// + guitext "(basic keybinds, for anything more use the 'bind' command)" + guitext "select action to bind and press desired keys (ESC when done):" + + bindidx = 0 + guilistsplit n 2 $bindactions [ + guilist [ + guitext (tabify (concatword $n ": ") 4) + [newbinds@bindidx] = (searchbinds $n) + guikeyfield [newbinds@bindidx] -12 [ + oldbinds = (searchbinds [@@n]) + looplist j $oldbinds [bind $j ""] + looplist j $[newbinds@@bindidx] [bind $j [@@@n]] + ] + bindidx = (+ $bindidx 1) + ] + ] [guibar] + + guitab "console" //////////////////////////////////////////////////////////////////////////////////////////////////////////// + guicheckbox "chat console" miniconfilter 0x300 0 + guitext "console size (lines)" + guislider consize + guitext "console filter:" + guilist [ + guilist [ + guibitfield "important information" confilter 0x11 + guibitfield "warnings" confilter 0x02 + guibitfield "errors" confilter 0x04 + guibitfield "script messages" confilter 0x20 + ] + guibar + guilist [ + guibitfield "chat" confilter 0x100 + guibitfield "team chat" confilter 0x200 + guibitfield "game events" confilter 0x400 + ] + guibar + guilist [ + guibitfield "self frags" confilter 0x800 + guibitfield "other player frags" confilter 0x1000 + guibitfield "team kills" confilter 0x2000 + ] + ] + guitext "full console size (percent of screen)" + guislider fullconsize + guitext "full console filter:" + guilist [ + guilist [ + guibitfield "important information" fullconfilter 0x11 + guibitfield "warnings" fullconfilter 0x02 + guibitfield "errors" fullconfilter 0x04 + guibitfield "script messages" fullconfilter 0x20 + ] + guibar + guilist [ + guibitfield "chat" fullconfilter 0x100 + guibitfield "team chat" fullconfilter 0x200 + guibitfield "game events" fullconfilter 0x400 + ] + guibar + guilist [ + guibitfield "self frags" fullconfilter 0x800 + guibitfield "other player frags" fullconfilter 0x1000 + guibitfield "team kills" fullconfilter 0x2000 + ] + ] + + guitab "cfg" //////////////////////////////////////////////////////////////////////////////////////////////////////////// + guitext "autoexec.cfg" + showfileeditor "autoexec.cfg" -64 13 +] "game" + ++fround = [round (+f $arg1 $arg2) (absf $arg2)] + +newgui ammobar [ + guicheckbox "AmmoBar" ammobar + guibar + guilist [ + guitext "AmmoBarAlign:^t^t^t" + guiradio "-1 " ammobaralign -1 + guiradio "0 " ammobaralign 0 + guiradio "1" ammobaralign 1 + ] + + guicheckbox "AmmoBarHorizontal" ammobarhorizontal + + guicheckbox "AmmoBarFlip" ammobarflip + + guicheckbox "AmmoBarHideEmpty" ammobarhideempty + + guitext "AmmoBarSep:" + guislider ammobarsep + + guitext "AmmoBarCountSep:" + guislider ammobarcountsep + + guilist [ + guitext "AmmoBarCountScale:^t" + guifield ammobarcountscale 5 + guistayopen [ guibutton "- " [ammobarcountscale (+fround $ammobarcountscale -0.1)] ] + guistayopen [ guibutton "+" [ammobarcountscale (+fround $ammobarcountscale 0.1)] ] + ] + + guilist [ + guitext "AmmoBarScale:^t^t^t" + guifield ammobarscale 5 + guistayopen [ guibutton "- " [ammobarscale (+fround $ammobarscale -0.01)] ] + guistayopen [ guibutton "+" [ammobarscale (+fround $ammobarscale 0.01)] ] + ] + + guilist [ + guitext "AmmoBarX:^t^t^t" + guifield ammobarx 5 + guistayopen [ guibutton "- " [ammobarx (+fround $ammobarx -0.01)] ] + guistayopen [ guibutton "+" [ammobarx (+fround $ammobarx 0.01)] ] + ] + guilist [ + guitext "AmmoBarY:^t^t^t" + guifield ammobary 5 + guistayopen [ guibutton "- " [ammobary (+fround $ammobary -0.01)] ] + guistayopen [ guibutton "+" [ammobary (+fround $ammobary 0.01)] ] + ] +] "AmmoBar" + + +newgui gameclock [ + guicheckbox "GameClock" gameclock + guibar + guilist [ + guitext "GameClockAlign:^t" + guiradio "-1 " gameclockalign -1 + guiradio "0 " gameclockalign 0 + guiradio "1" gameclockalign 1 + ] + + guitext "GameClockAlpha:" + guislider gameclockalpha + + // gameclockcolour 0 - 0xFFFFFF + // gameclocklowcolour 0 - 0xFFFFFF + + guilist [ + guitext "GameClockScale:^t" + guifield gameclockscale 5 + guistayopen [ guibutton "- " [gameclockscale (+fround $gameclockscale -0.01)] ] + guistayopen [ guibutton "+" [gameclockscale (+fround $gameclockscale 0.01)] ] + ] + + guilist [ + guitext "GameClockX:^t^t" + guifield gameclockx 5 + guistayopen [ guibutton "- " [gameclockx (+fround $gameclockx -0.01)] ] + guistayopen [ guibutton "+" [gameclockx (+fround $gameclockx 0.01)] ] + ] + guilist [ + guitext "GameClockY:^t^t" + guifield gameclocky 5 + guistayopen [ guibutton "- " [gameclocky (+fround $gameclocky -0.01)] ] + guistayopen [ guibutton "+" [gameclocky (+fround $gameclocky 0.01)] ] + ] +] "GameClock" + + +newgui hudscore [ + guicheckbox "HUDScore" hudscore + guibar + guilist [ + guitext "HUDScoreAlign:^t^t" + guiradio "-1 " hudscorealign -1 + guiradio "0 " hudscorealign 0 + guiradio "1" hudscorealign 1 + ] + + guitext "HUDScoreAlpha:" + guislider hudscorealpha + + // hudscoreenemycolour 0 - 0xFFFFFF + // hudscoreplayercolour 0 - 0xFFFFFF + + guitext "HUDScoreSep:" + guislider hudscoresep + + guilist [ + guitext "HUDScoreScale:^t^t" + guifield hudscorescale 5 + guistayopen [ guibutton "- " [hudscorescale (+fround $hudscorescale -0.01)] ] + guistayopen [ guibutton "+" [hudscorescale (+fround $hudscorescale 0.01)] ] + ] + + guilist [ + guitext "HUDScoreX:^t^t" + guifield hudscorex 5 + guistayopen [ guibutton "- " [hudscorex (+fround $hudscorex -0.01)] ] + guistayopen [ guibutton "+" [hudscorex (+fround $hudscorex 0.01)] ] + ] + guilist [ + guitext "HUDScoreY:^t^t" + guifield hudscorey 5 + guistayopen [ guibutton "- " [hudscorey (+fround $hudscorey -0.01)] ] + guistayopen [ guibutton "+" [hudscorey (+fround $hudscorey 0.01)] ] + ] +] "HUDScore" + + +bindactions = [forward backward left right jump attack togglezoom saycommand sayteamcommand showscores toggleconsole screenshot edittoggle "setweapon FI" "setweapon SG" "setweapon CG" "setweapon RL" "setweapon RI" "setweapon GL" "setweapon PI" "weapon" "universaldelta 1" "universaldelta -1" dropflag addbot delbot] + +entupdate = [ entset $entguitype $entguiattr0 $entguiattr1 $entguiattr2 $entguiattr3 $entguiattr4 ] + +initentgui = [ + entguitype = (enttype) + @(loopconcat i 5 [result [ + entguiattr@i = (entattr @i) + ]]) +] + +genentattributes = [ + entattributes = (loopconcat i (listlen $arg2) [ + entattribname = (at $arg2 $i) + entattriblimits = (at $arg3 (* 2 $i)) + entattriblimits2 = (at $arg3 (+ 1 (* 2 $i))) + if (=s (at $entattriblimits 0) $entattriblimits) [ + result [ + guitext @entattribname + guislider entguiattr@i @entattriblimits @entattriblimits2 entupdate + ] + ] [ + result [ + guitext @entattribname + guinameslider entguiattr@i [@@entattriblimits] [@@entattriblimits2] entupdate + ] + ] + ]) +] + +guilistsplit = [ + guilist [ + z = (div (+ (listlen $arg3) (- $arg2 1)) $arg2) + loop a $arg2 [ + guilist [ + if (>= $numargs 6) [arg6] + loopsublist $arg1 $arg3 (* $a $z) $z [ + arg4 + ] + ] + if (&& (>= $numargs 5) (< (+ $a 1) $arg2)) [arg5] + ] + ] +] + +quickeditmenu = [ + guitext "Quick Commands:" + guibar + guifield savemap_name 10 [ savemap $savemap_name ] + guibutton "quick light" "calclight -1" + guibutton "optimize map" "remip" + guibutton "new entity" "newent shells" + guibar + guibutton newmap + guibar + guibutton help "showgui editing" +] + +matmenu = [ + guibutton "air" "editmat air" + guibutton "water" "editmat water" + guibutton "lava" "editmat lava" + guibutton "clip" "editmat clip" + guibutton "glass" "editmat glass" + guibutton "noclip" "editmat noclip" + guibutton "gameclip" "editmat gameclip" + guibutton "death" "editmat death" + guibutton "alpha" "editmat alpha" + guicheckbox "show material volumes" showmat +] + +brushmenu = [ + guilist [ // diamonds + guiimage "packages/icons/brush_1c.png" brush_0 + guiimage "packages/icons/brush_21c.png" brush_1 + guiimage "packages/icons/brush_421c.png" brush_2 + ] + guilist [ // squares + guiimage "packages/icons/brush_3s.png" brush_3 + guiimage "packages/icons/brush_5s.png" brush_4 + guiimage "packages/icons/brush_7s.png" brush_5 + ] + guititle smooth + guilist [ // smooth + guiimage "packages/icons/brush_3s.png" brush_6 + guiimage "packages/icons/brush_5s.png" brush_7 + guiimage "packages/icons/brush_7s.png" brush_8 + ] +] + +newentgui = [ + genentattributes $arg1 $arg2 $arg3 + newgui $arg1 [ + guitext $entguitype + guibar + @entattributes + guitab type + guilistsplit n 2 $enttypelist [ + guibutton $n [ entset @n ] + ] + guitab misc + @quickeditmenu + ] "" [initentgui] +] + +looplist i $enttypelist [ + newentgui $i "" "" +] + +newgui materials [ + @matmenu + guitab misc + @quickeditmenu +] + +newgui brushes [ + @brushmenu + guitab misc + @quickeditmenu +] + +newgui quickedit [ + @quickeditmenu + guitab materials + @matmenu +] + +newentgui light "radius red green blue" "1 400 0 255 0 255 0 255" +newentgui spotlight "radius" "0 200" +newentgui playerstart "direction" "0 360" +newentgui teleport "tag" "0 20" +newentgui teledest "direction tag" "0 360 0 20" +newentgui monster "direction type" "0 360 0 7" +newentgui mapmodel "direction model" "0 360 0 372" +newentgui envmap "radius" "0 512" +newentgui jumppad "Z Y X" "-128 128 -128 127 -128 127" +newentgui sound "type radius size" "0 20 0 500 0 500" +newentgui particles "type" "0 13" + +contexteditgui = [ + if $hmapedit [showgui brushes] [ + if (enthavesel) [ + showgui (enttype) + ] [showgui (? (havesel) materials quickedit)] + ] +] + +showentgui = [ contexteditgui ] // legacy bind + +newgui seltexinfo [ + guitext (concatword "Slot: " (getseltex)) + guilist [ loop x 5 [ + texname = (gettexname (getseltex) $x) + texname = (substr $texname (+ (strstr $texname ">") 1)) // chop off any leading commands + guiimage (concatword "packages/" $texname) "" 1 1 + ]] + loop x 5 [ tex = (gettexname (getseltex) $x); if (strcmp $tex "") [] [guitext $tex]] +] diff --git a/data/rightup.png b/data/rightup.png new file mode 100644 index 0000000..38faa32 Binary files /dev/null and b/data/rightup.png differ diff --git a/data/sounds.cfg b/data/sounds.cfg new file mode 100644 index 0000000..620dd71 --- /dev/null +++ b/data/sounds.cfg @@ -0,0 +1,57 @@ +// hardcoded cube sounds (i.e. order matters, and these must always be the first to be registered). + +registersound "aard/jump" // 0 +registersound "aard/land" +registersound "q009/rifle" 80 // "awesund/rifle" //"free/rifle1" +altsound "q009/rifle2" 80 +altsound "q009/rifle3" 80 +registersound "free/punch1" +registersound "q009/shotgun" 110 // "free/shotgun" //"awesund/shotgun" +altsound "q009/shotgun2" 110 +altsound "q009/shotgun3" 110 +registersound "q009/minigun" 70 // "awesund/cg1" 90 // "free/chaingun_once" //"awesund/cg2" +altsound "q009/minigun2" 70 +altsound "q009/minigun3" 70 +registersound "q009/rlauncher" // "awesund/rlaunch" //"free/rocketlaunch" +altsound "q009/rlauncher2" +altsound "q009/rlauncher3" +registersound "q009/ren" 200 // "awesund/explode" //"free/rocketl" +altsound "q009/ren2" 200 +altsound "q009/ren3" 200 +registersound "aard/weapload" +registersound "aard/itempick" +registersound "free/itempick" // 10 +registersound "free/tick" +registersound "free/acid6" +registersound "free/itemback" +registersound "q009/teleport" 255 +registersound "aard/outofammo" +registersound "free/acid5" +registersound "aard/pain1" +registersound "aard/pain2" +registersound "aard/pain3" +registersound "aard/pain4" // 20 +registersound "aard/pain5" +registersound "aard/pain6" +registersound "aard/die1" +registersound "aard/die2" +registersound "q009/glauncher" // "awesund/flaunch" +registersound "q009/grenade" 200 +altsound "q009/grenade2" 200 +altsound "q009/grenade3" 200 +registersound "nieb/jumppad" 255 +registersound "q009/pistol" 80 // "free/pistol" +altsound "q009/pistol2" 80 +altsound "q009/pistol3" 80 + +registersound "blindabuser/fight" 150 +registersound "blindabuser/health_boost" 150 +registersound "blindabuser/health_boost_in_10_seconds" 150 +registersound "blindabuser/quad_damage" 150 +registersound "blindabuser/quad_damage_in_10_seconds" 150 + +registersound "soundsnap/burn" +registersound "soundsnap/chainsaw_attack" 150 +registersound "soundsnap/chainsaw_idle" 230 + +registersound "free/hit" 60 diff --git a/data/stdedit.cfg b/data/stdedit.cfg new file mode 100644 index 0000000..6d99574 --- /dev/null +++ b/data/stdedit.cfg @@ -0,0 +1,349 @@ + +// implements some editing commands + + +//////// Entity Editing /////////////// + +=enttype = [ + || [strcmp * $arg1] [strcmp (enttype) $arg1] +] + +=entattr = [ + || [strcmp * $arg2] [= (entattr $arg1) $arg2] +] + +// clear ents of given type +clearents = [ + if $editing [ + entcancel + entselect [ =enttype $arg1 ]; + echo Deleted (enthavesel) $arg1 entities; + delent + ] +] + +// replace all ents that match current selection +// with the values given +replaceents = [ + if $editing [ + do [ + entfind @(entget) + entset @(loopconcat i $numargs [result $[arg@(+ $i 1)]]) + ] + echo Replaced (enthavesel) entities + ] +] + +selentedit = [ saycommand ( concatword "/entset " (entget) ) ] +selreplaceents = [ saycommand ( concatword "/replaceents " (entget) ) ] +selentfindall = [ do [ entfind @(entget) ] ] + +// modify given attribute of ent by a given amount +// arg1 attribute +// arg2 value +entproperty = [ + entattr $arg1 (+ (entattr $arg1) $arg2) +] + +enttypelist = [ + light mapmodel playerstart envmap particles sound + shells bullets rockets riflerounds grenades cartridges + health healthboost greenarmour yellowarmour quaddamage + teleport teledest + monster carrot jumppad + base respawnpoint + spotlight + box barrel platform elevator + flag +] + +enttypeselect = [ + enttypelength = (listlen $enttypelist) + next = (mod (+ (indexof $enttypelist (enttype)) $arg1) $enttypelength) + if (< $next 0) [ next = (+ $next $enttypelength) ] + do [entset @(listsplice (entget) (at $enttypelist $next) 0 1)] +] + +////// Entity primary actions ///////// + +ent_action_base = [ entproperty 0 ( * $arg1 1 ) ] +ent_action_teleport = [ entproperty 0 ( * $arg1 1 ) ] +ent_action_teledest = [ entproperty 1 ( * $arg1 1 ) ] +ent_action_mapmodel = [ entproperty 1 ( * $arg1 1 ) ] +ent_action_spotlight = [ entproperty 0 ( * $arg1 5 ) ] +ent_action_light = [ entproperty 0 ( * $arg1 5 ) ] +ent_action_jumppad = [ entproperty 0 ( * $arg1 5 ) ] +ent_action_respawnpoint = [ entproperty 0 ( * $arg1 15 ) ] +ent_action_playerstart = [ entproperty 0 ( * $arg1 15 ) ] +ent_action_envmap = [ entproperty 0 ( * $arg1 5 ) ] +ent_action_particles = [ entproperty 0 ( * $arg1 1 ) ] +ent_action_sound = [ entproperty 0 ( * $arg1 1 ) ] +ent_action_cycle = [ entset ( if ( > $arg1 -1 ) [ result $arg2 ] [ result $arg3 ] ) ] +ent_action_shells = [ ent_action_cycle $arg1 bullets quaddamage ] +ent_action_bullets = [ ent_action_cycle $arg1 rockets shells ] +ent_action_rockets = [ ent_action_cycle $arg1 riflerounds bullets ] +ent_action_riflerounds = [ ent_action_cycle $arg1 grenades rockets ] +ent_action_grenades = [ ent_action_cycle $arg1 cartridges riflerounds ] +ent_action_cartridges = [ ent_action_cycle $arg1 quaddamage grenades ] +ent_action_quaddamage = [ ent_action_cycle $arg1 shells cartridges ] +ent_action_health = [ ent_action_cycle $arg1 healthboost yellowarmour ] +ent_action_healthboost = [ ent_action_cycle $arg1 greenarmour health ] +ent_action_greenarmour = [ ent_action_cycle $arg1 yellowarmour healthboost ] +ent_action_yellowarmour = [ ent_action_cycle $arg1 health greenarmour ] +ent_action_monster = [ entproperty 1 ( * $arg1 1 ) ] +ent_action_box = [ entproperty 1 ( * $arg1 1 ) ] +ent_action_barrel = [ entproperty 1 ( * $arg1 1 ) ] +ent_action_platform = [ entproperty 1 ( * $arg1 1 ) ] +ent_action_elevator = [ entproperty 1 ( * $arg1 1 ) ] + +//////// Copy and Paste ////////////// + +// 3 types of copying and pasting +// 1. select only cubes -> paste only cubes +// 2. select cubes and ents -> paste cubes and ents. same relative positions +// 3. select only ents -> paste last selected ent. if ents are selected, replace attrs as paste + +opaquepaste = 1 +entcopybuf = "" + +entreplace = [ + do [ + if (enthavesel) [] [ newent @entcopybuf ] + entset @entcopybuf + ] +] + +editcopy = [ + if (|| [havesel] [! (enthavesel)]) [ + entcopybuf = "" + entcopy + copy + ] [ + entcopybuf = (entget) + ] +] + +editpaste = [ + cancelpaste = (! (|| [enthavesel] [havesel])); + if (strcmp "" $entcopybuf) [ + pastehilite + reorient // temp; real fix will be in octaedit + onrelease [ + if $opaquepaste delcube + paste + entpaste + if $cancelpaste [ cancelsel ] + ] + ] [ + entreplace + if $cancelpaste [ cancelsel ] + ] +] + +/////// Selection /////////////// + +// select ents with given properties +// '*' is wildcard +entfind = [ + if (= $numargs 0) [ + entselect 1 + ] [ + entselect (concat [ && [=enttype @@arg1] ] (loopconcat i (- $numargs 1) [ + result [ [=entattr @@i @@[arg@(+ $i 2)]] ] + ])) + ] +] + +entfindinsel = [ + if (= $numargs 0) [ + entselect [ insel ] + ] [ + entselect (concat [ && [insel] [=enttype @@arg1] ] (loopconcat i (- $numargs 1) [ + result [ [=entattr @@i @@[arg@(+ $i 2)]] ] + ])) + ] +] + +lse = [ + line = "" + count = 0 + entloop [ + line = ( concatword $line (entget) " " ) + count = ( + $count 1 ) + if (> $count 4) [ + echo $line + line = "" + count = 0 + ] + ] + if (> $count 0 ) [ echo $line ] + echo (enthavesel) entities selected +] + +drag = [ dragging 1; onrelease [ dragging 0 ] ] +corners = [ selectcorners 1; dragging 1; onrelease [ selectcorners 0; dragging 0 ] ] +editmove = [ moving 1; onrelease [ moving 0 ]; result $moving ] +entdrag = [ entmoving 1; onrelease [entmoving 0]; result $entmoving ] +editdrag = [ cancelsel; || [entdrag] [ drag ] ] +selcorners = [ if $hmapedit [ hmapselect ] [ cancelsel; || [entdrag] [ corners ] ] ] +editextend = [ || [entdrag] [ selextend; reorient; editmove ] ] + +editmovewith = [ + if (havesel) [ + || [editmove] [ @arg1 ] + onrelease [ moving 0; dragging 0 ] + ] [ + @arg1 + ] +] + +editmovecorner = [ editmovewith selcorners ] +editmovedrag = [ editmovewith editdrag ] + +////// Other Editing commands ///////// + +editfacewentpush = [ + + if (|| [havesel] [! (enthavesel)] ) [ + if $moving [ + pushsel $arg1 + ] [ + entcancel + editface $arg1 $arg2 + ] + ] [ + if $entmoving [ entpush $arg1 ] [ ent_action_@(enttype) $arg1 ] + ] +] + +entswithdirection = "playerstart teledest mapmodel flag monster box barrel platform elevator" + +entdirection = [ + if ( && [enthavesel] [ = (havesel) 0 ] ) [ + if (>= (indexof $entswithdirection (enttype)) 0) [ + if (> $arg1 0) [ + entproperty 0 $arg2 + if (> (entattr 0) 360) [ entproperty 0 -360 ] + ] [ + entproperty 0 (- 0 $arg2) + if (< (entattr 0) 0) [ entproperty 0 360 ] + ] + ] + result 1 + ] [ + result 0 + ] +] + +editdel = [ if (! (enthavesel)) [delcube]; delent ] +editflip = [ flip; entflip ] + +editrotate = [ + || [ entdirection $arg1 15 ] [ + rotate $arg1 + entrotate $arg1 + ] +] + +editcut = [ + if (moving 1) [ + if (= $moving 1) [selsave] + onrelease [ + moving 0 + if (selmoved) [ + selswap + copy; entcopy + delcube; delent + selrestore + paste; entpaste + ] + ] + ] +] + +edithud = [ + format "%6^f7%7^f7gridpower ^f2%1 %2 %3 %4 %5" $gridpower ( + if $allfaces [format "^f2allfaces"][format "^f4allfaces"] + )( + if $entediting [format "^f2entediting"][format "^f4entediting"] + )( + if $entselsnap [format "^f2entselsnap"][format "^f4entselsnap"] + )( + if $dropwaypoints [format "^f0dropwaypoints"][] + )( + if $hmapedit [format "brush^f2 %1 ^f7:^f2 %2^n" $brushindex $brushname] [ + if $blendpaintmode [ + format "blendpaint mode: ^f2%1^f7^nblend brush: ^f2%2^n" (at $blendpaintmodes $blendpaintmode) (getblendbrushname (curblendbrush)) + ] [if (! (enthavesel)) [ + texnum = (? (>= $texguinum 0) $texguinum (getseltex)) + format "^f2%1 ^f7:^f2 %2^n" (max 0 $texnum) (gettexname $texnum) + ]] + ] + )( + if (enthavesel) [concat (entget) ":^f2" (enthavesel) "^f7selected^n"] + ) +] + +entcomplete = [ listcomplete $arg1 $enttypelist ] +entcomplete newent +entcomplete entfind +entcomplete clearents + +listcomplete editmat "air water clip glass noclip lava gameclip death alpha" +air = [ editmat air $arg1 ] +loop i 4 [ + [water@(? $i (+ $i 1))] = [ editmat water@(? $i (+ $i 1)) $arg1 ] + [lava@(? $i (+ $i 1))] = [ editmat lava@(? $i (+ $i 1)) $arg1 ] + [glass@(? $i (+ $i 1))] = [ editmat glass@(? $i (+ $i 1)) $arg1 ] +] +clip = [ editmat clip $arg1 ] +noclip = [ editmat noclip $arg1 ] +gameclip = [ editmat gameclip $arg1 ] +death = [ editmat death $arg1 ] +alpha = [ editmat alpha $arg1 ] + +blendpaintmodes = ["off" "replace" "dig" "fill" "inverted dig" "inverted fill"] +setblendpaintmode = [ + if (> $numargs 0) [blendpaintmode $arg1] [blendpaintmode 0] + echo "blend paint mode set to:" (at $blendpaintmodes $blendpaintmode) +] +scrollblendbrush = [ + if (> $numargs 0) [nextblendbrush $arg1] [nextblendbrush] + echo "blend brush set to:" (getblendbrushname (curblendbrush)) +] + +minimaphere = [minimapheight (at (getcampos) 2)] + +getsundir = [sunlightyaw (getcamyaw); sunlightpitch (getcampitch)] + +echovcolor = [echo ***vcolor (getvcolor $getseltex)] +echovrotate = [echo ***vrotate (getvrotate $getseltex)] +echovoffset = [echo ***voffset (getvoffset $getseltex)] +echovscroll = [echo ***vscroll (getvscroll $getseltex)] +echovscale = [echo ***vscale (getvscale $getseltex)] +echovlayer = [echo ***vlayer (getvlayer $getseltex)] +echovalpha = [echo ***valpha (getvalpha $getseltex)] + +// echovshaderparamname = [echo (getvshaderparamnames $getseltex)] // Echoes the name of altered vshaderparam, if used. Only works with vshaderparam, not params set in map.cfg +echovshaderparam = [echo ***vshaderparam (getvshaderparamnames $getseltex) (getvshaderparam $getseltex (getvshaderparamnames $getseltex))] // Only works with vshaderparam, not params set in map.cfg +// echovshaderparamenvscale = [echo ***shaderparam envscale (getvshaderparam $getseltex envscale)] +// echovshaderparamglowcolor = [echo ***shaderparam glowcolor (getvshaderparam $getseltex glowcolor)] +// echovshaderparamparallaxscale = [echo ***shaderparam parallaxscale (getvshaderparam $getseltex parallaxscale)] +// echovshaderparampulseglowcolor = [echo ***shaderparam pulseglowcolor (getvshaderparam $getseltex pulseglowcolor)] +// echovshaderparampulseglowspeed = [echo ***shaderparam pulseglowspeed (getvshaderparam $getseltex pulseglowspeed)] +// echovshaderparampulsespeed = [echo ***shaderparam pulsespeed (getvshaderparam $getseltex pulsespeed)] +// echovshaderparamspecscale = [echo ***shaderparam specscale (getvshaderparam $getseltex specscale)] + +findpickupents = [entfind shells;entfind bullets;entfind rockets;entfind riflerounds;entfind grenades;entfind cartridges;entfind greenarmour;entfind yellowarmour;entfind health;entfind healthboost;entfind quaddamage;] + +prettysky = [ + skybox "skyboxes/remus/sky01" + ambient 25 21 23 + skylight 148 153 163 + blurskylight 2 + sunlight 255 252 250 + sunlightscale 1.3 + sunlightpitch 43 + sunlightyaw 53 +] + diff --git a/data/stdlib.cfg b/data/stdlib.cfg new file mode 100644 index 0000000..46e2517 --- /dev/null +++ b/data/stdlib.cfg @@ -0,0 +1,59 @@ +// console language standard library + +// creates a macro whose body is a format string +// i.e. macro greet [ say Hi, %1! ] +macro = [ + $arg1 = (concat [format [@@arg2]] (loopconcat i $numargs [concatword " $arg" (+ $i 1)])) +] + +// binds a key so that it will toggle a variable +// i.e. bindvar 9 thirdperson +togglevar = [ + set $arg1 (= $$arg1 0) + if (= $$arg1 0) [echo $arg1 OFF] [echo $arg1 ON] +] +bindvar = [ + if (>= $numargs 3) [ + bind $arg1 [if (@arg3) [togglevar @@arg2]] + ] [ + bind $arg1 [togglevar @arg2] + ] +] +bindvarquiet = [ + bind $arg1 [set @arg2 (= $@arg2 0)] +] + +// same as above, but only binds for edit mode +editbindvar = [ + if (>= $numargs 3) [ + editbind $arg1 [if (@arg3) [togglevar @@arg2]] + ] [ + editbind $arg1 [togglevar @arg2] + ] +] +editbindvarquiet = [ + editbind $arg1 [set @arg2 (= $@arg2 0)] +] + +// binds a key so that it will set a modifier while held down +bindmod = [ + bind $arg1 [set @arg2 1; onrelease [set @@arg2 0]] +] + +// same as above, but only binds for edit mode +editbindmod = [ + editbind $arg1 [set @arg2 1; onrelease [set @@arg2 0]] +] + +quine = [ echo (format "quine = [%1]" $quine) ] + +loadsky = [ + skybox $arg1 + if (> $numargs 1) [ + spinsky $arg2 + ] [ + if (!=f $spinsky 0) [spinsky 0] + ] +] + +mapmsg = [ maptitle $arg1 ] diff --git a/data/teammate.png b/data/teammate.png new file mode 100644 index 0000000..d2961b1 Binary files /dev/null and b/data/teammate.png differ