Skip to content

Commit abfdbf4

Browse files
committed
Refactoring classes
1 parent 090ab05 commit abfdbf4

2 files changed

Lines changed: 3 additions & 23 deletions

File tree

Driver2MissionTool/mission_tool.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
#include <stdlib.h>
22
#include <stdio.h>
33
#include <string.h>
4-
54
#include <nstd/File.hpp>
65
#include "core/cmdlib.h"
7-
#include "script.hpp"
8-
#include "mission.hpp"
96

107
void CreateMission(const char* filename)
118
{
@@ -17,7 +14,6 @@ void CreateMission(const char* filename)
1714
void PrintCommandLineArguments()
1815
{
1916
MsgInfo("Example usage:\n");
20-
MsgInfo("\tDriver2MissionTool -make <mission_script_name.d2ms>\n");
2117
MsgInfo("\tDriver2MissionTool -decompile MISSIONS.BLK [mission_number]\n");
2218
MsgInfo("\tDriver2MissionTool -compile <mission_script_name.d2ms>\n");
2319
}
@@ -38,14 +34,7 @@ int main(const int argc, char** argv)
3834

3935
for (int i = 0; i < argc; i++)
4036
{
41-
if (!stricmp(argv[i], "-make"))
42-
{
43-
if (i + 1 <= argc)
44-
CreateMission(argv[i + 1]);
45-
else
46-
MsgWarning("-make must have a filename argument!");
47-
48-
}
37+
4938
}
5039

5140
return 0;

DriverImageTool/image_tool.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,7 @@ void ExportExtraImage(const char* filename, ubyte* data, ubyte* clut_data, int n
234234

235235
// In frontend, extra poly has a preview image drawn
236236
void ConvertBackgroundRaw(const char* filename, const char* extraFilename)
237-
{
238-
/* Inside RAW Files
239-
* imageCLUT are found at offset + 0x58000
240-
* timData is an array of each image 64 width, 256 height, and 6 pieces of image
241-
*
242-
*/
243-
237+
{
244238
FILE* bgFp = fopen(filename, "rb");
245239

246240
if (!bgFp)
@@ -291,9 +285,7 @@ void ConvertBackgroundRaw(const char* filename, const char* extraFilename)
291285
{
292286
for (int x = 0; x < rect_w * 2; x++)
293287
{
294-
size_t timDataIndex = (rect_y + y) * 64 * 6 + rect_x + x;
295-
size_t bgImagePieceIndex = y * 128 + x;
296-
timData[timDataIndex] = bgImagePiece[bgImagePieceIndex];
288+
timData[(rect_y + y) * 64 * 6 + rect_x + x] = bgImagePiece[y * 128 + x];
297289
}
298290
}
299291
}
@@ -321,7 +313,6 @@ void ConvertBackgroundRaw(const char* filename, const char* extraFilename)
321313
bgImagePiece, 64 * 2 * 36, 0, 0, 256, 36, imageClut, 1);
322314
}
323315

324-
// TODO: Decompress everything that we have something to recompress
325316
//else // pointless to have font and selection texture as tpage, but i'll leave it here as reference code
326317
{
327318
// try extract the rest

0 commit comments

Comments
 (0)