Browse Source

working on another computer so gotta update repo

Iver 1 month ago
parent
commit
15cfd3cdaf
8 changed files with 17 additions and 2 deletions
  1. 1 1
      README.md
  2. BIN
      builds/libpitmap.so
  3. BIN
      builds/main.bin
  4. 1 0
      dbg
  5. BIN
      images/test_gif.gif
  6. 1 0
      run
  7. 3 1
      src/launch_program/main.c
  8. 11 0
      src/library/main.c

+ 1 - 1
README.md

@@ -4,7 +4,7 @@
 
 
 ### By End of November, 2025
 ### By End of November, 2025
 
 
- - [x] bare minimum BMP support
+ - [x] bare minimum BMP support **`finished on November 29th, 2025`**
 
 
 ### By End of February, 2026
 ### By End of February, 2026
 
 

BIN
builds/libpitmap.so


BIN
builds/main.bin


+ 1 - 0
dbg

@@ -0,0 +1 @@
+gdb -ex run builds/main.bin

BIN
images/test_gif.gif


+ 1 - 0
run

@@ -0,0 +1 @@
+./builds/main.bin

+ 3 - 1
src/launch_program/main.c

@@ -1,5 +1,7 @@
 #include "../headers/pitmap.h"
 #include "../headers/pitmap.h"
 #include <stdio.h>
 #include <stdio.h>
+
+
 int write_tga(const char* path, const PM_image* img) {
 int write_tga(const char* path, const PM_image* img) {
     if (!img || !img->frame_buffer || img->width <= 0 || img->height <= 0)
     if (!img || !img->frame_buffer || img->width <= 0 || img->height <= 0)
         return -1;
         return -1;
@@ -41,7 +43,7 @@ int write_tga(const char* path, const PM_image* img) {
 }
 }
 
 
 int main(){
 int main(){
-    write_tga("./image.tga", PM_load_image("images/gordon_face_animated.bmp", 1));
+    write_tga("./image.tga", PM_load_image("images/test_gif.gif", 1));
 
 
     
     
 
 

+ 11 - 0
src/library/main.c

@@ -2,6 +2,7 @@
 #include <stdio.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <math.h>
 #include <math.h>
+#include <string.h>
 
 
 uint8_t *file_buffer;
 uint8_t *file_buffer;
 int current_byte;
 int current_byte;
@@ -216,5 +217,15 @@ PM_image* PM_load_image(char *filename, unsigned char debug_mode){
     fread(file_buffer, 1, size, fp);
     fread(file_buffer, 1, size, fp);
     fclose(fp);
     fclose(fp);
 
 
+    // see what the file type is
+
+    char *strtok_string = strtok(filename, ".");
+    while(strtok_string != NULL) {
+        strtok_string = strtok(NULL, ".");
+        printf("%s\n", strtok_string);
+    }
+
+    return NULL;
+
     return PM_load_bitmap(debug_mode);
     return PM_load_bitmap(debug_mode);
 }   
 }