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


C++ ReadStream::readSint16BE方法代码示例

本文整理汇总了C++中common::ReadStream::readSint16BE方法的典型用法代码示例。如果您正苦于以下问题:C++ ReadStream::readSint16BE方法的具体用法?C++ ReadStream::readSint16BE怎么用?C++ ReadStream::readSint16BE使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在common::ReadStream的用法示例。


在下文中一共展示了ReadStream::readSint16BE方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: drawRoundRect

void Design::drawRoundRect(Graphics::ManagedSurface *surface, Common::ReadStream &in,
				Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType) {
	int16 y1 = in.readSint16BE();
	int16 x1 = in.readSint16BE();
	int16 y2 = in.readSint16BE();
	int16 x2 = in.readSint16BE();
	int16 arc = in.readSint16BE();

	if (x1 > x2)
		SWAP(x1, x2);
	if (y1 > y2)
		SWAP(y1, y2);

	Common::Rect r(x1, y1, x2, y2);
	PlotData pd(surface, &patterns, fillType, 1, this);

	if (fillType <= patterns.size())
		Graphics::drawRoundRect(r, arc / 2, kColorBlack, true, drawPixel, &pd);

	pd.fillType = borderFillType;
	pd.thickness = borderThickness;

	if (borderThickness > 0 && borderFillType <= patterns.size())
		Graphics::drawRoundRect(r, arc / 2, kColorBlack, false, drawPixel, &pd);
}
开发者ID:Strangerke,项目名称:scummvm,代码行数:25,代码来源:design.cpp

示例2: readHotspot

void MouseHandler::readHotspot(Common::ReadStream &in, Hotspot &hotspot) {
	hotspot._screenIndex = in.readSint16BE();
	hotspot._x1 = in.readSint16BE();
	hotspot._y1 = in.readSint16BE();
	hotspot._x2 = in.readSint16BE();
	hotspot._y2 = in.readSint16BE();
	hotspot._actIndex = in.readUint16BE();
	hotspot._viewx = in.readSint16BE();
	hotspot._viewy = in.readSint16BE();
	hotspot._direction = in.readSint16BE();
}
开发者ID:AlbanBedel,项目名称:scummvm,代码行数:11,代码来源:mouse.cpp

示例3: drawOval

void Design::drawOval(Graphics::ManagedSurface *surface, Common::ReadStream &in,
			Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType) {
	int16 y1 = in.readSint16BE();
	int16 x1 = in.readSint16BE();
	int16 y2 = in.readSint16BE();
	int16 x2 = in.readSint16BE();
	PlotData pd(surface, &patterns, fillType, 1, this);

	if (fillType <= patterns.size())
		Graphics::drawEllipse(x1, y1, x2-1, y2-1, kColorBlack, true, drawPixel, &pd);

	pd.fillType = borderFillType;
	pd.thickness = borderThickness;

	if (borderThickness > 0 && borderFillType <= patterns.size())
		Graphics::drawEllipse(x1, y1, x2-1, y2-1, kColorBlack, false, drawPixel, &pd);
}
开发者ID:Strangerke,项目名称:scummvm,代码行数:17,代码来源:design.cpp

示例4: readBG

void Parser::readBG(Common::ReadStream &in, background_t &curBG) {
	curBG.verbIndex = in.readUint16BE();
	curBG.nounIndex = in.readUint16BE();
	curBG.commentIndex = in.readSint16BE();
	curBG.matchFl = (in.readByte() != 0);
	curBG.roomState = in.readByte();
	curBG.bonusIndex = in.readByte();
}
开发者ID:peres,项目名称:scummvm,代码行数:8,代码来源:parser.cpp

示例5: readBG

void Parser::readBG(Common::ReadStream &in, Background &curBG) {
	curBG._verbIndex = in.readUint16BE();
	curBG._nounIndex = in.readUint16BE();
	curBG._commentIndex = in.readSint16BE();
	curBG._matchFl = (in.readByte() != 0);
	curBG._roomState = in.readByte();
	curBG._bonusIndex = in.readByte();
}
开发者ID:Bundesdrucker,项目名称:scummvm,代码行数:8,代码来源:parser.cpp

示例6: drawPolygon

void Design::drawPolygon(Graphics::ManagedSurface *surface, Common::ReadStream &in,
	Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType) {

	byte ignored = in.readSint16BE(); // ignored

	if (ignored)
		warning("Ignored: %d", ignored);

	int numBytes = in.readSint16BE(); // #bytes used by polygon data, including the numBytes
	int16 by1 = in.readSint16BE();
	int16 bx1 = in.readSint16BE();
	int16 by2 = in.readSint16BE();
	int16 bx2 = in.readSint16BE();
	Common::Rect bbox(bx1, by1, bx2, by2);

	numBytes -= 8;

	int y1 = in.readSint16BE();
	int x1 = in.readSint16BE();

	Common::Array<int> xcoords;
	Common::Array<int> ycoords;

	numBytes -= 6;

	while (numBytes > 0) {
		int y2 = y1;
		int x2 = x1;
		int b = in.readSByte();
		if (b == -128) {
			y2 = in.readSint16BE();
			numBytes -= 3;
		} else {
			y2 += b;
			numBytes -= 1;
		}
		b = in.readSByte();
		if (b == -128) {
			x2 = in.readSint16BE();
			numBytes -= 3;
		} else {
			x2 += b;
			numBytes -= 1;
		}
		xcoords.push_back(x1);
		ycoords.push_back(y1);
		x1 = x2;
		y1 = y2;
	}
	xcoords.push_back(x1);
	ycoords.push_back(y1);

	int npoints = xcoords.size();
	int *xpoints = (int *)calloc(npoints, sizeof(int));
	int *ypoints = (int *)calloc(npoints, sizeof(int));
	for (int i = 0; i < npoints; i++) {
		xpoints[i] = xcoords[i];
		ypoints[i] = ycoords[i];
	}

	PlotData pd(surface, &patterns, fillType, 1, this);

	if (fillType <= patterns.size()) {
		Graphics::drawPolygonScan(xpoints, ypoints, npoints, bbox, kColorBlack, drawPixel, &pd);
	}

	pd.fillType = borderFillType;
	pd.thickness = borderThickness;
	if (borderThickness > 0 && borderFillType <= patterns.size()) {
		for (int i = 1; i < npoints; i++)
			Graphics::drawLine(xpoints[i-1], ypoints[i-1], xpoints[i], ypoints[i], kColorBlack, drawPixel, &pd);
	}

	free(xpoints);
	free(ypoints);
}
开发者ID:Strangerke,项目名称:scummvm,代码行数:76,代码来源:design.cpp


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