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


C++ BinaryInput::readInt32方法代码示例

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


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

示例1: deserialize

void ServerDescription::deserialize(BinaryInput& b) {
    serverName      = b.readString();
    applicationAddress.deserialize(b);
    applicationName = b.readString();
    maxClients      = b.readInt32();
    debugAssert(maxClients >= 0);
    currentClients  = b.readInt32();
    data            = b.readString();
    lastUpdateTime  = System::time();
}
开发者ID:jackpoz,项目名称:G3D-backup,代码行数:10,代码来源:Discovery.cpp

示例2: deserialize

    void deserialize(BinaryInput& b) {
        magic               = b.readInt32();
        version             = b.readInt32(); 
        skinWidth           = b.readInt32(); 
        skinHeight          = b.readInt32(); 
        frameSize           = b.readInt32(); 
        numSkins            = b.readInt32(); 
        numVertices         = b.readInt32(); 
        numTexCoords        = b.readInt32(); 
        numTriangles        = b.readInt32(); 
        numGlCommands       = b.readInt32(); 
        numFrames           = b.readInt32(); 
        offsetSkins         = b.readInt32(); 
        offsetTexCoords     = b.readInt32(); 
        offsetTriangles     = b.readInt32(); 
        offsetFrames        = b.readInt32(); 
        offsetGlCommands    = b.readInt32(); 
        offsetEnd           = b.readInt32();

    }
开发者ID:jackpoz,项目名称:G3D-backup,代码行数:20,代码来源:MD2Model_load.cpp

示例3: debugAssertM

GFont::GFont(const String& filename, BinaryInput& b) {    

    int ver = b.readInt32();
    debugAssertM(ver == 1 || ver == 2, "Can't read font files other than version 1");
    (void)ver;

    if (ver == 1) {
        charsetSize = 128;
    } else {
        charsetSize = b.readInt32();
    }

    // Read the widths
    subWidth.resize(charsetSize);
    for (int c = 0; c < charsetSize; ++c) {
        subWidth[c] = b.readUInt16();
    }

    baseline = b.readUInt16();
    int texWidth = b.readUInt16();
    charWidth  = texWidth / 16;
    charHeight = texWidth / 16;

    // The input may not be a power of 2
    int width  = ceilPow2(charWidth * 16);
    int height = ceilPow2(charHeight * (charsetSize / 16));
  
    // Create a texture
    const uint8* ptr = ((uint8*)b.getCArray()) + b.getPosition();
    debugAssertM((b.getLength() - b.getPosition()) >= width * height, 
        "File does not contain enough data for this size texture");

    Texture::Preprocess preprocess;
    preprocess.computeMinMaxMean = false;
    const bool generateMipMaps = true;

    
    m_texture = 
        Texture::fromMemory
        (   filename, 
            ptr,
            ImageFormat::R8(),
            width, 
            height,
            1,
            1,
            ImageFormat::R8(), 
            Texture::DIM_2D,
            generateMipMaps,
            preprocess);
       
    m_textureMatrix[0] = 1.0f / m_texture->width();
    m_textureMatrix[1] = 0;
    m_textureMatrix[2] = 0;
    m_textureMatrix[3] = 0;
    m_textureMatrix[4] = 0;
    m_textureMatrix[5] = 1.0f / m_texture->height();
    m_textureMatrix[6] = 0;
    m_textureMatrix[7] = 0;    
    m_textureMatrix[8] = 0;
    m_textureMatrix[9] = 0;
    m_textureMatrix[10] = 1;
    m_textureMatrix[11] = 0;
    m_textureMatrix[12] = 0;
    m_textureMatrix[13] = 0;
    m_textureMatrix[14] = 0;
    m_textureMatrix[15] = 1;

    m_name = filename;
}
开发者ID:jackpoz,项目名称:G3D-backup,代码行数:70,代码来源:GFont.cpp

示例4: deserialize

	void deserialize(BinaryInput& b) {
		i32 = b.readInt32();
		i64 = b.readInt64();
		s   = b.readString();
		f	= b.readFloat32();
	}
开发者ID:jackpoz,项目名称:G3D-backup,代码行数:6,代码来源:tReliableConduit.cpp


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