mirror of
https://github.com/aimrebirth/tools.git
synced 2026-04-14 17:33:25 +00:00
Some fixes.
This commit is contained in:
parent
0df077b7ab
commit
16fc4fea61
10 changed files with 62 additions and 35 deletions
|
|
@ -1,6 +1,4 @@
|
||||||
local_settings:
|
local_settings:
|
||||||
dependencies:
|
dependencies:
|
||||||
#- name: pvt.lzwdgc.polygon4.data_manager
|
- pvt.lzwdgc.polygon4.data_manager: master
|
||||||
- name: data_manager
|
|
||||||
local: k:/AIM/DataManager
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -309,92 +309,92 @@ types:
|
||||||
type: u4
|
type: u4
|
||||||
|
|
||||||
- id: roads
|
- id: roads
|
||||||
if: type == segment_type::ROAD
|
if: type == segment_type::road
|
||||||
repeat: expr
|
repeat: expr
|
||||||
repeat-expr: n_objects
|
repeat-expr: n_objects
|
||||||
type: map_object_with_array
|
type: map_object_with_array
|
||||||
|
|
||||||
- id: boundaries
|
- id: boundaries
|
||||||
if: type == segment_type::BOUNDARY
|
if: type == segment_type::boundary
|
||||||
repeat: expr
|
repeat: expr
|
||||||
repeat-expr: n_objects
|
repeat-expr: n_objects
|
||||||
type: map_object_with_array
|
type: map_object_with_array
|
||||||
|
|
||||||
- id: stones
|
- id: stones
|
||||||
if: type == segment_type::STONE
|
if: type == segment_type::stone
|
||||||
repeat: expr
|
repeat: expr
|
||||||
repeat-expr: n_objects
|
repeat-expr: n_objects
|
||||||
type: map_object
|
type: map_object
|
||||||
|
|
||||||
- id: trees
|
- id: trees
|
||||||
if: type == segment_type::TREE
|
if: type == segment_type::tree
|
||||||
repeat: expr
|
repeat: expr
|
||||||
repeat-expr: n_objects
|
repeat-expr: n_objects
|
||||||
type: map_object
|
type: map_object
|
||||||
|
|
||||||
- id: helpers
|
- id: helpers
|
||||||
if: type == segment_type::HELPER
|
if: type == segment_type::helper
|
||||||
repeat: expr
|
repeat: expr
|
||||||
repeat-expr: n_objects
|
repeat-expr: n_objects
|
||||||
type: map_object
|
type: map_object
|
||||||
|
|
||||||
- id: buildings
|
- id: buildings
|
||||||
if: type == segment_type::BUILDING
|
if: type == segment_type::building
|
||||||
repeat: expr
|
repeat: expr
|
||||||
repeat-expr: n_objects
|
repeat-expr: n_objects
|
||||||
type: map_object
|
type: map_object
|
||||||
|
|
||||||
- id: lamps
|
- id: lamps
|
||||||
if: type == segment_type::LAMP
|
if: type == segment_type::lamp
|
||||||
repeat: expr
|
repeat: expr
|
||||||
repeat-expr: n_objects
|
repeat-expr: n_objects
|
||||||
type: map_object
|
type: map_object
|
||||||
|
|
||||||
- id: images
|
- id: images
|
||||||
if: type == segment_type::IMAGE
|
if: type == segment_type::image
|
||||||
repeat: expr
|
repeat: expr
|
||||||
repeat-expr: n_objects
|
repeat-expr: n_objects
|
||||||
type: map_object
|
type: map_object
|
||||||
|
|
||||||
- id: anomalies
|
- id: anomalies
|
||||||
if: type == segment_type::ANOMALY
|
if: type == segment_type::anomaly
|
||||||
repeat: expr
|
repeat: expr
|
||||||
repeat-expr: n_objects
|
repeat-expr: n_objects
|
||||||
type: map_object
|
type: map_object
|
||||||
|
|
||||||
- id: towers
|
- id: towers
|
||||||
if: type == segment_type::TOWER
|
if: type == segment_type::tower
|
||||||
repeat: expr
|
repeat: expr
|
||||||
repeat-expr: n_objects
|
repeat-expr: n_objects
|
||||||
type: map_object
|
type: map_object
|
||||||
|
|
||||||
- id: sound_zones
|
- id: sound_zones
|
||||||
if: type == segment_type::SOUND_ZONE
|
if: type == segment_type::sound_zone
|
||||||
repeat: expr
|
repeat: expr
|
||||||
repeat-expr: n_objects
|
repeat-expr: n_objects
|
||||||
type: map_object
|
type: map_object
|
||||||
|
|
||||||
- id: sounds
|
- id: sounds
|
||||||
if: type == segment_type::SOUND
|
if: type == segment_type::sound
|
||||||
repeat: expr
|
repeat: expr
|
||||||
repeat-expr: n_objects
|
repeat-expr: n_objects
|
||||||
type: sound
|
type: sound
|
||||||
|
|
||||||
enums:
|
enums:
|
||||||
segment_type:
|
segment_type:
|
||||||
1: TEXTURE
|
1: texture
|
||||||
3: STONE
|
3: stone
|
||||||
4: TREE
|
4: tree
|
||||||
7: HELPER
|
7: helper
|
||||||
8: ROAD
|
8: road
|
||||||
11: BUILDING
|
11: building
|
||||||
12: IMAGE
|
12: image
|
||||||
13: LAMP
|
13: lamp
|
||||||
19: SOUND
|
19: sound
|
||||||
20: ANOMALY
|
20: anomaly
|
||||||
22: TOWER
|
22: tower
|
||||||
23: BOUNDARY
|
23: boundary
|
||||||
24: SOUND_ZONE
|
24: sound_zone
|
||||||
21: unk0
|
21: unk0
|
||||||
27: unk1
|
27: unk1
|
||||||
|
|
||||||
|
|
@ -476,4 +476,3 @@ types:
|
||||||
repeat-expr: length
|
repeat-expr: length
|
||||||
type: u4
|
type: u4
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -11,11 +11,11 @@ endif()
|
||||||
|
|
||||||
file(GLOB mmm_extractor_src "mmm_extractor/*")
|
file(GLOB mmm_extractor_src "mmm_extractor/*")
|
||||||
add_executable(mmm_extractor ${mmm_extractor_src})
|
add_executable(mmm_extractor ${mmm_extractor_src})
|
||||||
target_link_libraries(mmm_extractor common data_manager)
|
target_link_libraries(mmm_extractor common pvt.lzwdgc.polygon4.data_manager.data_manager)
|
||||||
|
|
||||||
file(GLOB mmo_extractor_src "mmo_extractor/*")
|
file(GLOB mmo_extractor_src "mmo_extractor/*")
|
||||||
add_executable(mmo_extractor ${mmo_extractor_src})
|
add_executable(mmo_extractor ${mmo_extractor_src})
|
||||||
target_link_libraries(mmo_extractor common data_manager)
|
target_link_libraries(mmo_extractor common pvt.lzwdgc.polygon4.data_manager.data_manager)
|
||||||
|
|
||||||
file(GLOB mmp_extractor_src "mmp_extractor/*")
|
file(GLOB mmp_extractor_src "mmp_extractor/*")
|
||||||
add_executable(mmp_extractor ${mmp_extractor_src})
|
add_executable(mmp_extractor ${mmp_extractor_src})
|
||||||
|
|
|
||||||
2
src/mmm_extractor/mmm_extractor.bat
Normal file
2
src/mmm_extractor/mmm_extractor.bat
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
python mmm_extractor.py --dir h:\Games\AIM\data\minimaps.pak.dir
|
||||||
|
python mmm_extractor.py --dir h:\Games\Steam\steamapps\common\AIM2\Data\DATA\LOCS
|
||||||
25
src/mmm_extractor/mmm_extractor.py
Normal file
25
src/mmm_extractor/mmm_extractor.py
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
#!/usr/bin/python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = argparse.ArgumentParser(description='Batch models converter')
|
||||||
|
parser.add_argument('--dir', dest='dir', help='path to directory with maps')
|
||||||
|
pargs = parser.parse_args()
|
||||||
|
|
||||||
|
if pargs.dir:
|
||||||
|
run(pargs.dir)
|
||||||
|
|
||||||
|
def run(dir):
|
||||||
|
for file in sorted(os.listdir(dir)):
|
||||||
|
if os.path.isdir(file) or os.path.splitext(file)[1].lower() != ".mmm":
|
||||||
|
continue
|
||||||
|
print('loading: ' + file)
|
||||||
|
p = subprocess.Popen(['mmm_extractor.exe', dir + '/' + file])
|
||||||
|
p.communicate()
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
|
|
@ -31,6 +31,7 @@
|
||||||
#include "other.h"
|
#include "other.h"
|
||||||
|
|
||||||
#include <Polygon4/DataManager/Storage.h>
|
#include <Polygon4/DataManager/Storage.h>
|
||||||
|
#include <Polygon4/DataManager/Types.h>
|
||||||
|
|
||||||
#include <buffer.h>
|
#include <buffer.h>
|
||||||
#include <types.h>
|
#include <types.h>
|
||||||
|
|
|
||||||
|
|
@ -212,7 +212,7 @@ void mmp::process()
|
||||||
const int unreal_koef = 51200;
|
const int unreal_koef = 51200;
|
||||||
const int aim_koef = 10;
|
const int aim_koef = 10;
|
||||||
const double diff = h_max - h_min;
|
const double diff = h_max - h_min;
|
||||||
const double scale = aim_koef / (unreal_koef / diff);
|
scale = aim_koef / (unreal_koef / diff);
|
||||||
|
|
||||||
for (auto &s : segments)
|
for (auto &s : segments)
|
||||||
{
|
{
|
||||||
|
|
@ -251,6 +251,7 @@ void mmp::writeFileInfo()
|
||||||
ofile << "h_max: " << h_max << "\n";
|
ofile << "h_max: " << h_max << "\n";
|
||||||
ofile << "h_diff: " << h_max - h_min << "\n";
|
ofile << "h_diff: " << h_max - h_min << "\n";
|
||||||
ofile << "scale16: " << scale16 << "\n";
|
ofile << "scale16: " << scale16 << "\n";
|
||||||
|
ofile << "scale: " << scale << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void mmp::writeTexturesList()
|
void mmp::writeTexturesList()
|
||||||
|
|
|
||||||
|
|
@ -159,6 +159,7 @@ struct mmp
|
||||||
Height h_min;
|
Height h_min;
|
||||||
Height h_max;
|
Height h_max;
|
||||||
double scale16 = 0;
|
double scale16 = 0;
|
||||||
|
double scale = 0;
|
||||||
mat<uint16_t> heightmap;
|
mat<uint16_t> heightmap;
|
||||||
mat<uint32_t> texmap;
|
mat<uint32_t> texmap;
|
||||||
mat<uint32_t> texmap_colored;
|
mat<uint32_t> texmap_colored;
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ BISON_TARGET(grammar
|
||||||
FLEX_TARGET(lexer
|
FLEX_TARGET(lexer
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/lexer.ll"
|
"${CMAKE_CURRENT_SOURCE_DIR}/lexer.ll"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/lexer.cpp"
|
"${CMAKE_CURRENT_BINARY_DIR}/lexer.cpp"
|
||||||
COMPILE_FLAGS --header-file="${CMAKE_CURRENT_BINARY_DIR}/lexer.h"
|
COMPILE_FLAGS --header-file=${CMAKE_CURRENT_BINARY_DIR}/lexer.h
|
||||||
)
|
)
|
||||||
ADD_FLEX_BISON_DEPENDENCY(lexer grammar)
|
ADD_FLEX_BISON_DEPENDENCY(lexer grammar)
|
||||||
|
|
||||||
|
|
@ -45,4 +45,4 @@ set(script2txt_src ${script2txt_src}
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable (script2txt ${script2txt_src} ${script2txt_inc})
|
add_executable (script2txt ${script2txt_src} ${script2txt_inc})
|
||||||
target_link_libraries (script2txt common schema)
|
target_link_libraries (script2txt common pvt.lzwdgc.polygon4.data_manager.schema)
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ void tm2tga(string fn)
|
||||||
src.seek(0x10);
|
src.seek(0x10);
|
||||||
src.read(&dxt5_flag, 1);
|
src.read(&dxt5_flag, 1);
|
||||||
src.seek(0x4C);
|
src.seek(0x4C);
|
||||||
|
|
||||||
if (dxt5_flag)
|
if (dxt5_flag)
|
||||||
{
|
{
|
||||||
dxt5 d;
|
dxt5 d;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue