Changeset 2787


Ignore:
Timestamp:
Jun 24, 2013, 4:42:40 PM (8 years ago)
Author:
sam
Message:

build: fix the X360 port.

Location:
trunk/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gpu/framebuffer.cpp

    r2770 r2787  
    2020#   define NEAR
    2121#   include <d3d9.h>
     22#elif defined _XBOX
     23#   include <xtl.h>
     24#   undef near /* Fuck Microsoft */
     25#   undef far /* Fuck Microsoft again */
    2226#endif
    2327
     
    4549    IDirect3DSurface9 *m_surface, *m_back_surface;
    4650#elif defined _XBOX
    47     D3DDevice9 *m_dev;
     51    D3DDevice *m_dev;
    4852    D3DTexture *m_texture;
    4953    D3DSurface *m_surface, *m_back_surface;
     
    6266    switch (m_format)
    6367    {
    64 #if defined USE_D3D9 || defined _XBOX
     68#if defined USE_D3D9
    6569    case R_16_F:        return D3DFMT_R16F;
    6670    case R_32_F:        return D3DFMT_R32F;
     
    7377    case RGB_8_I:
    7478    case RGB_8_UI:      return D3DFMT_R8G8B8;
     79    case RGBA_8:
     80    case RGBA_8_I:
     81    case RGBA_8_UI:     return D3DFMT_A8R8G8B8;
     82    case RGBA_16:
     83    case RGBA_16_I:
     84    case RGBA_16_UI:    return D3DFMT_A16B16G16R16;
     85    case RGBA_16_F:     return D3DFMT_A16B16G16R16F;
     86    case RGBA_32_F:     return D3DFMT_A32B32G32R32F;
     87#elif defined _XBOX
     88    case R_16_F:        return D3DFMT_R16F;
     89    case R_32_F:        return D3DFMT_R32F;
     90    case RG_16:
     91    case RG_16_I:
     92    case RG_16_UI:      return D3DFMT_G16R16;
     93    case RG_16_F:       return D3DFMT_G16R16F;
     94    case RG_32_F:       return D3DFMT_G32R32F;
     95    case RGB_8:
     96    case RGB_8_I:
     97    case RGB_8_UI:      return D3DFMT_X8R8G8B8;
    7598    case RGBA_8:
    7699    case RGBA_8_I:
     
    292315
    293316    if (FAILED(m_data->m_dev->CreateTexture(size.x, size.y, 1,
    294                                           D3DUSAGE_RENDERTARGET,
    295                                           (D3DFORMAT)fbo_format.GetFormat(), D3DPOOL_DEFAULT,
    296                                           &m_data->m_texture, nullptr)))
     317                                            D3DUSAGE_RENDERTARGET,
     318                                            (D3DFORMAT)fbo_format.GetFormat(),
     319                                            D3DPOOL_DEFAULT,
     320                                            &m_data->m_texture, nullptr)))
    297321        Abort();
    298322    if (FAILED(m_data->m_texture->GetSurfaceLevel(0, &m_data->m_surface)))
    299323        Abort();
    300324#elif defined _XBOX
    301     m_data->m_dev = (D3DDevice9 *)g_renderer->GetDevice();
     325    m_data->m_dev = (D3DDevice *)g_renderer->GetDevice();
    302326
    303327    if (FAILED(m_data->m_dev->CreateTexture(size.x, size.y, 1, 0,
    304                                           fbo_format.GetFormat(), D3DPOOL_DEFAULT,
    305                                           &m_data->m_texture, nullptr)))
     328                                            (D3DFORMAT)fbo_format.GetFormat(),
     329                                            D3DPOOL_DEFAULT,
     330                                            &m_data->m_texture, nullptr)))
    306331        Abort();
    307332    if (FAILED(m_data->m_dev->CreateRenderTarget(size.x, size.y,
    308                                                fbo_format.GetFormat(),
    309                                                D3DMULTISAMPLE_NONE, 0, 0,
    310                                                &m_data->m_surface, nullptr)))
     333                                                 (D3DFORMAT)fbo_format.GetFormat(),
     334                                                 D3DMULTISAMPLE_NONE, 0, 0,
     335                                                 &m_data->m_surface, nullptr)))
    311336        Abort();
    312337#else
  • trunk/src/gpu/indexbuffer.cpp

    r2770 r2787  
    2020#   define NEAR
    2121#   include <d3d9.h>
     22#elif defined _XBOX
     23#   include <xtl.h>
     24#   undef near /* Fuck Microsoft */
     25#   undef far /* Fuck Microsoft again */
    2226#endif
    2327
     
    4246    IDirect3DIndexBuffer9 *m_ibo;
    4347#elif defined _XBOX
    44     D3DDevice9 *m_dev;
     48    D3DDevice *m_dev;
    4549    D3DIndexBuffer *m_ibo;
    4650#else
     
    6569    m_data->m_dev = (IDirect3DDevice9 *)g_renderer->GetDevice();
    6670#   elif defined _XBOX
    67     m_data->m_dev = (D3DDevice9 *)g_renderer->GetDevice();
     71    m_data->m_dev = (D3DDevice *)g_renderer->GetDevice();
    6872#   endif
    6973
  • trunk/src/gpu/renderer.cpp

    r2777 r2787  
    9898    XGetVideoMode(&VideoMode);
    9999    size = lol::min(size, ivec2(VideoMode.dwDisplayWidth,
    100                                 VideoMode.dwDisplayHeight);
     100                                VideoMode.dwDisplayHeight));
    101101#   endif
    102102    D3DPRESENT_PARAMETERS d3dpp;
  • trunk/src/gpu/shader.cpp

    r2770 r2787  
    1616#include <cstdio>
    1717
    18 #ifdef WIN32
     18#if defined WIN32 && !defined _XBOX
    1919#   define WIN32_LEAN_AND_MEAN
    2020#   include <windows.h>
     
    2626#       include <d3dx9shader.h>
    2727#   endif
     28#elif defined _XBOX
     29#   include <xtl.h>
     30#   undef near /* Fuck Microsoft */
     31#   undef far /* Fuck Microsoft again */
    2832#endif
    2933
     
    5155    ID3DXConstantTable *vert_table, *frag_table;
    5256#elif defined _XBOX
    53     D3DDevice9 *m_dev;
     57    D3DDevice *m_dev;
    5458    D3DVertexShader *vert_shader;
    5559    D3DPixelShader *frag_shader;
     
    193197    data->m_dev = (IDirect3DDevice9 *)g_renderer->GetDevice();
    194198#   elif defined _XBOX
    195     data->m_dev = (D3DDevice9 *)g_renderer->GetDevice();
     199    data->m_dev = (D3DDevice *)g_renderer->GetDevice();
    196200#   endif
    197201
  • trunk/src/gpu/texture.cpp

    r2777 r2787  
    4646    D3DTEXTUREFILTERTYPE m_mip_filter;
    4747#elif defined _XBOX
    48     D3DDevice9 *m_dev;
     48    D3DDevice *m_dev;
    4949    D3DTexture *m_texture;
     50    D3DTEXTUREFILTERTYPE m_mag_filter;
     51    D3DTEXTUREFILTERTYPE m_min_filter;
     52    D3DTEXTUREFILTERTYPE m_mip_filter;
    5053#else
    5154    GLuint m_texture;
     
    7578    m_data->m_dev = (IDirect3DDevice9 *)g_renderer->GetDevice();
    7679#   elif defined _XBOX
    77     m_data->m_dev = (D3DDevice9 *)g_renderer->GetDevice();
     80    m_data->m_dev = (D3DDevice *)g_renderer->GetDevice();
    7881#   endif
    7982
     
    298301void Texture::GenerateMipmaps()
    299302{
    300 #if defined _XBOX || defined USE_D3D9
    301     m_data->m_texture->GenerateMipSubLevels();
     303#if defined USE_D3D9
     304    m_data->m_texture->->GenerateMipSubLevels();
     305#elif defined _XBOX
     306    /* FIXME: No direct mipmap generation support on X360 */
    302307#elif defined __CELLOS_LV2__
    303308    glBindTexture(GL_TEXTURE_2D, m_data->m_texture);
  • trunk/src/gpu/vertexbuffer.cpp

    r2770 r2787  
    2020#   define NEAR
    2121#   include <d3d9.h>
     22#elif defined _XBOX
     23#   include <xtl.h>
     24#   undef near /* Fuck Microsoft */
     25#   undef far /* Fuck Microsoft again */
    2226#endif
    2327
     
    4347    IDirect3DVertexBuffer9 *m_vbo;
    4448#elif defined _XBOX
    45     D3DDevice9 *m_dev;
     49    D3DDevice *m_dev;
    4650    D3DVertexBuffer *m_vbo;
    4751#else
     
    6569    IDirect3DVertexDeclaration9 *m_vdecl;
    6670#elif defined _XBOX
    67     D3DDevice9 *m_dev;
     71    D3DDevice *m_dev;
    6872    D3DVertexDeclaration *m_vdecl;
    6973#else
     
    565569    m_data->m_dev = (IDirect3DDevice9 *)g_renderer->GetDevice();
    566570#   elif defined _XBOX
    567     m_data->m_dev = (D3DDevice9 *)g_renderer->GetDevice();
     571    m_data->m_dev = (D3DDevice *)g_renderer->GetDevice();
    568572#   endif
    569573
     
    648652    m_data->m_dev = (IDirect3DDevice9 *)g_renderer->GetDevice();
    649653#   elif defined _XBOX
    650     m_data->m_dev = (D3DDevice9 *)g_renderer->GetDevice();
     654    m_data->m_dev = (D3DDevice *)g_renderer->GetDevice();
    651655#   endif
    652656
  • trunk/src/platform/xbox/xboxapp.cpp

    r2770 r2787  
    6464
    6565#if defined _XBOX
    66     D3DDevice9 *d3d_dev = (D3DDevice9 *)g_renderer->GetDevice();
     66    D3DDevice *d3d_dev = (D3DDevice *)g_renderer->GetDevice();
    6767    d3d_dev->Present(nullptr, nullptr, nullptr, nullptr);
    6868#endif
Note: See TracChangeset for help on using the changeset viewer.