|
|
Josh @ Dreamland
|
|
Reply #2 Posted on: November 16, 2008, 09:05:35 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
It's there in R3, assuming it functions. Does it...?
Check if it's on my list of corrected bugs in R3b
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
|
Josh @ Dreamland
|
|
Reply #5 Posted on: February 17, 2010, 10:14:35 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Draw_text has been my least favorite function to implement due to deciding how to handle newlines. Presently, ENIGMA (R3) uses GL lists to hold the instructions for drawing individual glyphs. When you call draw_text, the string you pass is iterated by the card (ideally) with a single GL call. This is quite efficient, but it creates ugly glyphs and makes newlines impossible. The reason for that is simple; GL lists can't interface with variables on the RAM. Each time a glyph is drawn, the drawing window is translated in the viewport, and the list for that glyph is called. There is no way to preserve the starting location. That leaves me with the option of making my own pass, or just drawing the glyphs in myself, both of which are unattractive choices.
When you call draw_text in Game Maker, it doesn't do any of those things. It iterates the string itself, yes, but then it draws a sprite corresponding to the desired glyph, as serp suggested. This leaves a bad taste in my mouth for a number of reasons, but seems to be the best way to mimmic Game Maker.
Perhaps the other, more efficient technique can be implemented as a backup feature.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
|
Josh @ Dreamland
|
|
Reply #8 Posted on: February 17, 2010, 08:26:05 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Luis: That would definitely be a consideration if GM was unicode-friendly, but since we know exactly how GM does it, I don't think that's a good idea here. Perhaps for future extensions of draw_text (Listen to us talking about drawing text like we're some sort of connoisseurs. Hmph).
Grundoko: No worries; our job is to make it look harmlessly simple. I pretty much failed at that in R3, but hey, "if at first you don't succeed, call it the beta." I don't think anyone can just throw together some code to do so... Perhaps the stuff in R4 has been fixed since. Serp would probably know.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
RetroX
|
|
Reply #9 Posted on: February 17, 2010, 10:16:35 pm |
|
|
Master of all things Linux
Location: US Joined: Apr 2008
Posts: 1055
|
Luis: That would definitely be a consideration if GM was unicode-friendly, but since we know exactly how GM does it, I don't think that's a good idea here. Perhaps for future extensions of draw_text (Listen to us talking about drawing text like we're some sort of connoisseurs. Hmph).
You could probably just check how SFML does it because while it is Unicode-friendly, it probably won't be too far-off. Also, it makes sense to support both Unicode and ASCII, because there's no point in limiting it to how GM does it.
|
|
« Last Edit: February 17, 2010, 10:19:24 pm by RetroX »
|
Logged
|
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)Why do all the pro-Microsoft people have troll avatars?
|
|
|
Josh @ Dreamland
|
|
Reply #10 Posted on: February 18, 2010, 07:09:43 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
The GM way is nicer-looking, but completely incompatible with the unicode way (unless, as I assume, SFML went to the trouble of anti-aliasing their gylphs). I can't store a sprite for each of two byte's worth of glyphs.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
|
Josh @ Dreamland
|
|
Reply #13 Posted on: February 18, 2010, 06:51:21 pm |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Both: GM can use any sprite the *creator* has installed (it can import any sprite the end user has installed at runtime). Being able to render custom fonts is proof *something* is stored in the EXE. Transforming text causes pixelation. That means it's being stored as a bitmap before draw; whether before load time is unknown at this point. We can't prove it doesn't store the actual font file in the exe with what we know here; you'll just have to take my word for it that it is in fact part of the GM exe format. (And I know this for a fact, so unless I've been miserably mistaken for a long time...)
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
|