~ares-developers/ares/gd03

« back to all changes in this revision

Viewing changes to src/Commands/MapSnapshot.h

  • 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
#ifndef CMD_MAPSNAP_H
 
2
#define CMD_MAPSNAP_H
 
3
 
 
4
class MapSnapshotCommandClass : public CommandClass
 
5
{
 
6
public:
 
7
        //Destructor
 
8
        virtual ~MapSnapshotCommandClass(){}
 
9
 
 
10
        //CommandClass
 
11
        virtual const char* GetName()
 
12
                { return "MapSnapshot"; }
 
13
 
 
14
        virtual const wchar_t* GetUIName()
 
15
                { return L"Map Snapshot"; }
 
16
 
 
17
        virtual const wchar_t* GetUICategory()
 
18
                { return L"Development"; }
 
19
 
 
20
        virtual const wchar_t* GetUIDescription()
 
21
                { return L"Saves the currently played map."; }
 
22
 
 
23
        virtual void Execute(DWORD dwUnk)
 
24
        {
 
25
                int i = 0;
 
26
                
 
27
                FILE* F = NULL;
 
28
                char buffer[0x10] = "\0";
 
29
 
 
30
                do
 
31
                {
 
32
                        if(F)fclose(F);
 
33
 
 
34
                        _snprintf(buffer, 16, "Map%04d.yrm", i++);
 
35
                        F = fopen(buffer, "rb");
 
36
                }while(F != NULL);
 
37
 
 
38
                DEBUGLOG("\t\t%s", buffer);
 
39
 
 
40
                char* pBuffer = buffer;
 
41
 
 
42
                SET_REG8(dl, 0);
 
43
                SET_REG32(ecx, pBuffer);
 
44
                CALL(0x687CE0);
 
45
 
 
46
                wchar_t msg[0x40] = L"\0";
 
47
                wsprintfW(msg, L"Map Snapshot saved as '%hs'.", buffer);
 
48
                MessageListClass::PrintMessage(msg);
 
49
        }
 
50
 
 
51
        //Constructor
 
52
        MapSnapshotCommandClass(){}
 
53
};
 
54
 
 
55
#endif