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

C++ AssertISV函数代码示例

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

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



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

示例1: AssertISV

void GFXPCD3D9WindowTarget::initPresentationParams()
{
   // Get some video mode related info.
   GFXVideoMode vm = mWindow->getVideoMode();

   // Do some validation...
   if(vm.fullScreen == true && mImplicit == false)
   {
      AssertISV(false, 
         "GFXPCD3D9WindowTarget::initPresentationParams - Cannot go fullscreen with secondary window!");
   }

   HWND hwnd = (HWND)mWindow->getSystemWindow( PlatformWindow::WindowSystem_Windows );
   AssertISV(hwnd, "GFXPCD3D9WindowTarget::initPresentationParams() - no HWND");

   // At some point, this will become GFXPCD3D9WindowTarget like trunk has,
   // so this cast isn't as bad as it looks. ;) BTR
   GFXPCD3D9Device* pcdevice = dynamic_cast<GFXPCD3D9Device*>(mDevice);
   mPresentationParams = pcdevice->setupPresentParams(vm, hwnd);

   if (mImplicit)
   {
      pcdevice->mMultisampleType = mPresentationParams.MultiSampleType;
      pcdevice->mMultisampleLevel = mPresentationParams.MultiSampleQuality;
   }
}
开发者ID:fr1tz,项目名称:terminal-overload,代码行数:26,代码来源:gfxPCD3D9Target.cpp


示例2: fillInputBuffer

   static boolean	fillInputBuffer(j_decompress_ptr cinfo)
      // Read data into our input buffer.  Client calls this
      // when it needs more data from the file.
   {
      StreamedJPEGReader*	src = (StreamedJPEGReader*) cinfo->client_data;
      AssertISV(src, "StreamedJPEGReader::fillInputBuffer - 'this' is missing!");

      U32 bytesRead = src->mFile->read((char*)src->mBuffer, 8192);

      if (bytesRead <= 0) 
      {
         // Is the file completely empty?
         AssertISV(!src->mStartOfFile, "StreamedJPEGReader::fillInputBuffer - Empty source stream!");

         // Insert a fake EOI marker.
         src->mBuffer[0] = (JOCTET) 0xFF;
         src->mBuffer[1] = (JOCTET) JPEG_EOI;
         bytesRead = 2;
      }

      // Expose buffer state to clients.
      src->mSource.next_input_byte = src->mBuffer;
      src->mSource.bytes_in_buffer = bytesRead;
      src->mStartOfFile = false;

      return true;
   }
开发者ID:gitrider,项目名称:wxsj2,代码行数:27,代码来源:atlasImportLargeImage.cpp


示例3: AssertISV

void AtlasOldMesher::optimize()
{
   AssertISV(false, "This is probably broken right now - BJG");
#if 0
   // Shove everything through nvTriStrip
   SetCacheSize(24);

   // first, stripify our geometry...
   PrimitiveGroup *pg;
   U16 pgCount;

   GenerateStrips(mIndices.address(), mIndices.size(), &pg, &pgCount, AtlasOldActivationHeightfield::smDoChecks);

   // We're lazy.
   AssertISV(pgCount == 1,
      "AtlasOldMesher::optimize - Got unexpectedly complex geometry from NVTriStrip! (a)");
   AssertISV(pg->type == PT_STRIP,
      "AtlasOldMesher::optimize - Got unexpectedly complex geometry from NVTriStrip! (b)");

   // Remap indices! BJGTODO - how am I supposed to interpet the results?
   /*   PrimitiveGroup *pgRemapped;
   RemapIndices(pg, pgCount, mVerts.size(), &pgRemapped); */

   // Ok, let's suck this stuff back in.
   mIndices.clear();
   mIndices.reserve(pg->numIndices);

   for(S32 i=0; i<pg->numIndices; i++)
      mIndices[i] = pg->indices[i];

   // And clean up the memory from the stripper.
   delete[] pg;

#endif
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:35,代码来源:atlasOldMesher.cpp


示例4: AssertISV

bool ResourceManager::remove( ResourceBase::Header* header )
{
   const Path &path = header->getPath();

#ifdef TORQUE_DEBUG_RES_MANAGER
   Con::printf( "ResourceManager::remove : [%s]", path.getFullPath().c_str() );
#endif

   ResourceHeaderMap::Iterator iter = mResourceHeaderMap.find( path.getFullPath() );
   if ( iter != mResourceHeaderMap.end() && iter->value == header )
   {
      AssertISV( header && (header->getRefCount() == 0), "ResourceManager error: trying to remove resource which is still in use." );
      mResourceHeaderMap.erase( iter );
   }
   else
   {
      iter = mPrevResourceHeaderMap.find( path.getFullPath() );
      if ( iter == mPrevResourceHeaderMap.end() || iter->value != header )
      {
         Con::errorf( "ResourceManager::remove : Trying to remove non-existent resource [%s]", path.getFullPath().c_str() );
         return false;
      }

      AssertISV( header && (header->getRefCount() == 0), "ResourceManager error: trying to remove resource which is still in use." );
      mPrevResourceHeaderMap.erase( iter );
   }

   FS::RemoveChangeNotification( path, this, &ResourceManager::notifiedFileChanged );

   return true;
}
开发者ID:fr1tz,项目名称:alux3d,代码行数:31,代码来源:resourceManager.cpp


示例5: AssertISV

void GFXPCD3D9WindowTarget::initPresentationParams()
{
   // Get some video mode related info.
   GFXVideoMode vm = mWindow->getVideoMode();

   // Do some validation...
   if(vm.fullScreen == true && mImplicit == false)
   {
      AssertISV(false, 
         "GFXPCD3D9WindowTarget::initPresentationParams - Cannot go fullscreen with secondary window!");
   }

   Win32Window *win = dynamic_cast<Win32Window*>(mWindow);
   AssertISV(win, "GFXPCD3D9WindowTarget::initPresentationParams() - got a non Win32Window window passed in! Did DX go crossplatform?");

   HWND hwnd = win->getHWND();

   // At some point, this will become GFXPCD3D9WindowTarget like trunk has,
   // so this cast isn't as bad as it looks. ;) BTR
   GFXPCD3D9Device* pcdevice = dynamic_cast<GFXPCD3D9Device*>(mDevice);
   mPresentationParams = pcdevice->setupPresentParams(vm, hwnd);

   if (mImplicit)
   {
      pcdevice->mMultisampleType = mPresentationParams.MultiSampleType;
      pcdevice->mMultisampleLevel = mPresentationParams.MultiSampleQuality;
   }
}
开发者ID:Adhdcrazzy,项目名称:Torque3D,代码行数:28,代码来源:gfxPCD3D9Target.cpp


示例6: AssertISV

bool AtlasChunk::readFromStream(AtlasChunk *ac, Stream *s)
{
   // First, read the size and allocate a buffer.
   
   // Let's do a sentinel check.
   U32 sent1;
   s->read(&sent1);
   AssertISV(sent1 == MakeFourCC('A', 'T', 'S', 'P'), "AtlasChunk::readFromStream - (sent1) invalid chunk master sentinel!");

   s->read(&ac->mChunkSize);

   // And now validate the chunk-type-sentinel.
   U32 sent2;
   s->read(&sent2);
   AssertISV(sent2 == ac->getHeadSentinel(), "AtlasChunk::readFromStream - (sent2) invalid chunk head sentinel!");

   // Get the chunk's data.  If it's already in memory, just reuse it.
   // Otherwise read it from the stream.

   bool isMemStream = false;
   U8 *data;
   U32 dataSize = ac->mChunkSize;
   
   if( dynamic_cast< MemStream* >( s ) )
   {
	   MemStream* memStream = ( MemStream* ) s;
	   U32 currentPos = memStream->getPosition();
	   isMemStream = true;
	   data = &( ( U8* ) memStream->getBuffer() )[ currentPos ];
	   memStream->setPosition( currentPos + dataSize );
   }
   else
   {
	   data = new U8[ dataSize ];

	   // Read next chunksize bytes into the buffer for later processing.
	   s->read( dataSize, data);
   }

   // Check end sentinel.
   U32 sent3;
   s->read(&sent3);
   AssertISV(sent3 == ac->getTailSentinel(), "AtlasChunk::readFromStream - (sent3) invalid chunk tail sentinel!");

   // And tell the chunk to read from that buffer...
   MemStream dataStream( dataSize, data );
   ac->read(&dataStream);

   // Clean up memory.
   if( !isMemStream )
	   delete[] data;

   // All done!
   return true;
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:55,代码来源:atlasChunk.cpp


示例7: initSource

   static void initSource(j_decompress_ptr cinfo)
   {
      StreamedJPEGReader*	src = (StreamedJPEGReader*) cinfo->client_data;
      AssertISV(src, "StreamedJPEGReader::initSource - 'this' is missing!");

      src->mStartOfFile = true;
   }
开发者ID:gitrider,项目名称:wxsj2,代码行数:7,代码来源:atlasImportLargeImage.cpp


示例8: AssertFatal

bool GFXD3D11OcclusionQuery::begin()
{
   if(GFXDevice::getDisableOcclusionQuery())
      return true;

   if (mQuery == NULL)
   {
      D3D11_QUERY_DESC queryDesc;
      queryDesc.Query = D3D11_QUERY_OCCLUSION;
      queryDesc.MiscFlags = 0;

      HRESULT hRes = D3D11DEVICE->CreateQuery(&queryDesc, &mQuery);

      if(FAILED(hRes))
      {
         AssertFatal(false, "GFXD3D11OcclusionQuery::begin - Hardware does not support D3D11 Occlusion-Queries, this should be caught before this type is created");
      }

      AssertISV(hRes != E_OUTOFMEMORY, "GFXD3D11OcclusionQuery::begin - Out of memory");
   }

   // Add a begin marker to the command buffer queue.
   D3D11DEVICECONTEXT->Begin(mQuery);

#ifdef TORQUE_GATHER_METRICS
   mBeginFrame = GuiTSCtrl::getFrameCount();
#endif

   return true;
}
开发者ID:03050903,项目名称:Torque3D,代码行数:30,代码来源:gfxD3D11OcclusionQuery.cpp


示例9: switch

U32 DDSFile::getSurfacePitch( U32 mipLevel ) const
{
   if(mFlags.test(CompressedData))
   {
      U32 sizeMultiple = 0;

      switch(mFormat)
      {
      case GFXFormatDXT1:
         sizeMultiple = 8;
         break;
      case GFXFormatDXT2:
      case GFXFormatDXT3:
      case GFXFormatDXT4:
      case GFXFormatDXT5:
         sizeMultiple = 16;
         break;
      default:
         AssertISV(false, "DDSFile::getPitch - invalid compressed texture format, we only support DXT1-5 right now.");
         break;
      }

      // Maybe need to be DWORD aligned?
      U32 align = getMax(U32(1), getWidth(mipLevel)/4) * sizeMultiple;
      align += 3; align >>=2; align <<=2;
      return align;

   }
开发者ID:AlkexGas,项目名称:Torque3D,代码行数:28,代码来源:ddsLoader.cpp


示例10: PROFILE_SCOPE

bool GFXGLShader::initShader( const Torque::Path &file, 
                              bool isVertex, 
                              const Vector<GFXShaderMacro> &macros )
{
   PROFILE_SCOPE(GFXGLShader_CompileShader);
   GLuint activeShader = glCreateShader(isVertex ? GL_VERTEX_SHADER : GL_FRAGMENT_SHADER);
   if(isVertex)
      mVertexShader = activeShader;
   else
      mPixelShader = activeShader;
   glAttachShader(mProgram, activeShader);
   
   
   // Ok it's not in the shader gen manager, so ask Torque for it
   FileStream stream;
   if ( !stream.open( file, Torque::FS::File::Read ) )
   {
      AssertISV(false, avar("GFXGLShader::initShader - failed to open shader '%s'.", file.getFullPath().c_str()));

      if ( smLogErrors )
         Con::errorf( "GFXGLShader::initShader - Failed to open shader file '%s'.", 
            file.getFullPath().c_str() );

      return false;
   }
   
   if ( !_loadShaderFromStream( activeShader, file, &stream, macros ) )
      return false;
   
   GLint compile;
   glGetShaderiv(activeShader, GL_COMPILE_STATUS, &compile);

   // Dump the info log to the console
   U32 logLength = 0;
   glGetShaderiv(activeShader, GL_INFO_LOG_LENGTH, (GLint*)&logLength);
   
   GLint compileStatus = GL_TRUE;
   if ( logLength )
   {
      FrameAllocatorMarker fam;
      char* log = (char*)fam.alloc(logLength);
      glGetShaderInfoLog(activeShader, logLength, NULL, log);

      // Always print errors
      glGetShaderiv( activeShader, GL_COMPILE_STATUS, &compileStatus );

      if ( compileStatus == GL_FALSE )
      {
         if ( smLogErrors )
         {
            Con::errorf( "GFXGLShader::initShader - Error compiling shader!" );
            Con::errorf( "Program %s: %s", file.getFullPath().c_str(), log );
         }
      }
      else if ( smLogWarnings )
         Con::warnf( "Program %s: %s", file.getFullPath().c_str(), log );
   }

   return compileStatus != GL_FALSE;
}
开发者ID:03050903,项目名称:Torque3D,代码行数:60,代码来源:gfxGLShader.cpp


示例11: if

void ConsoleConstructor::setup()
{
   for(ConsoleConstructor *walk = first; walk; walk = walk->next)
   {
#ifdef TORQUE_DEBUG
      walk->validate();
#endif

      if( walk->sc )
         Con::addCommand( walk->className, walk->funcName, walk->sc, walk->usage, walk->mina, walk->maxa, walk->toolOnly, walk->header );
      else if( walk->ic )
         Con::addCommand( walk->className, walk->funcName, walk->ic, walk->usage, walk->mina, walk->maxa, walk->toolOnly, walk->header );
      else if( walk->fc )
         Con::addCommand( walk->className, walk->funcName, walk->fc, walk->usage, walk->mina, walk->maxa, walk->toolOnly, walk->header );
      else if( walk->vc )
         Con::addCommand( walk->className, walk->funcName, walk->vc, walk->usage, walk->mina, walk->maxa, walk->toolOnly, walk->header );
      else if( walk->bc )
         Con::addCommand( walk->className, walk->funcName, walk->bc, walk->usage, walk->mina, walk->maxa, walk->toolOnly, walk->header );
      else if( walk->group )
         Con::markCommandGroup( walk->className, walk->funcName, walk->usage );
      else if( walk->callback )
         Con::noteScriptCallback( walk->className, walk->funcName, walk->usage, walk->header );
      else if( walk->ns )
      {
         Namespace* ns = Namespace::find( StringTable->insert( walk->className ) );
         if( ns )
            ns->mUsage = walk->usage;
      }
      else
      {
         AssertISV( false, "Found a ConsoleConstructor with an indeterminate type!" );
      }
   }
}
开发者ID:Adhdcrazzy,项目名称:Torque3D,代码行数:34,代码来源:console.cpp


示例12: String

HRESULT _gfxD3DXInclude::Open(THIS_ D3DXINCLUDE_TYPE IncludeType, LPCSTR pFileName, 
                              LPCVOID pParentData, LPCVOID *ppData, UINT *pBytes, 
                              LPSTR pFullPath, DWORD cbFullPath)
{
   // First try making the path relative to the parent.
   Torque::Path path = Torque::Path::Join( mLastPath.last(), '/', pFileName );
   path = Torque::Path::CompressPath( path );

   if ( !Torque::FS::ReadFile( path, (void *&)*ppData, *pBytes, true ) )
   {
      // Ok... now try using the path as is.
      path = String( pFileName );
      path = Torque::Path::CompressPath( path );

      if ( !Torque::FS::ReadFile( path, (void *&)*ppData, *pBytes, true ) )
      {
         AssertISV(false, avar( "Failed to open include '%s'.", pFileName));
         return E_FAIL;
      }
   }

   // If the data was of zero size then we cannot recurse
   // into this file and DX won't call Close() below.
   //
   // So in this case don't push on the path.
   if ( *pBytes > 0 )
      mLastPath.push_back( path.getRootAndPath() );

   return S_OK;
}
开发者ID:Adrellias,项目名称:Torque3D-DaveWork,代码行数:30,代码来源:gfxD3D9Shader.cpp


示例13: AssertFatal

bool GFXD3D9OcclusionQuery::begin()
{
   if ( GFXDevice::getDisableOcclusionQuery() )
      return true;

   if ( mQuery == NULL )
   {
#ifdef TORQUE_OS_XENON
      HRESULT hRes = static_cast<GFXD3D9Device*>( mDevice )->getDevice()->CreateQueryTiled( D3DQUERYTYPE_OCCLUSION, 2, &mQuery );
#else
      HRESULT hRes = static_cast<GFXD3D9Device*>( mDevice )->getDevice()->CreateQuery( D3DQUERYTYPE_OCCLUSION, &mQuery );
#endif

      AssertFatal( hRes != D3DERR_NOTAVAILABLE, "GFXD3D9OcclusionQuery::begin - Hardware does not support D3D9 Occlusion-Queries, this should be caught before this type is created" );
      AssertISV( hRes != E_OUTOFMEMORY, "GFXD3D9OcclusionQuery::begin - Out of memory" );
   }

   // Add a begin marker to the command buffer queue.
   mQuery->Issue( D3DISSUE_BEGIN );

#ifdef TORQUE_GATHER_METRICS
   mBeginFrame = GuiTSCtrl::getFrameCount();
#endif

   return true;
}
开发者ID:Andry86,项目名称:Torque3D,代码行数:26,代码来源:gfxD3D9OcclusionQuery.cpp


示例14: mngFatalErrorFn

static mng_bool mngFatalErrorFn(mng_handle mng, mng_int32 code, mng_int8 severity, mng_chunkid chunktype, mng_uint32 chunkseq, mng_int32 extra1, mng_int32 extra2, mng_pchar text)
{
   mng_cleanup(&mng);
   
   AssertISV(false, avar("Error reading MNG file:\n %s", (const char*)text));
   return MNG_FALSE;
}
开发者ID:nev7n,项目名称:Torque3D,代码行数:7,代码来源:bitmapMng.cpp


示例15: AssertISV

void GFXD3D9CardProfiler::init()
{
   mD3DDevice = dynamic_cast<GFXD3D9Device *>(GFX)->getDevice();
   AssertISV( mD3DDevice, "GFXD3D9CardProfiler::init() - No D3D9 Device found!");

   // Grab the caps so we can get our adapter ordinal and look up our name.
   D3DCAPS9 caps;
   D3D9Assert(mD3DDevice->GetDeviceCaps(&caps), "GFXD3D9CardProfiler::init - failed to get device caps!");

#ifdef TORQUE_OS_XENON
   mCardDescription = "Xbox360 GPU";
   mChipSet = "ATI";
   mVersionString = String::ToString(_XDK_VER);
   mVideoMemory = 512 * 1024 * 1024;
#else
   WMIVideoInfo wmiVidInfo;
   if( wmiVidInfo.profileAdapters() )
   {
      const PlatformVideoInfo::PVIAdapter &adapter = wmiVidInfo.getAdapterInformation( caps.AdapterOrdinal );

      mCardDescription = adapter.description;
      mChipSet = adapter.chipSet;
      mVersionString = adapter.driverVersion;
      mVideoMemory = adapter.vram;
   }
#endif

   Parent::init();
}
开发者ID:campadrenalin,项目名称:terminal-overload,代码行数:29,代码来源:gfxD3D9CardProfiler.cpp


示例16: AssertISV

Bool FileRWStream::open(const char* in_filename, bool readOnly)
{
   if(!readOnly && assertIsv)
   {
      AssertISV(ResourceManager::sm_pManager == NULL ||
               ResourceManager::sm_pManager->isValidWriteFileName(in_filename) == true,
               avar("Attempted write to file: %s.\n"
                     "File is not in a writable directory.", in_filename));
   }
	close();

	// Try to open the file for binary writing.
	// if the file exists truncate it.
   // if the file does not exist, then instruct open
	// to create a file with RW attributes

   if(!readOnly)
      hFile = CreateFile(in_filename, GENERIC_WRITE|GENERIC_READ, 0, NULL,
                      OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
   else
      hFile = CreateFile( in_filename, GENERIC_READ, FILE_SHARE_READ, NULL, 
                       OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
   if ( hFile == INVALID_HANDLE_VALUE)
	{
      setStatus();
		return FALSE;
	}

	clrStatus();
	isMine = YES;
	return TRUE;
}
开发者ID:AltimorTASDK,项目名称:TribesRebirth,代码行数:32,代码来源:filstrm.cpp


示例17: AssertISV

void AtlasDiscreteMesh::remap(const Vector<U16> &remapTable)
{
   AssertISV(remapTable.size() == mVertexCount, "AtlasDiscreteMesh::remap - remap table not the right size!");

   // Take each index, run it through the remap table, and store the result.
   for(U32 i=0; i<mIndexCount; i++)
      mIndex[i] = remapTable[mIndex[i]];
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:8,代码来源:atlasDiscreteMesh.cpp


示例18: mngProcessHeaderFn

static mng_bool mngProcessHeaderFn(mng_handle mng, mng_uint32 width, mng_uint32 height)
{
   mngstuff *mymng = (mngstuff *)mng_get_userdata(mng);

   GFXFormat format;
   mng_uint8 colorType = mng_get_colortype(mng);
   mng_uint8 alphaDepth = mng_get_alphadepth(mng);
   switch(colorType)
   {
      case MNG_COLORTYPE_GRAY:
      case MNG_COLORTYPE_JPEGGRAY:
         format = GFXFormatR8G8B8;
         mng_set_canvasstyle(mng, MNG_CANVAS_RGB8);
         break;

      case MNG_COLORTYPE_INDEXED:
         if(alphaDepth >= 1)
         {
            format = GFXFormatR8G8B8A8;
            mng_set_canvasstyle(mng, MNG_CANVAS_RGBA8);
         }
         else
         {
            format = GFXFormatR8G8B8;
            mng_set_canvasstyle(mng, MNG_CANVAS_RGB8);
         }

      case MNG_COLORTYPE_RGB:
      case MNG_COLORTYPE_JPEGCOLOR:
         if(alphaDepth >= 1)
         {
            format = GFXFormatR8G8B8A8;
            mng_set_canvasstyle(mng, MNG_CANVAS_RGBA8);
         }
         else
         {
            format = GFXFormatR8G8B8;
            mng_set_canvasstyle(mng, MNG_CANVAS_RGB8);
         }
         break;

      case MNG_COLORTYPE_RGBA:
      case MNG_COLORTYPE_JPEGCOLORA:
         format = GFXFormatR8G8B8A8;
         mng_set_canvasstyle(mng, MNG_CANVAS_RGBA8);
         break;

      default:
         // This case should never get hit, however it resolves a compiler
         // warning
         format = GFXFormat_FIRST;
         AssertISV( false, "Unknown color format in bitmap MNG Loading" );
   }

   mymng->image->allocateBitmap(width, height, false, format);
   return MNG_TRUE;
}
开发者ID:nev7n,项目名称:Torque3D,代码行数:57,代码来源:bitmapMng.cpp


示例19: AssertISV

void SimDataBlockEvent::unpack(NetConnection *cptr, BitStream *bstream)
{
   if(bstream->readFlag())
   {
      mProcess = true;
      id = bstream->readInt(DataBlockObjectIdBitSize) + DataBlockObjectIdFirst;
      S32 classId = bstream->readClassId(NetClassTypeDataBlock, cptr->getNetClassGroup());
      mIndex = bstream->readInt(DataBlockObjectIdBitSize);
      mTotal = bstream->readInt(DataBlockObjectIdBitSize + 1);
      
      SimObject* ptr;
      if( Sim::findObject( id, ptr ) )
      {
         // An object with the given ID already exists.  Make sure it has the right class.
         
         AbstractClassRep* classRep = AbstractClassRep::findClassRep( cptr->getNetClassGroup(), NetClassTypeDataBlock, classId );
         if( classRep && dStrcmp( classRep->getClassName(), ptr->getClassName() ) != 0 )
         {
            Con::warnf( "A '%s' datablock with id: %d already existed. "
                        "Clobbering it with new '%s' datablock from server.",
                        ptr->getClassName(), id, classRep->getClassName() );
            ptr->deleteObject();
            ptr = NULL;
         }
      }
      
      if( !ptr )
         ptr = ( SimObject* ) ConsoleObject::create( cptr->getNetClassGroup(), NetClassTypeDataBlock, classId );
         
      mObj = dynamic_cast< SimDataBlock* >( ptr );
      if( mObj != NULL )
      {
         #ifdef DEBUG_SPEW
         Con::printf(" - SimDataBlockEvent: unpacking event of type: %s", mObj->getClassName());
         #endif
         
         mObj->unpackData( bstream );
      }
      else
      {
         #ifdef DEBUG_SPEW
         Con::printf(" - SimDataBlockEvent: INVALID PACKET!  Could not create class with classID: %d", classId);
         #endif
         
         delete ptr;
         cptr->setLastError("Invalid packet in SimDataBlockEvent::unpack()");
      }

#ifdef TORQUE_DEBUG_NET
      U32 checksum = bstream->readInt(32);
      AssertISV( (checksum ^ DebugChecksum) == (U32)classId,
         avar("unpack did not match pack for event of class %s.",
            mObj->getClassName()) );
#endif

   }
}
开发者ID:Adhdcrazzy,项目名称:Torque3D,代码行数:57,代码来源:gameConnectionEvents.cpp


示例20: AssertISV

void Platform::setWindowSize(U32 newWidth, U32 newHeight, bool fullScreen )
{
   AssertISV(gWindow, "Platform::setWindowSize - no window present!");

   // Grab the curent video settings and diddle them with the new values.
   GFXVideoMode vm = gWindow->getVideoMode();
   vm.resolution.set(newWidth, newHeight);
   vm.fullScreen = fullScreen;
   gWindow->setVideoMode(vm);
}
开发者ID:03050903,项目名称:Torque3D,代码行数:10,代码来源:platformInterface.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ AssertIsOnBackgroundThread函数代码示例发布时间:2022-05-30
下一篇:
C++ AssertEx函数代码示例发布时间: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