本文整理汇总了Java中net.openrs.cache.sprite.Sprites类的典型用法代码示例。如果您正苦于以下问题:Java Sprites类的具体用法?Java Sprites怎么用?Java Sprites使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Sprites类属于net.openrs.cache.sprite包,在下文中一共展示了Sprites类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import net.openrs.cache.sprite.Sprites; //导入依赖的package包/类
private void initialize(final Cache cache) throws IOException {
TypeListManager.initialize(cache);
Textures.initialize(cache);
Sprites.initialize(cache);
XTEAManager.touch();
for (int i = 0; i < MAX_REGION; i++) {
final Region region = new Region(i);
int map = cache.getFileId(5, region.getTerrainIdentifier());
int loc = cache.getFileId(5, region.getLocationsIdentifier());
if (map == -1 && loc == -1)
continue;
if (map != -1) {
region.loadTerrain(cache.read(5, map).getData());
}
if (loc != -1) {
try {
region.loadLocations(cache.read(5, loc, XTEAManager.lookupMap(i)).getData());
}
catch (Exception e) {
flags.add(i);
}
}
regions.add(region);
if (lowestX == null || region.getBaseX() < lowestX.getBaseX()) {
lowestX = region;
}
if (highestX == null || region.getBaseX() > highestX.getBaseX()) {
highestX = region;
}
if (lowestY == null || region.getBaseY() < lowestY.getBaseY()) {
lowestY = region;
}
if (highestY == null || region.getBaseY() > highestY.getBaseY()) {
highestY = region;
}
}
final Sprite mapscene = Sprites.getSprite("mapscene");
final Sprite mapfunction = Sprites.getSprite("mapfunction");
for (int i = 0; i < mapscene.size(); i++) {
mapIcons.put(i, mapscene.getFrame(i).getScaledInstance(5, 6, 0));
}
for (int i = 0; i < mapfunction.size(); i++) {
mapFunctions.put(i, mapfunction.getFrame(i));
}
}
示例2: initialize
import net.openrs.cache.sprite.Sprites; //导入依赖的package包/类
private void initialize(final Cache cache) throws IOException
{
TypeListManager.initialize(cache);
Textures.initialize(cache);
Sprites.initialize(cache);
XTEAManager.touch();
for (int i = 0; i < MAX_REGION; i++)
{
final Region region = new Region(i);
int map = cache.getFileId(5, region.getTerrainIdentifier());
int loc = cache.getFileId(5, region.getLocationsIdentifier());
if (map == -1 && loc == -1)
continue;
if (map != -1)
{
region.loadTerrain(cache.read(5, map).getData());
}
if (loc != -1)
{
ByteBuffer buffer = cache.getStore().read(5, loc);
try
{
region.loadLocations(Container.decode(buffer, XTEAManager.lookupMap(i)).getData());
}
catch (Exception e)
{
if (buffer.limit() != 32)
{
flags.add(i);
}
}
}
regions.add(region);
if (lowestX == null || region.getBaseX() < lowestX.getBaseX())
{
lowestX = region;
}
if (highestX == null || region.getBaseX() > highestX.getBaseX())
{
highestX = region;
}
if (lowestY == null || region.getBaseY() < lowestY.getBaseY())
{
lowestY = region;
}
if (highestY == null || region.getBaseY() > highestY.getBaseY())
{
highestY = region;
}
}
final Sprite mapscene = Sprites.getSprite("mapscene");
for (int i = 0; i < mapscene.size(); i++)
{
mapIcons.put(i, mapscene.getFrame(i).getScaledInstance(4, 5, 0));
}
}