mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2024-11-22 05:45:38 +00:00
Update project to vs 2013. Clean compile warnings
This commit is contained in:
parent
ce99c47f8a
commit
93f6b01e0b
|
@ -405,7 +405,7 @@ void CLegacy3D::UploadTextures(unsigned x, unsigned y, unsigned width, unsigned
|
||||||
textureBuffer[i++] = 0.0f;
|
textureBuffer[i++] = 0.0f;
|
||||||
textureBuffer[i++] = 1.0f;
|
textureBuffer[i++] = 1.0f;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Update all texture sheets
|
// Update all texture sheets
|
||||||
for (size_t texSheet = 0; texSheet < numTexSheets; texSheet++)
|
for (size_t texSheet = 0; texSheet < numTexSheets; texSheet++)
|
||||||
|
@ -581,7 +581,7 @@ static bool IsDynamicModel(const UINT32 *data)
|
||||||
unsigned numVerts = (data[0]&0x40 ? 4 : 3);
|
unsigned numVerts = (data[0]&0x40 ? 4 : 3);
|
||||||
// Deduct number of reused verts
|
// Deduct number of reused verts
|
||||||
numVerts -= sharedVerts[data[0]&0xf];
|
numVerts -= sharedVerts[data[0]&0xf];
|
||||||
done = data[1]&4;
|
done = data[1] & 4 > 0;
|
||||||
// Skip header and vertices to next polygon
|
// Skip header and vertices to next polygon
|
||||||
data += 7 + numVerts * 4;
|
data += 7 + numVerts * 4;
|
||||||
}
|
}
|
||||||
|
@ -633,7 +633,7 @@ bool CLegacy3D::DrawModel(UINT32 modelAddr)
|
||||||
Cache = &PolyCache;
|
Cache = &PolyCache;
|
||||||
ModelRef = CacheModel(Cache, lutIdx, texOffset, model);
|
ModelRef = CacheModel(Cache, lutIdx, texOffset, model);
|
||||||
if (NULL == ModelRef)
|
if (NULL == ModelRef)
|
||||||
{
|
{
|
||||||
// Model could not be cached. Render what we have so far and try again.
|
// Model could not be cached. Render what we have so far and try again.
|
||||||
DrawDisplayList(&VROMCache, POLY_STATE_NORMAL);
|
DrawDisplayList(&VROMCache, POLY_STATE_NORMAL);
|
||||||
DrawDisplayList(&PolyCache, POLY_STATE_NORMAL);
|
DrawDisplayList(&PolyCache, POLY_STATE_NORMAL);
|
||||||
|
@ -974,8 +974,8 @@ void CLegacy3D::RenderViewport(UINT32 addr, int pri)
|
||||||
|
|
||||||
void CLegacy3D::RenderFrame(void)
|
void CLegacy3D::RenderFrame(void)
|
||||||
{
|
{
|
||||||
// Begin frame
|
// Begin frame
|
||||||
ClearErrors(); // must be cleared each frame
|
ClearErrors(); // must be cleared each frame
|
||||||
//printf("BEGIN FRAME\n");
|
//printf("BEGIN FRAME\n");
|
||||||
|
|
||||||
// Z buffering (Z buffer is cleared by display list viewport nodes)
|
// Z buffering (Z buffer is cleared by display list viewport nodes)
|
||||||
|
@ -1328,7 +1328,7 @@ CLegacy3D::CLegacy3D(void)
|
||||||
CLegacy3D::~CLegacy3D(void)
|
CLegacy3D::~CLegacy3D(void)
|
||||||
{
|
{
|
||||||
DestroyShaderProgram(shaderProgram,vertexShader,fragmentShader);
|
DestroyShaderProgram(shaderProgram,vertexShader,fragmentShader);
|
||||||
if (glBindBuffer != NULL) // we may have failed earlier due to lack of OpenGL 2.0 functions
|
if (glBindBuffer != NULL) // we may have failed earlier due to lack of OpenGL 2.0 functions
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, 0); // disable VBOs by binding to 0
|
glBindBuffer(GL_ARRAY_BUFFER, 0); // disable VBOs by binding to 0
|
||||||
glDeleteTextures(numTexMaps, texMapIDs);
|
glDeleteTextures(numTexMaps, texMapIDs);
|
||||||
|
|
||||||
|
|
|
@ -753,7 +753,7 @@ struct VBORef *CLegacy3D::CacheModel(ModelCache *Cache, int lutIdx, UINT16 texOf
|
||||||
bool validPoly = (P.header[0] & 0x300) != 0x300;
|
bool validPoly = (P.header[0] & 0x300) != 0x300;
|
||||||
|
|
||||||
// Obtain basic polygon parameters
|
// Obtain basic polygon parameters
|
||||||
done = P.header[1]&4; // last polygon?
|
done = P.header[1] & 4 > 0; // last polygon?
|
||||||
P.numVerts = (P.header[0]&0x40)?4:3;
|
P.numVerts = (P.header[0]&0x40)?4:3;
|
||||||
|
|
||||||
// Texture data
|
// Texture data
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
namespace New3D {
|
|
||||||
} // New3D
|
|
|
@ -1,2 +0,0 @@
|
||||||
namespace New3D {
|
|
||||||
} // New3D
|
|
|
@ -299,18 +299,18 @@ UINT64 PolyHeader::Hash(int textureXOffset, int textureYOffset)
|
||||||
{
|
{
|
||||||
UINT64 hash = 0;
|
UINT64 hash = 0;
|
||||||
|
|
||||||
hash |= (header[2] & 3); // bits 0-1 uv mirror bits
|
hash |= (header[2] & 3); // bits 0-1 uv mirror bits
|
||||||
hash |= ((header[3] >> 0) & 7) << 2; // bits 2-4 tex height
|
hash |= (UINT64)((header[3] >> 0) & 7) << 2; // bits 2-4 tex height
|
||||||
hash |= ((header[3] >> 3) & 7) << 5; // bits 5-7 tex width
|
hash |= (UINT64)((header[3] >> 3) & 7) << 5; // bits 5-7 tex width
|
||||||
hash |= X(textureXOffset) << 8; // bits 8-17 x offset
|
hash |= (UINT64)X(textureXOffset) << 8; // bits 8-17 x offset
|
||||||
hash |= Y(textureYOffset) << 18; // bits 18-27 y offset
|
hash |= (UINT64)Y(textureYOffset) << 18; // bits 18-27 y offset
|
||||||
hash |= TexFormat() << 28; // bits 28-30 tex format
|
hash |= (UINT64)TexFormat() << 28; // bits 28-30 tex format
|
||||||
hash |= (UINT64)TexEnabled() << 31; // bits 31 textures enabled
|
hash |= (UINT64)TexEnabled() << 31; // bits 31 textures enabled
|
||||||
hash |= (UINT64)LightEnabled() << 32; // bits 32 light enabled
|
hash |= (UINT64)LightEnabled() << 32; // bits 32 light enabled
|
||||||
hash |= (UINT64)DoubleSided() << 33; // bits 33 double sided
|
hash |= (UINT64)DoubleSided() << 33; // bits 33 double sided
|
||||||
hash |= (UINT64)AlphaTest() << 34; // bits 34 contour processing
|
hash |= (UINT64)AlphaTest() << 34; // bits 34 contour processing
|
||||||
hash |= (UINT64)PolyAlpha() << 35; // bits 35 poly alpha processing
|
hash |= (UINT64)PolyAlpha() << 35; // bits 35 poly alpha processing
|
||||||
hash |= (UINT64)TextureAlpha() << 36; // bits 35 poly alpha processing
|
hash |= (UINT64)TextureAlpha() << 36; // bits 35 poly alpha processing
|
||||||
|
|
||||||
//to do add the rest of the states
|
//to do add the rest of the states
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
/*
|
/*
|
||||||
* Render2D.cpp
|
* Render2D.cpp
|
||||||
*
|
*
|
||||||
* Implementation of the CRender2D class: OpenGL tile generator graphics.
|
* Implementation of the CRender2D class: OpenGL tile generator graphics.
|
||||||
*
|
*
|
||||||
* To-Do List
|
* To-Do List
|
||||||
* ----------
|
* ----------
|
||||||
* - Is there a better way to handle the overscan regions in wide screen mode?
|
* - Is there a better way to handle the overscan regions in wide screen mode?
|
||||||
|
@ -372,7 +372,7 @@ void CRender2D::DrawTileLine8BitNoClip(UINT32 *buf, UINT16 tile, int tileLine, c
|
||||||
void CRender2D::DrawLine(UINT32 *dest, int layerNum, int y, const UINT16 *nameTableBase, const UINT32 *pal)
|
void CRender2D::DrawLine(UINT32 *dest, int layerNum, int y, const UINT16 *nameTableBase, const UINT32 *pal)
|
||||||
{
|
{
|
||||||
// Determine the layer color depth (4 or 8-bit pixels)
|
// Determine the layer color depth (4 or 8-bit pixels)
|
||||||
bool is4Bit = regs[0x20/4] & (1<<(12+layerNum));
|
bool is4Bit = (regs[0x20 / 4] & (1 << (12 + layerNum))) > 0;
|
||||||
|
|
||||||
// Compute offsets due to vertical scrolling
|
// Compute offsets due to vertical scrolling
|
||||||
int vScroll = (regs[0x60/4+layerNum]>>16)&0x1FF;
|
int vScroll = (regs[0x60/4+layerNum]>>16)&0x1FF;
|
||||||
|
@ -551,7 +551,7 @@ bool CRender2D::DrawTilemaps(UINT32 *destBottom, UINT32 *destTop)
|
||||||
|
|
||||||
// Load horizontal full-screen scroll values and scroll mode
|
// Load horizontal full-screen scroll values and scroll mode
|
||||||
hFullScroll[i] = regs[0x60/4+i]&0x3FF;
|
hFullScroll[i] = regs[0x60/4+i]&0x3FF;
|
||||||
lineScrollMode[i] = regs[0x60/4+i]&0x8000;
|
lineScrollMode[i] = (regs[0x60 / 4 + i] & 0x8000)>0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -721,7 +721,7 @@ void CRender2D::EndFrame(void)
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
Emulation Callbacks
|
Emulation Callbacks
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
// Deprecated
|
// Deprecated
|
||||||
void CRender2D::WriteVRAM(unsigned addr, UINT32 data)
|
void CRender2D::WriteVRAM(unsigned addr, UINT32 data)
|
||||||
{
|
{
|
||||||
|
@ -763,7 +763,7 @@ bool CRender2D::Init(unsigned xOffset, unsigned yOffset, unsigned xRes, unsigned
|
||||||
|
|
||||||
// Load shaders
|
// Load shaders
|
||||||
if (OKAY != LoadShaderProgram(&shaderProgram,&vertexShader,&fragmentShader,NULL,NULL,vertexShaderSource,fragmentShaderSource))
|
if (OKAY != LoadShaderProgram(&shaderProgram,&vertexShader,&fragmentShader,NULL,NULL,vertexShaderSource,fragmentShaderSource))
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
|
||||||
// Get locations of the uniforms
|
// Get locations of the uniforms
|
||||||
glUseProgram(shaderProgram); // bind program
|
glUseProgram(shaderProgram); // bind program
|
||||||
|
@ -828,7 +828,7 @@ CRender2D::CRender2D(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
CRender2D::~CRender2D(void)
|
CRender2D::~CRender2D(void)
|
||||||
{
|
{
|
||||||
DestroyShaderProgram(shaderProgram,vertexShader,fragmentShader);
|
DestroyShaderProgram(shaderProgram,vertexShader,fragmentShader);
|
||||||
glDeleteTextures(2, texID);
|
glDeleteTextures(2, texID);
|
||||||
|
|
||||||
|
|
|
@ -326,7 +326,7 @@ bool CINIFile::Get(string SectionName, string SettingName, bool& value)
|
||||||
if (Get(SectionName, SettingName, intVal) == FAIL)
|
if (Get(SectionName, SettingName, intVal) == FAIL)
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
|
||||||
value = (bool)intVal;
|
value = intVal > 0;
|
||||||
|
|
||||||
return OKAY;
|
return OKAY;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1896,7 +1896,7 @@ bool CInputSystem::DetectJoystickAxis(unsigned joyNum, unsigned &axisNum, const
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maxRange > 3000)
|
if (maxRange > 3000)
|
||||||
printf("Detected\n", joyDetails->axisName[axisNum]);
|
printf("Detected %i\n", (int)joyDetails->axisName[axisNum]);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cancelled = true;
|
cancelled = true;
|
||||||
|
|
|
@ -2981,7 +2981,6 @@ static void Reverse32(UINT8 *buf, unsigned size)
|
||||||
static void ReadCROMDirectly(UINT8 *crom, char *fileName[4], unsigned combinedSize)
|
static void ReadCROMDirectly(UINT8 *crom, char *fileName[4], unsigned combinedSize)
|
||||||
{
|
{
|
||||||
FILE *fp[4] = { NULL, NULL, NULL, NULL };
|
FILE *fp[4] = { NULL, NULL, NULL, NULL };
|
||||||
long size[4];
|
|
||||||
|
|
||||||
// Open all files
|
// Open all files
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
|
|
|
@ -249,11 +249,6 @@ static bool CreateGLScreen(const char *caption, unsigned *xOffsetPtr, unsigned *
|
||||||
|
|
||||||
static bool ResizeGLScreen(unsigned *xOffsetPtr, unsigned *yOffsetPtr, unsigned *xResPtr, unsigned *yResPtr, unsigned *totalXResPtr, unsigned *totalYResPtr, bool keepAspectRatio, bool fullScreen)
|
static bool ResizeGLScreen(unsigned *xOffsetPtr, unsigned *yOffsetPtr, unsigned *xResPtr, unsigned *yResPtr, unsigned *totalXResPtr, unsigned *totalYResPtr, bool keepAspectRatio, bool fullScreen)
|
||||||
{
|
{
|
||||||
const SDL_VideoInfo *VideoInfo;
|
|
||||||
GLenum err;
|
|
||||||
float model3Ratio, ratio;
|
|
||||||
float xRes, yRes;
|
|
||||||
|
|
||||||
// Set video mode
|
// Set video mode
|
||||||
if (SDL_SetVideoMode(*xResPtr,*yResPtr,0,SDL_OPENGL|(fullScreen?SDL_FULLSCREEN|SDL_HWSURFACE:0)) == NULL)
|
if (SDL_SetVideoMode(*xResPtr,*yResPtr,0,SDL_OPENGL|(fullScreen?SDL_FULLSCREEN|SDL_HWSURFACE:0)) == NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,20 +1,17 @@
|
||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio 2008
|
# Visual Studio 2013
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Supermodel", "Supermodel.vcproj", "{B114BBD9-8AEA-4DAE-B367-A66A804CB3DD}"
|
VisualStudioVersion = 12.0.40629.0
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
{1248CF7C-B122-461C-9624-196AEFAE5046} = {1248CF7C-B122-461C-9624-196AEFAE5046}
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Supermodel", "Supermodel.vcxproj", "{B114BBD9-8AEA-4DAE-B367-A66A804CB3DD}"
|
||||||
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68} = {81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}
|
|
||||||
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A} = {DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDLmain", "SDLmain\SDLmain.vcproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDLmain", "SDLmain\SDLmain.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL", "SDL\SDL.vcproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL", "SDL\SDL.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZLib", "ZLib\ZLib.vcproj", "{248D61E0-2E9B-4C73-8839-A31FBCB7D109}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZLib", "ZLib\ZLib.vcxproj", "{248D61E0-2E9B-4C73-8839-A31FBCB7D109}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Musashi68K", "Musashi68K\Musashi68K.vcproj", "{1248CF7C-B122-461C-9624-196AEFAE5046}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Musashi68K", "Musashi68K\Musashi68K.vcxproj", "{1248CF7C-B122-461C-9624-196AEFAE5046}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
|
Loading…
Reference in a new issue