Ignore:
Timestamp:
Feb 3, 2011, 5:13:52 PM (10 years ago)
Author:
sam
Message:

Change the length of the thumbs list according to the game progress.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/monsterz/thumbs.cpp

    r340 r345  
    4545  : data(new ThumbsData())
    4646{
    47     data->npieces = npieces;
    4847    data->icons = Tiler::Register(PNG_ICONS, 24, 24, 1.0f);
    4948
    50     for (int n = 0; n < data->npieces; n++)
    51     {
    52         data->count[n] = 0;
    53         data->text[n] = new Text(NULL, "monsterz/gfx/font1.png");
    54         Ticker::Ref(data->text[n]);
    55         int3 p = int3(476, 383 - 28 * n, 1);
    56         data->text[n]->SetPos(p);
    57     }
     49    data->npieces = 0;
     50    SetMax(npieces);
    5851
    5952#if 0
     
    8376}
    8477
     78void Thumbs::SetMax(int npieces)
     79{
     80    for (int n = npieces; n < data->npieces; n++)
     81        Ticker::Unref(data->text[n]);
     82
     83    for (int n = data->npieces; n < npieces; n++)
     84    {
     85        data->count[n] = 0;
     86        data->text[n] = new Text(NULL, "monsterz/gfx/font1.png");
     87        Ticker::Ref(data->text[n]);
     88        int3 p = int3(476, 383 - 28 * n, 1);
     89        data->text[n]->SetPos(p);
     90    }
     91
     92    data->npieces = npieces;
     93}
     94
    8595void Thumbs::AddCount(int id, int count)
    8696{
Note: See TracChangeset for help on using the changeset viewer.