[Scummvm-git-logs] scummvm master -> 99f91430d30a2f8fec9df197bf9f96146213cb2f
aquadran
aquadran at gmail.com
Sun Mar 14 12:52:45 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
99f91430d3 ICB: Remove global constructors
Commit: 99f91430d30a2f8fec9df197bf9f96146213cb2f
https://github.com/scummvm/scummvm/commit/99f91430d30a2f8fec9df197bf9f96146213cb2f
Author: PaweÅ KoÅodziejski (aquadran at gmail.com)
Date: 2021-03-14T13:52:41+01:00
Commit Message:
ICB: Remove global constructors
Changed paths:
engines/icb/gfx/gfxstub_rev.cpp
engines/icb/stage_draw.h
engines/icb/stagedraw_pc_poly.cpp
diff --git a/engines/icb/gfx/gfxstub_rev.cpp b/engines/icb/gfx/gfxstub_rev.cpp
index f920690e8f..b02ee2e711 100644
--- a/engines/icb/gfx/gfxstub_rev.cpp
+++ b/engines/icb/gfx/gfxstub_rev.cpp
@@ -30,6 +30,7 @@
#include "engines/icb/gfx/gfxstub.h"
#include "engines/icb/gfx/gfxstub_dutch.h"
#include "engines/icb/gfx/gfxstub_rev_dutch.h"
+#include "engines/icb/p4_generic_pc.h"
namespace ICB {
@@ -43,16 +44,18 @@ uint8 pcRGBA[TEMP_TEXTURE_WIDTH * TEMP_TEXTURE_HEIGHT * BYTES_PER_COLOUR];
int32 bpp = 0;
+#define RGBBytesPerPixel 4 // 32 bit
+#define RGBWidth SCREEN_WIDTH // width
+#define RGBHeight SCREEN_DEPTH // height
+#define RGBPitch (RGBWidth * RGBBytesPerPixel) // pitch
+#define ZPitch (ZBytesPerPixel * SCREEN_WIDTH) // z-pitch
+#define ZBytesPerPixel 2 // 16bit z-buffer
+
// The big screen bitmap to draw everything into
extern char *pRGB;
-extern int32 RGBWidth;
-extern int32 RGBHeight;
-extern int32 RGBPitch;
-extern int32 RGBBytesPerPixel;
+
// The z buffer bitmap
extern char *pZ;
-extern int32 ZPitch;
-extern int32 ZBytesPerPixel;
#define MAX_POLYGON_VERTS 8
vertex2D verts[8];
diff --git a/engines/icb/stage_draw.h b/engines/icb/stage_draw.h
index 4f336f1963..b9bccb3287 100644
--- a/engines/icb/stage_draw.h
+++ b/engines/icb/stage_draw.h
@@ -32,6 +32,13 @@
namespace ICB {
+#define RGBBytesPerPixel 4 // 32 bit
+#define RGBWidth SCREEN_WIDTH // width
+#define RGBHeight SCREEN_DEPTH // height
+#define RGBPitch (RGBWidth * RGBBytesPerPixel) // pitch
+#define ZPitch (ZBytesPerPixel * SCREEN_WIDTH) // z-pitch
+#define ZBytesPerPixel 2 // 16bit z-buffer
+
#define MAXIMUM_POTENTIAL_ON_SCREEN_ACTOR_QUANTITY 32
#define ACTOR_SHADE_LIMIT 0.3f
diff --git a/engines/icb/stagedraw_pc_poly.cpp b/engines/icb/stagedraw_pc_poly.cpp
index af6de61e09..0d047d4273 100644
--- a/engines/icb/stagedraw_pc_poly.cpp
+++ b/engines/icb/stagedraw_pc_poly.cpp
@@ -71,13 +71,14 @@ typedef struct {
#define ACTORSORTBUFFERSIZE (256 * 1024)
#define MAXACTORQTY MAXIMUM_POTENTIAL_ON_SCREEN_ACTOR_QUANTITY
+#define RGBBytesPerPixel 4 // 32 bit
+#define RGBWidth SCREEN_WIDTH // width
+#define RGBHeight SCREEN_DEPTH // height
+#define RGBPitch (RGBWidth * RGBBytesPerPixel) // pitch
+#define ZPitch (ZBytesPerPixel * SCREEN_WIDTH) // z-pitch
+#define ZBytesPerPixel 2 // 16bit z-buffer
+
RevRenderDevice revRen;
-int32 RGBWidth = SCREEN_WIDTH; // width
-int32 RGBHeight = SCREEN_DEPTH; // height
-int32 RGBBytesPerPixel = 4; // 32 bit
-int32 RGBPitch = RGBWidth * RGBBytesPerPixel; // pitch
-int32 ZBytesPerPixel = 2; // 16bit z-buffer
-int32 ZPitch = ZBytesPerPixel * SCREEN_WIDTH; // z-pitch
char *pActorBuffer = NULL; // buffer for drawing actors
char *pRGB = NULL; // buffer for RGB data
char *pZa = NULL; // buffer for actor z data
@@ -692,8 +693,6 @@ void StageDrawPoly(SDactor *actors, uint32 actorQty) {
uint16 *zActor = (uint16 *)pZa;
screenShakeOffset += ((GetShakeY() * pitch >> 2) + GetShakeX());
- RGBPitch = RGBWidth * RGBBytesPerPixel;
-
{
/*try*/ {
// Fill in the table of used tiles
More information about the Scummvm-git-logs
mailing list