added 2d png support

This commit is contained in:
h4570
2020-12-01 17:26:10 +01:00
parent 3841487388
commit 510199164c
17 changed files with 317 additions and 80 deletions
+7 -2
View File
@@ -8,6 +8,7 @@ EE_OBJS = \
../../engine/models/mesh_frame.o \
../../engine/models/mesh_material.o \
../../engine/models/mesh.o \
../../engine/models/sprite.o \
../../engine/models/mesh_texture.o \
../../engine/modules/audio.o \
../../engine/modules/camera_base.o \
@@ -25,6 +26,7 @@ EE_OBJS = \
../../engine/loaders/dff_loader.o \
../../engine/loaders/md2_loader.o \
../../engine/loaders/obj_loader.o \
../../engine/loaders/png_loader.o \
../../engine/vu1_progs/draw3D.o \
../../engine/engine.o \
camera.o \
@@ -32,8 +34,11 @@ EE_OBJS = \
ari.o \
main.o
EE_LIBS = -ldraw -lgraph -lmath3d -lpacket -ldma -lpacket2 -lpad -laudsrv -lc -lstdc++
EE_INCS := -I./../../engine/include $(EE_INCS)
EE_LIBS = -ldraw -lgraph -lmath3d -lpacket -ldma -lpacket2 -lpad -laudsrv -lc -lstdc++ -lpng -lz
EE_INCS := -I./../../engine/include -I$(PS2SDK)/ports/include $(EE_INCS)
EE_LDFLAGS := -L$(PS2SDK)/ports/lib $(EE_LDFLAGS)
EE_CFLAGS := -DHAVE_LIBPNG -DHAVE_ZLIB $(EE_CFLAGS)
EE_CXXFLAGS := -DHAVE_LIBPNG -DHAVE_ZLIB $(EE_CXXFLAGS)
EE_DVP = dvp-as
EE_VCL = vcl
+11 -7
View File
@@ -48,6 +48,10 @@ void Ari::onInit()
island.shouldBeBackfaceCulled = true;
island.shouldBeFrustumCulled = false;
fist.size.set(100.0F, 100.0F);
MeshTexture *fistTex = texRepo->add("2d/", "fist", PNG);
fistTex->addLink(fist.getId());
islandAddons.loadDff("sunnyisl/", "sunnyisl3", 0.1F, false);
islandAddons.shouldBeBackfaceCulled = true;
islandAddons.rotation.x = -1.6F;
@@ -58,7 +62,7 @@ void Ari::onInit()
waterFloors[0].loadObj("water/", "water", 5.0F, false);
waterFloors[0].position.set(0.0F, 8.0F, 0.0F);
texRepo->addByMesh("water/", waterFloors[0]);
texRepo->addByMesh("water/", waterFloors[0], BMP);
for (u8 i = 0; i < WATER_TILES_COUNT; i++)
{
spirals[i].x = 1.0F;
@@ -74,11 +78,11 @@ void Ari::onInit()
->addLink(waterFloors[i].getId(), waterFloors[i].getMaterial(0).getId());
}
texRepo->addByMesh("sunnyisl/", island);
texRepo->addByMesh("sunnyisl/", islandAddons);
texRepo->addByMesh("skybox/", skybox);
texRepo->addByMesh("ari/", player.mesh);
engine->audio.playSong();
texRepo->addByMesh("sunnyisl/", island, BMP);
texRepo->addByMesh("sunnyisl/", islandAddons, BMP);
texRepo->addByMesh("skybox/", skybox, BMP);
texRepo->addByMesh("ari/", player.mesh, BMP);
// engine->audio.playSong();
}
void Ari::initBulb()
@@ -98,8 +102,8 @@ void Ari::onUpdate()
if (engine->pad.isCircleClicked)
engine->audio.playADPCM(adpcm2);
camera.update(engine->pad, player.mesh);
engine->renderer->drawRectangle();
engine->renderer->draw(skybox);
engine->renderer->draw(fist);
engine->renderer->draw(island);
engine->renderer->draw(islandAddons);
engine->renderer->draw(player.mesh);
+2
View File
@@ -17,6 +17,7 @@
#include <engine.hpp>
#include "objects/player.hpp"
#include <models/light_bulb.hpp>
#include <models/sprite.hpp>
#include <modules/texture_repository.hpp>
#include "./camera.hpp"
@@ -39,6 +40,7 @@ private:
Player player;
Mesh island, islandAddons, skybox;
Mesh *waterFloors;
Sprite fist;
audsrv_adpcm_t *adpcm1, *adpcm2;
Point *spirals;
Camera camera;
+9 -3
View File
@@ -8,6 +8,7 @@ EE_OBJS = \
../../engine/models/mesh_frame.o \
../../engine/models/mesh_material.o \
../../engine/models/mesh.o \
../../engine/models/sprite.o \
../../engine/models/mesh_texture.o \
../../engine/modules/audio.o \
../../engine/modules/camera_base.o \
@@ -25,6 +26,7 @@ EE_OBJS = \
../../engine/loaders/dff_loader.o \
../../engine/loaders/md2_loader.o \
../../engine/loaders/obj_loader.o \
../../engine/loaders/png_loader.o \
../../engine/vu1_progs/draw3D.o \
../../engine/engine.o \
managers/light_manager.o \
@@ -36,10 +38,14 @@ EE_OBJS = \
floors.o \
main.o
EE_LIBS = -ldraw -lgraph -lmath3d -lpacket -ldma -lpad -lpacket2 -laudsrv -lc -lstdc++
EE_INCS := -I./../../engine/include $(EE_INCS)
EE_LIBS = -ldraw -lgraph -lmath3d -lpacket -ldma -lpacket2 -lpad -laudsrv -lc -lstdc++ -lpng -lz
EE_INCS := -I./../../engine/include -I$(PS2SDK)/ports/include $(EE_INCS)
EE_LDFLAGS := -L$(PS2SDK)/ports/lib $(EE_LDFLAGS)
EE_CFLAGS := -DHAVE_LIBPNG -DHAVE_ZLIB $(EE_CFLAGS)
EE_CXXFLAGS := -DHAVE_LIBPNG -DHAVE_ZLIB $(EE_CXXFLAGS)
EE_DVP = dvp-as
EE_VCL = openvcl
EE_VCL = vcl
all: $(EE_BIN)
$(EE_STRIP) --strip-all $(EE_BIN)