Skip to content

Commit 421f59a

Browse files
committed
Bunch of minor fixes.
Stuff I noticed while revising the print edition.
1 parent 20f7dac commit 421f59a

32 files changed

+134
-126
lines changed

book/architecture-performance-and-games.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ extensibility should be engineered in so future changes are easier to make.
186186

187187
People get really excited about this. They envision future developers (or just
188188
their future self) stepping into the codebase and finding it open-ended,
189-
powerful, and just beckoning to be extended. They imagine the One Game Engine To
189+
powerful, and just beckoning to be extended. They imagine The One Game Engine To
190190
Rule Them All.
191191

192192
But this is where it starts to get tricky. Whenever you add a layer of

book/bytecode.markdown

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,8 @@ We define another instruction type for a number literal like so:
498498
<aside name="single">
499499

500500
Here, I'm reading a single byte for the value to avoid the fiddly code
501-
required to decode a multiple-byte integer, but in a real implementation, you'd
502-
want to be able to have literals that cover your full numeric range.
501+
required to decode a multiple-byte integer, but in a real implementation, you'll
502+
want to support literals that cover your full numeric range.
503503

504504
</aside>
505505

@@ -710,7 +710,7 @@ kind of behavior you want them to create.
710710

711711
<aside name="text">
712712

713-
The scripting system I wrote for [Henry Hatsworth and the Puzzling
713+
The scripting system I wrote for [Henry Hatsworth in the Puzzling
714714
Adventure][hatsworth] worked like this.
715715

716716
[hatsworth]: http://en.wikipedia.org/wiki/Henry_Hatsworth_in_the_Puzzling_Adventure

book/data-locality.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ the CPU busy, instructions are *pipelined* so that the subsequent instructions
516516
start processing before the first one finishes.
517517

518518
To do that, the CPU has to guess which instructions it will be executing next.
519-
In straight line code, that's easy, but with flow control, it's harder. While
519+
In straight line code, that's easy, but with control flow, it's harder. While
520520
it's executing the instructions for that `if`, does it guess that the particle
521521
is active and start executing the code for the `update()` call, or does it guess
522522
that it isn't?

book/double-buffer.markdown

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ isn't being accessed during modification.
226226
## Sample Code
227227

228228
Now that we've got the theory, let's see how it works in practice. We'll write a
229-
very bare-bones graphics system that lets us draw pixels on a frame buffer. In
229+
very bare-bones graphics system that lets us draw pixels on a framebuffer. In
230230
most consoles and PCs, the video driver provides this low-level part of the
231231
graphics system, but implementing it by hand here will let us see what's going on.
232232
First up is the buffer itself:
@@ -427,12 +427,11 @@ small change in `Stage`:
427427
^code 12
428428

429429
The `update()` function now updates all of the actors and *then* swaps
430-
all of their states.
431-
432-
The end result of this is that an actor will only see a slap in the
433-
frame *after* it was actually slapped. This way, the actors will behave the
434-
same no matter their order in the stage's array. As far as the user or any
435-
outside code can tell, all of the actors update simultaneously within a frame.
430+
all of their states. The end result of this is that an actor will only see a
431+
slap in the frame *after* it was actually slapped. This way, the actors will
432+
behave the same no matter their order in the stage's array. As far as the user
433+
or any outside code can tell, all of the actors update simultaneously within a
434+
frame.
436435

437436
## Design Decisions
438437

@@ -560,4 +559,4 @@ index.
560559
* <p>You can find the Double Buffer pattern in use in almost every graphics
561560
API out there. For example, OpenGL has `swapBuffers()`, Direct3D has "swap
562561
chains", and Microsoft's XNA framework swaps the framebuffers within its
563-
`endDraw()` function.</p>
562+
`endDraw()` method.</p>

book/event-queue.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ class="pattern">Update Method</a> pattern.
395395

396396
Now, we need to call that from somewhere convenient. What "convenient" means
397397
depends on your game. It may mean calling it from the main <a
398-
href="game-loop.html" class="pattern">Game Loop</a> or from a dedicated audio
398+
href="game-loop.html" class="pattern">game loop</a> or from a dedicated audio
399399
thread.
400400

401401
This works fine, but it does presume we can process *every* sound request in a

book/flyweight.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ maintainable style.
323323
href="http://en.wikipedia.org/wiki/Factory_method_pattern" class="gof-
324324
pattern">Factory Method</a> pattern.
325325

326-
In order to return a previously created flyweight, you'll have to keep track
326+
* In order to return a previously created flyweight, you'll have to keep track
327327
of the pool of ones that you've already instantiated. As the name implies,
328328
that means that an <a href="object-pool.html" class="pattern">Object
329329
Pool</a> might be a helpful place to store them.

book/object-pool.markdown

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,9 @@ particle class:
247247
^code 1
248248

249249
The default constructor initializes the particle to "not in use". A later call
250-
to `init()` initializes the particle to a live state.
251-
252-
Particles are animated over time using the unsurprisingly named `animate()`
253-
function, which should be called once per frame.
250+
to `init()` initializes the particle to a live state. Particles are animated
251+
over time using the unsurprisingly named `animate()` function, which should be
252+
called once per frame.
254253

255254
The pool needs to know which particles are available for reuse. It gets this
256255
from the particle's `inUse()` function. This function takes advantage of the fact that

book/singleton.markdown

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ other ways our codebase can get access to an object:
493493

494494
^code 11
495495

496-
With this, only `World` is globally available. Functions can get to the
496+
With this, only `Game` is globally available. Functions can get to the
497497
other systems <span name="demeter">through</span> it:
498498

499499
^code 12
@@ -505,20 +505,20 @@ other ways our codebase can get access to an object:
505505

506506
</aside>
507507

508-
If, later, the architecture is changed to support multiple `World` instances
508+
If, later, the architecture is changed to support multiple `Game` instances
509509
(perhaps for streaming or testing purposes), `Log`, `FileSystem`, and
510510
`AudioPlayer` are all unaffected -- they won't even know the difference. The
511-
downside with this, of course, is that more code ends up coupled to `World`
511+
downside with this, of course, is that more code ends up coupled to `Game`
512512
itself. If a class just needs to play sound, our example still requires it
513513
to know about the world in order to get to the audio player.
514514

515-
We solve this with a hybrid solution. Code that already knows about World
515+
We solve this with a hybrid solution. Code that already knows about `Game`
516516
can simply access `AudioPlayer` directly from it. For code that doesn't, we
517517
provide access to `AudioPlayer` using one of the other options described
518518
here.
519519

520520
* **Get it from a Service Locator.** So far, we're assuming the global class
521-
is some regular concrete class like `World`. Another option is to define a
521+
is some regular concrete class like `Game`. Another option is to define a
522522
class whose sole reason for being is to give global access to objects. This
523523
common pattern is called a <a class="pattern"
524524
href="service-locator.html">Service Locator</a> and gets its own chapter.

book/spatial-partition.markdown

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,9 @@ rows out.
362362
There's a relatively short list of well-defined spatial partitioning data
363363
structures, and one option would be to go through them one at a time here.
364364
Instead, I tried to organize this by their essential characteristics. My hope is
365-
that once you do learn about quadtrees and BSPs and the like, this will help you
366-
understand *how* and *why* they work and why you might choose one over the
367-
other.
365+
that once you do learn about quadtrees and binary space partitions (BSPs) and
366+
the like, this will help you understand *how* and *why* they work and why you
367+
might choose one over the other.
368368

369369
### Is the partition hierarchical or flat?
370370

book/subclass-sandbox.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,8 @@ particle system object, how would it get one?
459459
in the state that the base class needs before it needs it. That places the
460460
burden of initialization on the surrounding code. Another option is to let
461461
the base class handle it by pulling in the state it needs. One way to do
462-
that is by using a <a class="pattern" href="service-locator.html">Service
463-
Locator</a>:
462+
that is by using the <a class="pattern" href="service-locator.html">Service
463+
Locator</a> pattern:
464464

465465
^code 12
466466

0 commit comments

Comments
 (0)