Skip to content

Commit 08d0086

Browse files
committed
Fixed crash when going fullscreen, opening an app as admin, etc... while the game is open
1 parent 3b9fad9 commit 08d0086

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

src/DrawUtils.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ namespace DrawUtils
193193
info.Width,
194194
info.Height,
195195
info.MipLevels,
196-
D3DUSAGE_RENDERTARGET,
196+
0,
197197
info.Format,
198-
D3DPOOL_DEFAULT,
198+
D3DPOOL_MANAGED,
199199
D3DX_DEFAULT,
200200
D3DX_DEFAULT,
201201
0,
@@ -251,9 +251,9 @@ namespace DrawUtils
251251
info.Width,
252252
info.Height,
253253
info.MipLevels,
254-
D3DUSAGE_RENDERTARGET,
254+
0,
255255
info.Format,
256-
D3DPOOL_DEFAULT,
256+
D3DPOOL_MANAGED,
257257
D3DX_DEFAULT,
258258
D3DX_DEFAULT,
259259
0,
@@ -407,17 +407,17 @@ namespace DrawUtils
407407

408408
void GradiantRect::draw() const
409409
{
410-
Vertex vertexs[4];
410+
Vertex vertices[4];
411411
Vertex borders[5];
412412

413413
for (int i = 0; i < 4; i++) {
414-
vertexs[i] = borders[i] = this->_vertex[i];
415-
vertexs[i].color = this->fillColors[i];
414+
vertices[i] = borders[i] = this->_vertex[i];
415+
vertices[i].color = this->fillColors[i];
416416
borders[i].color = this->borderColors[i];
417417
}
418418
borders[4] = borders[0];
419419
SokuLib::textureMgr.setTexture(0, 0);
420-
SokuLib::pd3dDev->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, vertexs, sizeof(*vertexs));
420+
SokuLib::pd3dDev->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, vertices, sizeof(*vertices));
421421
SokuLib::pd3dDev->DrawPrimitiveUP(D3DPT_LINESTRIP, 4, borders, sizeof(*borders));
422422
}
423423

@@ -460,13 +460,13 @@ namespace DrawUtils
460460

461461
void Sprite::draw() const
462462
{
463-
Vertex vertexs[4];
463+
Vertex vertices[4];
464464

465465
for (int i = 0; i < 4; i++) {
466-
vertexs[i] = this->_vertex[i];
467-
vertexs[i].x -= 0.5;
468-
vertexs[i].y -= 0.5;
469-
vertexs[i].color = this->fillColors[i] * this->tint;
466+
vertices[i] = this->_vertex[i];
467+
vertices[i].x -= 0.5;
468+
vertices[i].y -= 0.5;
469+
vertices[i].color = this->fillColors[i] * this->tint;
470470
}
471471

472472
auto size = this->texture.getSize();
@@ -477,17 +477,17 @@ namespace DrawUtils
477477
float right = static_cast<float>(this->rect.left + this->rect.width) / size.x;
478478
float bottom = static_cast<float>(this->rect.top + this->rect.height) / size.y;
479479

480-
vertexs[3].u = vertexs[0].u = left;
481-
vertexs[2].u = vertexs[1].u = right;
482-
vertexs[1].v = vertexs[0].v = top;
483-
vertexs[2].v = vertexs[3].v = bottom;
484-
vertexs[2].x++;
485-
vertexs[1].x++;
486-
vertexs[2].y++;
487-
vertexs[3].y++;
480+
vertices[3].u = vertices[0].u = left;
481+
vertices[2].u = vertices[1].u = right;
482+
vertices[1].v = vertices[0].v = top;
483+
vertices[2].v = vertices[3].v = bottom;
484+
vertices[2].x++;
485+
vertices[1].x++;
486+
vertices[2].y++;
487+
vertices[3].y++;
488488
}
489489
this->texture.activate();
490-
SokuLib::pd3dDev->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, vertexs, sizeof(*vertexs));
490+
SokuLib::pd3dDev->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, vertices, sizeof(*vertices));
491491
}
492492

493493
Sprite::Sprite(const Camera &camera) noexcept :

0 commit comments

Comments
 (0)