mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-24 03:43:35 +00:00
Add Italia and Straight of Gibraltar maps (#1285)
## Description: Add Italia and Straight of Gibraltar Merging this directly into v23 because the map generation logic changed. Also removed last pixel if odd. The map dimensions must be even. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: evan
This commit is contained in:
@@ -36,12 +36,15 @@ export async function generateMap(
|
||||
`Processing Map: ${name}, dimensions: ${img.width}x${img.height}`,
|
||||
);
|
||||
|
||||
const terrain: Terrain[][] = Array(img.width)
|
||||
.fill(null)
|
||||
.map(() => Array(img.height).fill(null));
|
||||
const width = img.width - (img.width % 2);
|
||||
const height = img.height - (img.height % 2);
|
||||
|
||||
for (let x = 0; x < img.width; x++) {
|
||||
for (let y = 0; y < img.height; y++) {
|
||||
const terrain: Terrain[][] = Array(width)
|
||||
.fill(null)
|
||||
.map(() => Array(height).fill(null));
|
||||
|
||||
for (let x = 0; x < width; x++) {
|
||||
for (let y = 0; y < height; y++) {
|
||||
const color = img.getPixelRGBA(x, y);
|
||||
const alpha = color & 0xff;
|
||||
const blue = (color >> 8) & 0xff;
|
||||
|
||||
@@ -29,6 +29,8 @@ const maps = [
|
||||
"FalklandIslands",
|
||||
"Baikal",
|
||||
"Halkidiki",
|
||||
"Italia",
|
||||
"StraitOfGibraltar",
|
||||
];
|
||||
|
||||
const removeSmall = true;
|
||||
|
||||
Reference in New Issue
Block a user