aboutsummaryrefslogtreecommitdiff
path: root/advtrains/textures/advtrains_hud_r.png
blob: b357cabbcab48686f3745fc6ac3f8549c9a6d672 (plain)
ofshex dumpascii
0000 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 01 f4 00 00 00 64 04 03 00 00 00 82 e9 df .PNG........IHDR.......d........
0020 4e 00 00 00 18 50 4c 54 45 00 00 00 20 20 20 40 40 40 7f 7f 7f 9e 9e 9e be be be fc fc fc ff ff N....PLTE......@@@..............
0040 ff 86 7e 78 ee 00 00 00 e5 49 44 41 54 78 da ed da b1 69 03 31 18 80 51 e1 18 6b 84 b4 1e 21 5b ..~x.....IDATx....i.1..Q..k...![
0060 b8 f5 08 1e e1 aa 68 fd 14 21 60 9c 4b 6b 4c be f7 95 d7 3d 38 81 7e 49 63 48 92 24 49 92 a4 57 ......h..!`.KkL....=8.~IcH.$I..W
0080 6e ae 9d c2 f4 b5 75 e9 09 fb 1f f4 75 eb d2 57 98 be 75 e9 2b 4c 3f 27 e8 f7 3f f7 21 f3 c7 cf n.....u.....u..W..u.+L?'..?.!...
00a0 df ca e3 37 fd 33 48 ff 59 04 45 fa 08 d3 67 62 b1 ef d2 07 7a 91 fe de a5 4f 74 74 74 74 74 74 ...7.3H.Y.E...gb....z....Otttttt
00c0 f4 ff b5 9b fb e8 d2 c3 93 5b 77 5e 2f 1e 50 45 c6 f5 3d fa 2c 1d 46 df d3 df 5c 41 8c 2c fd 9a .........[w^/.PE..=.,.F...\A.,..
00e0 a5 77 2f 99 3d 2d 68 ae f5 73 97 ee 69 41 69 4b 73 e8 d2 cb 1b d9 cc cc 6a 68 7d f8 78 e9 d2 67 .w/.=-h..s..iAiKs.......jh}.x..g
0100 97 7e ea d2 47 9c be d0 d1 d1 d1 d1 d1 d1 d1 d1 d1 d1 d1 d1 5f 98 7e f1 78 0c 3d 47 5f 61 fa d6 .~..G..............._.~.x.=G_a..
0120 a5 af 22 7d a0 4b 92 24 49 92 a4 67 f5 05 5a bc b2 c6 57 70 fd 8e 00 00 00 00 49 45 4e 44 ae 42 .."}.K.$I..g..Z...Wp......IEND.B
0140 60 82 `.
n104'>104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502
/*
Minetest
Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef UTIL_STRING_HEADER
#define UTIL_STRING_HEADER

#include "irrlichttypes_bloated.h"
#include <stdlib.h>
#include <string>
#include <cstring>
#include <vector>
#include <sstream>
#include <cctype>

#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)

struct FlagDesc {
	const char *name;
	u32 flag;
};

std::wstring narrow_to_wide(const std::string& mbs);
std::string wide_to_narrow(const std::wstring& wcs);
std::string translatePassword(std::string playername, std::wstring password);
std::string urlencode(std::string str);
std::string urldecode(std::string str);
u32 readFlagString(std::string str, const FlagDesc *flagdesc, u32 *flagmask);
std::string writeFlagString(u32 flags, const FlagDesc *flagdesc, u32 flagmask);
size_t mystrlcpy(char *dst, const char *src, size_t size);
char *mystrtok_r(char *s, const char *sep, char **lasts);
u64 read_seed(const char *str);
bool parseColorString(const std::string &value, video::SColor &color, bool quiet);


/**
 * Returns a copy of s with spaces inserted at the right hand side to ensure
 *			that the string is len characters in length. If s is <= len then the
 *			returned string will be identical to s.
 */
static inline std::string padStringRight(std::string s, size_t len)
{
	if (len > s.size())
		s.insert(s.end(), len - s.size(), ' ');

	return s;
}


/**
 * Returns a version of the string s with the first occurrence of a string
 * contained within ends[] removed from the end of the string.
 *
 * @param s
 * @param ends A NULL- or ""- terminated array of strings to remove from s in
 *			the copy produced. Note that once one of these strings is removed
 *			that no further postfixes contained within this array are removed.
 *
 * @return If no end could be removed then "" is returned
 */
static inline std::string removeStringEnd(const std::string &s, const char *ends[])
{
	const char **p = ends;

	for (; *p && (*p)[0] != '\0'; p++) {
		std::string end = *p;
		if(s.size() < end.size())
			continue;
		if(s.substr(s.size()-end.size(), end.size()) == end)
			return s.substr(0, s.size() - end.size());
	}

	return "";
}


/**
 * Check two wide strings for equivalence. If case_insensitive is true
 * then the case of the strings are ignored (default is false).
 *
 * @param s1
 * @param s2
 * @param case_insensitive
 * @return true if the strings match
 */
inline bool str_equal(const std::wstring &s1, const std::wstring &s2,
		bool case_insensitive = false)
{
	if (case_insensitive) {
		if (s1.size() != s2.size())
			return false;

		for (size_t i = 0; i < s1.size(); ++i)
			if(tolower(s1[i]) != tolower(s2[i]))
				return false;

		return true;
	}

	return s1 == s2;
}


/**
 * Check whether str begins with the string prefix. If the argument
 *			case_insensitive == true then the check is case insensitve (default
 *			is false; i.e. case is significant).
 *
 * @param str
 * @param prefix
 * @param case_insensitive
 * @return	true if the str begins with prefix
 */
inline bool str_starts_with(const std::wstring &str, const std::wstring &prefix,
		bool case_insensitive = false)
{
	if (str.size() < prefix.size())
		return false;

	if (case_insensitive) {
		for (size_t i = 0; i < prefix.size(); ++i)
			if (tolower(str[i]) != tolower(prefix[i]))
				return false;
	} else {