~ares-developers/ares/gd03

« back to all changes in this revision

Viewing changes to src/Ext/Techno/Hooks.Insignia.cpp

  • Committer: Renegade
  • Date: 2010-05-29 08:12:17 UTC
  • Revision ID: git-v1:0a1bb6321f04d723afe64d1b843dc87b4da783ec
Creating /trunk/src.

git-svn-id: svn://svn.renegadeprojects.com/ares/trunk@622 859b54a9-7a54-0410-aeb3-f8d2f1fa40fd

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "Body.h"
 
2
#include "../TechnoType/Body.h"
 
3
 
 
4
DEFINE_HOOK(70A990, TechnoClass_DrawVeterancy, 5)
 
5
{
 
6
        GET(TechnoClass *, T, ECX);
 
7
        GET_STACK(Point2D *, XY, 0x4);
 
8
        GET_STACK(RectangleStruct *, pRect, 0x8);
 
9
 
 
10
        Point2D offset = *XY;
 
11
 
 
12
        SHPStruct *iFile = FileSystem::PIPS_SHP;
 
13
        int iFrame = -1;
 
14
        TechnoTypeExt::ExtData *pTypeData = TechnoTypeExt::ExtMap.Find(T->GetTechnoType());
 
15
 
 
16
        pTypeData->Insignia.BindTo(T);
 
17
        SHPStruct *fCustom = pTypeData->Insignia.Get();
 
18
 
 
19
        if(fCustom) {
 
20
                iFile = fCustom;
 
21
                iFrame = 0;
 
22
        } else {
 
23
                VeterancyStruct *XP = &T->Veterancy;
 
24
                if(XP->IsElite()) {
 
25
                        iFrame = 15;
 
26
                } else if(XP->IsVeteran()) {
 
27
                        iFrame = 14;
 
28
                }
 
29
        }
 
30
 
 
31
        if(iFrame != -1 && iFile) {
 
32
                offset.X += 5;
 
33
                offset.Y += 2;
 
34
                if(T->WhatAmI() != abs_Infantry) {
 
35
                        offset.X += 5;
 
36
                        offset.Y += 4;
 
37
                }
 
38
 
 
39
                DSurface::Hidden_2->DrawSHP(
 
40
                        FileSystem::THEATER_PAL, iFile, iFrame, &offset, pRect, bf_Alpha | bf_400 | bf_200, 0, -2, 0, 1000, 0, 0, 0, 0, 0);
 
41
        }
 
42
 
 
43
        return 0x70AA5B;
 
44
}