mirror of
https://git.planet-casio.com/Slyvtt/Collab_RPG.git
synced 2025-04-19 17:37:36 +02:00
Merge pull request 'Debug de npc.c/coverters.py' (#35) from Fcalva/Collab_RPG_Fcalva:master into dev
Reviewed-on: https://gitea.planet-casio.com/Slyvtt/Collab_RPG/pulls/35
This commit is contained in:
commit
608c668b00
2 changed files with 13 additions and 9 deletions
|
@ -7,8 +7,7 @@ import os
|
||||||
|
|
||||||
def convert(input, output, params, target):
|
def convert(input, output, params, target):
|
||||||
if params["custom-type"] == "map":
|
if params["custom-type"] == "map":
|
||||||
#convert_map(input, output, params, target)
|
print("ERROR : Asset ", params["name"], " has legacy type map")
|
||||||
#return 0
|
|
||||||
return 1
|
return 1
|
||||||
elif params["custom-type"] == "world":
|
elif params["custom-type"] == "world":
|
||||||
convert_world(input, output, params, target)
|
convert_world(input, output, params, target)
|
||||||
|
@ -208,8 +207,7 @@ def get_tile_map_data(input, output, params, target, xmin, ymin, xmax, ymax):
|
||||||
def get_extra_map_data(input, output, params, target, xmin, ymin, xmax, ymax):
|
def get_extra_map_data(input, output, params, target, xmin, ymin, xmax, ymax):
|
||||||
print( "WE ARE COMPUTING THE EXTRA DATA OF THE MAP : ", input )
|
print( "WE ARE COMPUTING THE EXTRA DATA OF THE MAP : ", input )
|
||||||
data = json.load(open(input, "r"))
|
data = json.load(open(input, "r"))
|
||||||
|
|
||||||
|
|
||||||
nblayer = ["id" in i for i in data["layers"]].count(True) - 1
|
nblayer = ["id" in i for i in data["layers"]].count(True) - 1
|
||||||
print( "I found ", nblayer, " of extradata")
|
print( "I found ", nblayer, " of extradata")
|
||||||
|
|
||||||
|
@ -288,13 +286,17 @@ def get_extra_map_data(input, output, params, target, xmin, ymin, xmax, ymax):
|
||||||
for v in layer["objects"]:
|
for v in layer["objects"]:
|
||||||
if v[ "id" ] == pathID:
|
if v[ "id" ] == pathID:
|
||||||
print( "path data found : " )
|
print( "path data found : " )
|
||||||
xdata = bytes()
|
|
||||||
ydata = bytes()
|
xdata = bytes("", "UTF-16")
|
||||||
|
ydata = bytes("", "UTF-16")
|
||||||
|
|
||||||
for w in v[ "polyline" ]:
|
for w in v[ "polyline" ]:
|
||||||
path_length = path_length + 1
|
path_length = path_length + 1
|
||||||
print( "X= ", w[ "x" ], " Y= ", w[ "y" ] )
|
print( "X= ", w[ "x" ], " Y= ", w[ "y" ] )
|
||||||
xdata += fxconv.u16( int( w[ "x" ] ) )
|
xdata += fxconv.u16( int( w[ "x" ] ) )
|
||||||
ydata += fxconv.u16( int( w[ "y" ] ) )
|
ydata += fxconv.u16( int( w[ "y" ] ) )
|
||||||
|
print("xdata : ", xdata)
|
||||||
|
print("ydata : ", ydata)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print( "PNJ has no Path" )
|
print( "PNJ has no Path" )
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <gint/display.h>
|
#include <gint/display.h>
|
||||||
|
#include <gint/keyboard.h> /*debug*/
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,7 +23,7 @@ extern bopti_image_t demo_PNJ_img;
|
||||||
void npc_draw(Game *game) {
|
void npc_draw(Game *game) {
|
||||||
Player *player = &game->player;
|
Player *player = &game->player;
|
||||||
|
|
||||||
for (int u=0; u<game->map_level->nbextradata; u++)
|
for (uint32_t u=0; u<game->map_level->nbextradata; u++) //uint pour enlever un warning
|
||||||
{
|
{
|
||||||
ExtraData *Data = &game->map_level->extradata[u];
|
ExtraData *Data = &game->map_level->extradata[u];
|
||||||
|
|
||||||
|
@ -37,9 +38,10 @@ void npc_draw(Game *game) {
|
||||||
for(int v=0; v<NbPoints; v++)
|
for(int v=0; v<NbPoints; v++)
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
|
||||||
int16_t deltaX1=((int16_t) (Data->xpath[v % NbPoints] * PXSIZE))-(int16_t) player->wx;
|
int16_t deltaX1=((int16_t) (Data->xpath[v % NbPoints] * PXSIZE))-(int16_t) player->wx;
|
||||||
int16_t deltaY1=((int16_t) (Data->ypath[v % NbPoints] * PXSIZE))-(int16_t) player->wy;
|
int16_t deltaY1=((int16_t) (Data->ypath[v % NbPoints] * PXSIZE))-(int16_t) player->wy;
|
||||||
|
/*DEBUG*/ dprint(0, 0, 0xFAFA, "coucou 43 : %d", v); dupdate(); getkey(); //plante avant ici (le v % NbPoints est sus)
|
||||||
|
|
||||||
int16_t deltaX2=((int16_t) (Data->xpath[(v+1) % NbPoints] * PXSIZE))-(int16_t) player->wx;
|
int16_t deltaX2=((int16_t) (Data->xpath[(v+1) % NbPoints] * PXSIZE))-(int16_t) player->wx;
|
||||||
int16_t deltaY2=((int16_t) (Data->ypath[(v+1) % NbPoints] * PXSIZE))-(int16_t) player->wy;
|
int16_t deltaY2=((int16_t) (Data->ypath[(v+1) % NbPoints] * PXSIZE))-(int16_t) player->wy;
|
||||||
|
@ -47,7 +49,7 @@ void npc_draw(Game *game) {
|
||||||
dline( player->px + deltaX1, player->py + deltaY1,
|
dline( player->px + deltaX1, player->py + deltaY1,
|
||||||
player->px + deltaX2, player->py + deltaY2,
|
player->px + deltaX2, player->py + deltaY2,
|
||||||
PATH_COLOR);
|
PATH_COLOR);
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue