read .OBJ file, first try

This commit is contained in:
Tonton Th 2020-06-05 00:17:17 +02:00
parent ee00eec000
commit 5a6e98d034
7 changed files with 65 additions and 2 deletions

4
.gitignore vendored
View File

@ -5,3 +5,7 @@ libbubulles.a
tbb tbb
gmon.out gmon.out
dummy-file dummy-file
tools/covid-19.obj
tools/read_obj

View File

@ -12,12 +12,15 @@ CC = gcc
OPT = -Wall -g -DDEBUG_LEVEL=0 -DMUST_ABORT OPT = -Wall -g -DDEBUG_LEVEL=0 -DMUST_ABORT
libbubulles.a: bubulles.o libbubulles.a: bubulles.o importobj.o
ar r $@ $? ar r $@ $?
bubulles.o: bubulles.c bubulles.h Makefile bubulles.o: bubulles.c bubulles.h Makefile
$(CC) $(OPT) -c $< $(CC) $(OPT) -c $<
importobj.o: importobj.c bubulles.h Makefile
$(CC) $(OPT) -c $<
# ------------------------------------------------ # ------------------------------------------------
# --- build some tests and tools # --- build some tests and tools

View File

@ -4,7 +4,7 @@
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
#define LIBBB_VERSION 52 #define LIBBB_VERSION 53
#define SZ_BUBULLE_TEXT 51 /* arbitrary value */ #define SZ_BUBULLE_TEXT 51 /* arbitrary value */

0
doc/tricks.txt Normal file
View File

26
importobj.c Normal file
View File

@ -0,0 +1,26 @@
/*
LIBBUBULLES
some functions for importing bubulles from dot-OBJ files.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bubulles.h"
/* --------------------------------------------------------------------- */
int try_to_read_an_OBJ_file(char *fname, int notused)
{
FILE *fpin;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( '%s' %d)\n", fname, notused);
#endif
return -7800;
}
/* --------------------------------------------------------------------- */

5
tools/Makefile Normal file
View File

@ -0,0 +1,5 @@
BBFUNCS = ../libbubulles.a
read_obj: read_obj.c Makefile ${BBFUNCS}
gcc -Wall $< ${BBFUNCS} -o $@

25
tools/read_obj.c Normal file
View File

@ -0,0 +1,25 @@
/*
tentatives de lecture des OBJ
*/
#include <stdio.h>
#include <stdlib.h>
#include "../bubulles.h"
int main(int argc, char *argv[])
{
int foo;
if (2 != argc) {
bubulles_version(1);
exit(0);
}
// foo = try_to_read_an_OBJ_file(argv[1], 0);
return 0;
}