Changeset 382


Ignore:
Timestamp:
Feb 7, 2011, 3:23:30 AM (10 years ago)
Author:
sam
Message:

Add more error reporting to the Tiler and the Ticker.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ticker.cpp

    r351 r382  
    180180            if (e->ref)
    181181            {
     182#if !FINAL_RELEASE
     183                fprintf(stderr, "ERROR: poking %s\n", e->GetName());
     184#endif
    182185                e->ref--;
    183186                n++;
  • trunk/src/tiler.cpp

    r222 r382  
    1313#endif
    1414
     15#include <cstdio>
     16
    1517#include "core.h"
    1618
     
    2426
    2527public:
     28    TilerData()
     29#if !FINAL_RELEASE
     30      : lasterror(-1)
     31#endif
     32    { }
     33
     34private:
    2635    Dict tilesets;
     36#if !FINAL_RELEASE
     37    int lasterror;
     38#endif
    2739}
    2840tilerdata;
     
    4254        TileSet *tileset = new TileSet(path, w, h, dilate);
    4355        data->tilesets.SetEntity(id, tileset);
     56#if !FINAL_RELEASE
     57        if (id == data->lasterror)
     58            data->lasterror = -1;
     59#endif
    4460    }
    4561
     
    5773
    5874    TileSet *tileset = (TileSet *)data->tilesets.GetEntity(id);
     75#if !FINAL_RELEASE
     76    if (!tileset && id != data->lasterror)
     77    {
     78        fprintf(stderr, "ERROR: blitting to null tiler #%i\n", id);
     79        data->lasterror = id;
     80        return;
     81    }
     82#endif
    5983    tileset->BlitTile(code & 0xffff, x, y, z, o);
    6084}
Note: See TracChangeset for help on using the changeset viewer.