Loading [MathJax]/extensions/Safe.js

Special Aircraft Service

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Possible to add a new map image to a map's load.ini?  (Read 151 times)

0 Members and 1 Guest are viewing this topic.

WxTech

  • Modder
  • member
  • Offline Offline
  • Posts: 6174
Possible to add a new map image to a map's load.ini?
« on: March 06, 2025, 05:42:11 PM »

A map's load.ini contains the following:

[MAP]
  ColorMap  = map_c.tga
  HeightMap = map_h.tga
  SmallMap  = map_M.tga
  TypeMap   = map_T.tga
  FarMap    = map_F.tga
  ReflMap   = map_R.tga

I'd like to add something like:
  WaterMap = map_W.tga

This would be an integrated map_C (assembled into a whole, not the 'mosaic' pattern as used and created for reduced file size), most likely reduced from the map_C's 50m/pixel to the same 200m/pixel of other maps like map_H and map_T.

The purpose of this map is to augment the determination of water depth as calculated in BigshipGeneric.class and ShipGeneric.class. In those classes the distance from the nearest shoreline is used. But some maps have shallows covering huge areas, or are located far offshore. I'd like to apply a depth determination taken from the pixel RGB value at the location of the ship. If a load.ini does not identify this new map_W.tga, this part of water depth determination would be ignored, with the usual distance from shore being used only.

I've added code to what seems to be the three relevant classes:
  LandConf
  Landscape
  PlMapActors

I don't see that it would be necessary to add code in PlMapLoad.class for these two reasons:
  1) map_W.tga is not used in any way to assemble the map; it is merely an image from which to read the RGB value via such code as this:
        int j = Landscape.getPixelMapW(Engine.land().WORLD2PIXX(((Tuple3d) (point3d)).x + d0), Engine.land().WORLD2PIXY(((Tuple3d) (point3d)).y + d1));

  2) This image is not intended to be editable and saved through the unlocked FMB.

So far this isn't working as hoped. To verify the concept I have temporarily tried using map_T.tga, and I am getting a correct RGB value from it. My issue seems to involve 'registering' my new image. Perhaps I could play with altering one of  map_M.tga, map_F.tga or map_R.tga into my map_W.tga...  ;)  Although I find no appearance of these three maps in any classes, suggesting that their utility is relegated to the deeper graphics engine.


Am I overlooking something?
Logged
Great minds discuss ideas. Average minds discuss events. Small minds discuss people. - Hyman Rickover (but probably predating his use.)
Pages: [1]   Go Up
 

Page created in 0.038 seconds with 20 queries.