Some fixes.

This commit is contained in:
lzwdgc 2017-06-01 21:30:01 +03:00
parent 0df077b7ab
commit 16fc4fea61
10 changed files with 62 additions and 35 deletions

View file

@ -1,6 +1,4 @@
local_settings:
dependencies:
#- name: pvt.lzwdgc.polygon4.data_manager
- name: data_manager
local: k:/AIM/DataManager
- pvt.lzwdgc.polygon4.data_manager: master

View file

@ -309,92 +309,92 @@ types:
type: u4
- id: roads
if: type == segment_type::ROAD
if: type == segment_type::road
repeat: expr
repeat-expr: n_objects
type: map_object_with_array
- id: boundaries
if: type == segment_type::BOUNDARY
if: type == segment_type::boundary
repeat: expr
repeat-expr: n_objects
type: map_object_with_array
- id: stones
if: type == segment_type::STONE
if: type == segment_type::stone
repeat: expr
repeat-expr: n_objects
type: map_object
- id: trees
if: type == segment_type::TREE
if: type == segment_type::tree
repeat: expr
repeat-expr: n_objects
type: map_object
- id: helpers
if: type == segment_type::HELPER
if: type == segment_type::helper
repeat: expr
repeat-expr: n_objects
type: map_object
- id: buildings
if: type == segment_type::BUILDING
if: type == segment_type::building
repeat: expr
repeat-expr: n_objects
type: map_object
- id: lamps
if: type == segment_type::LAMP
if: type == segment_type::lamp
repeat: expr
repeat-expr: n_objects
type: map_object
- id: images
if: type == segment_type::IMAGE
if: type == segment_type::image
repeat: expr
repeat-expr: n_objects
type: map_object
- id: anomalies
if: type == segment_type::ANOMALY
if: type == segment_type::anomaly
repeat: expr
repeat-expr: n_objects
type: map_object
- id: towers
if: type == segment_type::TOWER
if: type == segment_type::tower
repeat: expr
repeat-expr: n_objects
type: map_object
- id: sound_zones
if: type == segment_type::SOUND_ZONE
if: type == segment_type::sound_zone
repeat: expr
repeat-expr: n_objects
type: map_object
- id: sounds
if: type == segment_type::SOUND
if: type == segment_type::sound
repeat: expr
repeat-expr: n_objects
type: sound
enums:
segment_type:
1: TEXTURE
3: STONE
4: TREE
7: HELPER
8: ROAD
11: BUILDING
12: IMAGE
13: LAMP
19: SOUND
20: ANOMALY
22: TOWER
23: BOUNDARY
24: SOUND_ZONE
1: texture
3: stone
4: tree
7: helper
8: road
11: building
12: image
13: lamp
19: sound
20: anomaly
22: tower
23: boundary
24: sound_zone
21: unk0
27: unk1
@ -476,4 +476,3 @@ types:
repeat-expr: length
type: u4

View file

@ -11,11 +11,11 @@ endif()
file(GLOB mmm_extractor_src "mmm_extractor/*")
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/*")
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/*")
add_executable(mmp_extractor ${mmp_extractor_src})

View 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

View 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()

View file

@ -31,6 +31,7 @@
#include "other.h"
#include <Polygon4/DataManager/Storage.h>
#include <Polygon4/DataManager/Types.h>
#include <buffer.h>
#include <types.h>

View file

@ -212,7 +212,7 @@ void mmp::process()
const int unreal_koef = 51200;
const int aim_koef = 10;
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)
{
@ -251,6 +251,7 @@ void mmp::writeFileInfo()
ofile << "h_max: " << h_max << "\n";
ofile << "h_diff: " << h_max - h_min << "\n";
ofile << "scale16: " << scale16 << "\n";
ofile << "scale: " << scale << "\n";
}
void mmp::writeTexturesList()

View file

@ -159,6 +159,7 @@ struct mmp
Height h_min;
Height h_max;
double scale16 = 0;
double scale = 0;
mat<uint16_t> heightmap;
mat<uint32_t> texmap;
mat<uint32_t> texmap_colored;

View file

@ -21,7 +21,7 @@ BISON_TARGET(grammar
FLEX_TARGET(lexer
"${CMAKE_CURRENT_SOURCE_DIR}/lexer.ll"
"${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)
@ -45,4 +45,4 @@ set(script2txt_src ${script2txt_src}
)
add_executable (script2txt ${script2txt_src} ${script2txt_inc})
target_link_libraries (script2txt common schema)
target_link_libraries (script2txt common pvt.lzwdgc.polygon4.data_manager.schema)