Question: I need help with the error im getting. #include RasterSurface.h #include RasterSurface.cpp #include XTime.h #include XTime.cpp #include tiles _ 1 2

I need help with the error im getting.
#include "RasterSurface.h"
#include "RasterSurface.cpp"
#include "XTime.h"
#include "XTime.cpp"
#include "tiles_12.h"
#include
bool RS_Initialize(const char*_studentName, unsigned int _width, unsigned int _height);
bool RS_Update(const unsigned int*_xrgbPixels, const unsigned int _numPixels);
bool RS_Shutdown(void);
void ClearBuffer(std::vector& buffer, unsigned int color){
std::fill(buffer.begin(), buffer.end(), color);
}
unsigned int Convert2DTo1D(unsigned int x, unsigned int y, unsigned int width){
return y * width + x;
}
void DrawPixel(std::vector& buffer, unsigned int x, unsigned int y, unsigned int width, unsigned int color){
buffer[Convert2DTo1D(x, y, width)]= color;
}
void Blit(std::vector& buffer, unsigned int width, unsigned int* image, unsigned int imgWidth, unsigned int imgHeight, unsigned int startX, unsigned int startY){
for (unsigned int y =0; y < imgHeight; ++y){
for (unsigned int x =0; x < imgWidth; ++x){
buffer[Convert2DTo1D(startX + x, startY + y, width)]= image[Convert2DTo1D(x, y, imgWidth)];
}
}
}
int main(){
const char* studentName = "Your Name";
unsigned int width =500;
unsigned int height =500;
if (!RS_Initialize(studentName, width, height)){
return -1;
}
std::vector pixel_buffer(width * height, 0xFFFFFFFF); // Initialize with white color
while (RS_Update(pixel_buffer.data(), pixel_buffer.size())){
ClearBuffer(pixel_buffer, 0xFF000000); // Clear to black
//Draw a pixel at (250,250)
DrawPixel(pixel_buffer, 250,250, width, 0xFFFF0000);
Blit(pixel_buffer, width, tiles_12_pixels, tiles_12_width, tiles_12_height, 100,100);
}
RS_Shutdown();
return 0;
}
and the error is with the tiles_12_pixel and the error message says "argument of type "const unsigned int*" is incompatiable with parameter of type unsigned int*". it is error code E0167.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!