You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mostrar una textura de pared correctamente dentro de la imagen del juego, usando las texturas cargadas desde MiniLibX.
Contexto
El subject exige que cada pared muestre una textura distinta según la cara que mira (Norte, Sur, Este, Oeste). Las rutas de las texturas vendrán del archivo .cub (líneas NO, SO, WE, EA), que se parsea en otro issue. Este issue se centra en cargar esas texturas y pintarlas bien en la imagen, sin depender de rutas fijas en el código.
Alcance
Guardar las rutas de las cuatro texturas en t_game (el contrato acordado con el parsing).
Cargar cada textura con mlx_xpm_file_to_image a partir de esas rutas.
Dibujar una textura en la imagen del juego, leyendo sus píxeles con addr, size_line y bpp.
Liberar todas las texturas en la limpieza, sin fugas.
Display a wall texture correctly inside the game image, using textures loaded through MiniLibX.
Context
The subject requires each wall to show a different texture depending on the side it faces (North, South, East, West). The texture paths will come from the .cub file (NO, SO, WE, EA lines), which is handled in another issue. This issue focuses on loading those textures and drawing them correctly into the image, without relying on hard-coded paths.
Scope
Store the four texture paths in t_game (the contract agreed with the parsing side).
Load each texture with mlx_xpm_file_to_image from those paths.
Draw a texture into the game image by reading its pixels through addr, size_line and bpp.
What it is: path is a string with the texture file path (for example ./textures/north.xpm). It has no identifier (NO, SO...) and no newline at the end. Who writes it: the parsing part, when it reads the NO, SO, WE and EA lines of the .cub file. Who reads it: the texture loading part, with mlx_xpm_file_to_image.
Who owns the memory: once the string is copied into t_img.path, the cleanup function (clear_images) frees it. Nobody else frees it after that. Who frees on error: if something fails before the copy is stored in t_img.path, the part that made the copy frees it. If a path is missing: the texture loading returns an error, and the program exits cleanly with no leaks.****
Activity
SailMasterG commentedon Nov 7, 2026
Español
Descripción
Mostrar una textura de pared correctamente dentro de la imagen del juego, usando las texturas cargadas desde MiniLibX.
Contexto
El subject exige que cada pared muestre una textura distinta según la cara que mira (Norte, Sur, Este, Oeste). Las rutas de las texturas vendrán del archivo
.cub(líneasNO,SO,WE,EA), que se parsea en otro issue. Este issue se centra en cargar esas texturas y pintarlas bien en la imagen, sin depender de rutas fijas en el código.Alcance
t_game(el contrato acordado con el parsing).mlx_xpm_file_to_imagea partir de esas rutas.addr,size_lineybpp.Fuera de alcance
.cub(Parse and validate headers #23).Criterios de aceptación
Depende de: #12 (imágenes y struct
t_img).English
Description
Display a wall texture correctly inside the game image, using textures loaded through MiniLibX.
Context
The subject requires each wall to show a different texture depending on the side it faces (North, South, East, West). The texture paths will come from the
.cubfile (NO,SO,WE,EAlines), which is handled in another issue. This issue focuses on loading those textures and drawing them correctly into the image, without relying on hard-coded paths.Scope
t_game(the contract agreed with the parsing side).mlx_xpm_file_to_imagefrom those paths.addr,size_lineandbpp.Out of scope
.cubfile (Parse and validate headers #23).Acceptance criteria
Depends on: #12 (images and the
t_imgstruct).SailMasterG commentedon Nov 7, 2026
Interface contract: texture paths (t_img.path)
What it is: path is a string with the texture file path (for example ./textures/north.xpm). It has no identifier (NO, SO...) and no newline at the end.
Who writes it: the parsing part, when it reads the NO, SO, WE and EA lines of the .cub file.
Who reads it: the texture loading part, with mlx_xpm_file_to_image.
Who owns the memory: once the string is copied into t_img.path, the cleanup function (clear_images) frees it. Nobody else frees it after that.
Who frees on error: if something fails before the copy is stored in t_img.path, the part that made the copy frees it.
If a path is missing: the texture loading returns an error, and the program exits cleanly with no leaks.****
[-]Implement a simple texture display[/-][+]Render textures on walls[/+]