Add MathEngineTest and Commects and clean ups
This commit is contained in:
@@ -47,7 +47,6 @@ const bool cRenderer::Setup()
|
||||
mp_renderer = cVideo::Inst().CreateRender();
|
||||
SDL_Surface* surface = SDL_GetWindowSurface(cVideo::Inst().getWindow());
|
||||
mp_rendererSoftware = SDL_CreateSoftwareRenderer(surface);
|
||||
//mp_rendererCopy = cVideo::Inst().CreateRender();
|
||||
if (mp_renderer != nullptr)
|
||||
rtn = true;
|
||||
}
|
||||
@@ -169,13 +168,13 @@ SDL_Surface* cRenderer::TextureToSurface( SDL_Texture* texture )
|
||||
|
||||
SDL_Rect rec = { 0, 0, w, h };
|
||||
|
||||
SDL_Texture* tmp_texture = NewTexture(w, h, true); // Create a new texture with Software Renderer
|
||||
CopyTexture(texture, tmp_texture, true); // Copy old texture to the Software Renderer Texture renderer
|
||||
SetRenderTarget(texture);
|
||||
|
||||
if (SDL_RenderReadPixels(mp_renderer, nullptr, SDL_PIXELFORMAT_RGBA32, rtn->pixels, rtn->pitch) < 0)
|
||||
cUtility::Inst().Message("Unable to Read Texture's Pixels. SDL_RenderReadPixels():", __AT__, cUtility::eTypeSDL::SDL);
|
||||
|
||||
ResetRenderTarget();
|
||||
|
||||
Render(tmp_texture, nullptr, mp_rendererSoftware, &rec); // Render to the mp_rendererSoftware
|
||||
|
||||
SDL_RenderReadPixels(mp_rendererSoftware, nullptr, SDL_PIXELFORMAT_RGBA32, rtn->pixels, rtn->pitch);
|
||||
|
||||
return rtn;
|
||||
}
|
||||
|
||||
@@ -266,7 +265,6 @@ const bool cRenderer::AreEqual( SDL_Surface& one, SDL_Surface& two )
|
||||
if (SDL_MUSTLOCK(&two) > 0)
|
||||
SDL_UnlockSurface(&two);
|
||||
|
||||
|
||||
return rtn;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user