亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? xtocmod.cpp

?? celestia源代碼
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
#include <iostream>#include <fstream>#include <iomanip>#include <algorithm>#include <cstdio>#include <cassert>#include <cstring>#include <d3dx9.h>using namespace std;static IDirect3D9* g_d3d = NULL;static IDirect3DDevice9* g_d3dDev = NULL;static HWND g_mainWindow = NULL;char* D3DErrorString(HRESULT);    void ShowD3DErrorMessage(char* info, HRESULT hr);struct VertexAttribute{    enum {        Position = 0,        Color0   = 1,        Color1   = 2,        Normal   = 3,        Tangent  = 4,        Texture0 = 5,        Texture1 = 6,        Texture2 = 7,        Texture3 = 8,        MaxAttribute = 9,        InvalidAttribute  = -1,    };    enum Format    {        Float1 = 0,        Float2 = 1,        Float3 = 2,        Float4 = 3,        UByte4 = 4,        InvalidFormat = -1,    };    unsigned int offset;    Format format;};char* AttribFormatNames[] ={ "f1", "f2", "f3", "f4", "ub4" };char* AttribNames[] = {     "position",    "color0",    "color1",    "normal",    "tangent",    "texcoord0",    "texcoord1",    "texcoord2",    "texcoord3"};bool operator==(const D3DCOLORVALUE& c0, const D3DCOLORVALUE& c1){    return (c0.r == c1.r && c0.g == c1.g && c0.b == c1.b && c0.a == c1.a);}bool operator<(const D3DCOLORVALUE& c0, const D3DCOLORVALUE& c1){    if (c0.r == c1.r)    {        if (c0.g == c1.g)        {            if (c0.b == c1.b)                return c0.a < c1.a;            else                return c0.b < c1.b;        }        else        {            return c0.g < c1.g;        }    }    else    {        return c0.r < c1.r;    }}bool operator==(const D3DXMATERIAL& mat0, const D3DXMATERIAL& mat1){    // Compare the texture filenames for equality, safely handling    // null filenames.    bool sameTex;    if (mat0.pTextureFilename == NULL)    {        sameTex = (mat1.pTextureFilename == NULL);    }    else if (mat1.pTextureFilename == NULL)    {        sameTex = false;    }    else    {        sameTex = (strcmp(mat0.pTextureFilename, mat1.pTextureFilename) == 0);    }    return (mat0.MatD3D.Diffuse == mat1.MatD3D.Diffuse &&            mat0.MatD3D.Ambient == mat1.MatD3D.Ambient &&            mat0.MatD3D.Specular == mat1.MatD3D.Specular &&            mat0.MatD3D.Emissive == mat1.MatD3D.Emissive &&            mat0.MatD3D.Power == mat1.MatD3D.Power &&            sameTex);}ostream& operator<<(ostream& o, const D3DCOLORVALUE& c){    return (o << c.r << ' ' << c.g << ' ' << c.b);}static void render(){    g_d3dDev->Clear(0, NULL,                    D3DCLEAR_TARGET,                    D3DCOLOR_ARGB(255, 0, 0, 192),  // color                    0.0f,                           // z                    0);                             // stencil value}template<class T> int checkForFan(DWORD nTris, T* indices){    // Even number of triangles required; pairs of triangles can always    // be just as efficiently represented as strips, so skip them.    if (nTris % 2 == 1 || nTris <= 2)        return -1;    DWORD i;    T anchor = indices[0];    bool isFan = true;    for (i = 1; i < nTris / 2 && isFan; i++)    {        if (indices[i * 2] != anchor)            isFan = false;    }    if (isFan)        return 0;    isFan = true;    anchor = indices[1];    for (i = 1; i < nTris / 2 && isFan; i++)    {        if (indices[i * 2 + 1] != anchor)            isFan = false;    }    if (isFan)        cout << "fan: nTris=" << nTris << ", anchor=" << anchor << '\n';    return isFan ? 1 : -1;}template<class T> int DumpTriStrip(DWORD nTris,                                   T* indices,                                   int materialIndex,                                   ostream& meshfile){    meshfile << "tristrip ";    meshfile << materialIndex << ' ' << (nTris + 2) << '\n';                DWORD indexCount = nTris + 2;    for (DWORD j = 0; j < indexCount; j++)    {        meshfile << indices[j] << ' ';        if (j == indexCount - 1 || j % 12 == 11)            meshfile << '\n';    }}// The D3DX tristrip converter only produces strips, not fans.  It dumps// fans as strips where every other triangle is degenerate.  We detect such// strips and output them as fans instead, thus eliminating a bunch of// degenerate triangles.template<class T> void DumpTriStripAsFan(DWORD nTris,                                         T* indices,                                         int materialIndex,                                         DWORD anchorOffset,                                         ostream& meshfile){    meshfile << "trifan ";    meshfile << materialIndex << ' ' << (nTris / 2 + 3) << '\n';                DWORD indexCount = nTris + 2;    T anchor = indices[anchorOffset];    meshfile << anchor << ' ';    if (anchorOffset == 1)    {        for (int j = (int) indexCount - 1; j >= 0; j--)        {            if (indices[j] != anchor)                meshfile << indices[j] << ' ';            if (j == 0 || j % 12 == 11)                meshfile << '\n';        }    }    else if (anchorOffset == 0)    {        // D3DX never seems to produce strips where the first vertex is        // the anchor, but we'll handle it just in case.        for (int j = 1; j < (int) indexCount; j++)        {            if (indices[j] != anchor)                meshfile << indices[j] << ' ';            if (j == indexCount - 1 || j % 12 == 11)                meshfile << '\n';        }    }}bool StripifyMeshSubset(ID3DXMesh* mesh,                        DWORD attribId,                        ostream& meshfile){    // TODO: Fall back to tri lists if the strip size is too small    // TODO: Detect when a tri fan should be used instead of a tri list    // Convert to tri strips    IDirect3DIndexBuffer9* indices = NULL;    DWORD numIndices = 0;    ID3DXBuffer* strips = NULL;    DWORD numStrips = 0;    HRESULT hr;    hr = D3DXConvertMeshSubsetToStrips(mesh,                                       attribId,                                       0,                                       &indices,                                       &numIndices,                                       &strips,                                       &numStrips);    if (FAILED(hr))    {        cout << "Stripify failed\n";        return false;    }    cout << "Converted to " << numStrips << " strips\n";    cout << "Strip buffer size: " << strips->GetBufferSize() << '\n';    if (numStrips != strips->GetBufferSize() / 4)     {        cout << "Strip count is incorrect!\n";        return false;    }    bool index32 = false;    {        D3DINDEXBUFFER_DESC desc;        indices->GetDesc(&desc);        if (desc.Format == D3DFMT_INDEX32)        {            index32 = true;        }        else if (desc.Format == D3DFMT_INDEX16)        {            index32 = false;        }        else        {            cout << "Bad index format.  Strange.\n";            return false;        }    }    void* indexData = NULL;    hr = indices->Lock(0, 0, &indexData, D3DLOCK_READONLY);    if (FAILED(hr))    {        cout << "Failed to lock index buffer: " << D3DErrorString(hr) << '\n';        return false;    }    {        DWORD* stripLengths = reinterpret_cast<DWORD*>(strips->GetBufferPointer());        int k = 0;        for (int i = 0; i < numStrips; i++)        {            if (stripLengths[i] == 0)            {                cout << "Bad triangle strip (length == 0) in mesh!\n";                return false;            }            if (index32)            {                DWORD* indices = reinterpret_cast<DWORD*>(indexData) + k;                int fanStart = checkForFan(stripLengths[i], indices);                if (fanStart != 1)                {                    DumpTriStrip(stripLengths[i], indices, (int) attribId,                                 meshfile);                }                else                {                    DumpTriStripAsFan(stripLengths[i], indices, (int) attribId,                                      fanStart, meshfile);                }            }            else            {                WORD* indices = reinterpret_cast<WORD*>(indexData) + k;                int fanStart = checkForFan(stripLengths[i], indices);                if (fanStart != 1)                {                    DumpTriStrip(stripLengths[i], indices, (int) attribId,                                 meshfile);                }                else                {                    DumpTriStripAsFan(stripLengths[i], indices, (int) attribId,                                      fanStart, meshfile);                }            }            k += stripLengths[i] + 2;        }        cout << "k=" << k << ", numIndices=" << numIndices;        if (index32)            cout << ", 32-bit indices\n";        else            cout << ", 16-bit indices\n";    }    return true;}void DumpVertexDescription(VertexAttribute vertexMap[],                           ostream& meshfile){    meshfile << "vertexdesc\n";    for (int i = 0; i < VertexAttribute::MaxAttribute; i++)    {        if (vertexMap[i].format != VertexAttribute::InvalidFormat)        {            meshfile << AttribNames[i] << " " <<                AttribFormatNames[vertexMap[i].format] << " " << '\n';        }    }    meshfile << "end_vertexdesc\n\n";}bool DumpMeshVertices(ID3DXMesh* mesh,                      VertexAttribute vertexMap[],                      DWORD stride,                      ostream& meshfile){    IDirect3DVertexBuffer9* vb = NULL;    HRESULT hr = mesh->GetVertexBuffer(&vb);    if (FAILED(hr))    {        ShowD3DErrorMessage("Getting vertex buffer", hr);        return false;    }    char* vertexData = NULL;    hr = vb->Lock(0, 0, reinterpret_cast<void**>(&vertexData), D3DLOCK_READONLY);    if (FAILED(hr) || vertexData == NULL)    {        ShowD3DErrorMessage("Locking vertex buffer", hr);        return false;    }    DWORD numVertices = mesh->GetNumVertices();    meshfile << "vertices " << numVertices << '\n';    for (DWORD i = 0; i < numVertices; i++)    {        for (int attr = 0; attr < VertexAttribute::MaxAttribute; attr++)        {            if (vertexMap[attr].format != VertexAttribute::InvalidFormat)            {                char* chardata = vertexData + i * stride + vertexMap[attr].offset;                float* floatdata = reinterpret_cast<float*>(chardata);                                                                            switch (vertexMap[attr].format)                {                case VertexAttribute::Float1:                    meshfile << floatdata[0] << ' ';                    break;                case VertexAttribute::Float2:                    meshfile << floatdata[0] << ' ' << floatdata[1] << ' ';                    break;                case VertexAttribute::Float3:                    meshfile << floatdata[0] << ' ' << floatdata[1] << ' ';                    meshfile << floatdata[2] << ' ';                    break;                case VertexAttribute::Float4:                    meshfile << floatdata[0] << ' ' << floatdata[1] << ' ';                    meshfile << floatdata[2] << ' ' << floatdata[3];                    break;                case VertexAttribute::UByte4:                    meshfile << (unsigned int) chardata[0] << ' ' <<                                (unsigned int) chardata[1] << ' ' <<                                (unsigned int) chardata[2] << ' ' <<                                (unsigned int) chardata[3] << ' ';                    break;                default:                    break;                }            }        }        meshfile << '\n';    }    vb->Unlock();    meshfile << '\n';    return true;}bool CreateVertexAttributeMap(D3DVERTEXELEMENT9 declElements[],                              VertexAttribute vertexMap[]){    int i = 0;    for (i = 0; i < VertexAttribute::MaxAttribute; i++)    {        vertexMap[i].offset = 0;        vertexMap[i].format = VertexAttribute::InvalidFormat;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91免费观看视频在线| 91精品午夜视频| 国产欧美一区二区精品性色| 久久精品国产999大香线蕉| 欧美美女喷水视频| 日本欧美在线观看| 日韩欧美中文一区二区| 亚洲一区免费在线观看| 色综合色综合色综合| 欧美日韩一级大片网址| 天堂精品中文字幕在线| 欧美一级国产精品| 国产剧情av麻豆香蕉精品| 欧美激情综合在线| 色婷婷国产精品综合在线观看| 国产成人精品亚洲777人妖| 久久久国产精品麻豆| 成年人午夜久久久| 亚洲成人在线网站| 久久女同性恋中文字幕| 99re免费视频精品全部| 午夜一区二区三区在线观看| 日韩欧美国产综合| 成人av电影在线网| 天堂成人免费av电影一区| 欧美成人免费网站| caoporen国产精品视频| 日韩中文字幕亚洲一区二区va在线| 欧美大片一区二区三区| 成人av电影在线观看| 伊人一区二区三区| 91精品国产欧美一区二区18| 精品伦理精品一区| 日韩影院精彩在线| 色综合久久综合网欧美综合网| 一区二区不卡在线播放| 欧美一区二区三区爱爱| 国产成人久久精品77777最新版本| 一区二区三区日韩精品视频| 日韩你懂的在线观看| 95精品视频在线| 另类成人小视频在线| 一区二区中文字幕在线| 日韩一区二区三区视频在线观看| 大尺度一区二区| 美女网站在线免费欧美精品| 亚洲日本在线看| 国产三级精品视频| 欧美人妇做爰xxxⅹ性高电影| 成人午夜精品在线| 免费成人在线观看视频| 亚洲精品乱码久久久久| 久久精品免视看| 国产sm精品调教视频网站| 波多野结衣一区二区三区| 日本免费在线视频不卡一不卡二| 亚洲欧洲精品一区二区三区不卡| 精品久久久久香蕉网| 欧美丝袜丝交足nylons| aaa亚洲精品| 国产电影精品久久禁18| 在线亚洲一区二区| 成人午夜视频在线观看| 激情综合一区二区三区| 麻豆91在线播放| 亚洲成av人片在线观看| 亚洲三级免费观看| 国产精品美女久久久久aⅴ国产馆| 欧美一区二区三区的| 欧美唯美清纯偷拍| 欧洲人成人精品| 在线亚洲一区二区| 色综合咪咪久久| 色视频欧美一区二区三区| 99精品欧美一区二区蜜桃免费| 成人一区二区三区中文字幕| 国产一区欧美一区| 国产一区在线精品| 久久成人免费网| 精品一区二区日韩| 精品一区二区在线免费观看| 蜜臀久久99精品久久久久宅男 | 久久久一区二区三区| 精品久久久久久亚洲综合网| 欧美变态口味重另类| 欧美成人一级视频| 久久久不卡影院| 中文av一区二区| 亚洲欧美在线视频| 一区二区三区美女视频| 一级女性全黄久久生活片免费| 亚洲综合激情另类小说区| 亚洲一区二区在线观看视频| 亚洲永久免费av| 麻豆精品久久久| 国产成人综合在线播放| 99热99精品| 欧美久久久影院| 精品国产伦理网| 国产精品久久久久久一区二区三区| 亚洲人午夜精品天堂一二香蕉| 一区二区三区91| 美女www一区二区| 国产91在线看| 欧美色视频一区| 久久综合丝袜日本网| 中文字幕日韩精品一区| 亚洲成人高清在线| 国产一区在线看| 欧洲亚洲精品在线| 精品卡一卡二卡三卡四在线| 国产精品丝袜黑色高跟| 亚洲一区日韩精品中文字幕| 久久99在线观看| 成人黄色一级视频| 欧美伊人久久大香线蕉综合69| 欧美私模裸体表演在线观看| 精品福利视频一区二区三区| 欧美国产成人精品| **欧美大码日韩| 综合色天天鬼久久鬼色| 美国十次了思思久久精品导航| 国产精品1区二区.| 色婷婷av一区二区三区gif | 日韩一区二区三区观看| 2024国产精品视频| 亚洲人123区| 午夜日韩在线观看| 91在线一区二区| 欧美日韩国产精品自在自线| 26uuu国产日韩综合| 亚洲欧美在线视频观看| 午夜电影一区二区三区| 成人动漫在线一区| 4438成人网| 国产精品免费aⅴ片在线观看| 亚洲影视资源网| 国产传媒日韩欧美成人| 91麻豆成人久久精品二区三区| 欧美人动与zoxxxx乱| 国产精品另类一区| 日本伊人色综合网| 成人在线综合网| 日韩视频中午一区| 亚洲欧美日韩电影| 丁香桃色午夜亚洲一区二区三区| 91福利资源站| 久久精品一区蜜桃臀影院| 亚洲国产精品欧美一二99 | 五月激情丁香一区二区三区| 国产乱码一区二区三区| 欧美日韩激情一区| 国产精品欧美久久久久无广告 | 日产精品久久久久久久性色| 成人av高清在线| 精品欧美黑人一区二区三区| 亚洲黄色av一区| 精品一区二区三区免费| 91精品国产入口| 亚洲中国最大av网站| 成人app下载| 国产午夜亚洲精品不卡| 精品一区二区三区久久久| 欧美日韩亚洲丝袜制服| 一区二区三区在线视频免费观看 | 欧美日韩五月天| 一区二区免费在线播放| 波多野结衣精品在线| 久久蜜桃一区二区| 日av在线不卡| 欧美va亚洲va国产综合| 日韩不卡在线观看日韩不卡视频| 欧美在线视频全部完| 亚洲靠逼com| 国产很黄免费观看久久| 欧美v日韩v国产v| 美女精品一区二区| 日韩色在线观看| 美国欧美日韩国产在线播放| 欧美精品一卡两卡| 久久草av在线| 精品少妇一区二区三区视频免付费 | 欧美一级生活片| 日韩av网站在线观看| 欧美一区二区私人影院日本| 亚洲国产精品一区二区久久恐怖片| 欧美另类久久久品| 日本色综合中文字幕| 欧美一区二区三区免费在线看| 日韩av电影天堂| 国产欧美日韩三区| 成人18精品视频| 亚洲精品写真福利| 日本乱人伦aⅴ精品| 免费人成精品欧美精品| 精品国产网站在线观看| 国产精品白丝av| 亚洲欧洲成人av每日更新| 欧美精品777| 久久国产尿小便嘘嘘|