increase visual studio warning level and deal with the consequences.
This commit is contained in:
parent
a086c21ba7
commit
a88b22e547
|
@ -679,7 +679,7 @@ template<SPUInterpolationMode INTERPOLATE_MODE> static FORCEINLINE s32 Interpola
|
|||
ratio = ratio - (int)ratio;
|
||||
double ratio2 = ((1.0 - cos(ratio * M_PI)) * 0.5);
|
||||
//double ratio2 = (1.0f - cos_lut[((int)(ratio*256.0))&0xFF]) / 2.0f;
|
||||
return (((1-ratio2)*a) + (ratio2*b));
|
||||
return (s32)(((1-ratio2)*a) + (ratio2*b));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -327,7 +327,7 @@ TEMPLATE static u32 divide()
|
|||
|
||||
cpu->R[0] = (u32)(num / dnum);
|
||||
cpu->R[1] = (u32)(num % dnum);
|
||||
cpu->R[3] = (u32) (((s32)cpu->R[0])<0 ? -cpu->R[0] : cpu->R[0]);
|
||||
cpu->R[3] = (u32) (((s32)cpu->R[0])<0 ? -(s32)cpu->R[0] : cpu->R[0]);
|
||||
|
||||
return 6;
|
||||
}
|
||||
|
|
|
@ -1363,7 +1363,7 @@ void gfx3d_glLoadIdentity()
|
|||
|
||||
BOOL gfx3d_glLoadMatrix4x4(s32 v)
|
||||
{
|
||||
mtxCurrent[mode][ML4x4ind] = v;
|
||||
mtxCurrent[mode][ML4x4ind] = (float)v;
|
||||
|
||||
++ML4x4ind;
|
||||
if(ML4x4ind<16) return FALSE;
|
||||
|
@ -1380,7 +1380,7 @@ BOOL gfx3d_glLoadMatrix4x4(s32 v)
|
|||
|
||||
BOOL gfx3d_glLoadMatrix4x3(s32 v)
|
||||
{
|
||||
mtxCurrent[mode][ML4x3ind] = v;
|
||||
mtxCurrent[mode][ML4x3ind] = (float)v;
|
||||
|
||||
ML4x3ind++;
|
||||
if((ML4x3ind & 0x03) == 3) ML4x3ind++;
|
||||
|
@ -1402,7 +1402,7 @@ BOOL gfx3d_glLoadMatrix4x3(s32 v)
|
|||
|
||||
BOOL gfx3d_glMultMatrix4x4(s32 v)
|
||||
{
|
||||
mtxTemporal[MM4x4ind] = v;
|
||||
mtxTemporal[MM4x4ind] = (float)v;
|
||||
|
||||
MM4x4ind++;
|
||||
if(MM4x4ind<16) return FALSE;
|
||||
|
@ -1426,7 +1426,7 @@ BOOL gfx3d_glMultMatrix4x4(s32 v)
|
|||
|
||||
BOOL gfx3d_glMultMatrix4x3(s32 v)
|
||||
{
|
||||
mtxTemporal[MM4x3ind] = v;
|
||||
mtxTemporal[MM4x3ind] = (float)v;
|
||||
|
||||
MM4x3ind++;
|
||||
if((MM4x3ind & 0x03) == 3) MM4x3ind++;
|
||||
|
@ -1456,7 +1456,7 @@ BOOL gfx3d_glMultMatrix4x3(s32 v)
|
|||
|
||||
BOOL gfx3d_glMultMatrix3x3(s32 v)
|
||||
{
|
||||
mtxTemporal[MM3x3ind] = v;
|
||||
mtxTemporal[MM3x3ind] = (float)v;
|
||||
|
||||
|
||||
MM3x3ind++;
|
||||
|
|
|
@ -3266,7 +3266,7 @@ static int arc(lua_State *L) {
|
|||
|
||||
static int star(lua_State *L) {
|
||||
|
||||
double cx,cy,r1,r2,startAngle,numRays;
|
||||
lua_Integer cx,cy,r1,r2,startAngle,numRays;
|
||||
cx = luaL_checkinteger(L,1);
|
||||
cy = luaL_checkinteger(L,2);
|
||||
r1 = luaL_checkinteger(L,3);
|
||||
|
@ -3314,7 +3314,7 @@ static const struct luaL_reg aggbasicshapes [] =
|
|||
|
||||
static int fillColor(lua_State *L) {
|
||||
|
||||
double r,g,b,a;
|
||||
lua_Integer r,g,b,a;
|
||||
r = luaL_checkinteger(L,1);
|
||||
g = luaL_checkinteger(L,2);
|
||||
b = luaL_checkinteger(L,3);
|
||||
|
@ -3333,7 +3333,7 @@ static int noFill(lua_State *L) {
|
|||
|
||||
static int lineColor(lua_State *L) {
|
||||
|
||||
double r,g,b,a;
|
||||
lua_Integer r,g,b,a;
|
||||
r = luaL_checkinteger(L,1);
|
||||
g = luaL_checkinteger(L,2);
|
||||
b = luaL_checkinteger(L,3);
|
||||
|
|
|
@ -577,7 +577,7 @@ void BackupDevice::loadfile()
|
|||
else
|
||||
{
|
||||
//scan for desmume save footer
|
||||
const u32 cookieLen = strlen(kDesmumeSaveCookie);
|
||||
const s32 cookieLen = (s32)strlen(kDesmumeSaveCookie);
|
||||
char *sigbuf = new char[cookieLen];
|
||||
fseek(inf, -cookieLen, SEEK_END);
|
||||
fread(sigbuf,1,cookieLen,inf);
|
||||
|
@ -780,7 +780,7 @@ bool BackupDevice::load_duc(const char* filename)
|
|||
|
||||
bool BackupDevice::load_movie(std::istream* is) {
|
||||
|
||||
const u32 cookieLen = strlen(kDesmumeSaveCookie);
|
||||
const s32 cookieLen = (s32)strlen(kDesmumeSaveCookie);
|
||||
|
||||
is->seekg(-cookieLen, std::ios::end);
|
||||
is->seekg(-4, std::ios::cur);
|
||||
|
|
|
@ -706,8 +706,8 @@ struct edge_fx_fl {
|
|||
};
|
||||
|
||||
FORCEINLINE edge_fx_fl::edge_fx_fl(int Top, int Bottom) {
|
||||
Y = Ceil28_4(verts[Top]->y);
|
||||
int YEnd = Ceil28_4(verts[Bottom]->y);
|
||||
Y = Ceil28_4((fixed28_4)verts[Top]->y);
|
||||
int YEnd = Ceil28_4((fixed28_4)verts[Bottom]->y);
|
||||
Height = YEnd - Y;
|
||||
|
||||
if(Height)
|
||||
|
@ -715,13 +715,13 @@ FORCEINLINE edge_fx_fl::edge_fx_fl(int Top, int Bottom) {
|
|||
long dN = long(verts[Bottom]->y - verts[Top]->y);
|
||||
long dM = long(verts[Bottom]->x - verts[Top]->x);
|
||||
|
||||
long InitialNumerator = dM*16*Y - dM*verts[Top]->y + dN*verts[Top]->x - 1 + dN*16;
|
||||
long InitialNumerator = (long)(dM*16*Y - dM*verts[Top]->y + dN*verts[Top]->x - 1 + dN*16);
|
||||
FloorDivMod(InitialNumerator,dN*16,X,ErrorTerm);
|
||||
FloorDivMod(dM*16,dN*16,XStep,Numerator);
|
||||
Denominator = dN*16;
|
||||
|
||||
float YPrestep = Fixed28_4ToFloat(Y*16 - verts[Top]->y);
|
||||
float XPrestep = Fixed28_4ToFloat(X*16 - verts[Top]->x);
|
||||
float YPrestep = Fixed28_4ToFloat((fixed28_4)(Y*16 - verts[Top]->y));
|
||||
float XPrestep = Fixed28_4ToFloat((fixed28_4)(X*16 - verts[Top]->x));
|
||||
|
||||
float dy = 1/Fixed28_4ToFloat(dN);
|
||||
float dx = 1/Fixed28_4ToFloat(dM);
|
||||
|
@ -1042,7 +1042,7 @@ static void SoftRastConvertFramebuffer()
|
|||
|
||||
template<typename T>
|
||||
static T interpolate(const float ratio, const T& x0, const T& x1) {
|
||||
return x0 + (float)(x1-x0) * (ratio);
|
||||
return (T)(x0 + (float)(x1-x0) * (ratio));
|
||||
}
|
||||
|
||||
|
||||
|
@ -1381,7 +1381,7 @@ static void SoftRastRender()
|
|||
//which is currently just a float
|
||||
for(int j=0;j<type;j++)
|
||||
for(int k=0;k<2;k++)
|
||||
verts[j].coord[k] = iround(16.0f * verts[j].coord[k]);
|
||||
verts[j].coord[k] = (float)iround(16.0f * verts[j].coord[k]);
|
||||
|
||||
//hmm... shader gets setup every time because it depends on sampler which may have just changed
|
||||
shader.setup(poly->polyAttr);
|
||||
|
|
|
@ -137,7 +137,7 @@ void WINCLASS::sizingMsg(WPARAM wParam, LPARAM lParam, BOOL keepRatio)
|
|||
case WMSZ_BOTTOMRIGHT:
|
||||
{
|
||||
float ratio = ((rect->right - rect->left - xborder - xborder) / (float)minWidth);
|
||||
rect->bottom = (rect->top + ycaption + yborder + ymenu + (minHeight * ratio) + yborder);
|
||||
rect->bottom = (LONG)((rect->top + ycaption + yborder + ymenu + (minHeight * ratio) + yborder));
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -145,7 +145,7 @@ void WINCLASS::sizingMsg(WPARAM wParam, LPARAM lParam, BOOL keepRatio)
|
|||
case WMSZ_BOTTOM:
|
||||
{
|
||||
float ratio = ((rect->bottom - rect->top - ycaption - yborder - ymenu - yborder) / (float)minHeight);
|
||||
rect->right = (rect->left + xborder + (minWidth * ratio) + xborder);
|
||||
rect->right = (LONG)((rect->left + xborder + (minWidth * ratio) + xborder));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -390,7 +390,7 @@ void ScaleScreen(float factor)
|
|||
factor = 1.5f;
|
||||
else if(factor==65534)
|
||||
factor = 2.5f;
|
||||
MainWindow->setClientSize((video.rotatedwidthgap() * factor), (video.rotatedheightgap() * factor));
|
||||
MainWindow->setClientSize((int)(video.rotatedwidthgap() * factor), (int)(video.rotatedheightgap() * factor));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1854,7 +1854,7 @@ void UpdateWndRects(HWND hwnd)
|
|||
}
|
||||
|
||||
ratio = ((float)wndHeight / (float)defHeight);
|
||||
oneScreenHeight = ((video.height/2) * ratio);
|
||||
oneScreenHeight = (int)((video.height/2) * ratio);
|
||||
gapHeight = (wndHeight - (oneScreenHeight * 2));
|
||||
|
||||
if((video.rotation == 90) || (video.rotation == 270))
|
||||
|
|
|
@ -37,8 +37,8 @@ void Describe(HWND hwndDlg)
|
|||
u32 num_frames = md.records.size();
|
||||
|
||||
double tempCount = num_frames / (33513982.0/6/355/263);
|
||||
int num_seconds = tempCount;
|
||||
int fraction = (tempCount - num_seconds) * 100;
|
||||
int num_seconds = (int)tempCount;
|
||||
int fraction = ((int)tempCount - num_seconds) * 100;
|
||||
int seconds = num_seconds % 60;
|
||||
int minutes = (num_seconds / 60) % 60;
|
||||
int hours = (num_seconds / 60 / 60) % 60;
|
||||
|
|
Loading…
Reference in New Issue