aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/cruise/function.cpp2
-rw-r--r--engines/cruise/gfxModule.cpp15
-rw-r--r--engines/cruise/gfxModule.h3
3 files changed, 11 insertions, 9 deletions
diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp
index a17786d417..ee22669b08 100644
--- a/engines/cruise/function.cpp
+++ b/engines/cruise/function.cpp
@@ -915,7 +915,7 @@ int16 Op_SetColor(void) {
}
}
- gfxModuleData_setPal256(workpal);
+ gfxModuleData_setPalEntries(workpal, 0, 32);
return 0;
}
diff --git a/engines/cruise/gfxModule.cpp b/engines/cruise/gfxModule.cpp
index f3700253d3..490e208c1e 100644
--- a/engines/cruise/gfxModule.cpp
+++ b/engines/cruise/gfxModule.cpp
@@ -117,13 +117,10 @@ void gfxModuleData_setPalColor(int idx, int r, int g, int b) {
gfxModuleData_setDirtyColors(idx, idx);
}
-void gfxModuleData_setPal256(uint8 *ptr) {
- int R;
- int G;
- int B;
- int i;
+void gfxModuleData_setPalEntries(const byte *ptr, int start, int num) {
+ int R, G, B, i;
- for (i = 0; i < 256; i++) {
+ for (i = start; i < start + num; i++) {
R = *(ptr++);
G = *(ptr++);
B = *(ptr++);
@@ -134,7 +131,11 @@ void gfxModuleData_setPal256(uint8 *ptr) {
lpalette[i].A = 255;
}
- gfxModuleData_setDirtyColors(0, 255);
+ gfxModuleData_setDirtyColors(start, start + num - 1);
+}
+
+void gfxModuleData_setPal256(const byte *ptr) {
+ gfxModuleData_setPalEntries(ptr, 0, 256);
}
/*void gfxModuleData_setPal(uint8 *ptr) {
diff --git a/engines/cruise/gfxModule.h b/engines/cruise/gfxModule.h
index d71029455b..4b06e62991 100644
--- a/engines/cruise/gfxModule.h
+++ b/engines/cruise/gfxModule.h
@@ -59,7 +59,8 @@ void convertGfxFromMode5(const uint8 *sourcePtr, int width, int height, uint8 *d
void gfxModuleData_flipScreen(void);
//void gfxModuleData_setPal(uint8 * ptr);
void gfxModuleData_convertOldPalColor(uint16 oldColor, uint8 *pOutput);
-void gfxModuleData_setPal256(uint8 *ptr);
+void gfxModuleData_setPalEntries(const byte *ptr, int start, int num);
+void gfxModuleData_setPal256(const byte *ptr);
void flip(void);
void drawSolidBox(int32 x1, int32 y1, int32 x2, int32 y2, uint8 colour);
void resetBitmap(uint8 *dataPtr, int32 dataSize);