summaryrefslogtreecommitdiffhomepage
path: root/nGenEx/VideoDX9.cpp
diff options
context:
space:
mode:
authorFWoltermann@gmail.com <FWoltermann@gmail.com@076cb2c4-205e-83fd-5cf3-1be9aa105544>2011-12-08 16:46:21 +0000
committerFWoltermann@gmail.com <FWoltermann@gmail.com@076cb2c4-205e-83fd-5cf3-1be9aa105544>2011-12-08 16:46:21 +0000
commit396c12ee73193f4ac3665ecac2f634fc0b046697 (patch)
tree16edb33b60f95f6bda93bc84b3f2eb81e316ba1d /nGenEx/VideoDX9.cpp
parent50971e84e295033941fac5291b08e593541fe945 (diff)
downloadstarshatter-396c12ee73193f4ac3665ecac2f634fc0b046697.zip
starshatter-396c12ee73193f4ac3665ecac2f634fc0b046697.tar.gz
starshatter-396c12ee73193f4ac3665ecac2f634fc0b046697.tar.bz2
Fixes for unsafe string handling, variable scoping errors.
Diffstat (limited to 'nGenEx/VideoDX9.cpp')
-rw-r--r--nGenEx/VideoDX9.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/nGenEx/VideoDX9.cpp b/nGenEx/VideoDX9.cpp
index a818a2d..5b6984b 100644
--- a/nGenEx/VideoDX9.cpp
+++ b/nGenEx/VideoDX9.cpp
@@ -831,7 +831,7 @@ VideoDX9::SetBackgroundColor(Color c)
inline WORD
RampValue(UINT i, double recip_gamma, double fade)
{
- return (WORD) (65535.0 * fade * pow(i/255.f, recip_gamma));
+ return (WORD) (65535.0 * fade * pow((double)i/255.f, recip_gamma));
}
//-----------------------------------------------------------------------------
@@ -1990,7 +1990,7 @@ VideoDX9::DrawScreenPolys(int npolys, Poly* polys, int blend)
WORD* s = screen_indices;
Poly* p = polys;
- for (i = 0; i < npolys; i++) {
+ for (int i = 0; i < npolys; i++) {
if (p->nverts == 3) {
*s++ = p->verts[0] + first_vert;
*s++ = p->verts[1] + first_vert;
@@ -2575,7 +2575,7 @@ VideoDX9::DrawPolyOutline(Poly* p)
// last vertex, to close the loop
index = p->verts[0];
- i = p->nverts;
+ int i = p->nverts;
verts[i].x = vset->loc[index].x;
verts[i].y = vset->loc[index].y;
@@ -2921,7 +2921,7 @@ VideoDX9::UseXFont(const char* name, int size, bool bold, bool ital)
if (d3ddevice && name && *name && size > 4) {
RELEASE(d3dx_font);
- strcpy(font_name, name);
+ strcpy_s(font_name, name);
font_size = size;
font_bold = bold;
font_ital = ital;
@@ -3590,7 +3590,7 @@ char* D3DErrStr(HRESULT hr)
switch (hr) {
default:
- sprintf(errstrbuf, "Unrecognized error value = %08x.", hr);
+ sprintf_s(errstrbuf, "Unrecognized error value = %08x.", hr);
return errstrbuf;
case D3D_OK: