Remove trailing spaces
This commit is contained in:
parent
67a1e84859
commit
cf12992b6a
@ -38,15 +38,15 @@ int main(void)
|
||||
|
||||
SetTargetFPS(60); // Set desired framerate (frames-per-second)
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
switch(currentScreen)
|
||||
switch(currentScreen)
|
||||
{
|
||||
case LOGO:
|
||||
case LOGO:
|
||||
{
|
||||
// TODO: Update LOGO screen variables here!
|
||||
|
||||
@ -58,7 +58,7 @@ int main(void)
|
||||
currentScreen = TITLE;
|
||||
}
|
||||
} break;
|
||||
case TITLE:
|
||||
case TITLE:
|
||||
{
|
||||
// TODO: Update TITLE screen variables here!
|
||||
|
||||
@ -69,16 +69,16 @@ int main(void)
|
||||
}
|
||||
} break;
|
||||
case GAMEPLAY:
|
||||
{
|
||||
{
|
||||
// TODO: Update GAMEPLAY screen variables here!
|
||||
|
||||
// Press enter to change to ENDING screen
|
||||
if (IsKeyPressed(KEY_ENTER) || IsGestureDetected(GESTURE_TAP))
|
||||
{
|
||||
currentScreen = ENDING;
|
||||
}
|
||||
}
|
||||
} break;
|
||||
case ENDING:
|
||||
case ENDING:
|
||||
{
|
||||
// TODO: Update ENDING screen variables here!
|
||||
|
||||
@ -86,63 +86,63 @@ int main(void)
|
||||
if (IsKeyPressed(KEY_ENTER) || IsGestureDetected(GESTURE_TAP))
|
||||
{
|
||||
currentScreen = TITLE;
|
||||
}
|
||||
}
|
||||
} break;
|
||||
default: break;
|
||||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
switch(currentScreen)
|
||||
|
||||
switch(currentScreen)
|
||||
{
|
||||
case LOGO:
|
||||
case LOGO:
|
||||
{
|
||||
// TODO: Draw LOGO screen here!
|
||||
DrawText("LOGO SCREEN", 20, 20, 40, LIGHTGRAY);
|
||||
DrawText("WAIT for 2 SECONDS...", 290, 220, 20, GRAY);
|
||||
|
||||
|
||||
} break;
|
||||
case TITLE:
|
||||
case TITLE:
|
||||
{
|
||||
// TODO: Draw TITLE screen here!
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, GREEN);
|
||||
DrawText("TITLE SCREEN", 20, 20, 40, DARKGREEN);
|
||||
DrawText("PRESS ENTER or TAP to JUMP to GAMEPLAY SCREEN", 120, 220, 20, DARKGREEN);
|
||||
|
||||
|
||||
} break;
|
||||
case GAMEPLAY:
|
||||
{
|
||||
{
|
||||
// TODO: Draw GAMEPLAY screen here!
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, PURPLE);
|
||||
DrawText("GAMEPLAY SCREEN", 20, 20, 40, MAROON);
|
||||
DrawText("PRESS ENTER or TAP to JUMP to ENDING SCREEN", 130, 220, 20, MAROON);
|
||||
|
||||
} break;
|
||||
case ENDING:
|
||||
case ENDING:
|
||||
{
|
||||
// TODO: Draw ENDING screen here!
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, BLUE);
|
||||
DrawText("ENDING SCREEN", 20, 20, 40, DARKBLUE);
|
||||
DrawText("PRESS ENTER or TAP to RETURN to TITLE SCREEN", 120, 220, 20, DARKBLUE);
|
||||
|
||||
|
||||
} break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
// TODO: Unload all loaded data (textures, fonts, audio) here!
|
||||
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -39,13 +39,13 @@ int main(void)
|
||||
|
||||
// Generic quaternion for operations
|
||||
Quaternion q1 = { 0 };
|
||||
|
||||
|
||||
// Transform matrices required to draw 4 cylinders
|
||||
Matrix m1 = { 0 };
|
||||
Matrix m2 = { 0 };
|
||||
Matrix m3 = { 0 };
|
||||
Matrix m4 = { 0 };
|
||||
|
||||
|
||||
// Generic vectors for rotations
|
||||
Vector3 v1 = { 0 };
|
||||
Vector3 v2 = { 0 };
|
||||
@ -95,13 +95,13 @@ int main(void)
|
||||
|
||||
model.transform = m1;
|
||||
DrawModel(model, (Vector3){ -1, 0, 0 }, 1.0f, RED);
|
||||
|
||||
|
||||
model.transform = m2;
|
||||
DrawModel(model, (Vector3){ 1, 0, 0 }, 1.0f, RED);
|
||||
|
||||
|
||||
model.transform = m3;
|
||||
DrawModel(model, (Vector3){ 0, 0, 0 }, 1.0f, RED);
|
||||
|
||||
|
||||
model.transform = m4;
|
||||
DrawModel(model, (Vector3){ 0, 0, -1 }, 1.0f, RED);
|
||||
|
||||
|
@ -84,14 +84,14 @@ int main(void)
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginTextureMode(target);
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
|
||||
BeginMode2D(worldSpaceCamera);
|
||||
DrawRectanglePro(rec01, origin, rotation, BLACK);
|
||||
DrawRectanglePro(rec02, origin, -rotation, RED);
|
||||
DrawRectanglePro(rec03, origin, rotation + 45.0f, BLUE);
|
||||
EndMode2D();
|
||||
EndTextureMode();
|
||||
|
||||
|
||||
BeginDrawing();
|
||||
ClearBackground(RED);
|
||||
|
||||
@ -109,7 +109,7 @@ int main(void)
|
||||
// De-Initialization
|
||||
//--------------------------------------------------------------------------------------
|
||||
UnloadRenderTexture(target); // Unload render texture
|
||||
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -22,7 +22,7 @@ void DrawScene(void)
|
||||
{
|
||||
int count = 5;
|
||||
float spacing = 4;
|
||||
|
||||
|
||||
// Grid of cube trees on a plane to make a "world"
|
||||
DrawPlane((Vector3){ 0, 0, 0 }, (Vector2){ 50, 50 }, BEIGE); // Simple world plane
|
||||
|
||||
@ -73,10 +73,10 @@ int main(void)
|
||||
cameraPlayer2.position.y = 3.0f;
|
||||
|
||||
RenderTexture screenPlayer2 = LoadRenderTexture(screenWidth / 2, screenHeight);
|
||||
|
||||
|
||||
// Build a flipped rectangle the size of the split view to use for drawing later
|
||||
Rectangle splitScreenRect = { 0.0f, 0.0f, (float)screenPlayer1.texture.width, (float)-screenPlayer1.texture.height };
|
||||
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
@ -147,7 +147,7 @@ int main(void)
|
||||
UnloadRenderTexture(screenPlayer1); // Unload render texture
|
||||
UnloadRenderTexture(screenPlayer2); // Unload render texture
|
||||
UnloadTexture(textureGrid); // Unload texture
|
||||
|
||||
|
||||
CloseWindow(); // Close window and OpenGL context
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -46,7 +46,7 @@ int main(void)
|
||||
Vector3 position = { 0.0f, 0.0f, 0.0f }; // Set model position
|
||||
|
||||
// Load animation data
|
||||
int animsCount = 0;
|
||||
unsigned int animsCount = 0;
|
||||
ModelAnimation *anims = LoadModelAnimations("resources/models/iqm/guyanim.iqm", &animsCount);
|
||||
int animFrameCounter = 0;
|
||||
|
||||
|
@ -23,7 +23,7 @@ int main(void)
|
||||
//--------------------------------------------------------------------------------------
|
||||
const int screenWidth = 800;
|
||||
const int screenHeight = 450;
|
||||
|
||||
|
||||
const char *voxFileNames[] = {
|
||||
"resources/models/vox/chr_knight.vox",
|
||||
"resources/models/vox/chr_sword.vox",
|
||||
@ -31,7 +31,7 @@ int main(void)
|
||||
};
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [models] example - magicavoxel loading");
|
||||
|
||||
|
||||
// Define the camera to look into our 3d world
|
||||
Camera camera = { 0 };
|
||||
camera.position = (Vector3){ 10.0f, 10.0f, 10.0f }; // Camera position
|
||||
@ -52,7 +52,7 @@ int main(void)
|
||||
|
||||
TraceLog(LOG_WARNING, TextFormat("[%s] File loaded in %.3f ms", voxFileNames[i], t1 - t0));
|
||||
|
||||
// Compute model translation matrix to center model on draw position (0, 0 , 0)
|
||||
// Compute model translation matrix to center model on draw position (0, 0 , 0)
|
||||
BoundingBox bb = GetModelBoundingBox(models[i]);
|
||||
Vector3 center = { 0 };
|
||||
center.x = bb.min.x + (((bb.max.x - bb.min.x)/2));
|
||||
@ -68,7 +68,7 @@ int main(void)
|
||||
|
||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
// Main game loop
|
||||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
||||
{
|
||||
@ -77,7 +77,7 @@ int main(void)
|
||||
UpdateCamera(&camera); // Update our camera to orbit
|
||||
|
||||
// Cycle between models on mouse click
|
||||
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) currentModel = (currentModel + 1)%MAX_VOX_FILES;
|
||||
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) currentModel = (currentModel + 1)%MAX_VOX_FILES;
|
||||
|
||||
// Cycle between models on key pressed
|
||||
if (IsKeyPressed(KEY_RIGHT))
|
||||
@ -91,13 +91,13 @@ int main(void)
|
||||
if (currentModel < 0) currentModel = MAX_VOX_FILES - 1;
|
||||
}
|
||||
//----------------------------------------------------------------------------------
|
||||
|
||||
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
|
||||
// Draw 3D model
|
||||
BeginMode3D(camera);
|
||||
|
||||
|
@ -938,7 +938,7 @@ typedef struct rlglData {
|
||||
bool texCompASTC; // ASTC texture compression support (GL_KHR_texture_compression_astc_hdr, GL_KHR_texture_compression_astc_ldr)
|
||||
bool texMirrorClamp; // Clamp mirror wrap mode supported (GL_EXT_texture_mirror_clamp)
|
||||
bool texAnisoFilter; // Anisotropic texture filtering support (GL_EXT_texture_filter_anisotropic)
|
||||
bool computeShader; // Compute shaders support (GL_ARB_compute_shader)
|
||||
bool computeShader; // Compute shaders support (GL_ARB_compute_shader)
|
||||
bool ssbo; // Shader storage buffer object support (GL_ARB_shader_storage_buffer_object)
|
||||
|
||||
float maxAnisotropyLevel; // Maximum anisotropy level supported (minimum is 2.0f)
|
||||
@ -1918,9 +1918,9 @@ void rlLoadExtensions(void *loader)
|
||||
RLGL.ExtSupported.maxDepthBits = 32;
|
||||
RLGL.ExtSupported.texAnisoFilter = true;
|
||||
RLGL.ExtSupported.texMirrorClamp = true;
|
||||
#if defined(GRAPHICS_API_OPENGL_43)
|
||||
#if defined(GRAPHICS_API_OPENGL_43)
|
||||
if (GLAD_GL_ARB_compute_shader) RLGL.ExtSupported.computeShader = true;
|
||||
if (GLAD_GL_ARB_shader_storage_buffer_object) RLGL.ExtSupported.ssbo = true;
|
||||
if (GLAD_GL_ARB_shader_storage_buffer_object) RLGL.ExtSupported.ssbo = true;
|
||||
#endif
|
||||
#if !defined(__APPLE__)
|
||||
// NOTE: With GLAD, we can check if an extension is supported using the GLAD_GL_xxx booleans
|
||||
|
@ -4511,23 +4511,23 @@ char *EncodeBase64(const unsigned char *data, int inputLength, int *outputLength
|
||||
'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
|
||||
'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'
|
||||
};
|
||||
|
||||
|
||||
static const int modTable[] = { 0, 2, 1 };
|
||||
|
||||
|
||||
*outputLength = 4*((inputLength + 2)/3);
|
||||
|
||||
|
||||
char *encodedData = RL_MALLOC(*outputLength);
|
||||
|
||||
|
||||
if (encodedData == NULL) return NULL;
|
||||
|
||||
|
||||
for (int i = 0, j = 0; i < inputLength;)
|
||||
{
|
||||
unsigned int octetA = (i < inputLength)? (unsigned char)data[i++] : 0;
|
||||
unsigned int octetB = (i < inputLength)? (unsigned char)data[i++] : 0;
|
||||
unsigned int octetC = (i < inputLength)? (unsigned char)data[i++] : 0;
|
||||
|
||||
|
||||
unsigned int triple = (octetA << 0x10) + (octetB << 0x08) + octetC;
|
||||
|
||||
|
||||
encodedData[j++] = base64encodeTable[(triple >> 3*6) & 0x3F];
|
||||
encodedData[j++] = base64encodeTable[(triple >> 2*6) & 0x3F];
|
||||
encodedData[j++] = base64encodeTable[(triple >> 1*6) & 0x3F];
|
||||
@ -4535,7 +4535,7 @@ char *EncodeBase64(const unsigned char *data, int inputLength, int *outputLength
|
||||
}
|
||||
|
||||
for (int i = 0; i < modTable[inputLength%3]; i++) encodedData[*outputLength - 1 - i] = '=';
|
||||
|
||||
|
||||
return encodedData;
|
||||
}
|
||||
|
||||
@ -4544,11 +4544,11 @@ static unsigned char *DecodeBase64(char *data, int *outputLength)
|
||||
{
|
||||
static const unsigned char base64decodeTable[] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 62, 0, 0, 0, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
|
||||
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
|
||||
0, 0, 0, 62, 0, 0, 0, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
|
||||
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
|
||||
37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51
|
||||
};
|
||||
|
||||
|
||||
// Get output size of Base64 input data
|
||||
int outLength = 0;
|
||||
for (int i = 0; data[4*i] != 0; i++)
|
||||
@ -4625,7 +4625,7 @@ static Image LoadImageFromCgltfImage(cgltf_image *image, const char *texPath, Co
|
||||
|
||||
int size = 0;
|
||||
unsigned char *data = DecodeBase64(image->uri + i + 1, &size); // TODO: Use cgltf_load_buffer_base64()
|
||||
|
||||
|
||||
rimage = LoadImageFromMemory(".png", data, size);
|
||||
RL_FREE(data);
|
||||
|
||||
@ -5596,7 +5596,7 @@ void LoadGLTFMesh(cgltf_data *data, cgltf_node *node, Model *outModel, Matrix cu
|
||||
{
|
||||
cgltf_accessor *acc = mesh->primitives[p].attributes[j].data;
|
||||
outModel->meshes[(*primitiveIndex)].vertexCount = (int)acc->count;
|
||||
|
||||
|
||||
int bufferSize = outModel->meshes[(*primitiveIndex)].vertexCount*3*sizeof(float);
|
||||
outModel->meshes[(*primitiveIndex)].animVertices = RL_MALLOC(bufferSize);
|
||||
|
||||
@ -5657,7 +5657,7 @@ void LoadGLTFMesh(cgltf_data *data, cgltf_node *node, Model *outModel, Matrix cu
|
||||
unsigned int totalBoneWeights = boneCount*4;
|
||||
outModel->meshes[(*primitiveIndex)].boneIds = RL_MALLOC(totalBoneWeights*sizeof(int));
|
||||
short *bones = ReadGLTFValuesAs(acc, cgltf_component_type_r_16, false);
|
||||
|
||||
|
||||
// Find skin joint
|
||||
for (unsigned int a = 0; a < totalBoneWeights; a++)
|
||||
{
|
||||
@ -5667,7 +5667,7 @@ void LoadGLTFMesh(cgltf_data *data, cgltf_node *node, Model *outModel, Matrix cu
|
||||
unsigned int skinJointId = skinJoint - data->nodes;
|
||||
outModel->meshes[(*primitiveIndex)].boneIds[a] = skinJointId;
|
||||
}
|
||||
|
||||
|
||||
RL_FREE(bones);
|
||||
}
|
||||
else if (mesh->primitives[p].attributes[j].type == cgltf_attribute_type_weights)
|
||||
|
Loading…
Reference in New Issue
Block a user