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


C++ debugCN函数代码示例

本文整理汇总了C++中debugCN函数的典型用法代码示例。如果您正苦于以下问题:C++ debugCN函数的具体用法?C++ debugCN怎么用?C++ debugCN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: debugCN

void ScriptInterpreter::copyValue(ScriptValue &destValue, ScriptValue &sourceValue) {

	if (sourceValue.type == -1) {
		debugCN(kDebugScript, "ScriptInterpreter::copyValue() Trying to read uninitialized value!\n");
	}

	switch (destValue.type) {

	case kGameVar:
		_globalVars[destValue.value] = sourceValue;
		break;

	case kRegister:
		_registers[destValue.value] = sourceValue;
		break;

	case kLogicVar:
		// TODO: Move to own method
		if (sourceValue.type == kInteger) {
			_logicGlobals[destValue.value] = sourceValue.value;
		} else {
			debugCN(kDebugScript, "ScriptInterpreter::copyValue() Invalid source value type %d!\n", sourceValue.type);
		}
		break;

	case kKernelVar:
		setKernelVar(destValue.value, sourceValue);
		break;

	default:
		debugCN(kDebugScript, "ScriptInterpreter::copyValue() Invalid dest value type %d!\n", destValue.type);

	}

}
开发者ID:St0rmcrow,项目名称:scummvm,代码行数:35,代码来源:script.cpp

示例2: STRING

int ScriptInterpreter::o1_hasPlayerSaid() {
	const char *words[3];
	for (int i = 0; i < 3; i++)
		words[i] = STRING(i);
	debugCN(kDebugScript, "'%s', '%s', '%s'\n", words[0], words[1], words[2]);

	int result = _vm->_player->said(words[0], words[1], words[2]);

	debugCN(kDebugScript, "   -> '%d'\n", result);

	RETURN(result);
	return 3;
}
开发者ID:St0rmcrow,项目名称:scummvm,代码行数:13,代码来源:script.cpp

示例3: MystAreaImageSwitch

MystAreaDrag::MystAreaDrag(MohawkEngine_Myst *vm, ResourceType type, Common::SeekableReadStream *rlstStream, MystArea *parent) :
		MystAreaImageSwitch(vm, type, rlstStream, parent) {
	_flagHV = rlstStream->readUint16LE();
	_minH = rlstStream->readUint16LE();
	_maxH = rlstStream->readUint16LE();
	_minV = rlstStream->readUint16LE();
	_maxV = rlstStream->readUint16LE();
	_stepsH = rlstStream->readUint16LE();
	_stepsV = rlstStream->readUint16LE();
	_mouseDownOpcode = rlstStream->readUint16LE();
	_mouseDragOpcode = rlstStream->readUint16LE();
	_mouseUpOpcode = rlstStream->readUint16LE();

	debugC(kDebugResource, "\tdirection: %d", _flagHV);
	debugC(kDebugResource, "\thorizontal min: %d", _minH);
	debugC(kDebugResource, "\thorizontal max: %d", _maxH);
	debugC(kDebugResource, "\tvertical min: %d", _minV);
	debugC(kDebugResource, "\tvertical max: %d", _maxV);
	debugC(kDebugResource, "\thorizontal steps: %d", _stepsH);
	debugC(kDebugResource, "\tvertical steps: %d", _stepsV);
	debugC(kDebugResource, "\t_mouseDownOpcode: %d", _mouseDownOpcode);
	debugC(kDebugResource, "\t_mouseDragOpcode: %d", _mouseDragOpcode);
	debugC(kDebugResource, "\t_mouseUpOpcode: %d", _mouseUpOpcode);

	debugCN(kDebugResource, "Type 11 _mouseDownOpcode: %d\n", _mouseDownOpcode);
	debugCN(kDebugResource, "Type 11 _mouseDragOpcode: %d\n", _mouseDragOpcode);
	debugCN(kDebugResource, "Type 11 _mouseUpOpcode: %d\n", _mouseUpOpcode);

	for (byte i = 0; i < ARRAYSIZE(_lists); i++) {
		debugC(kDebugResource, "\tList %d:", i);

		uint16 listCount = rlstStream->readUint16LE();
		debugC(kDebugResource, "\t%d values", listCount);

		for (uint16 j = 0; j < listCount; j++) {
			_lists[i].push_back(rlstStream->readUint16LE());
			debugC(kDebugResource, "\tValue %d: %d", j, _lists[i][j]);
		}
	}

	_stepH = 0;
	_stepV = 0;

	if (_stepsH)
		_stepH = (_maxH - _minH) / (_stepsH - 1);

	if (_stepsV)
		_stepV = (_maxV - _minV) / (_stepsV - 1);
}
开发者ID:BenCastricum,项目名称:scummvm,代码行数:49,代码来源:myst_areas.cpp

示例4: MystResourceType8

MystResourceType11::MystResourceType11(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent) : MystResourceType8(vm, rlstStream, parent) {
	_flagHV = rlstStream->readUint16LE();
	_minH = rlstStream->readUint16LE();
	_maxH = rlstStream->readUint16LE();
	_minV = rlstStream->readUint16LE();
	_maxV = rlstStream->readUint16LE();
	_stepsH = rlstStream->readUint16LE();
	_stepsV = rlstStream->readUint16LE();
	_mouseDownOpcode = rlstStream->readUint16LE();
	_mouseDragOpcode = rlstStream->readUint16LE();
	_mouseUpOpcode = rlstStream->readUint16LE();

	debugC(kDebugResource, "\tdirection: %d", _flagHV);
	debugC(kDebugResource, "\thorizontal min: %d", _minH);
	debugC(kDebugResource, "\thorizontal max: %d", _maxH);
	debugC(kDebugResource, "\tvertical min: %d", _minV);
	debugC(kDebugResource, "\tvertical max: %d", _maxV);
	debugC(kDebugResource, "\thorizontal steps: %d", _stepsH);
	debugC(kDebugResource, "\tvertical steps: %d", _stepsV);
	debugC(kDebugResource, "\t_mouseDownOpcode: %d", _mouseDownOpcode);
	debugC(kDebugResource, "\t_mouseDragOpcode: %d", _mouseDragOpcode);
	debugC(kDebugResource, "\t_mouseUpOpcode: %d", _mouseUpOpcode);

	debugCN(kDebugResource, "Type 11 _mouseDownOpcode: %d\n", _mouseDownOpcode);
	debugCN(kDebugResource, "Type 11 _mouseDragOpcode: %d\n", _mouseDragOpcode);
	debugCN(kDebugResource, "Type 11 _mouseUpOpcode: %d\n", _mouseUpOpcode);

	for (byte i = 0; i < 3; i++) {
		debugC(kDebugResource, "\tList %d:", i);

		_lists[i].listCount = rlstStream->readUint16LE();
		debugC(kDebugResource, "\t%d values", _lists[i].listCount);

		_lists[i].list = new uint16[_lists[i].listCount];
		for (uint16 j = 0; j < _lists[i].listCount; j++) {
			_lists[i].list[j] = rlstStream->readUint16LE();
			debugC(kDebugResource, "\tValue %d: %d", j, _lists[i].list[j]);
		}
	}

	_stepH = 0;
	_stepV = 0;

	if (_stepsH)
		_stepH = (_maxH - _minH) / (_stepsH - 1);

	if (_stepsV)
		_stepV = (_maxV - _minV) / (_stepsV - 1);
}
开发者ID:Templier,项目名称:scummvm-test,代码行数:49,代码来源:myst_areas.cpp

示例5: INTEGER

int ScriptInterpreter::o1_triggerTimerProc() {
	int value1 = INTEGER(0);
	int value2 = INTEGER(1);
	int value3 = INTEGER(2);
	debugCN(kDebugScript, "%d; %d; %d\n", value1, value2, value3);
	return 3;
}
开发者ID:St0rmcrow,项目名称:scummvm,代码行数:7,代码来源:script.cpp

示例6: debugCN

const BAFile *BArchive::getFile(uint i) {
	// Check whether requested file exists
	if (i >= _fileCount) {
		return NULL;
	}

	debugCN(2, kDraciArchiverDebugLevel, "Accessing file %d from archive %s... ",
		i, _path.c_str());

	// Check if file has already been opened and return that
	if (_files[i]._data) {
		debugC(2, kDraciArchiverDebugLevel, "Cached");
		return _files + i;
	}

	BAFile *file;

	// file will be NULL if something goes wrong
	if (_isDFW) {
		file = loadFileDFW(i);
	} else {
		file = loadFileBAR(i);
	}

	return file;
}
开发者ID:33d,项目名称:scummvm,代码行数:26,代码来源:barchive.cpp

示例7: res

void MadsM4Engine::dumpFile(const char* filename, bool uncompress) {
	Common::DumpFile f;
	byte buffer[DUMP_BUFFER_SIZE];
	Common::SeekableReadStream *fileS = res()->get(filename);
	
	if (!f.open(filename))
		error("Could not open '%s' for writing", filename);

	int bytesRead = 0;
	warning("Dumping %s, size: %i\n", filename, fileS->size());

	if (!uncompress) {
		while (!fileS->eos()) {
			bytesRead = fileS->read(buffer, DUMP_BUFFER_SIZE);
			f.write(buffer, bytesRead);
		}
	} else {
		MadsPack packData(fileS);
		Common::SeekableReadStream *sourceUnc;
		for (int i = 0; i < packData.getCount(); i++) {
			sourceUnc = packData.getItemStream(i);
			debugCN(kDebugCore, "Dumping compressed chunk %i of %i, size is %i\n", i + 1, packData.getCount(), sourceUnc->size());
			while (!sourceUnc->eos()) {
				bytesRead = sourceUnc->read(buffer, DUMP_BUFFER_SIZE);
				f.write(buffer, bytesRead);
			}
			delete sourceUnc;
		}
	}

	f.close();
	res()->toss(filename);
	res()->purge();
}
开发者ID:St0rmcrow,项目名称:scummvm,代码行数:34,代码来源:m4.cpp

示例8: debugCN

void Kernel::roomParser() {
	if (_roomParserFn)
		_vm->_script->runFunction(_roomParserFn);
	else {
		debugCN(kDebugScript, "Kernel::roomParser() _roomParserFn is NULL\n");
	}
}
开发者ID:AdamRi,项目名称:scummvm-pink,代码行数:7,代码来源:globals.cpp

示例9: getHashFileEntry

Common::SeekableReadStream *FileSystem::loadFile(const char *resourceName, bool preloadFlag) {
	const HashFileEntry *hfe = getHashFileEntry(resourceName);
	Common::SeekableReadStream *result = NULL;

	if (hfe) {
		//debugCN(kDebugCore, "FileSystem::loadFile() success opening %s\n", filename);
		HashHagEntry *hagEntry = &_hagEntries[hfe->hagfile];

		if (preloadFlag) {
			// Creates a MemoryReadStream object that contains all of the resource in memory
			hagEntry->hagFile->seek(hfe->offset);
			result = _hagEntries[hfe->hagfile].hagFile->readStream(hfe->size);
		}
		else
			// Creates a SeekableSubReadStream, which will read the data in from disk as the
			// caller reads in data
			result = new Common::SeekableSubReadStream(hagEntry->hagFile, hfe->offset,
				hfe->offset + hfe->size);

	} else {
		debugCN(kDebugCore, "FileSystem::loadFile() error opening %s\n", resourceName);
	}

	return result;
}
开发者ID:peres,项目名称:scummvm,代码行数:25,代码来源:resource.cpp

示例10: debugCN

SoundSample *ZipSoundArchive::getSample(int i, uint freq) {
	if (i < 0 || i >= (int)_sampleCount) {
		return NULL;
	}
	debugCN(2, kDraciArchiverDebugLevel, "Accessing sample %d.%s from archive %s (format %[email protected]%d, capacity %d): ",
		i, _extension, _path, static_cast<int> (_format), _defaultFreq, _sampleCount);
	if (freq != 0 && (_format != RAW && _format != RAW80)) {
		error("Cannot resample a sound in compressed format");
		return NULL;
	}

	// We cannot really cache anything, because createReadStreamForMember()
	// returns the data as a ReadStream, which is not thread-safe.  We thus
	// read it again each time even if it has possibly been already cached
	// a while ago.  This is not such a problem for dubbing as for regular
	// sound samples.
	SoundSample sample;
	sample._frequency = freq ? freq : _defaultFreq;
	sample._format = _format;
	// Read in the file (without the file header)
	Common::String filename = Common::String::format("%d.%s", i+1, _extension);
	sample._stream = _archive->createReadStreamForMember(filename);
	if (!sample._stream) {
		debugC(2, kDraciArchiverDebugLevel, "Doesn't exist");
		return NULL;
	} else {
		debugC(2, kDraciArchiverDebugLevel, "Read");
		_cache.push_back(sample);
		// Return a pointer that we own and which we will deallocate
		// including its contents.
		return &_cache.back();
	}
}
开发者ID:BenCastricum,项目名称:scummvm,代码行数:33,代码来源:sound.cpp

示例11: switch

void ScriptInterpreter::derefValue(ScriptValue &value) {

	switch (value.type) {

	case kGameVar:
		value = _globalVars[value.value];
		break;

	case kInteger:
	case kConstString:
	case kDataRef:
	case kLogicVarRef:
		// These need no dereferencing
		break;

	case kRegister:
		value = _registers[value.value];
		break;

	case kLogicVar:
		// TODO: Move to own method
		value = _logicGlobals[value.value];
		break;

	case kKernelVar:
		getKernelVar(value.value, value);
		break;

	default:
		debugCN(kDebugScript, "ScriptInterpreter::derefValue() Invalid value type %d!\n", value.type);

	}

}
开发者ID:St0rmcrow,项目名称:scummvm,代码行数:34,代码来源:script.cpp

示例12: DATA

int ScriptInterpreter::o1_wilburSaid() {
	const SaidArray& saidArray = DATA(0, SaidArray);

	int result = 0;

	// NOTE: The "Common::String soundName" stuff is just temporary until playVoice is fixed.

	for (int i = 0; i < saidArray.size(); i++) {
		SaidArrayItem *item = saidArray[i];

		if (_vm->_player->said("LOOK AT", item->itemName) && item->digiNameLook) {
			debugCN(kDebugScript, "  -> LOOK AT: '%s'\n", item->digiNameLook);
			Common::String soundName = Common::String(item->digiNameLook) + ".raw";
			_vm->_sound->playVoice(soundName.c_str(), 100);
			result = 1;
			break;
		}

		if (_vm->_player->said("TAKE", item->itemName) && item->digiNameTake) {
			debugCN(kDebugScript, "  -> TAKE: '%s'\n", item->digiNameTake);
			Common::String soundName = Common::String(item->digiNameTake) + ".raw";
			_vm->_sound->playVoice(soundName.c_str(), 100);
			result = 1;
			break;
		}

		if (_vm->_player->said("GEAR", item->itemName) && item->digiNameGear) {
			debugCN(kDebugScript, "  -> GEAR: '%s'\n", item->digiNameGear);
			Common::String soundName = Common::String(item->digiNameGear) + ".raw";
			_vm->_sound->playVoice(soundName.c_str(), 100);
			result = 1;
			break;
		}

		/*
		debugCN(kDebugScript, "##### itemName = '%s'; digiNameLook = %s; digiNameTake = %s; digiNameGear = %s\n",
			item->itemName, item->digiNameLook, item->digiNameTake, item->digiNameGear);
		*/
	}
	debugCN(kDebugScript, "   -> '%d'\n", result);

	RETURN(result);
	return 1;
}
开发者ID:St0rmcrow,项目名称:scummvm,代码行数:44,代码来源:script.cpp

示例13: debugCN

void Font::setFontM4(const char *filename) {
	Common::SeekableReadStream *fontFile = _vm->res()->openFile(filename);

	if (fontFile->readUint32LE() != MKTAG('F','O','N','T')) {
		debugCN(kDebugGraphics, "Font::Font: FONT tag expected\n");
		return;
	}

	_maxHeight = fontFile->readByte();
	_maxWidth = fontFile->readByte();
	uint32 fontSize = fontFile->readUint32LE();

	//debugCN(kDebugGraphics, "Font::Font: _maxWidth = %d, _maxHeight = %d, fontSize = %d\n", _maxWidth, _maxHeight, fontSize);

	if (fontFile->readUint32LE() != MKTAG('W','I','D','T')) {
		debugCN(kDebugGraphics, "Font::Font: WIDT tag expected\n");
		return;
	}

	_charWidths = new uint8[256];
	fontFile->read(_charWidths, 256);

	if (fontFile->readUint32LE() != MKTAG('O','F','F','S')) {
		debugCN(kDebugGraphics, "Font::Font: OFFS tag expected\n");
		return;
	}

	_charOffs = new uint16[256];

	for (int i = 0; i < 256; i++)
		_charOffs[i] = fontFile->readUint16LE();

	if (fontFile->readUint32LE() != MKTAG('P','I','X','S')) {
		debugCN(kDebugGraphics, "Font::Font: PIXS tag expected\n");
		return;
	}

	_charData = new uint8[fontSize];
	fontFile->read(_charData, fontSize);

	_vm->res()->toss(filename);
}
开发者ID:St0rmcrow,项目名称:scummvm,代码行数:42,代码来源:font.cpp


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