Kaynağa Gözat

Art: switch to stdint

Streetwalrus Einstein 10 yıl önce
ebeveyn
işleme
d9aa2a8d26
2 değiştirilmiş dosya ile 6 ekleme ve 5 silme
  1. 3 3
      art/header.bash
  2. 3 2
      art/rules.mk

+ 3 - 3
art/header.bash

@@ -1,10 +1,10 @@
 #!/bin/bash
 
-header=$(cat $1 |grep "=" |sed -e "s/ =.*/;/" -e "s/^/extern /")
+header="#include <stdint.h>\n"$(cat $1 |grep "=" |sed -e "s/ =.*/;/" -e "s/^/extern /")
 
-echo "$header" | diff - $2 > /dev/null 2>&1
+echo -e "$header" | diff - $2 > /dev/null 2>&1
 if [[ $? -ne 0 ]]
   then
   echo "Making header $2"
-  echo "$header" > $2
+  echo -e "$header" > $2
 fi

+ 3 - 2
art/rules.mk

@@ -12,12 +12,13 @@ BUILT_SRCS += $(art_SPR_HDR)
 $(OUT)/%.cspr: %.png
 	@echo "SPRITE: $@"
 	@mkdir -p $(dir $@)
-	@ConvertImg --format n2dlib $< > $@
+	@ConvertImg --not-static --format n2dlib $< > $@
 
 $(art_SPR_SRC): $(art_SPR_DATA)
 	@echo "Catting sprites into sprites.c"
 	@rm -f $@
-	@cat $^ | sed "s/^static uint16_t/unsigned short/" >> $@
+	@echo "#include <stdint.h>" > $@
+	@cat $^ >> $@
 
 $(art_SPR_HDR): $(art_SPR_SRC)
 	@./$(art_LOCAL_PATH)/header.bash $< $@