-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[WIP] Minimap #344
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
Changes from all commits
bc9ee7a
da8a881
def5c6e
0035e8f
c037977
f3052a5
7495853
7004b17
a95df25
d698861
c932095
18e35fa
55125a9
62f836a
08df097
9037b68
aa3327b
3254c2c
c330a51
e622e2f
b7742d0
cc167c5
e933bee
480ce4f
035c6fd
c6a2e1d
d7fd202
ebcfcb3
b8c45b1
99fa15f
8638374
8e68e38
64b3d2b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| #version 120 | ||
|
|
||
| uniform ivec2 minimap_orig; | ||
| uniform ivec2 minimap_size; | ||
|
|
||
| varying vec4 out_vertex_position; | ||
| varying vec3 out_color; | ||
|
|
||
| void main(void) { | ||
| ivec2 center = ivec2(minimap_size.x/2, minimap_size.y/2); | ||
| ivec2 vpos = minimap_orig + center - ivec2(out_vertex_position.x, out_vertex_position.y); | ||
| vec3 color; | ||
|
|
||
| if (!(abs(vpos.x) * center.y + abs(vpos.y) * center.x <= center.x * center.y)) | ||
| discard; | ||
| else | ||
| color = out_color; | ||
|
|
||
| gl_FragColor = vec4(color, 1.0); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #version 120 | ||
|
|
||
| attribute vec4 vertex_position; | ||
| attribute vec3 color; | ||
|
|
||
| varying vec4 out_vertex_position; | ||
| varying vec3 out_color; | ||
|
|
||
| void main() { | ||
| out_vertex_position = vertex_position; | ||
| out_color = color; | ||
| gl_Position = gl_ModelViewProjectionMatrix * vertex_position; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hihi whitespace, tab indent pls |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,7 @@ add_sources(libopenage | |
| player.cpp | ||
| screenshot.cpp | ||
| texture.cpp | ||
|
|
||
| minimap.cpp | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. whtitespace |
||
| config.cpp | ||
| ) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -328,6 +328,9 @@ void GameSpec::load_terrain(AssetManager &am) { | |
| terrain_data.blending_masks.reserve(terrain_data.blendmode_count); | ||
| terrain_data.terrain_id_priority_map = std::make_unique<int[]>(terrain_data.terrain_id_count); | ||
| terrain_data.terrain_id_blendmode_map = std::make_unique<int[]>(terrain_data.terrain_id_count); | ||
| terrain_data.terrain_id_map_color_hi_map = std::make_unique<uint8_t[]>(terrain_data.terrain_id_count); | ||
| terrain_data.terrain_id_map_color_med_map = std::make_unique<uint8_t[]>(terrain_data.terrain_id_count); | ||
| terrain_data.terrain_id_map_color_low_map = std::make_unique<uint8_t[]>(terrain_data.terrain_id_count); | ||
| terrain_data.influences_buf = std::make_unique<struct influence[]>(terrain_data.terrain_id_count); | ||
|
|
||
|
|
||
|
|
@@ -345,6 +348,9 @@ void GameSpec::load_terrain(AssetManager &am) { | |
| // TODO: terrain double-define check? | ||
| terrain_data.terrain_id_priority_map[terrain_id] = line->blend_priority; | ||
| terrain_data.terrain_id_blendmode_map[terrain_id] = line->blend_mode; | ||
| terrain_data.terrain_id_map_color_hi_map[terrain_id] = line->map_color_hi; | ||
| terrain_data.terrain_id_map_color_med_map[terrain_id] = line->map_color_med; | ||
| terrain_data.terrain_id_map_color_low_map[terrain_id] = line->map_color_low; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. whitespace |
||
|
|
||
| // TODO: remove hardcoding and rely on nyan data | ||
| auto terraintex_filename = util::sformat("%s/%d.slp.png", this->terrain_path.c_str(), line->slp_id); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tab indent pls.