From: Olly
@Brandon
Thank you. I wasn't aware of anything until this tag. I was under the impression that drawing was working fine :S
I tested it today and yes it was completely broken. Not sure what changed recently in the client but I do know that its one of two things.. The Reset function is either not being called anymore or Present is being used now.. I'll look into it later. No detect-ability issues either way.
For now, here is a patch that will draw no matter what.. at the cost of a couple fps (creating the texture OpenGL style :l)
Hopefully it does NOT lag for you guys?
[ATTACH=CONFIG]23100[/ATTACH]
So what changed? I removed an else statement and replaced it with a SafeRelease:
if (!Texture) /**See Device->Reset for more info.**/
{
LoadTexture(Device, static_cast<unsigned char*>(SmartGlobal->dbg), SmartGlobal->width, SmartGlobal->height, Texture);
}
/*else
{
memcpy(TexturePixels, SmartGlobal->dbg, SmartGlobal->width * SmartGlobal->height * 4);
}*/
DrawTexture(Device, Texture, 0, 0, SmartGlobal->width, SmartGlobal->height);
SafeRelease(Texture); //Delete Texture
I've mentioned before that I do not like drawing like that.. "Deleting the texture". I prefer the client do it only when it needs to. Anyway, this should work for sure..
One more thing I changed for those that messaged me a while back about a MessageBox error annoying them if their d3d9 is missing a certain function.. I replaced it with:
catch(std::exception &e)
{
//MessageBox(nullptr, e.what(), "ERROR!", 0);
CONSOLE_SCREEN_BUFFER_INFO Info;
HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(hStdout, &Info);
int Attributes = Info.wAttributes;
SetConsoleTextAttribute(hStdout, FOREGROUND_RED | FOREGROUND_INTENSITY);
std::printf("\n\nDirect-X ERROR: %s\n\n\n", e.what());
SetConsoleTextAttribute(hStdout, Attributes);
}
return true;
This will no longer show a message box.. The plugin will not fail to load. Instead, it will simply tell you that there was an error (in red in Smart's console) and continue to load normally. If the error is fatal, it will instead not work. If the error is minor (as it always has been when you saw a messagebox), it will work fine. No it does not affect you in any way. It is simply there for debugging purposes and to let me know when things go down another path..
Sadly, no one ever reports anything :( Surprised I got tagged.. I'll be uploading the source for it today on Github as a new release. I think its a good one as drawing will always work. I will obviously find better ways to draw and update whenever I do.
EDIT:https://github.com/Brandon-T/DXI/releases/tag/v0.4