Testing on real wii hardware some more
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
#pragma once
|
||||
#include "display/mesh/quad.h"
|
||||
|
||||
#define SPRITEBATCH_SPRITES_MAX 32
|
||||
#define SPRITEBATCH_SPRITES_MAX 240
|
||||
#define SPRITEBATCH_VERTEX_COUNT (SPRITEBATCH_SPRITES_MAX * QUAD_VERTEX_COUNT)
|
||||
#define SPRITEBATCH_FLUSH_COUNT 4
|
||||
#define SPRITEBATCH_SPRITES_MAX_PER_FLUSH (\
|
||||
|
||||
+16
-16
@@ -41,13 +41,13 @@ void onNetworkConnected(void *user) {
|
||||
|
||||
networkinfo_t info = networkGetInfo();
|
||||
if(info.type == NETWORK_TYPE_IPV4) {
|
||||
printf(
|
||||
sceneLog(
|
||||
"Connected to network with IPv4 address: " NETWORK_INFO_FORMAT_IPV4 "\n",
|
||||
info.ipv4.ip[0], info.ipv4.ip[1], info.ipv4.ip[2], info.ipv4.ip[3]
|
||||
);
|
||||
#ifdef DUSK_NETWORK_IPV6
|
||||
} else if(info.type == NETWORK_TYPE_IPV6) {
|
||||
printf(
|
||||
sceneLog(
|
||||
"Connected to network with IPv6 address: " NETWORK_INFO_FORMAT_IPV6 "\n",
|
||||
info.ipv6.ip[0], info.ipv6.ip[1], info.ipv6.ip[2], info.ipv6.ip[3],
|
||||
info.ipv6.ip[4], info.ipv6.ip[5], info.ipv6.ip[6], info.ipv6.ip[7],
|
||||
@@ -57,27 +57,27 @@ void onNetworkConnected(void *user) {
|
||||
#endif
|
||||
}
|
||||
|
||||
printf("Network connected, I will disconnect at: %.2f1.\n", onlineSwapTime);
|
||||
sceneLog("Network connected, I will disconnect at: %.2f1.\n", onlineSwapTime);
|
||||
}
|
||||
|
||||
void onNetworkFailed(errorret_t error, void *user) {
|
||||
onlineSwapTime = TIME.time + 3.0f;
|
||||
printf("Failed to connect to network, will try again at %.2f1.\n", onlineSwapTime);
|
||||
sceneLog("Failed to connect to network, will try again at %.2f1.\n", onlineSwapTime);
|
||||
}
|
||||
|
||||
void onNetworkDisconnected(errorret_t error, void *user) {
|
||||
onlineSwapTime = TIME.time + 3.0f;
|
||||
printf("Network disconnected, will go online at %.2f1.\n", onlineSwapTime);
|
||||
sceneLog("Network disconnected, will go online at %.2f1.\n", onlineSwapTime);
|
||||
errorCatch(errorPrint(error));
|
||||
}
|
||||
|
||||
void onNetworkDisconnectFinished(void *user) {
|
||||
onlineSwapTime = TIME.time + 3.0f;
|
||||
printf("Finished disconnecting from network, will go online at %.2f1.\n", onlineSwapTime);
|
||||
sceneLog("Finished disconnecting from network, will go online at %.2f1.\n", onlineSwapTime);
|
||||
}
|
||||
|
||||
void goOnline() {
|
||||
printf("Going online...\n");
|
||||
sceneLog("Going online...\n");
|
||||
networkRequestConnection(
|
||||
onNetworkConnected,
|
||||
onNetworkFailed,
|
||||
@@ -87,7 +87,7 @@ void goOnline() {
|
||||
}
|
||||
|
||||
void goOffline() {
|
||||
printf("Going offline...\n");
|
||||
sceneLog("Going offline...\n");
|
||||
networkRequestDisconnection(onNetworkDisconnectFinished, NULL);
|
||||
}
|
||||
|
||||
@@ -113,8 +113,8 @@ errorret_t engineInit(const int32_t argc, const char_t **argv) {
|
||||
errorChain(networkInit());
|
||||
errorChain(gameInit());
|
||||
|
||||
// printf("Init done, going to queue online in 3 seconds...\n");
|
||||
// onlineSwapTime = TIME.time + 3.0f;
|
||||
sceneLog("Init done, going to queue online in 3 seconds...\n");
|
||||
onlineSwapTime = TIME.time + 3.0f;
|
||||
|
||||
// Camera
|
||||
entityid_t cam = entityManagerAdd();
|
||||
@@ -178,12 +178,12 @@ errorret_t engineUpdate(void) {
|
||||
uiUpdate();
|
||||
errorChain(sceneUpdate());
|
||||
|
||||
// /* Reset the box to its start position on demand. */
|
||||
// if(inputIsDown(INPUT_ACTION_ACCEPT)) {
|
||||
// componentid_t posComp = entityGetComponent(phBoxEnt, COMPONENT_TYPE_POSITION);
|
||||
// entityPositionSetPosition(phBoxEnt, posComp, (vec3){ 0.0f, 4.0f, 0.0f });
|
||||
// entityPhysicsSetVelocity(phBoxEnt, phBoxPhys, (vec3){ 0.0f, 0.0f, 0.0f });
|
||||
// }
|
||||
/* Reset the box to its start position on demand. */
|
||||
if(inputIsDown(INPUT_ACTION_ACCEPT)) {
|
||||
componentid_t posComp = entityGetComponent(phBoxEnt, COMPONENT_TYPE_POSITION);
|
||||
entityPositionSetPosition(phBoxEnt, posComp, (vec3){ 0.0f, 4.0f, 0.0f });
|
||||
entityPhysicsSetVelocity(phBoxEnt, phBoxPhys, (vec3){ 0.0f, 0.0f, 0.0f });
|
||||
}
|
||||
|
||||
/* Step physics: positions are updated directly on POSITION components. */
|
||||
physicsManagerUpdate();
|
||||
|
||||
@@ -180,8 +180,9 @@ errorret_t sceneRender(void) {
|
||||
// errorChain(shaderSetTexture(&SHADER_UNLIT, SHADER_UNLIT_0TEXTURE, &DEFAULT_FONT_TEXTURE));
|
||||
// errorChain(shaderSetColor(&SHADER_UNLIT, SHADER_UNLIT_COLOR, COLOR_WHITE));
|
||||
errorChain(textDraw(
|
||||
100, 100,
|
||||
"Hello World",
|
||||
32, 32,
|
||||
// "Hello World",
|
||||
SCENE_LOG,
|
||||
COLOR_WHITE,
|
||||
&DEFAULT_FONT_TILESET,
|
||||
&DEFAULT_FONT_TEXTURE
|
||||
|
||||
@@ -52,6 +52,7 @@ errorret_t meshDrawDolphin(
|
||||
assertTrue(offsetof(meshvertex_t, pos) == 8, "pos offset wrong");
|
||||
#endif
|
||||
|
||||
// Flush vertex data to GPU. This is required before drawing with GX.
|
||||
DCFlushRange(
|
||||
(void*)&mesh->vertices[vertexOffset],
|
||||
sizeof(meshvertex_t) * vertexCount
|
||||
|
||||
Reference in New Issue
Block a user