aboutsummaryrefslogtreecommitdiff
path: root/games/minimal/mods/default/textures/treeprop.png
blob: eb8a8e6c4f72f621425efa2fffd133d433c5daca (plain)
ofshex dumpascii
0000 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 00 20 00 00 00 20 08 03 00 00 00 44 a4 8a .PNG........IHDR.............D..
0020 c6 00 00 01 77 50 4c 54 45 00 00 00 00 1d 00 01 08 00 06 11 00 08 31 00 0c 3c 00 0e 31 08 10 36 ....wPLTE.............1..<..1..6
0040 00 14 4c 00 15 40 00 17 1e 08 17 25 00 19 20 08 1a 21 07 1a 52 00 1b 15 05 1b 42 00 1b 50 08 1b ..L..@.....%.....!..R.....B..P..
0060 53 00 1c 26 0b 1c 4a 08 1c 4d 00 1d 36 08 1d 48 00 1d 4a 03 1d 4b 02 1e 3c 05 1e 45 07 1e 48 04 S..&..J..M..6..H..J..K..<..E..H.
0080 1e 4c 07 1e 51 00 1e 57 00 1f 2a 0d 1f 45 0d 1f 50 05 21 16 06 21 4a 00 21 52 03 21 52 08 24 36 .L..Q..W..*..E..P.!..!J.!R.!R.$6
00a0 11 25 4c 09 25 55 01 25 59 02 26 20 17 28 21 11 28 38 10 29 21 1c 29 50 0f 29 60 03 2a 51 0a 2a .%L.%U.%Y.&..(!.(8.)!.)P.)`.*Q.*
00c0 61 08 2b 1c 11 2b 24 14 2b 28 1d 2b 74 00 2c 1b 11 2c 22 1e 2c 23 1e 2c 39 16 2c 65 01 2d 29 18 a.+..+$.+(.+t.,..,".,#.,9.,e.-).
00e0 2e 69 00 2f 24 16 30 2a 1b 30 3e 19 30 61 0a 30 64 0a 31 68 01 32 2e 1d 33 2b 25 33 63 0b 33 6b .i./$.0*.0>.0a.0d.1h.2..3+%3c.3k
0100 05 34 2e 1e 34 5a 0c 34 69 0c 34 6c 0c 34 76 00 35 2b 1c 35 2d 16 36 4c 16 36 73 00 37 2a 18 39 .4..4Z.4i.4l.4v.5+.5-.6L.6s.7*.9
0120 7b 00 3a 2f 1f 3b 22 14 3b 78 02 3c 21 08 3c 2f 20 3d 3a 21 3d 77 06 3e 2d 24 3e 72 08 3e 73 08 {.:/.;".;x.<!.</.=:!=w.>-$>r.>s.
0140 3f 2a 18 40 30 26 43 7c 04 44 7a 12 45 34 2a 46 32 1b 47 79 14 4c 32 1e 4e 8a 0a 4f 35 1e 50 9d ?*.@0&C|.Dz.E4*F2.Gy.L2.N..O5.P.
0160 00 54 a6 01 55 3a 21 56 4a 26 56 99 1a 57 a0 00 58 4f 2f 5c 3f 26 5e a5 0f 61 4b 22 63 48 29 66 .T..U:!VJ&V..W..XO/\?&^..aK"cH)f
0180 48 29 66 50 23 6b 55 30 6c 55 30 6e 41 2b 6f 57 2e 70 52 39 73 56 2b 75 4e 30 76 59 33 78 c0 10 H)fP#kU0lU0nA+oW.pR9sV+uN0vY3x..
01a0 02 6e 6a 74 00 00 00 01 74 52 4e 53 00 40 e6 d8 66 00 00 01 2c 49 44 41 54 78 da ed 8f 57 4f 02 .njt....tRNS.@..f...,IDATx...WO.
01c0 51 14 84 c7 de db da 50 b1 a3 a8 d8 50 b1 57 14 51 c6 b2 76 ec 05 15 6c 28 76 c1 1f ef 2d 1b 62 Q......P....P.W.Q..v...l(v...-.b
01e0 7c f5 95 c9 b9 c9 99 c9 f9 26 bb 48 29 a5 ff 28 c2 4a 3b ff 64 32 72 3c 0e 5b 86 67 13 6e 37 f9 |........&.H)..(.J;.d2r<.[.g.n7.
0200 fb 48 46 56 12 26 9b 43 34 cd 9e 2a a2 ba df 49 22 c9 8b a1 36 64 20 50 94 23 2e 3b 6c 35 dc b4 .HFV.&.C4..*...I"...6d.P.#.;l5..
0220 78 ad bc 5a 69 9c 26 d9 44 da 59 28 18 f6 81 21 ca 46 31 64 58 1a 1b eb 4e 67 49 8d dd af a0 81 x..Zi.&.D.Y(...!.F1dX...NgI.....
0240 94 8d 62 fc 11 4a 23 39 d3 c2 98 7b 07 ea 46 c7 ce a1 fa 03 cd 05 2c cc 4f 60 59 37 76 96 ce e3 ..b..J#9...{..F.......,.O`Y7v...
0260 3b c9 49 44 63 c0 22 eb f7 d7 db ba 1a 5b a6 78 95 e4 8c 68 10 88 06 db cb 2a 06 20 b4 36 f8 a6 ;.IDc."......[.x...h.....*...6..
0280 72 b9 ef 3d a0 d8 48 4b 8f 79 80 98 67 2e 3f db 2b c3 b1 e9 0f d5 27 f7 8b 4f 64 1a 46 46 dc 07 r..=..HK.y..g.?.+.....'..Od.FF..
02a0 c4 7d de 72 af 3a e8 de fe 52 9f 21 f7 de 17 64 19 46 41 c2 05 24 5c 47 e3 fa 60 68 e3 1d 37 5b .}.r.:...R.!...d.FA..$\G..`h..7[
02c0 50 5a 78 06 d0 ba fb 74 00 88 77 bd aa c2 e3 c9 57 9c 2f 41 69 f4 16 40 c9 c8 65 10 10 ef 64 06 PZx....t..w.....W./Ai..@..e...d.
02e0 3f 4f 24 59 d9 50 35 ac be 00 00 00 00 49 45 4e 44 ae 42 60 82 ?O$Y.P5......IEND.B`.
href='#n184'>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 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710
/*
** $Id: lgc.c,v 2.38.1.2 2011/03/18 18:05:38 roberto Exp $
** Garbage Collector
** See Copyright Notice in lua.h
*/

#include <string.h>

#define lgc_c
#define LUA_CORE

#include "lua.h"

#include "ldebug.h"
#include "ldo.h"
#include "lfunc.h"
#include "lgc.h"
#include "lmem.h"
#include "lobject.h"
#include "lstate.h"
#include "lstring.h"
#include "ltable.h"
#include "ltm.h"


#define GCSTEPSIZE	1024u
#define GCSWEEPMAX	40
#define GCSWEEPCOST	10
#define GCFINALIZECOST	100


#define maskmarks	cast_byte(~(bitmask(BLACKBIT)|WHITEBITS))

#define makewhite(g,x)	\
   ((x)->gch.marked = cast_byte(((x)->gch.marked & maskmarks) | luaC_white(g)))

#define white2gray(x)	reset2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT)
#define black2gray(x)	resetbit((x)->gch.marked, BLACKBIT)

#define stringmark(s)	reset2bits((s)->tsv.marked, WHITE0BIT, WHITE1BIT)


#define isfinalized(u)		testbit((u)->marked, FINALIZEDBIT)
#define markfinalized(u)	l_setbit((u)->marked, FINALIZEDBIT)


#define KEYWEAK         bitmask(KEYWEAKBIT)
#define VALUEWEAK       bitmask(VALUEWEAKBIT)



#define markvalue(g,o) { checkconsistency(o); \
  if (iscollectable(o) && iswhite(gcvalue(o))) reallymarkobject(g,gcvalue(o)); }

#define markobject(g,t) { if (iswhite(obj2gco(t))) \
		reallymarkobject(g, obj2gco(t)); }


#define setthreshold(g)  (g->GCthreshold = (g->estimate/100) * g->gcpause)


static void removeentry (Node *n) {
  lua_assert(ttisnil(gval(n)));
  if (iscollectable(gkey(n)))
    setttype(gkey(n), LUA_TDEADKEY);  /* dead key; remove it */
}


static void reallymarkobject (global_State *g, GCObject *o) {
  lua_assert(iswhite(o) && !isdead(g, o));
  white2gray(o);
  switch (o->gch.tt) {
    case LUA_TSTRING: {
      return;
    }
    case LUA_TUSERDATA: {
      Table *mt = gco2u(o)->metatable;
      gray2black(o);  /* udata are never gray */
      if (mt) markobject(g, mt);
      markobject(g, gco2u(o)->env);
      return;
    }
    case LUA_TUPVAL: {
      UpVal *uv = gco2uv(o);
      markvalue(g, uv->v);
      if (uv->v == &uv->u.value)  /* closed? */
        gray2black(o);  /* open upvalues are never black */
      return;
    }
    case LUA_TFUNCTION: {
      gco2cl(o)->c.gclist = g->gray;
      g->gray = o;
      break;
    }
    case LUA_TTABLE: {
      gco2h(o)->gclist = g->gray;
      g->gray = o;
      break;
    }
    case LUA_TTHREAD: {
      gco2th(o)->gclist = g->gray;
      g->gray = o;
      break;
    }
    case LUA_TPROTO: {
      gco2p(o)->gclist = g->gray;
      g->gray = o;
      break;
    }
    default: lua_assert(0);
  }
}


static void marktmu (global_State *g) {
  GCObject *u = g->tmudata;
  if (u) {
    do {
      u = u->gch.next;
      makewhite(g, u);  /* may be marked, if left from previous GC */
      reallymarkobject(g, u);
    } while (u != g->tmudata);
  }
}


/* move `dead' udata that need finalization to list `tmudata' */
size_t luaC_separateudata (lua_State *L, int all) {
  global_State *g = G(L);
  size_t deadmem = 0;
  GCObject **p = &g->mainthread->next;
  GCObject *curr;
  while ((curr = *p) != NULL) {
    if (!(iswhite(curr) || all) || isfinalized(gco2u(curr)))
      p = &curr->gch.next;  /* don't bother with them */
    else if (fasttm(L, gco2u(curr)->metatable, TM_GC) == NULL) {
      markfinalized(gco2u(curr));  /* don't need finalization */
      p = &curr->gch.next;
    }
    else {  /* must call its gc method */
      deadmem += sizeudata(gco2u(curr));
      markfinalized(gco2u(curr));
      *p = curr->gch.next;
      /* link `curr' at the end of `tmudata' list */
      if (g->tmudata == NULL)  /* list is empty? */
        g->tmudata = curr->gch.next = curr;  /* creates a circular list */
      else {
        curr->gch.next = g->tmudata->gch.next;
        g->tmudata->gch.next = curr;
        g->tmudata = curr;
      }
    }
  }
  return deadmem;
}


static int traversetable (global_State *g, Table *h) {
  int i;
  int weakkey = 0;
  int weakvalue = 0;
  const TValue *mode;
  if (h->metatable)
    markobject(g, h->metatable);
  mode = gfasttm(g, h->metatable, TM_MODE);
  if (mode && ttisstring(mode)) {  /* is there a weak mode? */
    weakkey = (strchr(svalue(mode), 'k') != NULL);
    weakvalue = (strchr(svalue(mode), 'v') != NULL);
    if (weakkey || weakvalue) {  /* is really weak? */
      h->marked &= ~(KEYWEAK | VALUEWEAK);  /* clear bits */
      h->marked |= cast_byte((weakkey << KEYWEAKBIT) |
                             (weakvalue << VALUEWEAKBIT));
      h->gclist = g->weak;  /* must be cleared after GC, ... */
      g->weak = obj2gco(h);  /* ... so put in the appropriate list */
    }
  }
  if (weakkey && weakvalue) return 1;
  if (!weakvalue) {
    i = h->sizearray;
    while (i--)
      markvalue(g, &h->array[i]);
  }
  i = sizenode(h);
  while (i--) {
    Node *n = gnode(h, i);
    lua_assert(ttype(gkey(n)) != LUA_TDEADKEY || ttisnil(gval(n)));
    if (ttisnil(gval(n)))
      removeentry(n);  /* remove empty entries */
    else {
      lua_assert(!ttisnil(gkey(n)));
      if (!weakkey) markvalue(g, gkey(n));
      if (!weakvalue) markvalue(g, gval(n));
    }
  }
  return weakkey || weakvalue;
}


/*
** All marks are conditional because a GC may happen while the
** prototype is still being created
*/
static void traverseproto (global_State *g, Proto *f) {
  int i;
  if (f->source) stringmark(f->source);
  for (i=0; i<f->sizek; i++)  /* mark literals */
    markvalue(g, &f->k[i]);
  for (i=0; i<f->sizeupvalues; i++) {  /* mark upvalue names */
    if (f->upvalues[i])
      stringmark(f->upvalues[i]);
  }
  for (i=0; i<f->sizep; i++) {  /* mark nested protos */
    if (f->p[i])
      markobject(g, f->p[i]);
  }
  for (i=0; i<f->sizelocvars; i++) {  /* mark local-variable names */
    if (f->locvars[i].varname)
      stringmark(f->locvars[i].varname);
  }
}



static void traverseclosure (global_State *g, Closure *cl) {
  markobject(g, cl->c.env);
  if (cl->c.isC) {
    int i;
    for (i=0; i<cl->c.nupvalues; i++)  /* mark its upvalues */
      markvalue(g, &cl->c.upvalue[i]);
  }
  else {
    int i;
    lua_assert(cl->l.nupvalues == cl->l.p->nups);
    markobject(g, cl->l.p);
    for (i=0; i<cl->l.nupvalues; i++)  /* mark its upvalues */
      markobject(g, cl->l.upvals[i]);
  }
}


static void checkstacksizes (lua_State *L, StkId max) {
  int ci_used = cast_int(L->ci - L->base_ci);  /* number of `ci' in use */
  int s_used = cast_int(max - L->stack);  /* part of stack in use */
  if (L->size_ci > LUAI_MAXCALLS)  /* handling overflow? */
    return;  /* do not touch the stacks */
  if (4*ci_used < L->size_ci && 2*BASIC_CI_SIZE < L->size_ci)
    luaD_reallocCI(L, L->size_ci/2);  /* still big enough... */
  condhardstacktests(luaD_reallocCI(L, ci_used + 1));
  if (4*s_used < L->stacksize &&
      2*(BASIC_STACK_SIZE+EXTRA_STACK) < L->stacksize)