Cleaning up stuff

This commit is contained in:
tognee 2019-09-18 00:09:46 +02:00
parent 5423be67ca
commit a5ea06a928
44 changed files with 7329 additions and 7432 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -2,9 +2,9 @@
echo Building 3DSX/ELF/SMDH... echo Building 3DSX/ELF/SMDH...
make make
echo Creating banner... echo Creating banner...
bannertool.exe makebanner -i icons-banners/banner.png -a icons-banners/audio.wav -o icons-banners/banner.bnr bannertool makebanner -i icons-banners/banner.png -a icons-banners/audio.wav -o icons-banners/banner.bnr
echo Creating icon... echo Creating icon...
bannertool.exe makesmdh -s "Minicraft3DS" -l "3DS Homebrew port of Notch's ludum dare game 'Minicraft', updated." -p "Davideesk/Andre111/ElijahZAwesome" -i icons-banners/icon.png -o icons-banners/icon.icn bannertool makesmdh -s "Minicraft3DS" -l "3DS Homebrew port of Notch's ludum dare game 'Minicraft', updated." -p "Davideesk/Andre111/ElijahZAwesome" -i icons-banners/icon.png -o icons-banners/icon.icn
echo Creating ROMFS... echo Creating ROMFS...
3dstool -cvtf romfs icons-banners/romfs.bin --romfs-dir romfs/ 3dstool -cvtf romfs icons-banners/romfs.bin --romfs-dir romfs/
echo Creating CIA... echo Creating CIA...

Binary file not shown.

BIN
data/icons.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

View file

@ -1,78 +0,0 @@
# Minicraft3DS
3DS Homebrew port of Notch's ludum dare game "Minicraft"
Current Version: Version 1.6.1
----------
**Download:**
If you just want to download the game prebuilt check the releases tab in Github:
https://github.com/ElijahZAwesome/Minicraft3DS/releases
For building the game yourself look below.
----------
**Dependencies:**
For building and installing the dependencies look below.
ctrulib by smea: https://github.com/smealum/ctrulib
citro3d by fincs: https://github.com/fincs/citro3d
sf2dlib by xerpi: https://github.com/xerpi/sf2dlib
sfillib by xerpi: https://github.com/xerpi/sfillib
zlib: http://www.zlib.net/
----------
**Building:**
**1. Install devkitARM by devkitPro**
- On Windows download https://sourceforge.net/projects/devkitpro/files/Automated%20Installer/
- And install atleast Minimal System and devkitARM
- This includes make, ctrulib and citro3d
**2. Install zlib, libjpeg-turbo and libpng**
- Download 3DS-Portlibs: https://github.com/devkitPro/3ds_portlibs
- Run these commands:
```
make zlib
make install-zlib
make libjpeg-turbo
make libpng
make install
```
**3. Install sf2dlib**
- Download https://github.com/xerpi/sf2dlib
- In the libsf2d directory run these commands:
```
make
make install
```
**4. Install sfillib**
- Download https://github.com/xerpi/sfillib
- In the libsfil directory run these commands:
```
make
make install
```
**5. You can now build Minicraft3DS 3dsx, elf, cia, and 3ds files by running the build.bat file.**
----------
You can do anything with the source code (besides sell it) as long as you give proper credit to the right people.
If you are going to make a mod of this version, be sure to give credit to Markus "Notch" Perrson because he did create the original game after all.
# Misc
This source code is subject to a lot of change for better optimization/cleanliness.
Forum thread: https://gbatemp.net/threads/release-new-minicraft3ds-fork-v1-4.494947/

View file

@ -1,4 +0,0 @@
theme: jekyll-theme-cayman
title: Minicraft3DS
description: A 2D Homebrew for 3DS
show_downloads: true

View file

Binary file not shown.

View file

@ -1,5 +0,0 @@
@echo off
echo Building 3DSX/ELF/SMDH...
make
echo Running in citra
%localappdata%/Citra/canary-mingw/citra-qt.exe result/Minicraft3DS.3dsx

View file

@ -246,6 +246,3 @@ Entity newGlowwormEntity(int x, int y, int level);
Entity newNPCEntity(int type, int x, int y, int level); Entity newNPCEntity(int type, int x, int y, int level);
void addEntityToList(Entity e, EntityManager* em); void addEntityToList(Entity e, EntityManager* em);
void removeEntityFromList(Entity * e,int level,EntityManager* em); void removeEntityFromList(Entity * e,int level,EntityManager* em);

View file

@ -133,7 +133,7 @@ void hurtEntity(Entity *e, int damage, int dir, u32 hurtColor, Entity *damager){
int i; int i;
// In hindsight I should've made a generic Mob struct, but whatever. ¯\_(-.-)_/¯ // In hindsight I should've made a generic Mob struct, but whatever. <20>\_(-.-)_/<2F>
switch(e->type){ switch(e->type){
case ENTITY_PLAYER: case ENTITY_PLAYER:
e->p.health -= damage; e->p.health -= damage;

View file

@ -7,7 +7,7 @@
#include "MapGen.h" #include "MapGen.h"
#include "Quests.h" #include "Quests.h"
#include "icons2_png.h" #include "icons_png.h"
#include "player_png.h" #include "player_png.h"
#include "Font_png.h" #include "Font_png.h"
#include "bottombg_png.h" #include "bottombg_png.h"

View file

@ -875,4 +875,3 @@ void createDungeonRoom(int w, int h, bool dragon, int level, u8 * map, u8 * data
break; break;
} }
} }

View file

@ -367,14 +367,14 @@ void tickMenu(int menu){
keyProp[1] = KEY_DDOWN | KEY_CPAD_DOWN | KEY_CSTICK_DOWN; keyProp[1] = KEY_DDOWN | KEY_CPAD_DOWN | KEY_CSTICK_DOWN;
keyProp[2] = KEY_DLEFT | KEY_CPAD_LEFT | KEY_CSTICK_LEFT; keyProp[2] = KEY_DLEFT | KEY_CPAD_LEFT | KEY_CSTICK_LEFT;
keyProp[3] = KEY_DRIGHT | KEY_CPAD_RIGHT | KEY_CSTICK_RIGHT; keyProp[3] = KEY_DRIGHT | KEY_CPAD_RIGHT | KEY_CSTICK_RIGHT;
keyProp[4] = KEY_A | KEY_B | KEY_L | KEY_ZR; keyProp[4] = KEY_A | KEY_B;
keyProp[5] = KEY_X | KEY_Y | KEY_R | KEY_ZL; keyProp[5] = KEY_X | KEY_Y;
keyProp[6] = KEY_START; keyProp[6] = KEY_START;
keyProp[7] = KEY_A; keyProp[7] = KEY_A;
keyProp[8] = KEY_B; keyProp[8] = KEY_B;
keyProp[9] = KEY_X; keyProp[9] = KEY_X;
keyProp[10] = KEY_R; keyProp[10] = KEY_R | KEY_ZR;
keyProp[11] = KEY_L; keyProp[11] = KEY_L | KEY_ZL;
bindOpt = false; bindOpt = false;
errorBut = -1; errorBut = -1;
break; break;
@ -490,7 +490,7 @@ void tickMenu(int menu){
if(currentSelection > 0){ if(currentSelection > 0){
isLoadingTP = 4; isLoadingTP = 4;
} else { } else {
icons = sfil_load_PNG_buffer(icons2_png, SF2D_PLACE_RAM); icons = sfil_load_PNG_buffer(icons_png, SF2D_PLACE_RAM);
reloadColors(); reloadColors();
font = sfil_load_PNG_buffer(Font_png, SF2D_PLACE_RAM); font = sfil_load_PNG_buffer(Font_png, SF2D_PLACE_RAM);
bottombg = sfil_load_PNG_buffer(bottombg_png, SF2D_PLACE_RAM); bottombg = sfil_load_PNG_buffer(bottombg_png, SF2D_PLACE_RAM);

View file

@ -5,9 +5,6 @@
FILE *recvFile; FILE *recvFile;
size_t recvFileSize; size_t recvFileSize;
void * writeBool(void *buffer, size_t *size, bool value) { void * writeBool(void *buffer, size_t *size, bool value) {
*((bool*) buffer) = value; *((bool*) buffer) = value;
*(size) += sizeof(bool); *(size) += sizeof(bool);
@ -38,9 +35,6 @@ void * writeSizeT(void *buffer, size_t *size, size_t value) {
return buffer + sizeof(size_t); return buffer + sizeof(size_t);
} }
void * readBool(void *buffer, size_t *size, bool *value) { void * readBool(void *buffer, size_t *size, bool *value) {
*value = *((bool*) buffer); *value = *((bool*) buffer);
*(size) -= sizeof(bool); *(size) -= sizeof(bool);
@ -71,9 +65,6 @@ void * readSizeT(void *buffer, size_t *size, size_t *value) {
return buffer + sizeof(size_t); return buffer + sizeof(size_t);
} }
void processPacket(void *packet, size_t size) { void processPacket(void *packet, size_t size) {
//Differenciate the packets and process them //Differenciate the packets and process them
switch(packetGetID(packet)) { switch(packetGetID(packet)) {
@ -202,9 +193,6 @@ size_t packetGetDataSize(size_t size) {
return size-sizeof(u8)-sizeof(u8)-sizeof(u32); return size-sizeof(u8)-sizeof(u8)-sizeof(u32);
} }
size_t writeStartPacket(void *buffer, u32 seed) { size_t writeStartPacket(void *buffer, u32 seed) {
size_t size = 0; size_t size = 0;
buffer = writeU8(buffer, &size, PACKET_START); buffer = writeU8(buffer, &size, PACKET_START);

View file

@ -1118,7 +1118,7 @@ void renderFurniture(int itemID, int x, int y) {
render16(x, y, 240, 128, 0); render16(x, y, 240, 128, 0);
break; break;
case ITEM_POTION_MAKER: case ITEM_POTION_MAKER:
render16(x, y, 240, 96, 0); render16(x, y, 192, 168, 0);
break; break;
} }
} }
@ -1523,7 +1523,7 @@ void renderItemIcon(int itemID, int countLevel, int x, int y) {
render(x, y, 0, 152, 0); render(x, y, 0, 152, 0);
break; break;
case ITEM_WOOD: case ITEM_WOOD:
render(x, y, 8, 152, 0); render(x, y, 160, 168, 0);
break; break;
case ITEM_STONE: case ITEM_STONE:
renderb(x, y, 16, 152, 0, rockColor[1]); renderb(x, y, 16, 152, 0, rockColor[1]);
@ -1559,19 +1559,19 @@ void renderItemIcon(int itemID, int countLevel, int x, int y) {
render(x, y, 80, 152, 0); render(x, y, 80, 152, 0);
break; break;
case ITEM_GOLD_APPLE: case ITEM_GOLD_APPLE:
render(x, y, 177, 160, 0); render(x, y, 144, 168, 0);
break; break;
case ITEM_STRENGTH_POTION: case ITEM_STRENGTH_POTION:
render(x, y, 184, 160, 0); render(x, y, 176, 160, 0);
break; break;
case ITEM_SPEED_POTION: case ITEM_SPEED_POTION:
render(x, y, 191, 160, 0); render(x, y, 184, 160, 0);
break; break;
case ITEM_REGEN_POTION: case ITEM_REGEN_POTION:
render(x, y, 198, 160, 0); render(x, y, 192, 160, 0);
break; break;
case ITEM_SWIM_BREATH_POTION: case ITEM_SWIM_BREATH_POTION:
render(x, y, 219, 160, 0); render(x, y, 200, 160, 0);
break; break;
case ITEM_SLIME: case ITEM_SLIME:
renderb(x, y, 88, 152, 0, 0xFF4DC04D); renderb(x, y, 88, 152, 0, 0xFF4DC04D);
@ -1604,7 +1604,7 @@ void renderItemIcon(int itemID, int countLevel, int x, int y) {
render(x, y, 144, 160, 0); render(x, y, 144, 160, 0);
break; break;
case ITEM_POTION_MAKER: case ITEM_POTION_MAKER:
render(x, y, 216, 152, 0); render(x, y, 192, 168, 0);
break; break;
case ITEM_WALL_WOOD: case ITEM_WALL_WOOD:
renderb(x, y, 224, 144, 0, woodColor); renderb(x, y, 224, 144, 0, woodColor);

View file

@ -135,7 +135,7 @@ int main() {
quitGame = false; quitGame = false;
initBGMap = 1; initBGMap = 1;
icons = sfil_load_PNG_buffer(icons2_png, SF2D_PLACE_RAM); icons = sfil_load_PNG_buffer(icons_png, SF2D_PLACE_RAM);
playerSprites = sfil_load_PNG_buffer(player_png, SF2D_PLACE_RAM); playerSprites = sfil_load_PNG_buffer(player_png, SF2D_PLACE_RAM);
font = sfil_load_PNG_buffer(Font_png, SF2D_PLACE_RAM); font = sfil_load_PNG_buffer(Font_png, SF2D_PLACE_RAM);
bottombg = sfil_load_PNG_buffer(bottombg_png, SF2D_PLACE_RAM); bottombg = sfil_load_PNG_buffer(bottombg_png, SF2D_PLACE_RAM);
@ -163,14 +163,14 @@ int main() {
localInputs.k_down.input = KEY_DDOWN | KEY_CPAD_DOWN | KEY_CSTICK_DOWN; localInputs.k_down.input = KEY_DDOWN | KEY_CPAD_DOWN | KEY_CSTICK_DOWN;
localInputs.k_left.input = KEY_DLEFT | KEY_CPAD_LEFT | KEY_CSTICK_LEFT; localInputs.k_left.input = KEY_DLEFT | KEY_CPAD_LEFT | KEY_CSTICK_LEFT;
localInputs.k_right.input = KEY_DRIGHT | KEY_CPAD_RIGHT | KEY_CSTICK_RIGHT; localInputs.k_right.input = KEY_DRIGHT | KEY_CPAD_RIGHT | KEY_CSTICK_RIGHT;
localInputs.k_attack.input = KEY_A | KEY_B | KEY_L | KEY_ZR; localInputs.k_attack.input = KEY_A | KEY_B;
localInputs.k_menu.input = KEY_X | KEY_Y | KEY_R | KEY_ZL; localInputs.k_menu.input = KEY_X | KEY_Y;
localInputs.k_pause.input = KEY_START; localInputs.k_pause.input = KEY_START;
localInputs.k_accept.input = KEY_A; localInputs.k_accept.input = KEY_A;
localInputs.k_decline.input = KEY_B; localInputs.k_decline.input = KEY_B;
localInputs.k_delete.input = KEY_X; localInputs.k_delete.input = KEY_X;
localInputs.k_menuNext.input = KEY_R; localInputs.k_menuNext.input = KEY_R | KEY_ZR;
localInputs.k_menuPrev.input = KEY_L; localInputs.k_menuPrev.input = KEY_L | KEY_ZL;
/* If btnSave exists, then use that. */ /* If btnSave exists, then use that. */
if ((file = fopen("btnSave.bin", "rb"))) { if ((file = fopen("btnSave.bin", "rb"))) {

View file

@ -89,7 +89,7 @@ int loadTexturePack(char * filename) {
} }
if(texturepackUseDefaultIcons){ if(texturepackUseDefaultIcons){
icons = sfil_load_PNG_buffer(icons2_png, SF2D_PLACE_RAM); icons = sfil_load_PNG_buffer(icons_png, SF2D_PLACE_RAM);
reloadColors(); reloadColors();
} }
if(texturepackUseDefaultPlayer) playerSprites = sfil_load_PNG_buffer(player_png, SF2D_PLACE_RAM); if(texturepackUseDefaultPlayer) playerSprites = sfil_load_PNG_buffer(player_png, SF2D_PLACE_RAM);