Skip to content

Commit 8449c6d

Browse files
committed
Merge branch 'fix/texunit_binding' into feature/apply_effect
2 parents 61d409b + 03c1592 commit 8449c6d

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Goals
5353
-----
5454

5555
* Fully authentic look and feel
56-
* This can only be approximated, since the behaviour of the original game is mostly undocumented,
56+
* This can only be approximated since the behavior of the original game is mostly undocumented,
5757
and guessing/experimenting can only get you this close
5858
* We will not implement useless artificial limitations (max 30 selectable units...)
5959
* An easily-moddable content format: [**nyan** yet another notation](https://github.com/SFTtech/nyan)
@@ -79,7 +79,7 @@ Current State of the Project
7979

8080
**Important notice**: At the moment, "gameplay" is basically non-functional.
8181
We're implementing the internal game simulation (how units even do anything) with simplicity and extensibility in mind, so we had to get rid of the temporary (but kind of working) previous version.
82-
With these changes we can (finally) actually make use of our converted asset packs and our nyan API!
82+
With these changes, we can (finally) actually make use of our converted asset packs and our nyan API!
8383
We're working day and night to make gameplay return\*.
8484
If you're interested, we wrote detailed explanations on our blog: [Part 1](https://blog.openage.dev/new-gamestate-2020.html), [Part 2](https://blog.openage.dev/engine-core-modules.html), [Monthly Devlog](https://blog.openage.dev/tag/news.html).
8585

@@ -99,16 +99,16 @@ If you're interested, we wrote detailed explanations on our blog: [Part 1](https
9999
Installation Packages
100100
---------------------
101101

102-
There's many missing parts for an actually working game.
102+
There are many missing parts for an actually working game.
103103
So if you "just wanna play", [you'll be disappointed](#current-state-of-the-project), unfortunately.
104104

105-
We strongly recommend to build the program from source to get the latest, greatest and shiniest project state :)
105+
We strongly recommend building the program from source to get the latest, greatest, and shiniest project state :)
106106

107107

108-
* For **Linux** check at [repology](https://repology.org/project/openage/versions) if your distribution has any packages available. Otherwise you need to build from source.
108+
* For **Linux** check at [repology](https://repology.org/project/openage/versions) if your distribution has any packages available. Otherwise, you need to build from source.
109109
We don't release `*.deb`, `*.rpm`, Flatpak, snap or AppImage packages yet.
110110
* For **Windows** check our [release page](https://github.com/SFTtech/openage/releases) for the latest installer.
111-
Otherwise, you need to build from source.
111+
Otherwise, you need to build from the source.
112112

113113
* For **macOS** we currently don't have any packages, you need to build from source.
114114

@@ -152,15 +152,15 @@ Contributing
152152
You might ask yourself now "Sounds cool, but how do I participate
153153
and ~~get famous~~ contribute useful features?".
154154

155-
Fortunately for you, there is a lot to do and we are very grateful for help.
155+
Fortunately for you, there is a lot to do and we are very grateful for your help.
156156

157157
## Where do I start?
158158

159159
* **Check the issues** [labelled with `good first issue`](https://github.com/SFTtech/openage/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22). These are tasks that you can start right away and don't require much previous knowledge.
160160
* **Ask us** in the [chat](https://matrix.to/#/#sfttech:matrix.org). Someone there could need
161161
help with something.
162162
* You can also **take the initiative** and fix a bug you found, create an issue for discussion or
163-
implement a feature that we never though of, but always wanted.
163+
implement a feature that we never thought of, but always wanted.
164164

165165

166166
## Ok, I found something. What now?
@@ -176,7 +176,7 @@ Fortunately for you, there is a lot to do and we are very grateful for help.
176176
## How do I contribute my features/changes?
177177

178178
* Read the **[contributing guide](/doc/contributing.md)**.
179-
* You can upload work in progress (WIP) versions or drafts of your contribution to get feedback or support.
179+
* You can upload work-in-progress (WIP) versions or drafts of your contribution to get feedback or support.
180180
* Tell us (again) when you want us to review your work.
181181

182182
## I want to help, but I'm not a programmer...

libopenage/renderer/opengl/shader_program.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,11 @@ void GlShaderProgram::update_uniforms(std::shared_ptr<GlUniformInput> const &uni
424424
glBindTexture(GL_TEXTURE_2D, tex);
425425
// TODO: maybe call this at a more appropriate position
426426
glUniform1i(loc, tex_unit_id);
427-
auto &tex_value = *this->textures_per_texunits[tex_unit_id];
428-
tex_value = tex;
427+
ENSURE(tex_unit_id < this->textures_per_texunits.size(),
428+
"Tried to assign texture to non-existant texture unit at index "
429+
<< tex_unit_id
430+
<< " (max: " << this->textures_per_texunits.size() << ").");
431+
this->textures_per_texunits[tex_unit_id] = tex;
429432
break;
430433
}
431434
default:

libopenage/renderer/opengl/shader_program.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ class GlShaderProgram final : public ShaderProgram
195195
std::unordered_map<std::string, GlVertexAttrib> attribs;
196196

197197
/// Store which texture handles are currently bound to the shader's texture units.
198+
/// A value of std::nullopt means the texture unit is unbound (no texture assigned).
198199
std::vector<std::optional<GLuint>> textures_per_texunits;
199200

200201
/// Whether this program has been validated.

0 commit comments

Comments
 (0)