void MapData::SetTileInfo(float x, float y, int tile, int layer, int id) { Tile* temp; switch (layer) { case 1: { temp = &mLayer1[tile]; break; } case 2: { temp = &mLayer2[tile]; break; } case 3: { temp = &mLayer3[tile]; break; } case 4: { temp = &mLayer4[tile]; break; } default: { break; } } temp->SetPosition(SVector2(x, y)); temp->SetType(id); }
LPARAM TileGroup::ItemLoaded(UINT64 id, LoadItemResponse *item) { int iconPosition = GetIconPosition(item->id); RECT pos = mLayoutSettings.RectFromID(iconPosition, mTileWidth, mTileHeight, int(mWindow->GetSize().width + 0.5f), int(mWindow->GetSize().height + 0.5f)); Tile *icon = new Tile(this, item->id, mWorkingFolder, mTileWidth, mTileHeight, mTileSettings, item->thumbnail); icon->SetPosition(iconPosition, (int)pos.left, (int)pos.top); mTiles.push_back(icon); return 0; }