View previous topic :: View next topic |
Author |
Message |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
|
Back to top |
|
 |
Estx Expert Cheater
Reputation: 0
Joined: 04 Mar 2008 Posts: 172
|
Posted: Thu Apr 24, 2008 9:35 am Post subject: |
|
|
Haven't come across that before and I use std::string a fair bit, strange..
Mind posting the snippet of code that renders the strings? Or a replicate of it.
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Thu Apr 24, 2008 9:44 am Post subject: |
|
|
The code that paints the text is an ASM static lib. Which I use because:
1.) I can't convert it to C++ (Uses MMX functions and such.)
2.) It creates alpha blended text for other methods of drawing.
3.) Various other small reasons that aren't important.
Theres not really anything I can post it though, as the project is a dynamically driven GDI engine. The text objects are a single reusable class that is vectored for each string object thats loaded into the GUI.
(And no PaintText is not an API.)
Code: | void CText::Draw()
{
PaintText( this->m_dcText, this->m_dibText, cEngine->m_dcMemory, cEngine->m_vFrame->m_dibFrame, m_vString.c_str(), m_vRect.left, m_vRect.top );
} |
Code: | void CWindow::DrawTexts()
{
// Draw Text Objects
for( int iIndex=0; iIndex<static_cast<int>(m_vTextObjects.size()); iIndex++ )
m_vTextObjects[ iIndex ]->Draw();
} |
Like I said, the code isn't going to help much for anyone to actually understand the purpose. Either way, the code isn't the issue as it works with all the other optimization settings, just not 'Full Optimization'.
_________________
- Retired. |
|
Back to top |
|
 |
Estx Expert Cheater
Reputation: 0
Joined: 04 Mar 2008 Posts: 172
|
Posted: Thu Apr 24, 2008 10:00 am Post subject: |
|
|
I see what you mean. The code doesn't help at all in this case lol.
The only thing that I can think of that would be remotely relevant is that the for loop isn't indexing the entire m_vTextObjects size. I'm guessing you've already checked to see if the size is different between optimization modes?
Other than that, I'm quite stumped. :\ Sorry I couldn't be of much help. If something pops into mind, I'll post it as soon as I can.
|
|
Back to top |
|
 |
HalfPrime Grandmaster Cheater
Reputation: 0
Joined: 12 Mar 2008 Posts: 532 Location: Right there...On your monitor
|
Posted: Thu Apr 24, 2008 1:14 pm Post subject: |
|
|
Are you using -02 or -03 for full optimization? I've heard -03 can do wonky things and generally isn't that helpful.
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Thu Apr 24, 2008 5:33 pm Post subject: |
|
|
HalfPrime wrote: | Are you using -02 or -03 for full optimization? I've heard -03 can do wonky things and generally isn't that helpful. |
Full Optimization is its own setting.
http://msdn2.microsoft.com/en-us/library/59a3b321(VS.71).aspx
Currently, I am using:
/Ob2 /Oi /Ot /Oy /GT /GL via Custom optimization but as I said would really prefer using Full as it helps a lot with speed and size.
Yes, I have tested the size of the text object vector as well, it is the correct size and does loop the full vector when being told to draw.
:: EDIT ::
Turns out it was the drawing function that I am using to draw the text which is inside an ASM static lib. The compiler, when fully optimized, didn't save registers over the call so things were being overwritten which fucked the vector after the first call was made to draw the first text object. Fixed by embracing the call with pushad/popad:
Code: |
_asm pushad
PrintText( ... );
_asm popad
|
Guess you could say compiler fault for this but meh... just happy to at least figure this out. x.x
Another quick edit, to avoid using inline I fixed this by adding the following to the proto:
Quote: | PaintText PROC C uses ebx esi edi ... |
_________________
- Retired. |
|
Back to top |
|
 |
|