I'm basically taking a rectangle sample from a surface and applying it to the screen surface then applying anohter surface ontop of that which has the picture then on top of that a border image that depends on if its selected or not if so its blue if not irs grey
however it is not working for some reason the overlay borders graduly multiply each update till the semi transparent pixels are completley opaque
heres my source code for this
CODE
intMenuPagePrev = intMenuPage;
int intMultiplyer = 9 * intMenuPage;
int intIncCol = 0;
int intIncRow = 0;
int intIncCounter = 0;
int intOverlayDifferenceW = surfaceChannelSelection->w - vecChannelImageCache[0]->w;
int intOverlayDifferenceH = surfaceChannelSelection->h - vecChannelImageCache[0]->h;
//Apply Channels
for(int i = 0; i < 9; i++) {
//The Portions Of The Sprite Map To Be Blitted
SDL_Rect rectBackgroundSample;
//Clip Range For The Top Left
rectBackgroundSample.x = intCoordCol[intIncCol] - (intOverlayDifferenceW / 2);
rectBackgroundSample.y = intCoordRow[intIncRow] - (intOverlayDifferenceH / 2);
rectBackgroundSample.w = surfaceChannelSelection->w;
rectBackgroundSample.h = surfaceChannelSelection->h;
applySurface(intCoordCol[intIncCol] - (intOverlayDifferenceW / 2), intCoordRow[intIncRow] - (intOverlayDifferenceH / 2), surfaceBackground, surfaceMenuScreen, &rectBackgroundSample);
cout << vecChannelImageCache.size() << endl;
cout << intMenuPage << endl;
applySurface(intCoordCol[intIncCol], intCoordRow[intIncRow], vecChannelImageCache[i + intMultiplyer], surfaceMenuScreen);
//Apply Selection Overlay
if ((i + intMultiplyer) == intCurrentChannel) {
applySurface(intCoordCol[intIncCol], intCoordRow[intIncRow], surfaceChannelSelection, surfaceMenuScreen);
}
else {
applySurface(intCoordCol[intIncCol], intCoordRow[intIncRow], surfaceChannelInactive, surfaceMenuScreen);
}
SDL_UpdateRect(surfaceMenuScreen, intCoordCol[intIncCol] - 1, intCoordRow[intIncRow] - 1, surfaceChannelSelection->w + 2, surfaceChannelSelection->h + 2);
//Calculate Which Row To Use
if (intIncCounter > 1) {
intIncCounter = 0;
++intIncRow;
}
else {
++intIncCounter;
}
//Calculate Which Column To Use
if (intIncCol > 1) {
intIncCol = 0;
}
else {
++intIncCol;
}
}
and here is a screen shot of what is happening top half is what it should look like and is what it looks like when it starts the bottom half is the result of the overlays not being overlayed (and i know the background is being sampled and placed on the surface every time because ive tested it with a background image) and it also happens if i update the entire screen or flip the entire screen
however it is not working for some reason the overlay borders graduly multiply each update till the semi transparent pixels are completley opaque
heres my source code for this
CODE
intMenuPagePrev = intMenuPage;
int intMultiplyer = 9 * intMenuPage;
int intIncCol = 0;
int intIncRow = 0;
int intIncCounter = 0;
int intOverlayDifferenceW = surfaceChannelSelection->w - vecChannelImageCache[0]->w;
int intOverlayDifferenceH = surfaceChannelSelection->h - vecChannelImageCache[0]->h;
//Apply Channels
for(int i = 0; i < 9; i++) {
//The Portions Of The Sprite Map To Be Blitted
SDL_Rect rectBackgroundSample;
//Clip Range For The Top Left
rectBackgroundSample.x = intCoordCol[intIncCol] - (intOverlayDifferenceW / 2);
rectBackgroundSample.y = intCoordRow[intIncRow] - (intOverlayDifferenceH / 2);
rectBackgroundSample.w = surfaceChannelSelection->w;
rectBackgroundSample.h = surfaceChannelSelection->h;
applySurface(intCoordCol[intIncCol] - (intOverlayDifferenceW / 2), intCoordRow[intIncRow] - (intOverlayDifferenceH / 2), surfaceBackground, surfaceMenuScreen, &rectBackgroundSample);
cout << vecChannelImageCache.size() << endl;
cout << intMenuPage << endl;
applySurface(intCoordCol[intIncCol], intCoordRow[intIncRow], vecChannelImageCache[i + intMultiplyer], surfaceMenuScreen);
//Apply Selection Overlay
if ((i + intMultiplyer) == intCurrentChannel) {
applySurface(intCoordCol[intIncCol], intCoordRow[intIncRow], surfaceChannelSelection, surfaceMenuScreen);
}
else {
applySurface(intCoordCol[intIncCol], intCoordRow[intIncRow], surfaceChannelInactive, surfaceMenuScreen);
}
SDL_UpdateRect(surfaceMenuScreen, intCoordCol[intIncCol] - 1, intCoordRow[intIncRow] - 1, surfaceChannelSelection->w + 2, surfaceChannelSelection->h + 2);
//Calculate Which Row To Use
if (intIncCounter > 1) {
intIncCounter = 0;
++intIncRow;
}
else {
++intIncCounter;
}
//Calculate Which Column To Use
if (intIncCol > 1) {
intIncCol = 0;
}
else {
++intIncCol;
}
}
and here is a screen shot of what is happening top half is what it should look like and is what it looks like when it starts the bottom half is the result of the overlays not being overlayed (and i know the background is being sampled and placed on the surface every time because ive tested it with a background image) and it also happens if i update the entire screen or flip the entire screen