Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge parsing onto merge #3

Merged
merged 10 commits into from
Aug 31, 2023
Merged

Merge parsing onto merge #3

merged 10 commits into from
Aug 31, 2023

Conversation

gd-harco
Copy link
Collaborator

Parsing logic is implemented in the code, No other change has been made to the render part, it will just check if the argv[1] is a valid .cub file before continuing.
Now with 100% less submodule and a use of strncmp !

A new header file, parsing.h, was created to help organize and modularize the parsing functionality of the application. This file was included in the cub.h header to make the new parsing functions widely available across the codebase. The added files were also reflected in the Makefile and sources.mk. This change aims to enhance code readability and maintainability."
A new header file, parsing.h, was created to help organize and modularize the parsing functionality of the application. This file was included in the cub.h header to make the new parsing functions widely available across the codebase. The added files were also reflected in the Makefile and sources.mk. This change aims to enhance code readability and maintainability."
Added the libft library as a submodule and its inclusion in the header file. The libft library contains reusable C function which is already used by many projects. Their addition in the Makefile allows these functions to be compiled and linked into the executable. This will make developing new features easier and faster because we have a robust set of tools readily available. The .gitmodules file ensures that this library is cloned whenever this repository is cloned. This makes it easier for new developers to set up their development environments.
The change introduces error messages for invalid command line arguments used in the cub3D project. The error messages include definitions for wrong usage, incorrect file extension, and inaccessible map file. This improves the traceability of error sources, aiding in future debugging efforts.
Added a new parsing.c file and started implementing the logic in it. It includes some basic error checks like verifying the number of arguments and validating the file extension. This is the start of building the parsing functionality for the application. In addition, the printf.h library was added to the cub.h file to support the printf function.
# Conflicts:
#	Makefile
#	incs/parsing.h
The program will now start by launching the parsing code. If anything goes wrong during this step, the program now exit properly.
The 'all' rule in the Makefile has been updated to initialize and update any git submodules before building the project. This change ensures that any dependencies managed as submodules are correctly set up before attempting the build, preventing potential build failures due to missing or outdated dependencies.
Simplified the logic used for validating the suffix of a parsed map file. Initial implementation was manually checking each character of the suffix by hardcoded indices. This was refactored to use the `ft_strncmp` function to compare the last 4 characters to the expected suffix ".cub". This simplifies the code, improves readability, and reduces the probability of off-by-one errors in the indexing.
Copy link
Owner

@BenoitRoux0 BenoitRoux0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code propre et lisible. GL pour la suite.

Copy link
Owner

@BenoitRoux0 BenoitRoux0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code propre et lisible. GL pour la suite.

@BenoitRoux0 BenoitRoux0 merged commit 31e2966 into master Aug 31, 2023
This was referenced Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants