当前位置: 首页>>代码示例>>Java>>正文


Java Sprites类代码示例

本文整理汇总了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));
	}
}
 
开发者ID:jordanabrahambaws,项目名称:Quavo,代码行数:60,代码来源:MapImageDumper.java

示例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));
	}
}
 
开发者ID:kfricilone,项目名称:OpenRS,代码行数:70,代码来源:MapImageDumper.java


注:本文中的net.openrs.cache.sprite.Sprites类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。