]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/menu/nexuiz/image.c
menu rearrangements by Samual
[divverent/nexuiz.git] / data / qcsrc / menu / nexuiz / image.c
1 #ifdef INTERFACE
2 CLASS(NexuizImage) EXTENDS(Image)
3         METHOD(NexuizImage, configureNexuizImage, void(entity, string, float))
4 ENDCLASS(NexuizImage)
5 entity makeNexuizImage(string theImage, float theAspect);
6 #endif
7
8 #ifdef IMPLEMENTATION
9 entity makeNexuizImage(string theImage, float theAspect)
10 {
11         entity me;
12         me = spawnNexuizImage();
13         me.configureNexuizImage(me, theImage, theAspect);
14         return me;
15 }
16 void configureNexuizImageNexuizImage(entity me, string theImage, float theAspect)
17 {
18         me.configureImage(me, theImage);
19         if(theAspect < 0) // use image aspect
20         {
21                 vector sz;
22                 sz = draw_PictureSize(theImage);
23                 me.forcedAspect = sz_x / sz_y;
24         }
25         else
26                 me.forcedAspect = theAspect;
27 }
28 #endif