Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Ha haha..... I'm having trouble with alfont.

Credits go to CGamesPlay for helping out!
This thread is locked; no one can reply to it. rss feed Print
 1   2 
Ha haha..... I'm having trouble with alfont.
X-G
Member #856
December 2000
avatar

Quote:

I copied it from a tutorial I made and didn't feel like deleting them.

What tutorial? Seriously, tell me. I need to know.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Taiko Keiji
Member #8,307
February 2007
avatar

I havent put it online yet but when I do i'll let you know where to get it.8-)

Life could be better, machines could program themselves.

Taiko Keiji-
http://lostotaku.net

gnolam
Member #2,030
March 2002
avatar

If the rest of it looks like that, please don't unleash it upon the world...

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

CGamesPlay
Member #2,559
July 2002
avatar

I don't know if you care, because in any case, it works now, but:

The alfont_init didn't make it work, something else you changed did. Remember when we did this?

Quote:

E:\game stuff\Dev-Cpp\Game Engine/Fonts/abaddon.ttf does not exist

file_exists is not dependent on alfont, so having not initialized alfont couldn't have been the problem.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Tobias Dammers
Member #2,604
August 2002
avatar

Quote:

The question is, can you really depend on it short circuiting?

Yes. The C standard mandates short-circuit logic.

Quote:

What tutorial? Seriously, tell me. I need to know.

"Teach Yourself How Not To Do Things Right In 24 Hours"

Personally, I'd do:

1int init_gfx_mode() {
2struct gfxmode {
3 int driver;
4 int w;
5 int h;
6};
7 
8gfxmode gml[] = {
9 { GFX_AUTODETECT, 1280, 1024 },
10 { GFX_AUTODETECT, 1280, 960 },
11 // etc etc
12 { GFX_AUTODETECT, 640, 480 },
13 { GFX_SAFE, 320, 200 },
14 { 0, 0, 0 }
15};
16 
17for (int i = 0; gml<i>.w, ++i) {
18 if (!set_gfx_mode(gml<i>.driver, gml<i>.w, gml<i>.h, 0, 0))
19 return 0;
20}
21 
22return -1;
23}

...but that's just me.

---
Me make music: Triofobie
---
"We need Tobias and his awesome trombone, too." - Johan Halmén

Taiko Keiji
Member #8,307
February 2007
avatar

Even when I got it to work, it said this file does not exist but then it continued with the program and loaded the font just fine.

The tutorial isn't meant to be the simplest and prettiest. It's meant for beginners to get a grasp of how the most basic of allegro functions work.
And if I said I haven't uploaded it yet, it probably means that i'm not done with it and i'm making changes. Have you tried to make any tutorials for other beginners? NO, then shut up, atleast i'm trying to help by sharing what knowlege I have.

Life could be better, machines could program themselves.

Taiko Keiji-
http://lostotaku.net

CGamesPlay
Member #2,559
July 2002
avatar

Quote:

Even when I got it to work, it said this file does not exist but then it continued with the program and loaded the font just fine.

Ah, you are correct. I misinterpreted the documentation for file_exists. It should read: file_exists("Fonts/abaddon.ttf", FA_ALL, NULL).

Quote:

Have you tried to make any tutorials for other beginners? NO, then shut up, atleast i'm trying to help by sharing what knowlege I have.

You know what happens when you assume, right?

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

X-G
Member #856
December 2000
avatar

Yeah, the problems begin with that knowledge is misleading and contains horrible coding practices no one should ever be taught.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Taiko Keiji
Member #8,307
February 2007
avatar

My bad, I was just trying to help some people who were in the same boat I once was; and obviously still am. So I added a few brackets, it's just to show how it's laid out. Other than that it really is just basic loading a Bitmap fron a file, loading a font( correctly, not anything to do with this thread), and displaying a few different things using a buffer. That's all. Sorry for making assumptions by the way.

Life could be better, machines could program themselves.

Taiko Keiji-
http://lostotaku.net

 1   2 


Go to: