Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
decoyer2 committed Mar 14, 2023
1 parent 55862b9 commit c7e5f28
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 28 deletions.
6 changes: 3 additions & 3 deletions DataProcess/interpret.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,10 @@ void Interpreter::drawBasic(){
d.drawBasic(820,212,58);
d.drawBonus(549, 820, 562+58, 58, "character", std::vector<std::string>{"cryo_dmg_"});
d.drawWeapon(470, 20, 620, 620+200, 45, 30, 100);
InitializeMagick("/home/pifordecoyer/code/cpp/GenshinCard/Image/TOP.png");
InitializeMagick("/home/ser3_decoyer/repo/GenshinCard/Image/TOP.png");
Image image;
image.read("/home/pifordecoyer/code/cpp/GenshinCard/Image/TOP.png");
image.read("/home/ser3_decoyer/repo/GenshinCard/Image/TOP.png");
image.draw(d.get_drawList());
image.write("/home/pifordecoyer/code/cpp/GenshinCard/Image/Ganyu.png");
image.write("/home/ser3_decoyer/repo/GenshinCard/Image/Ganyu.png");
}
}
Binary file modified GenshinCard
Binary file not shown.
18 changes: 9 additions & 9 deletions Image/DrawStat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void DrawStat::calculateAll(){
std::cout<<"Can't with "<<stat.first<<std::endl;
}
}
this->stats.at(stat.first) += (temp+this->character->get_stat(stat.first));
this->stats.at(stat.first) += (this->character->get_stat(stat.first));
std::cout<<stat.first<<" has value: "<<this->stats.at(stat.first)<<std::endl;
}
this->calculate = true;
Expand Down Expand Up @@ -117,16 +117,16 @@ void DrawStat::drawBonus(int xstat, int xval, int y, int spacey, std::string mod
y+=spacey;
}
}
void DrawStat::iconToDrawlist(std::string icon, int x, int y){
Image img(icon);
img.resize(Geometry(FONT_SIZE, FONT_SIZE));
this->drawList.push_back(x - img.size().width() - int(round(FONT_SIZE/3), //x cordinate
y - FONT_SIZE + int(round(FONT_SIZE/4)), //y cordinate
0, 0, img, OverCompositeOp));
}
//void DrawStat::iconToDrawlist(std::string icon, int x, int y){
// Image img(icon);
// img.resize(Geometry(FONT_SIZE, FONT_SIZE));
// this->drawList.push_back(x - img.size().width() - int(round(FONT_SIZE/3)), //x cordinate
// y - FONT_SIZE + int(round(FONT_SIZE/4)), //y cordinate
// img, OverCompositeOp));
//}
void DrawStat::drawWeapon(int ximg, int yimg, int xstat, int xval, int y, int spacey, int icon_size){
if(!calculate){calculateAll();}
Image wp("/home/pifordecoyer/code/cpp/GenshinCard/Image/UI_EquipIcon_Bow_Amos_Awaken#63040.png");
Image wp("/home/ser3_decoyer/repo/GenshinCard/Image/UI_EquipIcon_Bow_Amos_Awaken#63040.png");
wp.resize(Geometry(icon_size, icon_size));
this->drawList.push_back(DrawableFont(FONT));
this->drawList.push_back(DrawableCompositeImage(ximg, yimg, 0, 0, wp, OverCompositeOp));
Expand Down
Binary file modified Image/Ganyu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Image/background
Binary file not shown.
4 changes: 2 additions & 2 deletions Image/background.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ void drawWeapon(Image *image, int size){
//return 1;
}
}
int main(int argc, char **argv)
//int mainx(int argc, char **argv)
//int main(int argc, char **argv)
int mainx(int argc, char **argv)
{
InitializeMagick(*argv);
DrawableText demo(0,0,"1999 HP");
Expand Down
4 changes: 2 additions & 2 deletions Image/local.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
g++ -std=c++2b `/home/pifordecoyer/code/cpp/GenshinCard/ImageMagick/bin/Magick++-config --cxxflags --cppflags` \
g++ -std=c++20 `Magick++-config --cxxflags --cppflags` \
-fdiagnostics-color=always \
-g ./background.cpp \
-o background \
`/home/pifordecoyer/code/cpp/GenshinCard/ImageMagick/bin/Magick++-config --ldflags --libs` \
`Magick++-config --ldflags --libs` \
-DBOOST_BIND_GLOBAL_PLACEHOLDERS
Binary file modified Image/result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions include/DrawStat.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class DrawStat : Stat{ //of char and weapon, this class just create drawlist
void iconToDrawlist(std::string icon, int x, int y);
void drawBasic(int, int, int);
void drawBonus(int, int, int, int, std::string, std::vector<std::string> displayStat = {}, bool skipBasic = true); //from artifacts
void drawWeapon(int ximg, int yimg, int xstat, int xval, int y, int spacey);
void drawArtifact(int ximg, int yimg, int xstat, int xval, int y, int spacey, int icon_size=100);
void drawWeapon(int ximg, int yimg, int xstat, int xval, int y, int spacey, int icon_size=100);
void drawArtifact(int ximg, int yimg, int xstat, int xval, int y, int spacey);
void drawTalents(int, int, int);
void drawCons(int, int, int);
std::vector<Drawable> get_drawList();
Expand Down
2 changes: 1 addition & 1 deletion include/GlobalValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <utility>
#include "str.h"
#define FONT_SIZE 26
#define FONT "Times-New-Roman"
#define FONT "Times-Roman"
const std::map<std::string, std::map<int, double>> artifact5_main_stats ={
//7.0 9.0 11.0 12.9 14.9 16.9 18.9 20.9 22.8 24.8 26.8 28.8 30.8 32.8 34.7 36.7 38.7 40.7 42.7 44.6 46.6
{"hp_", {
Expand Down
11 changes: 6 additions & 5 deletions local.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
g++ -std=c++2b `/home/pifordecoyer/code/cpp/GenshinCard/ImageMagick/bin/Magick++-config --cxxflags --cppflags` \
g++ -std=c++20 `Magick++-config --cxxflags --cppflags` \
-fdiagnostics-color=always \
-I/home/pifordecoyer/code/cpp/GenshinCard/include \
-I/usr/include/python3.10/ \
-I/home/ser3_decoyer/repo/GenshinCard/include \
-I/usr/include/python3.9/ \
-g ./*.cpp ./DataProcess/*.cpp ./BaseStat/*.cpp ./Util/*.cpp ./Image/*.cpp \
-o GenshinCard \
`/home/pifordecoyer/code/cpp/GenshinCard/ImageMagick/bin/Magick++-config --ldflags --libs` `python3.10-config --ldflags --embed` \
-ljsoncpp -l:libboost_python310.so -lcpr \
`Magick++-config --ldflags --libs` `python3.9-config --ldflags --embed` \
-ljsoncpp -l:libboost_python39.so -lcpr \
-DBOOST_BIND_GLOBAL_PLACEHOLDERS \
-Wno-deprecated-declarations \
-DBOOST_ALLOW_DEPRECATED_HEADERS
16 changes: 14 additions & 2 deletions req.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,20 @@ sudo apt-get install -y python3.10 python3-pip git-all build-essential pkg-confi
git clone https://github.com/ImageMagick/ImageMagick.git "${SCRIPTPATH}/ImageMagick"
cd "${SCRIPTPATH}/ImageMagick" && ./configure CXX=g++
make
make install
sudo make install
git clone https://github.com/libcpr/cpr.git "${SCRIPTPATH}/cpr"
cd "${SCRIPTPATH}/cpr" && mkdir build && cd build
cmake "${SCRIPTPATH}/cpr" -DCPR_BUILD_TESTS=OFF
sudo make install
sudo make install

#--------------------------------export env variables--------------------------------
file="${HOME}/.bashrc"

while IFS= read -r line
do
[ -z "$line" ] && continue
grep -xq -- "export ${line}" "$file" || echo "\nexport ${line}" | sudo tee -a "$file"
#end while loop
done < "${SCRIPTPATH}/.env"


4 changes: 2 additions & 2 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/usr/bin/g++ -g -shared -fPIC -std=c++2b \
`/app/GenshinCard/ImageMagick/bin/Magick++-config --cxxflags --cppflags` \
-fdiagnostics-color=always -I/app/GenshinCard/include -I/usr/include/python3.10/ \
-fdiagnostics-color=always -I/app/GenshinCard/include -I/usr/include/python3.9/ \
/app/GenshinCard/*.cpp /app/GenshinCard/DataProcess/*.cpp -o /app/GenshinCard/GenshinCard.so \
`/app/GenshinCard/ImageMagick/bin/Magick++-config --ldflags --libs` `python3.10-config --ldflags --embed` \
`/app/GenshinCard/ImageMagick/bin/Magick++-config --ldflags --libs` `python3.9-config --ldflags --embed` \
-ljsoncpp -l:libboost_python310.so -lcpr
ldconfig
echo "Build complete."
Expand Down

0 comments on commit c7e5f28

Please sign in to comment.