Allegro.cc - Online Community

Allegro.cc Forums » The Depot » funky font effect library

This thread is locked; no one can reply to it. rss feed Print
funky font effect library
Neil Walker
Member #210
April 2000
avatar

Hello,
[edit]don't use this attachment, use the one in my email below[/edit]

It's a font library, and it does funky stuff, hence why it's called funky font. Pointless showing a screenshot as it's the animation effect you need to see to appreciate it.

You can do the following with it:
1. display text with various alignments (left/right/centred/justified) and automatic wrapping.
2. add textures and various shading effects

but mainly the point of the library is
3. apply various effects

I use it in my latest game for example for contracting/constricting animated menus and displaying wrapped text in help.

the effects you can do are:
- 3d spinning/rotation effects
- text scattering
- various undulating effects
- shaking noise
- mexican waves
- heart beats
- etc.

Basically, you load a bitmap font then set some text, then you apply various effects to it, namely, spread/bouncing/sine/noise/rotate/scale/bow/damping.

Most things are done by calling one or two functions per logic frame and a replace textout function.

I didn't write it, btw, a friend did who's too shy to post (Graham). I'm just using it :)

source code plus a windows exe attached. just press letters a-z for some things you can do. and maybe 1-4 and 5-8 for other stuff.

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

Graham Goring
Member #2,367
May 2002

Please note I wrote this AGES ago, which is why the code is completely vile. Obviously I'd do it differently these days.

Although that isn't an invitation for all you STL bandwagon sods to jump in. ;)

Neil Walker
Member #210
April 2000
avatar

No matter goring, I think it's superb now I'm using it.

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

Onewing
Member #6,152
August 2005
avatar

Wow, some neat stuff in there. Is this in the depot? (lazy-ness prevents me from reading or searching)

------------
Solo-Games.org | My Tech Blog: The Digital Helm

LennyLen
Member #5,313
December 2004
avatar

Quote:

Is this in the depot?

I don't know, but it's attached to Neil's first post.

Neil Walker
Member #210
April 2000
avatar

I can put it in the depot if anyone thinks it's worth keeping.

[edit]
If anyone gets it you'll need to change the code that uses function style casts for 'unsigned long' and 'unsigned short' to be explicit casts, i.e.

colour=unsigned long (blah)

should be changed to
colour=(unsigned long)(blah)

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

miran
Member #2,407
June 2002

Doesn't come even close to compiling.

--
sig used to be here

Neil Walker
Member #210
April 2000
avatar

Of course it does, how do you think I attached the exe and I'm using it in my game ;)

I've got it compiled via mingw and msvc, which near enough covers all bases.

Attached to this email is a new version fixing the cast bug with mingw and project files for devcpp and msvc8, the exe is from mingw.

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

miran
Member #2,407
June 2002

[code]
D:\tmp>g++ *.cpp -o test.exe -lalleg
fontdemo.cpp: In function `int _mangled_main()':
fontdemo.cpp:287: warning: passing `double' for argument passing 5 of `void
PFONT_posmod_selection(prop_text_struct*, float, float, int, int, float,
float, int)'
fontdemo.cpp:287: warning: argument to `int' from `double'
fontdemo.cpp:298: warning: passing `double' for argument passing 4 of `void
PFONT_texmod_selection(prop_text_struct*, float, float, int, int, float,
float, int)'
fontdemo.cpp:298: warning: argument to `int' from `double'
fontdemo.cpp:332: warning: passing `double' for argument passing 4 of `void
PFONT_texmod_selection(prop_text_struct*, float, float, int, int, float,
float, int)'
fontdemo.cpp:332: warning: argument to `int' from `double'
fontdemo.cpp:333: warning: passing `double' for argument passing 5 of `void
PFONT_posmod_selection(prop_text_struct*, float, float, int, int, float,
float, int)'
fontdemo.cpp:333: warning: argument to `int' from `double'
fontdemo.cpp:377: warning: passing `double' for argument passing 4 of `void
PFONT_texmod_selection(prop_text_struct*, float, float, int, int, float,
float, int)'
fontdemo.cpp:377: warning: argument to `int' from `double'
fontdemo.cpp:378: warning: passing `double' for argument passing 5 of `void
PFONT_posmod_selection(prop_text_struct*, float, float, int, int, float,
float, int)'
fontdemo.cpp:378: warning: argument to `int' from `double'
fontdemo.cpp:534: warning: passing `double' for argument passing 9 of `void
PFONT_draw_frame_list_coloured(prop_text_struct*, int, int, int, float,
float, BITMAP*, int, int, int)'
fontdemo.cpp:534: warning: argument to `int' from `double'
fontdemo.cpp:537: warning: passing `double' for argument passing 9 of `void
PFONT_draw_frame_list_vert_lerped_coloured(prop_text_struct*, int, int, int,

float, float, BITMAP*, int, int, int, int, int, int)'
fontdemo.cpp:537: warning: argument to `int' from `double'
fontdemo.cpp:537: warning: passing `double' for argument passing 11 of `void
PFONT_draw_frame_list_vert_lerped_coloured(prop_text_struct*, int, int, int,

float, float, BITMAP*, int, int, int, int, int, int)'
fontdemo.cpp:537: warning: argument to `int' from `double'
fontdemo.cpp:547: warning: `textout' is deprecated (declared at
c:/mingw/include/allegro/alcompat.h:158)
funkyfont.cpp: In function `void GRAPHICS_double_masked_blit_32bit(BITMAP*,
BITMAP*, BITMAP*, int, int, int, int, int, int, int, int)':
funkyfont.cpp:109: parse error before `long'
funkyfont.cpp: In function `void GRAPHICS_colour_blit_32bit(BITMAP*, BITMAP*,
int, int, int, int, int, int, long unsigned int)':
funkyfont.cpp:160: parse error before `long'
funkyfont.cpp: In function `void
GRAPHICS_colour_vert_lerped_blit_32bit(BITMAP*, BITMAP*, int, int, int, int,

int, int, long unsigned int*)':
funkyfont.cpp:215: parse error before `long'
funkyfont.cpp: In function `void GRAPHICS_double_masked_blit_16bit(BITMAP*,
BITMAP*, BITMAP*, int, int, int, int, int, int, int, int)':
funkyfont.cpp:265: parse error before `short'
funkyfont.cpp: In function `void GRAPHICS_colour_blit_16bit(BITMAP*, BITMAP*,
int, int, int, int, int, int, short unsigned int)':
funkyfont.cpp:316: parse error before `short'
funkyfont.cpp: In function `void
GRAPHICS_colour_vert_lerped_blit_16bit(BITMAP*, BITMAP*, int, int, int, int,

int, int, short unsigned int*)':
funkyfont.cpp:371: parse error before `short'
funkyfont.cpp: In function `void PFONT_posmod_selection(prop_text_struct*,
float, float, int, int, float, float, int)':
funkyfont.cpp:913: warning: initialization to `int' from `float'
funkyfont.cpp:913: warning: argument to `int' from `float'
funkyfont.cpp:914: warning: initialization to `int' from `float'
funkyfont.cpp:914: warning: argument to `int' from `float'
funkyfont.cpp: In function `void PFONT_posmod_distort(prop_text_struct*, float,

float, float, float)':
funkyfont.cpp:1015: warning: initialization to `int' from `float'
funkyfont.cpp:1015: warning: argument to `int' from `float'
funkyfont.cpp:1016: warning: initialization to `int' from `float'
funkyfont.cpp:1016: warning: argument to `int' from `float'
funkyfont.cpp: In function `void PFONT_posmod_rotate(prop_text_struct*, float,
float, float)':
funkyfont.cpp:1090: warning: initialization to `int' from `float'
funkyfont.cpp:1090: warning: argument to `int' from `float'
funkyfont.cpp:1091: warning: initialization to `int' from `float'
funkyfont.cpp:1091: warning: argument to `int' from `float'
funkyfont.cpp: In function `void
PFONT_posmod_rotate_selection(prop_text_struct*, float, float, float, float,

float, int)':
funkyfont.cpp:1121: warning: initialization to `int' from `float'
funkyfont.cpp:1121: warning: argument to `int' from `float'
funkyfont.cpp:1122: warning: initialization to `int' from `float'
funkyfont.cpp:1122: warning: argument to `int' from `float'
funkyfont.cpp: In function `void PFONT_posmod_scale(prop_text_struct*, float,
float, float, float)':
funkyfont.cpp:1232: warning: initialization to `int' from `float'
funkyfont.cpp:1232: warning: argument to `int' from `float'
funkyfont.cpp:1233: warning: initialization to `int' from `float'
funkyfont.cpp:1233: warning: argument to `int' from `float'
funkyfont.cpp: In function `void PFONT_posmod_bow_in(prop_text_struct*, float,
float, float, float)':
funkyfont.cpp:1252: warning: initialization to `int' from `float'
funkyfont.cpp:1252: warning: argument to `int' from `float'
funkyfont.cpp:1253: warning: initialization to `int' from `float'
funkyfont.cpp:1253: warning: argument to `int' from `float'
funkyfont.cpp: In function `void PFONT_posmod_bow_out(prop_text_struct*, float,

float, float, float)':
funkyfont.cpp:1282: warning: initialization to `int' from `float'
funkyfont.cpp:1282: warning: argument to `int' from `float'
funkyfont.cpp:1283: warning: initialization to `int' from `float'
funkyfont.cpp:1283: warning: argument to `int' from `float'
funkyfont.cpp: In function `void PFONT_posmod_damp_point(prop_text_struct*,
int, float, int)':
funkyfont.cpp:1348: warning: assignment to `int' from `float'
funkyfont.cpp:1348: warning: argument to `int' from `float'
funkyfont.cpp: In function `void
PFONT_texmod_bouncing_in_phase(prop_text_struct*, float, float, float,
float, float, float)':
funkyfont.cpp:1545: warning: passing `double' for argument passing 1 of `int
abs(int)'
funkyfont.cpp:1545: warning: argument to `int' from `double'
funkyfont.cpp:1546: warning: passing `double' for argument passing 1 of `int
abs(int)'
funkyfont.cpp:1546: warning: argument to `int' from `double'
funkyfont.cpp: In function `void PFONT_texmod_selection(prop_text_struct*,
float, float, int, int, float, float, int)':
funkyfont.cpp:1625: warning: initialization to `int' from `float'
funkyfont.cpp:1625: warning: argument to `int' from `float'
funkyfont.cpp:1626: warning: initialization to `int' from `float'
funkyfont.cpp:1626: warning: argument to `int' from `float'
funkyfont.cpp: In function `void PFONT_texmod_rotate(prop_text_struct*, float,
float, float)':
funkyfont.cpp:1762: warning: initialization to `int' from `float'
funkyfont.cpp:1762: warning: argument to `int' from `float'
funkyfont.cpp:1763: warning: initialization to `int' from `float'
funkyfont.cpp:1763: warning: argument to `int' from `float'
funkyfont.cpp: In function `void PFONT_texmod_scale(prop_text_struct*, float,
float, float, float)':
funkyfont.cpp:1786: warning: initialization to `int' from `float'
funkyfont.cpp:1786: warning: argument to `int' from `float'
funkyfont.cpp:1787: warning: initialization to `int' from `float'
funkyfont.cpp:1787: warning: argument to `int' from `float'
funkyfont.cpp: In function `void PFONT_texmod_bow_in(prop_text_struct*, float,
float, float, float)':
funkyfont.cpp:1806: warning: initialization to `int' from `float'
funkyfont.cpp:1806: warning: argument to `int' from `float'
funkyfont.cpp:1807: warning: initialization to `int' from `float'
funkyfont.cpp:1807: warning: argument to `int' from `float'
funkyfont.cpp: In function `void PFONT_texmod_bow_out(prop_text_struct*, float,

float, float, float)':
funkyfont.cpp:1836: warning: initialization to `int' from `float'
funkyfont.cpp:1836: warning: argument to `int' from `float'
funkyfont.cpp:1837: warning: initialization to `int' from `float'
funkyfont.cpp:1837: warning: argument to `int' from `float'
funkyfont.cpp: In function `void PFONT_find_extremes(prop_text_struct*)':
funkyfont.cpp:1874: warning: assignment to `int' from `float'
funkyfont.cpp:1874: warning: argument to `int' from `float'
funkyfont.cpp:1877: warning: assignment to `int' from `float'
funkyfont.cpp:1877: warning: argument to `int' from `float'
funkyfont.cpp:1880: warning: assignment to `int' from `float'
funkyfont.cpp:1880: warning: argument to `int' from `float'
funkyfont.cpp:1883: warning: assignment to `int' from `float'
funkyfont.cpp:1883: warning: argument to `int' from `float'
funkyfont.cpp: In function `void
PFONT_draw_frame_list_notexture(prop_text_struct*, int, int, int, float,
float, BITMAP*)':
funkyfont.cpp:1898: warning: initialization to `int' from `float'
funkyfont.cpp:1898: warning: argument to `int' from `float'
funkyfont.cpp:1899: warning: initialization to `int' from `float'
funkyfont.cpp:1899: warning: argument to `int' from `float'
funkyfont.cpp:1906: warning: passing `float' for argument passing 3 of `void
masked_blit(BITMAP*, BITMAP*, int, int, int, int, int, int)'
funkyfont.cpp:1906: warning: argument to `int' from `float'
funkyfont.cpp:1906: warning: passing `float' for argument passing 4 of `void
masked_blit(BITMAP*, BITMAP*, int, int, int, int, int, int)'
funkyfont.cpp:1906: warning: argument to `int' from `float'
funkyfont.cpp:1906: warning: passing `float' for argument passing 5 of `void
masked_blit(BITMAP*, BITMAP*, int, int, int, int, int, int)'
funkyfont.cpp:1906: warning: argument to `int' from `float'
funkyfont.cpp:1906: warning: passing `float' for argument passing 6 of `void
masked_blit(BITMAP*, BITMAP*, int, int, int, int, int, int)'
funkyfont.cpp:1906: warning: argument to `int' from `float'
funkyfont.cpp: In function `void
PFONT_draw_frame_list_texture(prop_text_struct*, int, int, int, float,
float, BITMAP*, texture_struct*)':
funkyfont.cpp:1917: warning: initialization to `int' from `float'
funkyfont.cpp:1917: warning: argument to `int' from `float'
funkyfont.cpp:1918: warning: initialization to `int' from `float'
funkyfont.cpp:1918: warning: argument to `int' from `float'
funkyfont.cpp:1925: warning: passing `float' for argument passing 1 of `int
MATH_wrap(int, int)'
funkyfont.cpp:1925: warning: argument to `int' from `float'
funkyfont.cpp:1926: warning: passing `float' for argument passing 1 of `int
MATH_wrap(int, int)'
funkyfont.cpp:1926: warning: argument to `int' from `float'
funkyfont.cpp:1935: warning: passing `float' for argument passing 4 of `void
GRAPHICS_double_masked_blit_16bit(BITMAP*, BITMAP*, BITMAP*, int, int, int,
int, int, int, int, int)'
funkyfont.cpp:1935: warning: argument to `int' from `float'
funkyfont.cpp:1935: warning: passing `float' for argument passing 5 of `void
GRAPHICS_double_masked_blit_16bit(BITMAP*, BITMAP*, BITMAP*, int, int, int,
int, int, int, int, int)'
funkyfont.cpp:1935: warning: argument to `int' from `float'
funkyfont.cpp:1935: warning: passing `float' for argument passing 6 of `void
GRAPHICS_double_masked_blit_16bit(BITMAP*, BITMAP*, BITMAP*, int, int, int,
int, int, int, int, int)'
funkyfont.cpp:1935: warning: argument to `int' from `float'
funkyfont.cpp:1935: warning: passing `float' for argument passing 7 of `void
GRAPHICS_double_masked_blit_16bit(BITMAP*, BITMAP*, BITMAP*, int, int, int,
int, int, int, int, int)'
funkyfont.cpp:1935: warning: argument to `int' from `float'
funkyfont.cpp:1935: warning: passing `float' for argument passing 8 of `void
GRAPHICS_double_masked_blit_16bit(BITMAP*, BITMAP*, BITMAP*, int, int, int,
int, int, int, int, int)'
funkyfont.cpp:1935: warning: argument to `int' from `float'
funkyfont.cpp:1935: warning: passing `float' for argument passing 9 of `void
GRAPHICS_double_masked_blit_16bit(BITMAP*, BITMAP*, BITMAP*, int, int, int,
int, int, int, int, int)'
funkyfont.cpp:1935: warning: argument to `int' from `float'
funkyfont.cpp:1942: warning: passing `float' for argument passing 4 of `void
GRAPHICS_double_masked_blit_32bit(BITMAP*, BITMAP*, BITMAP*, int, int, int,
int, int, int, int, int)'
funkyfont.cpp:1942: warning: argument to `int' from `float'
funkyfont.cpp:1942: warning: passing `float' for argument passing 5 of `void
GRAPHICS_double_masked_blit_32bit(BITMAP*, BITMAP*, BITMAP*, int, int, int,
int, int, int, int, int)'
funkyfont.cpp:1942: warning: argument to `int' from `float'
funkyfont.cpp:1942: warning: passing `float' for argument passing 6 of `void
GRAPHICS_double_masked_blit_32bit(BITMAP*, BITMAP*, BITMAP*, int, int, int,
int, int, int, int, int)'
funkyfont.cpp:1942: warning: argument to `int' from `float'
funkyfont.cpp:1942: warning: passing `float' for argument passing 7 of `void
GRAPHICS_double_masked_blit_32bit(BITMAP*, BITMAP*, BITMAP*, int, int, int,
int, int, int, int, int)'
funkyfont.cpp:1942: warning: argument to `int' from `float'
funkyfont.cpp:1942: warning: passing `float' for argument passing 8 of `void
GRAPHICS_double_masked_blit_32bit(BITMAP*, BITMAP*, BITMAP*, int, int, int,
int, int, int, int, int)'
funkyfont.cpp:1942: warning: argument to `int' from `float'
funkyfont.cpp:1942: warning: passing `float' for argument passing 9 of `void
GRAPHICS_double_masked_blit_32bit(BITMAP*, BITMAP*, BITMAP*, int, int, int,
int, int, int, int, int)'
funkyfont.cpp:1942: warning: argument to `int' from `float'
funkyfont.cpp: In function `void
PFONT_draw_frame_list_coloured(prop_text_struct*, int, int, int, float,
float, BITMAP*, int, int, int)':
funkyfont.cpp:1956: warning: initialization to `int' from `float'
funkyfont.cpp:1956: warning: argument to `int' from `float'
funkyfont.cpp:1957: warning: initialization to `int' from `float'
funkyfont.cpp:1957: warning: argument to `int' from `float'
funkyfont.cpp:1971: warning: passing `float' for argument passing 3 of `void
GRAPHICS_colour_blit_16bit(BITMAP*, BITMAP*, int, int, int, int, int, int,
short unsigned int)'
funkyfont.cpp:1971: warning: argument to `int' from `float'
funkyfont.cpp:1971: warning: passing `float' for argument passing 4 of `void
GRAPHICS_colour_blit_16bit(BITMAP*, BITMAP*, int, int, int, int, int, int,
short unsigned int)'
funkyfont.cpp:1971: warning: argument to `int' from `float'
funkyfont.cpp:1971: warning: passing `float' for argument passing 5 of `void
GRAPHICS_colour_blit_16bit(BITMAP*, BITMAP*, int, int, int, int, int, int,
short unsigned int)'
funkyfont.cpp:1971: warning: argument to `int' from `float'
funkyfont.cpp:1971: warning: passing `float' for argument passing 6 of `void
GRAPHICS_colour_blit_16bit(BITMAP*, BITMAP*, int, int, int, int, int, int,
short unsigned int)'
funkyfont.cpp:1971: warning: argument to `int' from `float'
funkyfont.cpp:1978: warning: passing `float' for argument passing 3 of `void
GRAPHICS_colour_blit_32bit(BITMAP*, BITMAP*, int, int, int, int, int, int,
long unsigned int)'
funkyfont.cpp:1978: warning: argument to `int' from `float'
funkyfont.cpp:1978: warning: passing `float' for argument passing 4 of `void
GRAPHICS_colour_blit_32bit(BITMAP*, BITMAP*, int, int, int, int, int, int,
long unsigned int)'
funkyfont.cpp:1978: warning: argument to `int' from `float'
funkyfont.cpp:1978: warning: passing `float' for argument passing 5 of `void
GRAPHICS_colour_blit_32bit(BITMAP*, BITMAP*, int, int, int, int, int, int,
long unsigned int)'
funkyfont.cpp:1978: warning: argument to `int' from `float'
funkyfont.cpp:1978: warning: passing `float' for argument passing 6 of `void
GRAPHICS_colour_blit_32bit(BITMAP*, BITMAP*, int, int, int, int, int, int,
long unsigned int)'
funkyfont.cpp:1978: warning: argument to `int' from `float'
funkyfont.cpp: In function `void
PFONT_draw_frame_list_vert_lerped_coloured(prop_text_struct*, int, int, int,

float, float, BITMAP*, int, int, int, int, int, int)':
funkyfont.cpp:1992: warning: initialization to `int' from `float'
funkyfont.cpp:1992: warning: argument to `int' from `float'
funkyfont.cpp:1993: warning: initialization to `int' from `float'
funkyfont.cpp:1993: warning: argument to `int' from `float'
funkyfont.cpp:2003: warning: passing `float' for argument passing 1 of `int
makecol16(int, int, int)'
funkyfont.cpp:2003: warning: argument to `int' from `float'
funkyfont.cpp:2003: warning: passing `float' for argument passing 2 of `int
makecol16(int, int, int)'
funkyfont.cpp:2003: warning: argument to `int' from `float'
funkyfont.cpp:2003: warning: passing `float' for argument passing 3 of `int
makecol16(int, int, int)'
funkyfont.cpp:2003: warning: argument to `int' from `float'
funkyfont.cpp:2004: warning: passing `float' for argument passing 1 of `int
makecol32(int, int, int)'
funkyfont.cpp:2004: warning: argument to `int' from `float'
funkyfont.cpp:2004: warning: passing `float' for argument passing 2 of `int
makecol32(int, int, int)'
funkyfont.cpp:2004: warning: argument to `int' from `float'
funkyfont.cpp:2004: warning: passing `float' for argument passing 3 of `int
makecol32(int, int, int)'
funkyfont.cpp:2004: warning: argument to `int' from `float'
funkyfont.cpp:2016: warning: passing `float' for argument passing 3 of `void
GRAPHICS_colour_vert_lerped_blit_16bit(BITMAP*, BITMAP*, int, int, int, int,

int, int, short unsigned int*)'
funkyfont.cpp:2016: warning: argument to `int' from `float'
funkyfont.cpp:2016: warning: passing `float' for argument passing 4 of `void
GRAPHICS_colour_vert_lerped_blit_16bit(BITMAP*, BITMAP*, int, int, int, int,

int, int, short unsigned int*)'
funkyfont.cpp:2016: warning: argument to `int' from `float'
funkyfont.cpp:2016: warning: passing `float' for argument passing 5 of `void
GRAPHICS_colour_vert_lerped_blit_16bit(BITMAP*, BITMAP*, int, int, int, int,

int, int, short unsigned int*)'
funkyfont.cpp:2016: warning: argument to `int' from `float'
funkyfont.cpp:2016: warning: passing `float' for argument passing 6 of `void
GRAPHICS_colour_vert_lerped_blit_16bit(BITMAP*, BITMAP*, int, int, int, int,

int, int, short unsigned int*)'
funkyfont.cpp:2016: warning: argument to `int' from `float'
funkyfont.cpp:2023: warning: passing `float' for argument passing 3 of `void
GRAPHICS_colour_vert_lerped_blit_32bit(BITMAP*, BITMAP*, int, int, int, int,

int, int, long unsigned int*)'
funkyfont.cpp:2023: warning: argument to `int' from `float'
funkyfont.cpp:2023: warning: passing `float' for argument passing 4 of `void
GRAPHICS_colour_vert_lerped_blit_32bit(BITMAP*, BITMAP*, int, int, int, int,

int, int, long unsigned int*)'
funkyfont.cpp:2023: warning: argument to `int' from `float'
funkyfont.cpp:2023: warning: passing `float' for argument passing 5 of `void
GRAPHICS_colour_vert_lerped_blit_32bit(BITMAP*, BITMAP*, int, int, int, int,

int, int, long unsigned int*)'
funkyfont.cpp:2023: warning: argument to `int' from `float'
funkyfont.cpp:2023: warning: passing `float' for argument passing 6 of `void
GRAPHICS_colour_vert_lerped_blit_32bit(BITMAP*, BITMAP*, int, int, int, int,

int, int, long unsigned int*)'
funkyfont.cpp:2023: warning: argument to `int' from `float'
funkyfont.cpp:2029:2: warning: no newline at end of file
[/code]

Mostly warnings, but there are some errors in there too...

--
sig used to be here

Neil Walker
Member #210
April 2000
avatar

I'll have a look, what version of gcc, I'm running 3.4.2 and that compiles fine. All those warnings are just float to ints mainly.

Are you running the version in my previous attachment, at line 109 it should read:
colour = (unsigned long) (m_source[x+mask_source_x]);

the error in your log points to the previous error which had it erroneously as
colour = unsigned long (m_source[x+mask_source_x]);

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

miran
Member #2,407
June 2002

Oooh, the latest version compiles! :o

--
sig used to be here

Neil Walker
Member #210
April 2000
avatar

read my previous message ;)

do you like?

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

miran
Member #2,407
June 2002

Tis funky! :D

--
sig used to be here

GullRaDriel
Member #3,861
September 2003
avatar

It makes me feel the old schoold days :p

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

Richard Phipps
Member #1,632
November 2001
avatar

I remember this funking thing from a few years ago.

Kirr
Member #5,060
September 2004
avatar

Nice effects! I will certainly implement paragraph formatting with different adjustments in future Glyph Keeper. For the other effects, are there any examples of real games (or other programs) using them in meaningful way?

--
"Go to the NW of Stonemarket Plaza to the Blue Glyph Keeper Library door and enter."
- Lunabean's Thief Deadly Shadows Walkthrough, day eight

Neil Walker
Member #210
April 2000
avatar

Quote:

I remember this funking thing from a few years ago

that was probably me too, it's taken me this long to start using it ;)

Quote:

are there any examples of real games (or other programs) using them in meaningful way?

I'm just using a few simple effects, one to show the currently selected menu item (contract/expand), another to show messages floating on the screen then as they scatter all over change the text then let it dampen back to normal to show the next message.

Most games use some kind of font transition effect. Just look at mario kart, there's messages that display with a sine wave effect, messages that have text pivoting/swinging, etc.

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

m c
Member #5,337
December 2004
avatar

This is very cool. I liked the effect that was mapped onto key V.

Anyway, im definitely going to use this, even though its in c++. Although i do not understand that. Although it doesnt compile under C, i can't see where you / he uses any special c++ stuff. It'd be funny if the only c++ thing was bool.

(\ /)
(O.o)
(> <)

Graham Goring
Member #2,367
May 2002

It's only C++ in terms of the declaration of variables as and when I need them rather than at the top of functions, so it's nothing you can't turn into regular C easily enough.

Richard Phipps
Member #1,632
November 2001
avatar

Would:
#define bool unsigned char
work for porting to C?

LennyLen
Member #5,313
December 2004
avatar

It's better to define it this way:
enum bool {false, true};

m c
Member #5,337
December 2004
avatar

yes it was very easy to "port".

The code was pretty neat and clean as well. It was easier to go through this than most of my old projects.

Anyway, in funkyfont.cpp, on lines #1647 and #1670, there is if (influence > 0.8) int john = 0;.

What was that going to be? It's like if(false) call_function(); especially seeing as how they are the only places in the whole file where there is a variable called john.

Is that the remnants of some old code, or some half-implemented stuff? I wasn't sure so i just commented it out.

Anyway, I've attached the modified files for anyone's convenience. I tested it and everything seems good.

[EDIT] This is GNU C / C99. I didnt re-order variable declarations becuase i cannot think of a c compiler that anyone uses that needs that. And im a very lazy person.8-)

(\ /)
(O.o)
(> <)

Graham Goring
Member #2,367
May 2002

It's because I'm a bad person. Basically when I want to stop a function without having a horrible assert box pop up I test for the condition, and inside the brackets I create a variable and stick a breakpoint on that line. And then I forget that I've done it and as a result my code is littered with "int a=0;" lines.

Neil Walker
Member #210
April 2000
avatar

Turning that question around (and hijacking the thread at the same time), I've used a few libraries that define pragmas that stop the compiler if you compile it as c++ rather than c. What kind of things can you have in a C file that would stop it compiling as c++ ?

[edit]void pointers for one ;)

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

Go to: