Example #1
0
 public function getLocation(Neuron_GameServer_Map_Location $location, $objectcount = 0)
 {
     // Fetch the image from the old map object
     $l = $this->map->getLocation($location->x(), $location->y(), $objectcount > 0);
     $color = $l->getMapColor();
     $image = $l->getImage();
     // Make a new sprite
     $out = new Neuron_GameServer_Map_Display_Sprite(STATIC_URL . 'images/tiles/' . $image['image'] . '.gif');
     $out->setColor(new Neuron_GameServer_Map_Color($color[0], $color[1], $color[2]));
     return array($out);
 }
function map_image_cache(Neuron_GameServer_Map_Display_Sprite $image)
{
    global $imageCache;
    global $output;
    global $imagecounter;
    $id = $image->getURI();
    if (!isset($imageCache[$id])) {
        $intid = md5($id);
        $imageCache[$id] = $imagecounter;
        $output['images'][$imagecounter] = array('id' => $intid, 'url' => $image->getURI());
        $imagecounter++;
    }
    return $imageCache[$id];
}