# Changes
3ds Backend: - switch to shaderProgramUse Desktop Backend - Add Pre Alpha Text Input and Keyboard Support - Move Shader Attrib Setup into a function and callit every time we need a set up vbo - Move to Mat4 api Core: - Add fquat support - Add LoadFile2Str - Move Mat4 Lib from Project n73 to Palladium - Add full supprot for vec cross types - Add Normalize, Distance and Dot to all - Add Cross to vec3 Drivers: - Add a SetViewPort func to GFX - Add Keyboard keys and Flasg to Hid Image: - Add Vertical Flipping - Add Horizontal flipping UI7: - Fix Critical Bug in IO Viewport handler - Fix library list (error on MinGW for some reason) Lazyvec: - Split into multiple source files - Generate new functions (see core updates)
This commit is contained in:
@ -77,6 +77,46 @@ PD_IMAGE_API void Image::Copy(const std::vector<u8>& buf, int w, int h,
|
||||
}
|
||||
}
|
||||
|
||||
PD_IMAGE_API void Image::FlipHorizontal() {
|
||||
/**
|
||||
* Dont know if i am brain dead but i think this code
|
||||
* should Horizpntal flip an image
|
||||
* Probably this needs some optimisation like not always calling
|
||||
* Fmt2Bpp and use `* 0.5` instead of `/ 2` i guess
|
||||
*/
|
||||
for (int i = 0; i < pWidth / 2; i++) {
|
||||
for (int j = 0; j < pHeight; j++) {
|
||||
int src = (j * pWidth + i) * Fmt2Bpp(pFmt);
|
||||
int dst = (j * pWidth + (pWidth - 1 - i)) * Fmt2Bpp(pFmt);
|
||||
for (int k = 0; k < Fmt2Bpp(pFmt); k++) {
|
||||
PD::u8 tmp = pBuffer[dst + k];
|
||||
pBuffer[dst + k] = pBuffer[src + k];
|
||||
pBuffer[src + k] = tmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PD_IMAGE_API void Image::FlipVertical() {
|
||||
/**
|
||||
* Dont know if i am brain dead but i think this code
|
||||
* should Vertical flip an image
|
||||
* Probably this needs some optimisation like not always calling
|
||||
* Fmt2Bpp and use `* 0.5` instead of `/ 2` i guess
|
||||
*/
|
||||
for (int i = 0; i < pWidth; i++) {
|
||||
for (int j = 0; j < pHeight / 2; j++) {
|
||||
int src = (j * pWidth + i) * Fmt2Bpp(pFmt);
|
||||
int dst = ((pHeight - 1 - j) * pWidth + i) * Fmt2Bpp(pFmt);
|
||||
for (int k = 0; k < Fmt2Bpp(pFmt); k++) {
|
||||
PD::u8 tmp = pBuffer[dst + k];
|
||||
pBuffer[dst + k] = pBuffer[src + k];
|
||||
pBuffer[src + k] = tmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PD_IMAGE_API void Image::Convert(Image::Ref img, Image::Format dst) {
|
||||
if (img->pFmt == dst) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user