Skip to content

Commit

Permalink
1744 lines enduro.h. removed client struct; replaced with gamestate. …
Browse files Browse the repository at this point in the history
…removed redundant logic.
  • Loading branch information
xinpw8 committed Jan 3, 2025
1 parent 4933556 commit 734acd8
Show file tree
Hide file tree
Showing 3 changed files with 257 additions and 695 deletions.
15 changes: 6 additions & 9 deletions pufferlib/ocean/enduro/cy_enduro.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,8 @@ cdef extern from "enduro.h":
LogBuffer* log_buffer
size_t obs_size
int num_envs

ctypedef struct Client:
float width
float height
Enduro gameState

ctypedef struct GameState

# Function prototypes
LogBuffer* allocate_logbuffer(int size)
Expand All @@ -53,16 +50,16 @@ cdef extern from "enduro.h":
void init(Enduro* env, int seed, int env_index)
void reset(Enduro* env)
void c_step(Enduro* env)
void c_render(Client* client, Enduro* env)
Client* make_client(Enduro* env)
void close_client(Client* client, Enduro* env)
void c_render(GameState* client, Enduro* env)
GameState* make_client(Enduro* env)
void close_client(GameState* client, Enduro* env)

# Define Cython wrapper class
cdef class CyEnduro:
cdef:
Enduro* envs
LogBuffer* logs
Client* client
GameState* client
int num_envs

def __init__(self,
Expand Down
3 changes: 1 addition & 2 deletions pufferlib/ocean/enduro/enduro.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ int demo() {
};

allocate(&env);
Client* client = make_client(&env);

GameState* client = make_client(&env);
unsigned int seed = 0;
init(&env, seed, 0);
reset(&env);
Expand Down
Loading

0 comments on commit 734acd8

Please sign in to comment.