Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Minimap #344

Closed
wants to merge 33 commits into from
Closed

[WIP] Minimap #344

wants to merge 33 commits into from

Conversation

jfeo
Copy link
Contributor

@jfeo jfeo commented Aug 12, 2015

Here's my progress on a minimap.

There's probably a lot of style issues, etc. and I need to rebase some commits...

Right now, I think it's an issue that the Minimap registers itself with the engine for drawing, but then is deleted when the game is ended (dangling pointer?)

A good way to draw resources is also needed. Where are the colors/palette indices for them?

Video for those who just want to see what it looks like.
implements and fixes #111

jfeo added 28 commits May 7, 2015 17:23
… dimensions, fixed dynamic minimap placement so view port is correctly displayed
* Fixed check for HD-edition in the drs-mounting function
* Fixed dir for string resources
* Added missing drs-file mounts for AoC
* Conditional path for the test for existance of `emires2_x1_p1.dat`
* Added jfeo as author
  to choose western point and `auto_mapping` for fitting the resolution
  to the current terrain.
* Fixed error with change in the terrain color attributes (variable
  names changed)
* Changed how references are made to Engine singleton.
* Only auto-fit map when terrain is changed (update added to input
  section)
@jfeo jfeo mentioned this pull request Aug 12, 2015
@Jon0
Copy link
Member

Jon0 commented Aug 12, 2015

The game_main class should only include pure game state data, so its not the best owner for the minimap, I would suggest looking at main.cpp, line 42-44 the where the are other components, and similarly minimap can be made on the stack (no 'new' constructor),

You would need to change the constructor parameters to minimap(Engine *engine, ... size, ... hudpos) The minimap wont need to have pointers to the unit container and terrain since these can be retrieved in the minimap::on_drawhud() call using GameMain *game = engine.get_game() note: that will return nullptr when there is no active game, in which case no minimap should be drawn.

if the result is not null you will just use game->terrain, and game->placed_units, as before.

@TheJJ TheJJ added nice new thing ☺ A new feature that was not there before lang: c++ Done in C++ code in progress labels Aug 12, 2015
@franciscod
Copy link
Contributor

oh the video looks awesome! nice work :D

I almost forgot about gaben, and chuckled when he popped in the background 😄

@TheJJ
Copy link
Member

TheJJ commented Aug 14, 2015

If you perform your rebase, you might want to use git rebase -m -i upstream/master.

@jfeo
Copy link
Contributor Author

jfeo commented Aug 16, 2015

Is there any reason for me to keep the commit history of my own commits, or would it be okay to just squash it all into 1 commit? I think it would be easier for me

@TheJJ
Copy link
Member

TheJJ commented Aug 16, 2015

Sure, you can squash them into one if you like. Most of the time my work builds up incrementally so it makes sense keeping the history (e.g. "implemented ...", then "engine: make use of ...", then "bla: enable ... globally") so each step could be reverted easily some day.

@jfeo
Copy link
Contributor Author

jfeo commented Aug 16, 2015

Yes, I think I need to use a more structured approach in the future, instead of haphazardly adding everything and commiting :-P I'll just squash everything then.

@jfeo jfeo mentioned this pull request Aug 16, 2015
@@ -23,7 +23,7 @@ add_sources(libopenage
player.cpp
screenshot.cpp
texture.cpp

minimap.cpp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whtitespace

@boombatower
Copy link
Contributor

Does this predate the python interface and need to be updated for that approach or is this ready to be built on? Debating using this in referencing issue.

@jfeo
Copy link
Contributor Author

jfeo commented Sep 10, 2015

Hey @boombatower. I'm a bit unsure of what you mean by the python interface. I just pulled from master locally, and it works, so there's that :-) In regards to #11, I suppose it would make sense to perhaps use this as a base (perhaps make it more generic?).
Arbitrary sizes are already possible, like this:
2015-09-10-193505_800x600_scrot

@VelorumS VelorumS mentioned this pull request May 28, 2016
@TheJJ TheJJ removed the in progress label Sep 28, 2016
@TheJJ
Copy link
Member

TheJJ commented Jan 30, 2017

Used in #559 and integrated in the qt ui.

@TheJJ TheJJ closed this Jan 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang: c++ Done in C++ code nice new thing ☺ A new feature that was not there before
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement minimap
5 participants