Browse Source

Added some more models to play with.

master
Nico de Poel 3 years ago
parent
commit
8bcc7c2e8b
  1. 9
      CMakeLists.txt
  2. 25
      main.c
  3. BIN
      ogre.ps1mdl
  4. BIN
      ogre_b.tim
  5. BIN
      ogre_f.tim
  6. BIN
      quaddama.ps1mdl
  7. BIN
      quaddama_b.tim
  8. BIN
      quaddama_f.tim

9
CMakeLists.txt

@ -16,10 +16,19 @@ psn00bsdk_add_executable(template STATIC main.c)
psn00bsdk_target_incbin(template PRIVATE mdl_player player.ps1mdl) psn00bsdk_target_incbin(template PRIVATE mdl_player player.ps1mdl)
psn00bsdk_target_incbin(template PRIVATE tim_player_f player_f.tim) psn00bsdk_target_incbin(template PRIVATE tim_player_f player_f.tim)
psn00bsdk_target_incbin(template PRIVATE tim_player_b player_b.tim) psn00bsdk_target_incbin(template PRIVATE tim_player_b player_b.tim)
psn00bsdk_target_incbin(template PRIVATE mdl_shambler shambler.ps1mdl) psn00bsdk_target_incbin(template PRIVATE mdl_shambler shambler.ps1mdl)
psn00bsdk_target_incbin(template PRIVATE tim_shambler_f shambler_f.tim) psn00bsdk_target_incbin(template PRIVATE tim_shambler_f shambler_f.tim)
psn00bsdk_target_incbin(template PRIVATE tim_shambler_b shambler_b.tim) psn00bsdk_target_incbin(template PRIVATE tim_shambler_b shambler_b.tim)
psn00bsdk_target_incbin(template PRIVATE mdl_ogre ogre.ps1mdl)
psn00bsdk_target_incbin(template PRIVATE tim_ogre_f ogre_f.tim)
psn00bsdk_target_incbin(template PRIVATE tim_ogre_b ogre_b.tim)
psn00bsdk_target_incbin(template PRIVATE mdl_quaddama quaddama.ps1mdl)
psn00bsdk_target_incbin(template PRIVATE tim_quaddama_f quaddama_f.tim)
psn00bsdk_target_incbin(template PRIVATE tim_quaddama_b quaddama_b.tim)
psn00bsdk_add_cd_image( psn00bsdk_add_cd_image(
iso # Target name iso # Target name
template # Output file name (= template.bin + template.cue) template # Output file name (= template.bin + template.cue)

25
main.c

@ -51,6 +51,12 @@ extern u_long tim_player_b[];
extern u_long mdl_shambler[]; extern u_long mdl_shambler[];
extern u_long tim_shambler_f[]; extern u_long tim_shambler_f[];
extern u_long tim_shambler_b[]; extern u_long tim_shambler_b[];
extern u_long mdl_ogre[];
extern u_long tim_ogre_f[];
extern u_long tim_ogre_b[];
extern u_long mdl_quaddama[];
extern u_long tim_quaddama_f[];
extern u_long tim_quaddama_b[];
typedef struct typedef struct
{ {
@ -76,9 +82,11 @@ typedef struct
ps1texture_t front, back; ps1texture_t front, back;
} ps1skin_t; } ps1skin_t;
ps1mdl_t playerModel = { .position = { -150, 0, 0 }, .rotation = { 0 } };
ps1mdl_t shamblerModel = { .position = { 150, 0, 0 }, .rotation = { 0, 0, ONE >> 1, 0 } };
ps1skin_t playerSkin, shamblerSkin;
ps1mdl_t playerModel = { .position = { -180, 0, 0 }, .rotation = { 0 } };
ps1mdl_t shamblerModel = { .position = { 180, 0, 0 }, .rotation = { 0, 0, ONE >> 1, 0 } };
ps1mdl_t ogreModel = { .position = { 0, 180, 0 }, .rotation = { 0, 0, (ONE * 3) >> 2, 0 } };
ps1mdl_t quadModel = { .position = { -32, 0, 0 }, .rotation = { 0 } };
ps1skin_t playerSkin, shamblerSkin, ogreSkin, quadSkin;
const MATRIX identity = { const MATRIX identity = {
ONE, 0, 0, ONE, 0, 0,
@ -204,6 +212,12 @@ void init(void)
loadModel(mdl_shambler, &shamblerModel); loadModel(mdl_shambler, &shamblerModel);
loadSkin(tim_shambler_f, tim_shambler_b, &shamblerSkin); loadSkin(tim_shambler_f, tim_shambler_b, &shamblerSkin);
loadModel(mdl_ogre, &ogreModel);
loadSkin(tim_ogre_f, tim_ogre_b, &ogreSkin);
loadModel(mdl_quaddama, &quadModel);
loadSkin(tim_quaddama_f, tim_quaddama_b, &quadSkin);
InitGeom(); InitGeom();
gte_SetGeomOffset(SCREENWIDTH >> 1, SCREENHEIGHT >> 1); gte_SetGeomOffset(SCREENWIDTH >> 1, SCREENHEIGHT >> 1);
gte_SetGeomScreen(180); // Screen depth for FOV control. Essentially the Z position of the vanishing point. gte_SetGeomScreen(180); // Screen depth for FOV control. Essentially the Z position of the vanishing point.
@ -521,6 +535,8 @@ void drawStuff(int counter)
drawModel(&view_matrix, &playerModel, &playerSkin, counter >> 2); drawModel(&view_matrix, &playerModel, &playerSkin, counter >> 2);
drawModel(&view_matrix, &shamblerModel, &shamblerSkin, counter >> 2); drawModel(&view_matrix, &shamblerModel, &shamblerSkin, counter >> 2);
//drawModel(&view_matrix, &ogreModel, &ogreSkin, counter >> 2);
drawModel(&view_matrix, &quadModel, &quadSkin, 0);
} }
// Main function, program entrypoint // Main function, program entrypoint
@ -535,7 +551,8 @@ int main(int argc, const char *argv[])
counter = 0; counter = 0;
while(1) while(1)
{ {
//playerModel.rotation.vz = (counter << 2) % ONE;
quadModel.rotation.vz = (counter << 5) % ONE;
quadModel.position.vz = (isin(counter << 6) * 32) >> 12;
drawStuff(counter); drawStuff(counter);

BIN
ogre.ps1mdl

BIN
ogre_b.tim

BIN
ogre_f.tim

BIN
quaddama.ps1mdl

BIN
quaddama_b.tim

BIN
quaddama_f.tim

Loading…
Cancel
Save