Author Topic: Map viewer  (Read 214 times)

jj2007

  • Member
  • *****
  • Posts: 7551
  • Assembler is fun ;-)
    • MasmBasic
Map viewer
« on: October 06, 2017, 12:15:23 PM »
Extract all files to a tmp folder, then start ArrayPlotMaps.exe and press F1 for help. So far tested on Win7-64 and XP. I am curious if it works on all systems ::)

Caution the maps are very old, I hope nobody is politically offended :bgrin:

The source is included (*.asc) but it won't build with the current MB version. The absolute minimum source would be as follows:
Code: [Select]
include \masm32\MasmBasic\Res\MbGui.asm
  GuiControl MyMap, "canvas"              ; create a dedicated new control ;-)
  GetFiles *.dmi
  ArrayLoadMap 0, Files$(0)

Event CanvasPaint
  ArrayPlot hWnd, RgbCol(100, 240, 255)         ; init with window (or control) handle and background colour
  PaintMap RgbCol(127, 127, 127), lines=2       ; display map with grey borders 2px thick
  ArrayPlot exit, "Map of "+Left$(Files$(0), Rinstr(Files$(0), ".")-1)       ; finish with a title

Event Message
  If_ uMsg==WM_MOUSEMOVE || uMsg==WM_LBUTTONDOWN Then <ArrayMapRegion(uMsg-WM_MOUSEMOVE)>         ; show tooltip
GuiEnd
« Last Edit: October 17, 2017, 05:04:24 AM by jj2007 »

sinsi

  • Member
  • ****
  • Posts: 996
Re: Map viewer
« Reply #1 on: October 06, 2017, 12:23:27 PM »
No indication of which part is currently selected (except by changing colour).
Name tooltip stays when changing map.
Where's Australia??? :biggrin:
I can walk on water but stagger on beer.

jj2007

  • Member
  • *****
  • Posts: 7551
  • Assembler is fun ;-)
    • MasmBasic
Re: Map viewer
« Reply #2 on: October 06, 2017, 12:32:48 PM »
No indication of which part is currently selected (except by changing colour).

This is by design 8)

Quote
Name tooltip stays when changing map.

Which Windows version? It changes on mine.

Quote
Where's Australia??? :biggrin:

Oops, corrected above. Oceania.dmi was included but .map was missing :icon_redface:

sinsi

  • Member
  • ****
  • Posts: 996
Re: Map viewer
« Reply #3 on: October 06, 2017, 12:38:51 PM »
Windows 10 Pro x64
I can walk on water but stagger on beer.

jj2007

  • Member
  • *****
  • Posts: 7551
  • Assembler is fun ;-)
    • MasmBasic
Re: Map viewer
« Reply #4 on: October 06, 2017, 05:35:14 PM »
Yep, I can reproduce that one on Win10-64 Home, and, with some luck, also on Win7-64. But it's only temporary, as soon as you move on to the next region, the correct name shows up. A non-issue imho but thanks for flagging it :icon14:

Will see if I find a "reset tooltips" command.

mikeburr

  • Regular Member
  • *
  • Posts: 26
Re: Map viewer
« Reply #5 on: October 10, 2017, 01:12:38 PM »
win 7 64   old HP keyboard [but quite feature rich]
map selection not working on mine [ie selection keys not working ]
could only get Africa ...the countries incidentally were not correct either ... where are   British Nyasaland ... Rhodesia ...Tanganika ???? etc 
tried various other methods of associating the DMI as well
couldn't run it under Linux/Wine either but thats not surprising ..
regards   mike b

jj2007

  • Member
  • *****
  • Posts: 7551
  • Assembler is fun ;-)
    • MasmBasic
Re: Map viewer
« Reply #6 on: October 10, 2017, 04:40:57 PM »
where are   British Nyasaland ... Rhodesia ...Tanganika ???? etc

When I wrote "the maps are very old", I meant the year 2000, not 1900 :P

jj2007

  • Member
  • *****
  • Posts: 7551
  • Assembler is fun ;-)
    • MasmBasic
Re: Map viewer
« Reply #7 on: October 16, 2017, 05:14:22 AM »
Version 2 attached, works with the maps above. Work in progress, the source is still too confused to be posted here :icon_redface:

felipe

  • Member
  • ***
  • Posts: 282
  • I love assembly language programming.
Re: Map viewer
« Reply #8 on: October 16, 2017, 10:19:00 AM »
i Get an error when tried to execute it:

FATAL ERROR:
Could not open
dmi
for Recall,FileRead$,etc.


 :icon_exclaim: Windows 8.1 64 bits...(Don't have masmbasic installed). I downloaded the last version (v2).
Felipe.

jj2007

  • Member
  • *****
  • Posts: 7551
  • Assembler is fun ;-)
    • MasmBasic
Re: Map viewer
« Reply #9 on: October 16, 2017, 02:47:09 PM »
Could not open
dmi

works with the maps above.

I didn't want to post the maps twice. Extract them to the folder where the new exe sits.

felipe

  • Member
  • ***
  • Posts: 282
  • I love assembly language programming.
Re: Map viewer
« Reply #10 on: October 17, 2017, 02:39:37 AM »
 :t Pretty nice, all worked fine, but the left and right arrow to change the country seems like don't.
Felipe.

jj2007

  • Member
  • *****
  • Posts: 7551
  • Assembler is fun ;-)
    • MasmBasic
Re: Map viewer
« Reply #11 on: October 17, 2017, 05:07:30 AM »
Thanks :P

I dropped the left-right thing because now you can select the country simply by clicking on it. Afterwards, the up-down arrays change the colour.

First post is updated with new version, including the source - 48 lines of code :biggrin: