• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ LMsg函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: FL_DBG

	bool Instance::process_movement() {
		FL_DBG(_log, "Moving...");
		ActionInfo* info = m_activity->m_actioninfo;
		// timeslice for this movement
		unsigned int timedelta = m_activity->m_timeprovider->getGameTime() - info->m_prev_call_time;
		FL_DBG(_log, LMsg("timedelta ") <<  timedelta << " prevcalltime " << info->m_prev_call_time);
		// how far we can travel
		double distance_to_travel = (static_cast<double>(timedelta) / 1000.0) * info->m_speed;
		FL_DBG(_log, LMsg("dist ") <<  distance_to_travel);

		Location nextLocation = m_location;
		info->m_pather_session_id = info->m_pather->getNextLocation(
			this, *info->m_target,
			distance_to_travel, nextLocation, *m_facinglocation,
			info->m_pather_session_id);
		m_location.getLayer()->getInstanceTree()->removeInstance(this);
		m_location = nextLocation;
		//ExactModelCoordinate a = nextLocation.getMapCoordinates();
		//ExactModelCoordinate b = m_actioninfo->m_target->getMapCoordinates();
		m_location.getLayer()->getInstanceTree()->addInstance(this);
		// return if we are close enough to target to stop
		if (info->m_pather_session_id == -1) {
			return true;
		}
		return false;
	}
开发者ID:mgeorgehansen,项目名称:FIFE_Technomage,代码行数:26,代码来源:instance.cpp


示例2: VFSSource

	DAT2::DAT2(VFS* vfs, const std::string& file)
		: VFSSource(vfs), m_datpath(file), m_data(vfs->open(file)), m_filelist() {

		FL_LOG(_log, LMsg("MFFalloutDAT2")
			<< "loading: " << file
			<< " filesize: " << m_data->getDataLength());

		m_data->setIndex(m_data->getDataLength() - 8);
		uint32_t fileListLength = m_data->read32Little();
		uint32_t archiveSize = m_data->read32Little();

		FL_LOG(_log, LMsg("MFFalloutDAT2")
			<< "FileListLength: " << fileListLength
			<< " ArchiveSize: " << archiveSize);

		if (archiveSize != m_data->getDataLength())
			throw InvalidFormat("size mismatch");

		m_data->setIndex( archiveSize - fileListLength - 8);
		m_filecount = m_data->read32Little();
		m_currentIndex = m_data->getCurrentIndex();

		FL_LOG(_log, LMsg("MFFalloutDAT2 FileCount: ") << m_filecount);

		// Do not read the complete file list at startup.
		// Instead read a chunk each frame.
		m_timer.setInterval(0);
		m_timer.setCallback( boost::bind( &DAT2::readFileEntry, this) );
		m_timer.start();
	}
开发者ID:Creepinevil,项目名称:fifengine,代码行数:30,代码来源:dat2.cpp


示例3: alcOpenDevice

	void SoundManager::init() {
		m_device = alcOpenDevice(NULL);

		if (!m_device || alcGetError(m_device) != ALC_NO_ERROR) {
			FL_ERR(_log, LMsg() << "Could not open audio device - deactivating audio module");
			m_device = NULL;
			return;
		}

		m_context = alcCreateContext(m_device, NULL);
		if (!m_context || alcGetError(m_device) != ALC_NO_ERROR) {
			FL_ERR(_log, LMsg() << "Couldn't create audio context - deactivating audio module");
			m_device = NULL;
			return;
		}

		alcMakeContextCurrent(m_context);
		if (alcGetError(m_device) != ALC_NO_ERROR) {
			FL_ERR(_log, LMsg() << "Couldn't change current audio context - deactivating audio module");
			m_device = NULL;
			return;
		}

		// set listener position
		alListener3f(AL_POSITION, 0.0, 0.0, 0.0);
		ALfloat vec1[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 1.0};
		alListenerfv(AL_ORIENTATION, vec1);

		// set volume
		alListenerf(AL_GAIN, m_volume);
	}
开发者ID:mgeorgehansen,项目名称:FIFE_Technomage,代码行数:31,代码来源:soundmanager.cpp


示例4: FL_WARN

	VFSSource* VFS::createSource(const std::string& path) {

		if (hasSource(path)) {
			FL_WARN(_log, LMsg(path) << " is already used as VFS source");
			return 0;
		}

		type_providers::const_iterator end = m_providers.end();
		for (type_providers::const_iterator i = m_providers.begin(); i != end; ++i) {
			VFSSourceProvider* provider = *i;
			if (!provider->isReadable(path))
				continue;

			try {
				VFSSource* source = provider->createSource(path);
				return source;
			} catch (const Exception& ex) {
				FL_WARN(_log, LMsg(provider->getName()) << " thought it could load " << path << " but didn't succeed (" << ex.what() << ")");
				continue;
			} catch (...) {
				FL_WARN(_log, LMsg(provider->getName()) << " thought it could load " << path << " but didn't succeed (unknown exception)");
				continue;
			}
		}

		FL_WARN(_log, LMsg("no provider for ") << path << " found");
		return 0;
	}
开发者ID:fifengine,项目名称:fifengine,代码行数:28,代码来源:vfs.cpp


示例5: VFSSource

	DAT1::DAT1(VFS* vfs, const std::string& file) : VFSSource(vfs), m_datpath(file), m_data(vfs->open(file))  {
		FL_LOG(_log, LMsg("MFFalloutDAT1") 
			<< "loading: " << file 
			<< " filesize: " << m_data->getDataLength());

		m_data->setIndex(0);

		const uint32_t dircount = m_data->read32Big();
		m_data->moveIndex(4*3);

		FL_LOG(_log, LMsg("MFFalloutDAT1") 
			<< "number of directories " << dircount);

		// Sanity check. Each dir entry needs min. 16 bytes.
		if( dircount*16 > m_data->getDataLength() ) {
			throw InvalidFormat("directory count larger than filesize.");
		}

		std::list<std::string> dir_names;
		for (uint32_t i = 0; i < dircount; ++i) {
			std::string name = readString();
			if (name == ".") {
				name = "";
			}
			dir_names.push_back(name);
		}

		for(std::list<std::string>::iterator i= dir_names.begin(); i!= dir_names.end(); ++i)
			loadFileList(*i);
	}
开发者ID:karottenreibe,项目名称:FIFE,代码行数:30,代码来源:dat1.cpp


示例6: CellGrid

	HexGrid::HexGrid(bool allow_diagonals): CellGrid(allow_diagonals) {
		FL_DBG(_log, "Constructing new HexGrid");
		FL_DBG(_log, LMsg("HEX_WIDTH ") << HEX_WIDTH);
		FL_DBG(_log, LMsg("HEX_TO_EDGE ") << HEX_TO_EDGE);
		FL_DBG(_log, LMsg("HEX_TO_CORNER ") << HEX_TO_CORNER);
		FL_DBG(_log, LMsg("HEX_EDGE_HALF ") << HEX_EDGE_HALF);
		FL_DBG(_log, LMsg("VERTICAL_MULTIP ") << VERTICAL_MULTIP);
	}
开发者ID:mgeorgehansen,项目名称:FIFE_Technomage,代码行数:8,代码来源:hexgrid.cpp


示例7: CellGrid

	HexGrid::HexGrid(bool axial):
		CellGrid(),
		m_axial(axial) {
		FL_DBG(_log, "Constructing new HexGrid");
		FL_DBG(_log, LMsg("HEX_WIDTH ") << HEX_WIDTH);
		FL_DBG(_log, LMsg("HEX_TO_EDGE ") << HEX_TO_EDGE);
		FL_DBG(_log, LMsg("HEX_TO_CORNER ") << HEX_TO_CORNER);
		FL_DBG(_log, LMsg("HEX_EDGE_HALF ") << HEX_EDGE_HALF);
		FL_DBG(_log, LMsg("VERTICAL_MULTIP ") << VERTICAL_MULTIP);
	}
开发者ID:Beliaar,项目名称:fifengine,代码行数:10,代码来源:hexgrid.cpp


示例8: MarkRoutine

void MarkRoutine()
{
	int x, y;

	if (InitOverlayPage(sizeof(*markdata), &MarkLf, 1))
		return;
	flayer->l_encoding = fore->w_encoding;
	flayer->l_mode = 1;
	markdata = (struct markdata *)flayer->l_data;
	markdata->md_user = D_user;	/* XXX: Correct? */
	markdata->md_window = fore;
	markdata->second = 0;
	markdata->rep_cnt = 0;
	markdata->append_mode = 0;
	markdata->write_buffer = 0;
	markdata->nonl = 0;
	markdata->left_mar = 0;
	markdata->right_mar = fore->w_width - 1;
	markdata->hist_offset = fore->w_histheight;
	x = fore->w_x;
	y = D2W(fore->w_y);
	if (x >= fore->w_width)
		x = fore->w_width - 1;

	LGotoPos(flayer, x, W2D(y));
	LMsg(0, "Copy mode - Column %d Line %d(+%d) (%d,%d)",
	     x + 1, W2D(y + 1), fore->w_histheight, fore->w_width, fore->w_height);
	markdata->cx = markdata->x1 = x;
	markdata->cy = markdata->y1 = y;
	flayer->l_x = x;
	flayer->l_y = W2D(y);
}
开发者ID:meh,项目名称:screen,代码行数:32,代码来源:mark.c


示例9: assert

	void DAT2::readFileEntry() const {
		assert( m_filecount != 0);

		// Load more items per call,
		// otherwise it takes _ages_ until everything is in.
		uint32_t load_per_cycle = 50;
		if( load_per_cycle > m_filecount )
			load_per_cycle = m_filecount;
		m_filecount -= load_per_cycle;

		// Save the old index in an exception save way.
		IndexSaver isaver(m_data.get());

		// Move index to file list and read the entries.
		m_data->setIndex(m_currentIndex);
		RawDataDAT2::s_info info;
		while( load_per_cycle-- ) {
			uint32_t namelen = m_data->read32Little();
			info.name = fixPath(m_data->readString(namelen));

			info.type = m_data->read8();
			info.unpackedLength = m_data->read32Little();
			info.packedLength = m_data->read32Little();
			info.offset = m_data->read32Little();

			m_filelist.insert(std::make_pair(info.name, info));
		}
		m_currentIndex = m_data->getCurrentIndex();

		// Finally log on completion and stop the timer.
		if( m_filecount == 0 ) {
			FL_LOG(_log, LMsg("MFFalloutDAT2, All file entries in '") << m_datpath << "' loaded.");
			m_timer.stop();
		}
	}
开发者ID:Creepinevil,项目名称:fifengine,代码行数:35,代码来源:dat2.cpp


示例10: FL_LOG

	DAT2::type_filelist::const_iterator DAT2::findFileEntry(const std::string& path) const {

		// Either the normalization is bogus, or we have to do
		// it here, too. Otherwise we can't load the files returned
		// by listFiles.

		std::string name = path;

		// Normalize the path
		if (name.find("./") == 0) {
			name.erase(0, 2);
		}

		type_filelist::const_iterator i = m_filelist.find(name);

		// We might have another chance to find the file
		// if the number of file entries not zero.
		if ( m_filecount && i == m_filelist.end()) {
			FL_LOG(_log, LMsg("MFFalloutDAT2")
				<< "Missing '" << name
				<< "' in partially(" << m_filecount <<") loaded "<< m_datpath);
			while( m_filecount && i == m_filelist.end()) {
				readFileEntry();
				i = m_filelist.find(name);
			}
		}
		return i;
	}
开发者ID:Creepinevil,项目名称:fifengine,代码行数:28,代码来源:dat2.cpp


示例11: getXZigzagOffset

	ExactModelCoordinate HexGrid::toExactLayerCoordinates(const ExactModelCoordinate& map_coord) {
		ExactModelCoordinate layer_coords = m_inverse_matrix * map_coord;
		layer_coords.y /= VERTICAL_MULTIP;
		layer_coords.x -= getXZigzagOffset(layer_coords.y);
		FL_DBG(_log, LMsg("mapcoords ") << map_coord << " converted to layer: " << layer_coords);
		return layer_coords;
	}
开发者ID:Beliaar,项目名称:fifengine,代码行数:7,代码来源:hexgrid.cpp


示例12: tranformed_coords

	ExactModelCoordinate HexGrid::toMapCoordinates(const ExactModelCoordinate& layer_coords) {
		ExactModelCoordinate tranformed_coords(layer_coords);
		tranformed_coords.x += getXZigzagOffset(layer_coords.y);
		tranformed_coords.y *= VERTICAL_MULTIP;
		ExactModelCoordinate result = m_matrix * tranformed_coords;
		FL_DBG(_log, LMsg("layercoords ") << layer_coords << " converted to map: " << result);
		return result;
	}
开发者ID:Beliaar,项目名称:fifengine,代码行数:8,代码来源:hexgrid.cpp


示例13: createSource

	void VFS::addNewSource(const std::string& path) {
		VFSSource* source = createSource(path);
		if (source) {
			addSource(source);
		} else {
			FL_WARN(_log, LMsg("Failed to add new VFS source: ") << path);
		}
	}
开发者ID:fifengine,项目名称:fifengine,代码行数:8,代码来源:vfs.cpp


示例14: initializeChanges

	void Instance::move(const std::string& action_name, const Location& target, const double speed) {
		initializeChanges();
		initializeAction(action_name);
		m_activity->m_actioninfo->m_target = new Location(target);
		m_activity->m_actioninfo->m_speed = speed;
		setFacingLocation(target);
		FL_DBG(_log, LMsg("starting action ") <<  action_name << " from" << m_location << " to " << target << " with speed " << speed);
	}
开发者ID:mgeorgehansen,项目名称:FIFE_Technomage,代码行数:8,代码来源:instance.cpp


示例15: orientation

	bool CellGrid::ptInTriangle(const ExactModelCoordinate& pt, const ExactModelCoordinate& pt1, const ExactModelCoordinate& pt2, const ExactModelCoordinate& pt3) {
		double o1 = orientation(pt1, pt2, pt);
		double o2 = orientation(pt2, pt3, pt);
		double o3 = orientation(pt3, pt1, pt);
		bool result = (o1 == o2) && (o2 == o3);
		FL_DBG(_log, LMsg("ptInTriangle, pt=") << pt << " pt1=" << pt1 << " pt2=" << pt2 << " pt3=" << pt3 << " in=" << result);
		return result;
	}
开发者ID:fifengine,项目名称:fifengine,代码行数:8,代码来源:cellgrid.cpp


示例16: IMG_Load

	Image* RenderBackendSDL::createMainScreen(unsigned int width, unsigned int height, unsigned char bitsPerPixel, bool fs, const std::string& title, const std::string& icon) {
		Uint32 flags = 0;
		if (fs) {
			flags |= SDL_FULLSCREEN;
		}

		if(icon != "") {
			SDL_Surface *img = IMG_Load(icon.c_str());
			if(img != NULL) {
				SDL_WM_SetIcon(img, 0);
			}
		}

		SDL_Surface* screen = NULL;

		if( 0 == bitsPerPixel ) {
			/// autodetect best mode
			unsigned char possibleBitsPerPixel[] = {16, 24, 32, 0};
			int i = 0;
			while( true ) {
				bitsPerPixel = possibleBitsPerPixel[i];
				if( !bitsPerPixel ) {
					// Last try, sometimes VideoModeOK seems to lie.
					// Try bpp=0
					screen = SDL_SetVideoMode(width, height, bitsPerPixel, flags);
					if( !screen ) {
						throw SDLException("Videomode not available");
					}
					break;
				}
				bitsPerPixel = SDL_VideoModeOK(width, height, bitsPerPixel, flags);
				if ( bitsPerPixel ) {
					screen = SDL_SetVideoMode(width, height, bitsPerPixel, flags);
					if( screen ) {
						break;
					}
				}
				++i;
			}
		} else {
			if ( !SDL_VideoModeOK(width, height, bitsPerPixel, flags) ) {
				throw SDLException("Videomode not available");
			}
			screen = SDL_SetVideoMode(width, height, bitsPerPixel, flags);
		}
		FL_LOG(_log, LMsg("RenderBackendSDL")
			<< "Videomode " << width << "x" << height
			<< " at " << int(screen->format->BitsPerPixel) << " bpp");

		SDL_WM_SetCaption(title.c_str(), NULL);

		if (!screen) {
			throw SDLException(SDL_GetError());
		}

		m_screen = new SDLImage(screen);
		return m_screen;
	}
开发者ID:m64,项目名称:PEG,代码行数:58,代码来源:renderbackendsdl.cpp


示例17: FL_LOG

	void RawData::readInto(uint8_t* buffer, size_t len) {
		if (m_index_current + len > getDataLength()) {
			FL_LOG(_log, LMsg("RawData") << m_index_current << " : " << len << " : " << getDataLength());
			throw IndexOverflow(__FUNCTION__);
		}

		m_datasource->readInto(buffer, m_index_current, len);
		m_index_current += len;
	}
开发者ID:Creepinevil,项目名称:fifengine,代码行数:9,代码来源:rawdata.cpp


示例18: FL_WARN

	ImagePtr ImageManager::create(const std::string& name, IResourceLoader* loader){
		if (exists(name)) {
			FL_WARN(_log, LMsg("ImageManager::create(std::string, IResourceLoader* loader) - ") << "Resource name " << name << " was previously created.  Returning original Image...");
			return getPtr(name);
		}

		Image* ptr = RenderBackend::instance()->createImage(name, loader);
		return add(ptr);
	}
开发者ID:fifengine,项目名称:fifengine,代码行数:9,代码来源:imagemanager.cpp


示例19: FL_DBG

	RawData* VFS::open(const std::string& path) {
		FL_DBG(_log, LMsg("Opening: ") << path);

		VFSSource* source = getSourceForFile(path);
		if (!source)
			throw NotFound(path);

		return source->open(path);
	}
开发者ID:fifengine,项目名称:fifengine,代码行数:9,代码来源:vfs.cpp


示例20: FL_WARN

	SoundClipPtr SoundClipManager::create(const std::string& name, IResourceLoader* loader){
		if (exists(name)) {
			FL_WARN(_log, LMsg("SoundClipManager::create(std::string, IResourceLoader* loader) - ") << "Resource name " << name << " was previously created.  Returning original SoundClip...");
			return get(name);
		}

		SoundClip* ptr = new SoundClip(name, loader);
		return add(ptr);
	}
开发者ID:Beliaar,项目名称:fifengine,代码行数:9,代码来源:soundclipmanager.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LO函数代码示例发布时间:2022-05-30
下一篇:
C++ LM_WARN函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap