mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-18 12:05:14 -04:00
fixes and fixes
This commit is contained in:
parent
1e0f7df47f
commit
c252baa696
@ -315,12 +315,12 @@ void Block_RecalculateBB(BlockID block) {
|
|||||||
Real32 leftX = Block_GetSpriteBB_LeftX(elemSize, texX, texY, bmp);
|
Real32 leftX = Block_GetSpriteBB_LeftX(elemSize, texX, texY, bmp);
|
||||||
Real32 rightX = Block_GetSpriteBB_RightX(elemSize, texX, texY, bmp);
|
Real32 rightX = Block_GetSpriteBB_RightX(elemSize, texX, texY, bmp);
|
||||||
|
|
||||||
Vector3 centre = Vector3_Create3(0.5f, 0, 0.5f);
|
Vector3 centre = VECTOR3_CONST(0.5f, 0.0f, 0.5f);
|
||||||
Vector3 minRaw = Vector3_RotateY3(leftX - 0.5f, bottomY, 0, 45.0f * MATH_DEG2RAD);
|
Vector3 minRaw = Vector3_RotateY3(leftX - 0.5f, bottomY, 0, 45.0f * MATH_DEG2RAD);
|
||||||
Vector3 maxRaw = Vector3_RotateY3(rightX - 0.5f, topY, 0, 45.0f * MATH_DEG2RAD);
|
Vector3 maxRaw = Vector3_RotateY3(rightX - 0.5f, topY, 0, 45.0f * MATH_DEG2RAD);
|
||||||
|
|
||||||
Vector3_Add(&minRaw, ¢re, &Block_MinBB[block]);
|
Vector3_Add(&Block_MinBB[block], &minRaw, ¢re);
|
||||||
Vector3_Add(&maxRaw, ¢re, &Block_MaxBB[block]);
|
Vector3_Add(&Block_MaxBB[block], &maxRaw, ¢re);
|
||||||
Block_CalcRenderBounds(block);
|
Block_CalcRenderBounds(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ void D3D9_SetTexturePartData(IDirect3DTexture9* texture, Int32 x, Int32 y, Bitma
|
|||||||
UInt32 stride = (UInt32)(bmp->Width) * BITMAP_SIZEOF_PIXEL;
|
UInt32 stride = (UInt32)(bmp->Width) * BITMAP_SIZEOF_PIXEL;
|
||||||
|
|
||||||
for (yy = 0; yy < bmp->Height; yy++) {
|
for (yy = 0; yy < bmp->Height; yy++) {
|
||||||
Platform_MemCpy(src, dst, stride);
|
Platform_MemCpy(dst, src, stride);
|
||||||
src += stride;
|
src += stride;
|
||||||
dst += rect.Pitch;
|
dst += rect.Pitch;
|
||||||
}
|
}
|
||||||
|
@ -283,6 +283,8 @@ Int32 Game_CalcRenderType(STRING_PURE String* type) {
|
|||||||
void Game_OnResize(void* obj) {
|
void Game_OnResize(void* obj) {
|
||||||
Size2D size = Window_GetClientSize();
|
Size2D size = Window_GetClientSize();
|
||||||
Game_Width = size.Width; Game_Height = size.Height;
|
Game_Width = size.Width; Game_Height = size.Height;
|
||||||
|
if (Game_Width == 0) Game_Width = 1;
|
||||||
|
if (Game_Height == 0) Game_Height = 1;
|
||||||
|
|
||||||
Gfx_OnWindowResize();
|
Gfx_OnWindowResize();
|
||||||
Game_UpdateProjection();
|
Game_UpdateProjection();
|
||||||
|
@ -271,15 +271,18 @@ bool Stream_ReadUtf8Char(Stream* stream, UInt16* codepoint) {
|
|||||||
|
|
||||||
bool Stream_ReadLine(Stream* stream, STRING_TRANSIENT String* text) {
|
bool Stream_ReadLine(Stream* stream, STRING_TRANSIENT String* text) {
|
||||||
String_Clear(text);
|
String_Clear(text);
|
||||||
|
bool readAny = false;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
UInt16 codepoint;
|
UInt16 codepoint;
|
||||||
if (!Stream_ReadUtf8Char(stream, &codepoint)) return false;
|
if (!Stream_ReadUtf8Char(stream, &codepoint)) break;
|
||||||
|
readAny = true;
|
||||||
|
|
||||||
/* Handle \r\n or \n line endings */
|
/* Handle \r\n or \n line endings */
|
||||||
if (codepoint == '\r') continue;
|
if (codepoint == '\r') continue;
|
||||||
if (codepoint == '\n') return true;
|
if (codepoint == '\n') return true;
|
||||||
String_Append(text, Convert_UnicodeToCP437(codepoint));
|
String_Append(text, Convert_UnicodeToCP437(codepoint));
|
||||||
}
|
}
|
||||||
|
return readAny;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Stream_WriteLine(Stream* stream, STRING_TRANSIENT String* text) {
|
void Stream_WriteLine(Stream* stream, STRING_TRANSIENT String* text) {
|
||||||
|
@ -70,7 +70,6 @@ Vector3 Vector3_GetDirVector(Real32 yawRad, Real32 pitchRad);
|
|||||||
NOTE: This is not an identity function. Returned pitch is always within [-90, 90] degrees.*/
|
NOTE: This is not an identity function. Returned pitch is always within [-90, 90] degrees.*/
|
||||||
void Vector3_GetHeading(Vector3 dir, Real32* yawRad, Real32* pitchRad);
|
void Vector3_GetHeading(Vector3 dir, Real32* yawRad, Real32* pitchRad);
|
||||||
|
|
||||||
|
|
||||||
void Matrix_RotateX(Matrix* result, Real32 angle);
|
void Matrix_RotateX(Matrix* result, Real32 angle);
|
||||||
void Matrix_RotateY(Matrix* result, Real32 angle);
|
void Matrix_RotateY(Matrix* result, Real32 angle);
|
||||||
void Matrix_RotateZ(Matrix* result, Real32 angle);
|
void Matrix_RotateZ(Matrix* result, Real32 angle);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user