-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathciv3mapper.cpp
More file actions
47 lines (42 loc) · 1.74 KB
/
Copy pathciv3mapper.cpp
File metadata and controls
47 lines (42 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <iostream>
#include <tclap/CmdLine.h>
#include <string>
#include "maprender.h"
int main(int argc, char* argv[]) {
// Set up all the command line stuff
TCLAP::CmdLine cmd("Utility for creating pretty video replay maps from Civilization 3 SAV files", ' ', "0.0.1");
TCLAP::UnlabeledValueArg<std::string> savfile("savfile", "A Civ 3 Save File", true, "MySave.SAV", "yourfile.SAV");
TCLAP::ValueArg<int> xoffset("x", "x-offset", "Shift the map horizontally by x tiles", false, 0, "integer");
TCLAP::ValueArg<int> yoffset("y", "y-offset", "Shift the map vertically by y tiles", false, 0, "integer");
TCLAP::ValueArg<int> framerate("f", "frame-rate", "Set the number of turns per second", false, 6, "integer");
TCLAP::SwitchArg stretch("s", "stretch", "If set, the map will be stretched to fit the viewport. Otherwise, black bars will be used", false);
TCLAP::SwitchArg loop("l", "loop", "If set, the replay will loop back to the beginning after finishing", false);
cmd.add(savfile);
cmd.add(loop);
cmd.add(stretch);
cmd.add(framerate);
cmd.add(yoffset);
cmd.add(xoffset);
cmd.parse(argc, argv);
Civ3::SAV sav(savfile.getValue());
if (sav.valid) {
Civ3::MapRender mr(&sav, xoffset.getValue(), yoffset.getValue(), framerate.getValue(), stretch.getValue(), loop.getValue());
}
return 0;
};
/*
TODO:
[Done] Comments
[Done] Support compressed sav
Test for vertical maps
[Done] Loop flag
[Done] Frame rate flag
[Done] Investigate Ottoman SAV (seg fault, odd beginning behavior)
[Done] Fix Colors
[Done] Fix color tiles not wrapping
[Done] Fix offset flags
[Done] Fix negative offset
[Done] Better error handling
Show borders and cities?
[Done] second.SAV standard.SAV core dump
*/