MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / ProgramVersion

Function ProgramVersion

Descent3/program.cpp:72–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70// Initializes the current program state
71
72void ProgramVersion(int version_type, uint8_t major, uint8_t minor, uint8_t build) {
73 oeLnxAppDatabase dbase((oeLnxAppDatabase *)Database);
74
75 Program_version.version_type = version_type;
76 Program_version.major = major;
77 Program_version.minor = minor;
78 Program_version.build = build;
79
80 PROGRAM(beta) = 0;
81 PROGRAM(demo) = 0;
82
83 if (version_type & BETA_VERSION)
84 PROGRAM(beta) = 1;
85 if (version_type & DEMO_VERSION)
86 PROGRAM(demo) = 1;
87
88 switch (version_type & (~0xf000)) {
89 case DEVELOPMENT_VERSION:
90 PROGRAM(debug) = 1;
91 PROGRAM(editor) = 0;
92 PROGRAM(release) = 0;
93 PROGRAM(windowed) = 0;
94 break;
95
96 case RELEASE_VERSION:
97 PROGRAM(debug) = 0;
98 PROGRAM(editor) = 0;
99 PROGRAM(release) = 0;
100 PROGRAM(windowed) = 0;
101 break;
102
103 default:
104 Int3(); // NO NO NO
105 }
106
107 if (dbase.lookup_record("Version")) {
108 dbase.write("Major", Program_version.major);
109 dbase.write("Minor", Program_version.minor);
110 dbase.write("Build", Program_version.build);
111 } else {
112 Error("Unable to find version key for %s", PRODUCT_NAME);
113 }
114}

Callers 2

OnCreateClientMethod · 0.85
Descent3Function · 0.85

Calls 3

ErrorFunction · 0.85
lookup_recordMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected