Hi.
I have an very odd error.
I have finished a game (Evorales), this game works without any problem.
Now I am trying to add the Japanese language, which meant changing the fonts files (the ones I was using originally did not support Japanese characters).
At changing the fonts, the game began to give memory errors or texts that did not display well (and I don't mean string encoding problems).
Exactly the same source code, just changing the font files.
- Change "steamwreck" (35 kB) for "NotoSerifCJKjp-hinted" (23 MB ), rear/write protected area memory error from sfml-graphics.dll when used SFMLwindows.draw(TEXTobject)
There was no error loading the font or creating the TEXT objects
- Change "steamwreck" (35 kB) for "mplus" (1300 kB), no memory error, but text strings were displayed with errors, for example "spaol" instead of "Español", etc.
After several hours of testing, I found that when creating a very big array to store the game's keystrokes, it overwritten the same memory area used by the font, causing this problem.
In my particular case, creating these variables somehow corrupts the font texture
Private plstGamePad(199999) As UInt32
Change 199999 for other number more small (999) or even more greater (999999) solve all previus TEXT problems.
My assumption is that the SFML implementation in NET does not reserve memory properly when loading font files. Apparently this error is notorious only with relatively large files.
I tried to produce a minimal code that would replicate the problem, but it was impossible, due to the limitations of the language when reserving memory.