Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit a2b1c17

Browse files
committed
Add missing comments
Minor missed stuff
1 parent 98660f0 commit a2b1c17

File tree

5 files changed

+59
-65
lines changed

5 files changed

+59
-65
lines changed

Managers/FrameMan.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -502,22 +502,22 @@ namespace RTE {
502502

503503
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
504504

505-
void FrameMan::CreateNewPlayerBackBuffer(short player, unsigned short w, unsigned short h) {
505+
void FrameMan::CreateNewNetworkPlayerBackBuffer(short player, unsigned short width, unsigned short height) {
506506
for (unsigned short f = 0; f < 2; f++) {
507507
destroy_bitmap(m_NetworkBackBufferIntermediate8[f][player]);
508-
m_NetworkBackBufferIntermediate8[f][player] = create_bitmap_ex(8, w, h);
508+
m_NetworkBackBufferIntermediate8[f][player] = create_bitmap_ex(8, width, height);
509509

510510
destroy_bitmap(m_NetworkBackBufferIntermediateGUI8[f][player]);
511-
m_NetworkBackBufferIntermediateGUI8[f][player] = create_bitmap_ex(8, w, h);
511+
m_NetworkBackBufferIntermediateGUI8[f][player] = create_bitmap_ex(8, width, height);
512512

513513
destroy_bitmap(m_NetworkBackBufferFinal8[f][player]);
514-
m_NetworkBackBufferFinal8[f][player] = create_bitmap_ex(8, w, h);
514+
m_NetworkBackBufferFinal8[f][player] = create_bitmap_ex(8, width, height);
515515

516516
destroy_bitmap(m_NetworkBackBufferFinalGUI8[f][player]);
517-
m_NetworkBackBufferFinalGUI8[f][player] = create_bitmap_ex(8, w, h);
517+
m_NetworkBackBufferFinalGUI8[f][player] = create_bitmap_ex(8, width, height);
518518
}
519-
m_PlayerScreenWidth = w;
520-
m_PlayerScreenHeight = h;
519+
m_PlayerScreenWidth = width;
520+
m_PlayerScreenHeight = height;
521521
}
522522

523523
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Managers/FrameMan.h

Lines changed: 51 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ namespace RTE {
8888

8989
#pragma region Getters and Setters
9090
/// <summary>
91-
/// Gets the 8bpp back-buffer bitmap.
91+
/// Gets the 8bpp backbuffer bitmap.
9292
/// </summary>
93-
/// <returns>A pointer to the BITMAP 8bpp back-buffer. OWNERSHIP IS NOT TRANSFERRED!</returns>
93+
/// <returns>A pointer to the BITMAP 8bpp backbuffer. OWNERSHIP IS NOT TRANSFERRED!</returns>
9494
BITMAP * GetBackBuffer8() const { return m_BackBuffer8; }
9595

9696
/// <summary>
97-
/// Gets the 32bpp back-buffer bitmap. Make sure you don't do any blending stuff to the 8bpp one!
97+
/// Gets the 32bpp backbuffer bitmap. Make sure you don't do any blending stuff to the 8bpp one!
9898
/// </summary>
99-
/// <returns>A pointer to the BITMAP 32bpp back-buffer. OWNERSHIP IS NOT TRANSFERRED!</returns>
99+
/// <returns>A pointer to the BITMAP 32bpp backbuffer. OWNERSHIP IS NOT TRANSFERRED!</returns>
100100
BITMAP * GetBackBuffer32() const { return m_BackBuffer32; }
101101

102102
/// <summary>
@@ -182,7 +182,7 @@ namespace RTE {
182182
bool IsValidResolution(unsigned short width, unsigned short height) const;
183183

184184
/// <summary>
185-
/// Tells how many times the screen resolution is being multiplied and the back-buffer stretched across for better readability.
185+
/// Tells how many times the screen resolution is being multiplied and the backbuffer stretched across for better readability.
186186
/// </summary>
187187
/// <returns>What multiple the screen resolution is run in (1 normal).</returns>
188188
unsigned short ResolutionMultiplier() const { return m_ResMultiplier; }
@@ -316,7 +316,7 @@ namespace RTE {
316316

317317
#pragma region Drawing
318318
/// <summary>
319-
/// Flips the frame buffers, showing the back-buffer on the current display.
319+
/// Flips the frame buffers, showing the backbuffer on the current display.
320320
/// </summary>
321321
void FlipFrameBuffers();
322322

@@ -378,80 +378,81 @@ namespace RTE {
378378

379379
#pragma region Network Handling
380380
/// <summary>
381-
/// Returns true if this manager is in multiplayer mode, storing the 8bpp back-buffer for network transmission.
381+
/// Returns true if this manager is in multiplayer mode, storing the 8bpp backbuffer for network transmission.
382382
/// </summary>
383383
/// <returns>True if in multiplayer mode.</returns>
384384
bool IsInMultiplayerMode() const { return m_StoreNetworkBackBuffer; }
385385

386386
/// <summary>
387-
/// Sets the multiplayer mode flag, telling the manager to store the 8bpp back-buffer for network transmission.
387+
/// Sets the multiplayer mode flag, telling the manager to store the 8bpp backbuffer for network transmission.
388388
/// </summary>
389389
/// <param name="value">Whether this manager should operate in multiplayer mode.</param>
390390
void SetMultiplayerMode(bool value) { m_StoreNetworkBackBuffer = value; }
391391

392392
/// <summary>
393-
/// Gets the 8bpp back-buffer bitmap used to draw network transmitted image on top of everything.
393+
/// Gets the ready 8bpp backbuffer bitmap used to draw network transmitted image on top of everything.
394394
/// </summary>
395-
/// <param name="player">Which player screen to get back-buffer bitmap from.</param>
396-
/// <returns>A pointer to the 8bpp back-buffer BITMAP. OWNERSHIP IS NOT TRANSFERRED!</returns>
395+
/// <param name="player">Which player screen to get backbuffer bitmap for.</param>
396+
/// <returns>A pointer to the 8bpp backbuffer BITMAP. OWNERSHIP IS NOT TRANSFERRED!</returns>
397397
BITMAP * GetNetworkBackBuffer8Ready(short player) const { return m_NetworkBackBufferFinal8[m_NetworkFrameReady][player]; }
398398

399399
/// <summary>
400-
///
400+
/// Gets the ready 8bpp backbuffer GUI bitmap used to draw network transmitted image on top of everything.
401401
/// </summary>
402-
/// <param name="player">Which player screen to get GUI back-buffer bitmap from.</param>
403-
/// <returns>A pointer to the 8bpp GUI back-buffer BITMAP. OWNERSHIP IS NOT TRANSFERRED!</returns>
402+
/// <param name="player">Which player screen to get GUI backbuffer bitmap for.</param>
403+
/// <returns>A pointer to the 8bpp GUI backbuffer BITMAP. OWNERSHIP IS NOT TRANSFERRED!</returns>
404404
BITMAP * GetNetworkBackBufferGUI8Ready(short player) const { return m_NetworkBackBufferFinalGUI8[m_NetworkFrameReady][player]; }
405405

406406
/// <summary>
407-
///
407+
/// Gets the current 8bpp backbuffer bitmap used to draw network transmitted image on top of everything.
408408
/// </summary>
409-
/// <param name="player"></param>
410-
/// <returns></returns>
409+
/// <param name="player">Which player screen to get backbuffer bitmap for.</param>
410+
/// <returns>A pointer to the 8bpp backbuffer BITMAP. OWNERSHIP IS NOT TRANSFERRED!</returns>
411411
BITMAP * GetNetworkBackBuffer8Current(short player) const { return m_NetworkBackBufferFinal8[m_NetworkFrameCurrent][player]; }
412412

413413
/// <summary>
414-
///
414+
/// Gets the current 8bpp backbuffer GUI bitmap used to draw network transmitted image on top of everything.
415415
/// </summary>
416-
/// <param name="player"></param>
417-
/// <returns></returns>
416+
/// <param name="player">Which player screen to get backbuffer bitmap for.</param>
417+
/// <returns>A pointer to the 8bpp GUI backbuffer BITMAP. OWNERSHIP IS NOT TRANSFERRED!</returns>
418418
BITMAP * GetNetworkBackBufferGUI8Current(short player) const { return m_NetworkBackBufferFinalGUI8[m_NetworkFrameCurrent][player]; }
419419

420420
/// <summary>
421-
/// Gets the 8bpp intermediate bitmap used to send network transmitted image.
421+
/// Gets the ready 8bpp intermediate backbuffer bitmap used to copy network transmitted image to before sending.
422422
/// </summary>
423-
/// <param name="player">Which player screen to get intermediate bitmap from.</param>
423+
/// <param name="player">Which player screen to get intermediate bitmap for.</param>
424424
/// <returns>A pointer to the 8bpp intermediate BITMAP. OWNERSHIP IS NOT TRANSFERRED!</returns>
425425
BITMAP * GetNetworkBackBufferIntermediate8Ready(short player) const { return m_NetworkBackBufferIntermediate8[m_NetworkFrameReady][player]; }
426426

427427
/// <summary>
428-
///
428+
/// Gets the ready 8bpp intermediate backbuffer GUI bitmap used to copy network transmitted image to before sending.
429429
/// </summary>
430-
/// <param name="player">Which player screen to get intermediate GUI bitmap from.</param>
430+
/// <param name="player">Which player screen to get intermediate GUI bitmap for.</param>
431431
/// <returns>A pointer to the 8bpp intermediate GUI BITMAP. OWNERSHIP IS NOT TRANSFERRED!</returns>
432432
BITMAP * GetNetworkBackBufferIntermediate8Current(short player) const { return m_NetworkBackBufferIntermediate8[m_NetworkFrameCurrent][player]; }
433433

434434
/// <summary>
435-
///
435+
/// Gets the current 8bpp intermediate backbuffer bitmap used to copy network transmitted image to before sending.
436436
/// </summary>
437-
/// <param name="player"></param>
438-
/// <returns></returns>
437+
/// <param name="player">Which player screen to get intermediate bitmap for.</param>
438+
/// <returns>A pointer to the 8bpp intermediate BITMAP. OWNERSHIP IS NOT TRANSFERRED!</returns>
439439
BITMAP * GetNetworkBackBufferIntermediateGUI8Ready(short player) const { return m_NetworkBackBufferIntermediateGUI8[m_NetworkFrameReady][player]; }
440440

441441
/// <summary>
442-
///
442+
/// Gets the current 8bpp intermediate backbuffer GUI bitmap used to copy network transmitted image to before sending.
443443
/// </summary>
444-
/// <param name="player"></param>
445-
/// <returns></returns>
444+
/// <param name="player">Which player screen to get intermediate GUI bitmap for.</param>
445+
/// <returns>A pointer to the 8bpp intermediate GUI BITMAP. OWNERSHIP IS NOT TRANSFERRED!</returns>
446446
BITMAP * GetNetworkBackBufferIntermediateGUI8Current(short player) const { return m_NetworkBackBufferIntermediateGUI8[m_NetworkFrameCurrent][player]; }
447447

448448
/// <summary>
449-
///
449+
/// Gets whether the network backbuffers are locked to be updated.
450450
/// </summary>
451-
/// <param name="player"></param>
452-
/// <returns></returns>
451+
/// <param name="player">Which player screen to check for.</param>
452+
/// <returns>Whether the network backbuffers are locked to be updated.</returns>
453453
bool IsNetworkBitmapLocked(short player) const { return m_NetworkBitmapIsLocked[player]; }
454454

455+
// TODO: Figure out.
455456
/// <summary>
456457
///
457458
/// </summary>
@@ -460,30 +461,30 @@ namespace RTE {
460461
Vector GetTargetPos(short screen) const { return m_TargetPos[m_NetworkFrameReady][screen]; }
461462

462463
/// <summary>
463-
///
464+
/// Gets whether we are drawing the contents of the network backbuffers on top of m_BackBuffer8 every frame.
464465
/// </summary>
465-
/// <returns></returns>
466+
/// <returns>Whether we are drawing the contents of the network backbuffers on top of m_BackBuffer8 every frame or not.</returns>
466467
bool GetDrawNetworkBackBuffer() const { return m_DrawNetworkBackBuffer; }
467468

468469
/// <summary>
469-
///
470+
/// Sets whether to draw the contents of the network backbuffers on top of m_BackBuffer8 every frame.
470471
/// </summary>
471-
/// <param name="value"></param>
472+
/// <param name="value">Whether to draw the contents of the network backbuffers on top of m_BackBuffer8 every frame or not.</param>
472473
void SetDrawNetworkBackBuffer(bool value) { m_DrawNetworkBackBuffer = value; }
473474

474475
/// <summary>
475-
///
476+
/// Gets whether we are dumping the contents of the m_BackBuffer8 to the network backbuffers every frame.
476477
/// </summary>
477-
/// <returns></returns>
478+
/// <returns>Whether the contents of the m_BackBuffer8 are being dumped to the network backbuffers every frame.</returns>
478479
bool GetStoreNetworkBackBuffer() const { return m_StoreNetworkBackBuffer; }
479480

480481
/// <summary>
481-
///
482+
/// Creates a new set of network backbuffers for the specified player.
482483
/// </summary>
483-
/// <param name="player"></param>
484-
/// <param name="w"></param>
485-
/// <param name="h"></param>
486-
void CreateNewPlayerBackBuffer(short player, unsigned short w, unsigned short h);
484+
/// <param name="player">Player to create new backbuffer for.</param>
485+
/// <param name="width">Width of new backbuffer.</param>
486+
/// <param name="height">Height of new backbuffer</param>
487+
void CreateNewNetworkPlayerBackBuffer(short player, unsigned short width, unsigned short height);
487488
#pragma endregion
488489

489490
#pragma region Palette Routines
@@ -523,7 +524,7 @@ namespace RTE {
523524
int SaveBitmapToBMP(BITMAP *bitmap, const char *nameBase) { return SaveBitmap(SingleBitmap, nameBase, bitmap); }
524525

525526
/// <summary>
526-
/// Dumps a bitmap of the screen back-buffer to a 8bpp BMP file.
527+
/// Dumps a bitmap of the screen backbuffer to a 8bpp BMP file.
527528
/// </summary>
528529
/// <param name="nameBase">The filename of the file to save to, WITHOUT EXTENSION.</param>
529530
/// <returns>0 for success, anything below 0 is a sign of failure.</returns>
@@ -604,8 +605,8 @@ namespace RTE {
604605
bool m_FlashedLastFrame[c_MaxScreenCount]; //!< Whether we flashed last frame or not.
605606
Timer m_FlashTimer[c_MaxScreenCount]; //!< Flash screen timer.
606607

607-
BITMAP *m_BackBuffer8; //!< Screen back-buffer, always 8bpp, gets copied to the 32bpp buffer for post-processing.
608-
BITMAP *m_BackBuffer32; //!< 32bpp back-buffer, only used for post-processing.
608+
BITMAP *m_BackBuffer8; //!< Screen backbuffer, always 8bpp, gets copied to the 32bpp buffer for post-processing.
609+
BITMAP *m_BackBuffer32; //!< 32bpp backbuffer, only used for post-processing.
609610
BITMAP *m_ScreenDumpBuffer; //!< Temporary buffer for making quick screencaps.
610611
BITMAP *m_WorldDumpBuffer; //!< Temporary buffer for making whole scene screencaps.
611612

@@ -616,13 +617,13 @@ namespace RTE {
616617

617618
Vector m_TargetPos[2][c_MaxScreenCount]; //!< Frame target position for network players.
618619

619-
bool m_DrawNetworkBackBuffer; //!< If true, draws the contents of the m_NetworkBackBuffer8 on top of m_BackBuffer8 every frame in FrameMan.Draw.
620-
bool m_StoreNetworkBackBuffer; //!< If true, dumps the contents of the m_BackBuffer8 to the m_NetworkBackBuffer8 every frame.
620+
bool m_StoreNetworkBackBuffer; //!< If true, dumps the contents of the m_BackBuffer8 to the network backbuffers every frame.
621+
bool m_DrawNetworkBackBuffer; //!< If true, draws the contents of the network backbuffers on top of m_BackBuffer8 every frame in FrameMan.Draw.
621622

622623
unsigned short m_NetworkFrameCurrent; //!< Which frame index is being rendered, 0 or 1.
623624
unsigned short m_NetworkFrameReady; //!< Which frame is rendered and ready for transmission, 0 or 1.
624625

625-
bool m_NetworkBitmapIsLocked[c_MaxScreenCount]; //!< If true then the network bitmap is being updated.
626+
bool m_NetworkBitmapIsLocked[c_MaxScreenCount]; //!< If true then the network bitmap is being updated (Pseudo mutex lock/unlock).
626627
// TODO: Test if this destroys the whole multiplayer and use instead of the one above if it doesn't.
627628
//std::mutex m_NetworkBitmapIsLocked[c_MaxScreenCount];
628629

Managers/NetworkServer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1855,7 +1855,7 @@ namespace RTE
18551855
m_ClientConnections[index].ResY = m->ResolutionY;
18561856
m_ClientConnections[index].IsActive = true;
18571857
m_ClientConnections[index].PlayerName = m->Name;
1858-
g_FrameMan.CreateNewPlayerBackBuffer(index, m->ResolutionX, m->ResolutionY);
1858+
g_FrameMan.CreateNewNetworkPlayerBackBuffer(index, m->ResolutionX, m->ResolutionY);
18591859

18601860
m_Server->SetTimeoutTime(5000, m_ClientConnections[index].ClientId);
18611861

Managers/SettingsMan.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ void SettingsMan::Clear()
5050
m_EndlessMode = false;
5151
m_PrintDebugInfo = false;
5252
m_PreciseCollisions = true;
53-
m_ForceSafeGfxDriver = false;
54-
m_ForceSoftwareGfxDriver = false;
55-
m_ForceSafeGfxDriver = false;
5653
m_ForceVirtualFullScreenGfxDriver = false;
5754
m_ForceOverlayedWindowGfxDriver = false;
5855
m_ForceNonOverlayedWindowGfxDriver = false;

Managers/SettingsMan.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -584,10 +584,6 @@ class SettingsMan:
584584
//Whether CC uses additional Draws during MO's PreTravel and PostTravel to
585585
//update MO layer this frame with more precision(true), or it just uses data from the last frame with less precision(false)
586586
bool m_PreciseCollisions;
587-
// Whether we should try using software-mode drivers
588-
bool m_ForceSoftwareGfxDriver;
589-
// Whether we should try using safe-mode drivers
590-
bool m_ForceSafeGfxDriver;
591587
// Whether we should try using fullscreen mode
592588
bool m_ForceVirtualFullScreenGfxDriver;
593589
// Whether we should try using overlayed window driver

0 commit comments

Comments
 (0)