mirror of
https://github.com/GRRLIB/GRRLIB.git
synced 2024-11-22 15:02:20 +00:00
[ADD] unlimited3D sample code, based on the 2D version
This commit is contained in:
parent
80877d8fee
commit
22e432e3d4
11 changed files with 10359 additions and 0 deletions
140
examples/unlimited3d/Makefile
Normal file
140
examples/unlimited3d/Makefile
Normal file
|
@ -0,0 +1,140 @@
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
# Clear the implicit built in rules
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
.SUFFIXES:
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
ifeq ($(strip $(DEVKITPPC)),)
|
||||||
|
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC)
|
||||||
|
endif
|
||||||
|
|
||||||
|
include $(DEVKITPPC)/wii_rules
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
# TARGET is the name of the output
|
||||||
|
# BUILD is the directory where object files & intermediate files will be placed
|
||||||
|
# SOURCES is a list of directories containing source code
|
||||||
|
# INCLUDES is a list of directories containing extra header files
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
TARGET := $(notdir $(CURDIR))
|
||||||
|
BUILD := build
|
||||||
|
SOURCES := source source/gfx
|
||||||
|
DATA := data
|
||||||
|
INCLUDES :=
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
# options for code generation
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
CFLAGS = -g -O2 -mrvl -Wall $(MACHDEP) $(INCLUDE)
|
||||||
|
CXXFLAGS = $(CFLAGS)
|
||||||
|
|
||||||
|
#LDFLAGS = -g $(MACHDEP) -mrvl -Wl,-Map,$(notdir $@).map
|
||||||
|
LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map -Wl,--section-start,.init=0x81000000
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
# any extra libraries we wish to link with the project
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
LIBS := -lgrrlib -lpngu -lpng -ljpeg -lz -lfat -lwiiuse -lbte -logc -lm
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
# list of directories containing libraries, this must be the top level containing
|
||||||
|
# include and lib
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
LIBDIRS := $(CURDIR)/$(GRRLIB)
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
# no real need to edit anything past this point unless you need to add additional
|
||||||
|
# rules for different file extensions
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
ifneq ($(BUILD),$(notdir $(CURDIR)))
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
export OUTPUT := $(CURDIR)/$(TARGET)
|
||||||
|
|
||||||
|
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
|
||||||
|
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
|
||||||
|
|
||||||
|
export DEPSDIR := $(CURDIR)/$(BUILD)
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
# automatically build a list of object files for our project
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
|
||||||
|
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
|
||||||
|
sFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
|
||||||
|
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S)))
|
||||||
|
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
# use CXX for linking C++ projects, CC for standard C
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
ifeq ($(strip $(CPPFILES)),)
|
||||||
|
export LD := $(CC)
|
||||||
|
else
|
||||||
|
export LD := $(CXX)
|
||||||
|
endif
|
||||||
|
|
||||||
|
export OFILES := $(addsuffix .o,$(BINFILES)) \
|
||||||
|
$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
|
||||||
|
$(sFILES:.s=.o) $(SFILES:.S=.o)
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
# build a list of include paths
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
export INCLUDE := $(foreach dir,$(INCLUDES), -iquote $(CURDIR)/$(dir)) \
|
||||||
|
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
|
||||||
|
-I$(CURDIR)/$(BUILD) \
|
||||||
|
-I$(LIBOGC_INC)
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
# build a list of library paths
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \
|
||||||
|
-L$(LIBOGC_LIB)
|
||||||
|
|
||||||
|
export OUTPUT := $(CURDIR)/$(TARGET)
|
||||||
|
.PHONY: $(BUILD) clean
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
$(BUILD):
|
||||||
|
@[ -d $@ ] || mkdir -p $@
|
||||||
|
@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
clean:
|
||||||
|
@echo clean ...
|
||||||
|
@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
run:
|
||||||
|
psoload $(TARGET).dol
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
reload:
|
||||||
|
psoload -r $(TARGET).dol
|
||||||
|
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
else
|
||||||
|
|
||||||
|
DEPENDS := $(OFILES:.o=.d)
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
# main targets
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
$(OUTPUT).dol: $(OUTPUT).elf
|
||||||
|
$(OUTPUT).elf: $(OFILES)
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
# This rule links in binary data with the .jpg extension
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
%.jpg.o : %.jpg
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
@echo $(notdir $<)
|
||||||
|
$(bin2o)
|
||||||
|
|
||||||
|
-include $(DEPENDS)
|
||||||
|
|
||||||
|
#---------------------------------------------------------------------------------
|
||||||
|
endif
|
||||||
|
#---------------------------------------------------------------------------------
|
67
examples/unlimited3d/source/gfx/font.c
Normal file
67
examples/unlimited3d/source/gfx/font.c
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
/*
|
||||||
|
This file was autogenerated by raw2c.
|
||||||
|
Visit http://www.devkitpro.org
|
||||||
|
*/
|
||||||
|
|
||||||
|
const unsigned char font[] = {
|
||||||
|
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||||
|
0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x30, 0x08, 0x06, 0x00, 0x00, 0x00, 0x60, 0xc5, 0xa3,
|
||||||
|
0xdf, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00,
|
||||||
|
0x03, 0x5e, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda, 0xed, 0x9d, 0xd1, 0xb2, 0xad, 0x20, 0x08, 0x40,
|
||||||
|
0x4f, 0x4d, 0xff, 0xff, 0xcb, 0xdd, 0xa7, 0x3d, 0xd3, 0x6d, 0x6c, 0x54, 0x40, 0x40, 0x5d, 0xeb,
|
||||||
|
0xe9, 0xcc, 0xd9, 0x91, 0x26, 0x48, 0x44, 0x4a, 0xc7, 0xdf, 0x20, 0xee, 0xfb, 0xbe, 0x7f, 0x7f,
|
||||||
|
0x1f, 0xc7, 0x71, 0xfc, 0x81, 0x2b, 0xcf, 0xf1, 0xd7, 0xea, 0xe0, 0x7d, 0xae, 0xf7, 0x39, 0x6b,
|
||||||
|
0xbf, 0x43, 0x4e, 0xbb, 0x78, 0xea, 0xe7, 0x4b, 0x87, 0x5f, 0xd4, 0x74, 0xdb, 0x3b, 0xff, 0xb5,
|
||||||
|
0xed, 0xb7, 0xca, 0xbf, 0xe5, 0x0e, 0xef, 0x81, 0x86, 0x78, 0x63, 0x1f, 0x7d, 0x0e, 0x74, 0x3f,
|
||||||
|
0xaf, 0xf3, 0xfb, 0xd2, 0x57, 0xc9, 0xc1, 0xb4, 0x1e, 0x6b, 0xe9, 0x2c, 0x4b, 0xc7, 0xf6, 0xf6,
|
||||||
|
0xff, 0x79, 0xcc, 0x89, 0x59, 0xc0, 0xca, 0x13, 0xbe, 0x37, 0xb2, 0xe0, 0x66, 0xa8, 0x8b, 0xce,
|
||||||
|
0x66, 0x1b, 0xef, 0x0b, 0xd3, 0xc0, 0xe0, 0x01, 0x5b, 0x68, 0x95, 0xad, 0x39, 0xb8, 0x5a, 0x5a,
|
||||||
|
0x64, 0x44, 0xaa, 0x44, 0x23, 0x8f, 0x03, 0x5c, 0x14, 0x9c, 0x1e, 0x58, 0x3b, 0x3f, 0xaf, 0x7e,
|
||||||
|
0x5a, 0xd8, 0x77, 0xeb, 0xf9, 0x2e, 0x2f, 0x25, 0x30, 0x21, 0xc1, 0x7b, 0xc2, 0x7b, 0x4e, 0x64,
|
||||||
|
0xeb, 0x09, 0xbc, 0xab, 0xf3, 0xb3, 0x6a, 0xab, 0xf5, 0x25, 0xc9, 0x19, 0x69, 0x98, 0x00, 0xb0,
|
||||||
|
0xb7, 0xf3, 0x8b, 0x86, 0x47, 0x60, 0x18, 0x1a, 0xc9, 0x7b, 0x47, 0xff, 0xa5, 0xb7, 0x9b, 0x1e,
|
||||||
|
0xed, 0x67, 0x72, 0x14, 0xd9, 0x9c, 0x5f, 0x8f, 0x0d, 0x78, 0xd8, 0xcb, 0xb3, 0x8d, 0x6b, 0x07,
|
||||||
|
0x83, 0x80, 0xbd, 0x9c, 0xe0, 0x88, 0x27, 0x96, 0x59, 0xfa, 0x6f, 0xe5, 0xc0, 0xac, 0xaf, 0x37,
|
||||||
|
0xab, 0x13, 0x24, 0x02, 0x04, 0xf8, 0x70, 0x00, 0xd1, 0x69, 0x9b, 0xde, 0x08, 0x76, 0x87, 0x47,
|
||||||
|
0x57, 0xe9, 0x3a, 0x40, 0xf7, 0x47, 0xe0, 0x9e, 0x85, 0x93, 0x00, 0x3c, 0x85, 0xe4, 0x88, 0xfc,
|
||||||
|
0xb6, 0xb3, 0x11, 0x1c, 0x20, 0x48, 0x74, 0xf9, 0x75, 0x07, 0x5e, 0xc5, 0x11, 0xcd, 0xe4, 0x50,
|
||||||
|
0xac, 0x77, 0xfc, 0x58, 0xdc, 0x5c, 0x34, 0x3b, 0x47, 0x24, 0x7d, 0xc8, 0xf8, 0x16, 0x1e, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x51, 0x97, 0x93, 0x79, 0xff, 0xd6, 0xd5,
|
||||||
|
0xb8, 0x51, 0x12, 0x33, 0x43, 0x12, 0x55, 0x5a, 0x8f, 0x0c, 0xf4, 0x48, 0xf4, 0x3f, 0x62, 0x9d,
|
||||||
|
0x9b, 0xa7, 0xfd, 0x6a, 0xe7, 0x60, 0xa6, 0xf6, 0x23, 0xe5, 0xcd, 0x1d, 0xe0, 0xa8, 0x7a, 0x5e,
|
||||||
|
0xb3, 0xcb, 0xb3, 0x4c, 0xc1, 0xc7, 0x01, 0x5a, 0x17, 0xea, 0xf4, 0x68, 0x1f, 0xf9, 0x38, 0x79,
|
||||||
|
0xea, 0x01, 0x02, 0xc0, 0xb6, 0xb8, 0xef, 0x04, 0x19, 0x51, 0xfb, 0x6b, 0xf5, 0x55, 0xef, 0x33,
|
||||||
|
0x5c, 0x5f, 0xe4, 0x3a, 0x2c, 0x22, 0xea, 0x79, 0xc6, 0x2a, 0xb2, 0xf6, 0x5f, 0x49, 0xfe, 0xfa,
|
||||||
|
0xfd, 0xf3, 0x67, 0xc0, 0xda, 0xed, 0x3f, 0xda, 0x5c, 0x98, 0x54, 0x5e, 0x33, 0x01, 0x25, 0xd7,
|
||||||
|
0xaf, 0x95, 0x87, 0x75, 0x1c, 0xb0, 0xa6, 0x1f, 0xd6, 0xf2, 0x59, 0xf5, 0x20, 0xd9, 0xce, 0xa7,
|
||||||
|
0xd1, 0x57, 0xcb, 0x38, 0xfe, 0xb7, 0x17, 0x58, 0x53, 0x60, 0xb0, 0xa7, 0x73, 0x4f, 0x47, 0x21,
|
||||||
|
0x89, 0xe6, 0x4a, 0xf2, 0xda, 0xbc, 0x8e, 0x24, 0x87, 0xf0, 0xee, 0xbf, 0x55, 0x81, 0xc6, 0x59,
|
||||||
|
0x23, 0x9b, 0xc8, 0xbe, 0x66, 0xca, 0xaf, 0x6a, 0xed, 0xa0, 0x55, 0x3e, 0xab, 0x6d, 0x44, 0x47,
|
||||||
|
0x78, 0xbd, 0x01, 0x16, 0x39, 0x40, 0x80, 0x0d, 0x22, 0x5e, 0x28, 0x73, 0x66, 0x1b, 0xfc, 0xe8,
|
||||||
|
0x47, 0x08, 0x0f, 0xc3, 0x6a, 0x6d, 0x63, 0xa6, 0x8f, 0xfa, 0xdc, 0x9d, 0xe0, 0x98, 0x90, 0xcf,
|
||||||
|
0x20, 0x7f, 0x66, 0x74, 0x14, 0x38, 0x41, 0xe8, 0x7d, 0xdc, 0xf9, 0x81, 0x13, 0x44, 0xbe, 0x47,
|
||||||
|
0xfe, 0xb2, 0x56, 0xf8, 0x8e, 0x6f, 0xe4, 0x46, 0x5d, 0x3f, 0x39, 0x40, 0xec, 0x6f, 0xb5, 0xb1,
|
||||||
|
0xca, 0xa6, 0x2b, 0x72, 0x80, 0x00, 0xb0, 0xef, 0xd3, 0x83, 0x26, 0xac, 0x8c, 0xd8, 0x4a, 0xd6,
|
||||||
|
0xda, 0xf6, 0xc8, 0x8f, 0x3f, 0x5b, 0xf7, 0x1f, 0xd6, 0x89, 0x6a, 0x6a, 0xfd, 0xa8, 0xed, 0x64,
|
||||||
|
0xc8, 0x32, 0x7f, 0x76, 0x9b, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0,
|
||||||
|
0x26, 0x26, 0xe5, 0x68, 0x34, 0xc7, 0xb5, 0x92, 0xa5, 0x1c, 0x57, 0xed, 0x9c, 0xcd, 0x03, 0xbf,
|
||||||
|
0x69, 0x3d, 0xb8, 0xd2, 0xf8, 0xce, 0x78, 0xfd, 0x52, 0xfb, 0xf1, 0x2c, 0x07, 0x55, 0xda, 0x36,
|
||||||
|
0x97, 0xb1, 0x1c, 0x9c, 0x45, 0x3d, 0x4f, 0x29, 0x7c, 0x17, 0xd8, 0xfa, 0x8e, 0x22, 0xdc, 0x4b,
|
||||||
|
0xac, 0x91, 0xb7, 0xd8, 0xcb, 0x3c, 0xba, 0xfd, 0x5a, 0xbb, 0x91, 0xd7, 0x5f, 0x73, 0xca, 0xbc,
|
||||||
|
0x31, 0xcc, 0x37, 0x7f, 0xac, 0x60, 0x1d, 0x20, 0x00, 0x6c, 0x0b, 0x11, 0x20, 0x10, 0x61, 0xc0,
|
||||||
|
0xb6, 0x3a, 0xb9, 0x46, 0x87, 0x98, 0xde, 0x64, 0xfb, 0x36, 0xc7, 0x4c, 0x45, 0x4d, 0x33, 0x8c,
|
||||||
|
0x9f, 0x34, 0x1f, 0xa8, 0xa9, 0xe7, 0x88, 0x03, 0x8a, 0xaf, 0x87, 0x19, 0xb5, 0x90, 0xf9, 0x8a,
|
||||||
|
0x7e, 0x06, 0x8f, 0xca, 0x21, 0xd4, 0x72, 0x51, 0xdc, 0x8d, 0x73, 0xeb, 0xef, 0x7d, 0x5c, 0x6f,
|
||||||
|
0xc1, 0x4d, 0xf4, 0x5f, 0x9e, 0xd3, 0x11, 0xf5, 0x30, 0x23, 0xf3, 0xad, 0xe4, 0x00, 0x61, 0xe9,
|
||||||
|
0x48, 0x1f, 0xa0, 0xcb, 0x01, 0x8e, 0x30, 0x2c, 0xeb, 0x73, 0xb6, 0xde, 0x4d, 0x22, 0xfa, 0x8a,
|
||||||
|
0xfc, 0x7a, 0x25, 0xe1, 0x7b, 0xfa, 0x94, 0x69, 0xfc, 0x24, 0x25, 0xc2, 0xa2, 0x4b, 0xc1, 0x79,
|
||||||
|
0xeb, 0xff, 0xf4, 0xea, 0x04, 0x4e, 0x10, 0x79, 0x9c, 0x20, 0xe3, 0x9f, 0xcd, 0x09, 0x5e, 0xd9,
|
||||||
|
0x8c, 0x2b, 0x7b, 0x5e, 0x86, 0xf5, 0x61, 0xe8, 0xc4, 0x9a, 0xe7, 0x4b, 0x84, 0x19, 0xaf, 0xd3,
|
||||||
|
0xb3, 0x5f, 0xd6, 0x6d, 0xb1, 0x0c, 0x06, 0xdc, 0x26, 0x39, 0xa3, 0x20, 0x77, 0x82, 0xdc, 0x78,
|
||||||
|
0x17, 0x8e, 0x00, 0xa3, 0x97, 0x31, 0x94, 0x8c, 0x4f, 0xfb, 0xf5, 0xae, 0xe8, 0xc9, 0xe3, 0xd9,
|
||||||
|
0x7f, 0x49, 0xfb, 0x96, 0x7d, 0x58, 0xc5, 0x7e, 0x5a, 0xae, 0xa3, 0x26, 0x17, 0xad, 0x7f, 0xab,
|
||||||
|
0xf1, 0xe7, 0x25, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0xf0, 0x0f,
|
||||||
|
0xab, 0xb9, 0x5f, 0xb5, 0x2f, 0x5e, 0xd2, 0x50, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44,
|
||||||
|
0xae, 0x42, 0x60, 0x82
|
||||||
|
};
|
||||||
|
const int font_size = sizeof(font);
|
14
examples/unlimited3d/source/gfx/font.h
Normal file
14
examples/unlimited3d/source/gfx/font.h
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
/*
|
||||||
|
This file was autogenerated by raw2c.
|
||||||
|
Visit http://www.devkitpro.org
|
||||||
|
*/
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------
|
||||||
|
#ifndef _font_h_
|
||||||
|
#define _font_h_
|
||||||
|
//---------------------------------------------------------------------------------
|
||||||
|
extern const unsigned char font[];
|
||||||
|
extern const int font_size;
|
||||||
|
//---------------------------------------------------------------------------------
|
||||||
|
#endif //_font_h_
|
||||||
|
//---------------------------------------------------------------------------------
|
BIN
examples/unlimited3d/source/gfx/font.png
Normal file
BIN
examples/unlimited3d/source/gfx/font.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 932 B |
9856
examples/unlimited3d/source/gfx/girl.c
Normal file
9856
examples/unlimited3d/source/gfx/girl.c
Normal file
File diff suppressed because it is too large
Load diff
14
examples/unlimited3d/source/gfx/girl.h
Normal file
14
examples/unlimited3d/source/gfx/girl.h
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
/*
|
||||||
|
This file was autogenerated by raw2c.
|
||||||
|
Visit http://www.devkitpro.org
|
||||||
|
*/
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------
|
||||||
|
#ifndef _girl_h_
|
||||||
|
#define _girl_h_
|
||||||
|
//---------------------------------------------------------------------------------
|
||||||
|
extern const unsigned char girl[];
|
||||||
|
extern const int girl_size;
|
||||||
|
//---------------------------------------------------------------------------------
|
||||||
|
#endif //_girl_h_
|
||||||
|
//---------------------------------------------------------------------------------
|
BIN
examples/unlimited3d/source/gfx/girl.png
Normal file
BIN
examples/unlimited3d/source/gfx/girl.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 154 KiB |
47
examples/unlimited3d/source/gfx/logo.c
Normal file
47
examples/unlimited3d/source/gfx/logo.c
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
/*
|
||||||
|
This file was autogenerated by raw2c.
|
||||||
|
Visit http://www.devkitpro.org
|
||||||
|
*/
|
||||||
|
|
||||||
|
const unsigned char logo[] = {
|
||||||
|
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
|
||||||
|
0x00, 0x00, 0x01, 0x60, 0x00, 0x00, 0x00, 0x5c, 0x08, 0x06, 0x00, 0x00, 0x00, 0x50, 0xae, 0x6f,
|
||||||
|
0x2e, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00,
|
||||||
|
0x02, 0x28, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda, 0xed, 0xdd, 0x4b, 0x8e, 0xa4, 0x30, 0x10, 0x40,
|
||||||
|
0x41, 0x68, 0x71, 0xff, 0x2b, 0xd3, 0x37, 0x28, 0x23, 0x8c, 0x95, 0x1f, 0x47, 0xec, 0x7b, 0xaa,
|
||||||
|
0x4c, 0x99, 0x37, 0x2c, 0x52, 0xe6, 0x38, 0x00, 0x08, 0x71, 0xae, 0xfc, 0xc7, 0xef, 0xfb, 0xbe,
|
||||||
|
0xdb, 0x5c, 0xa8, 0xf3, 0x3c, 0xbb, 0xac, 0xf3, 0xd7, 0x5a, 0x3a, 0xfd, 0x9e, 0x6f, 0xd7, 0xb9,
|
||||||
|
0x72, 0xad, 0x33, 0xdf, 0xa9, 0xd2, 0x3d, 0xea, 0x7e, 0x79, 0xe6, 0xcf, 0xff, 0x41, 0x00, 0x31,
|
||||||
|
0x04, 0x18, 0x40, 0x80, 0x01, 0x04, 0x18, 0x00, 0x01, 0x06, 0x10, 0x60, 0x00, 0x3e, 0x36, 0x35,
|
||||||
|
0x5e, 0x31, 0x1a, 0x27, 0xc9, 0x36, 0x72, 0xb3, 0x6a, 0xad, 0xd5, 0xd6, 0xf9, 0x76, 0x0c, 0x68,
|
||||||
|
0x97, 0x75, 0xae, 0x5c, 0x6b, 0xc4, 0x3e, 0xda, 0xe5, 0x33, 0x2b, 0xde, 0xfb, 0x9e, 0x80, 0x01,
|
||||||
|
0x82, 0x08, 0x30, 0x80, 0x00, 0x03, 0x08, 0x30, 0x00, 0x02, 0x0c, 0x20, 0xc0, 0x00, 0x7c, 0x6c,
|
||||||
|
0x38, 0x42, 0x31, 0x33, 0x82, 0xe1, 0x34, 0xb4, 0x7a, 0x6b, 0xe9, 0xf4, 0x7b, 0x56, 0x3b, 0x0d,
|
||||||
|
0xed, 0xed, 0xbd, 0x36, 0x33, 0x0e, 0xea, 0x34, 0xb4, 0xb5, 0x6b, 0x19, 0xed, 0x41, 0x4f, 0xc0,
|
||||||
|
0x00, 0x41, 0x04, 0x18, 0x40, 0x80, 0x01, 0x04, 0x18, 0x00, 0x01, 0x06, 0x10, 0x60, 0x00, 0x04,
|
||||||
|
0x18, 0xa0, 0x87, 0xeb, 0x38, 0xd6, 0xcd, 0x1f, 0x92, 0x53, 0xa7, 0xa3, 0x02, 0xad, 0x93, 0xcc,
|
||||||
|
0xfb, 0x68, 0xf4, 0xb7, 0x9e, 0x80, 0x01, 0x82, 0x08, 0x30, 0x80, 0x00, 0x03, 0x08, 0x30, 0x00,
|
||||||
|
0x02, 0x0c, 0x20, 0xc0, 0x00, 0x7c, 0xec, 0xca, 0xf8, 0xa5, 0x8c, 0x08, 0x8d, 0xaf, 0xc3, 0x2e,
|
||||||
|
0x47, 0x7d, 0x76, 0x5b, 0x2b, 0xee, 0x17, 0x4f, 0xc0, 0x00, 0x02, 0x0c, 0x20, 0xc0, 0x00, 0x08,
|
||||||
|
0x30, 0x80, 0x00, 0x03, 0x20, 0xc0, 0x00, 0xfd, 0x5c, 0x15, 0xbf, 0x74, 0xc4, 0x48, 0x49, 0xc4,
|
||||||
|
0x68, 0x5c, 0xc4, 0x1b, 0x6b, 0x3b, 0xfd, 0x9e, 0xc6, 0x19, 0xf7, 0x92, 0xf1, 0x0d, 0xcf, 0xde,
|
||||||
|
0x8a, 0x0c, 0x90, 0x94, 0x00, 0x03, 0x08, 0x30, 0x80, 0x00, 0x03, 0x20, 0xc0, 0x00, 0x02, 0x0c,
|
||||||
|
0x80, 0x00, 0x03, 0xf4, 0x70, 0xb9, 0x04, 0xfb, 0xf1, 0x56, 0xe4, 0x7a, 0xeb, 0x74, 0x24, 0x67,
|
||||||
|
0xcd, 0x7d, 0xe4, 0xad, 0xc8, 0x00, 0x49, 0x09, 0x30, 0x80, 0x00, 0x03, 0x08, 0x30, 0x00, 0x02,
|
||||||
|
0x0c, 0x20, 0xc0, 0x00, 0x7c, 0xac, 0xe4, 0x18, 0x9a, 0xb7, 0x05, 0x7b, 0x2b, 0x72, 0x47, 0x8e,
|
||||||
|
0xcf, 0xdc, 0xef, 0x7e, 0xf1, 0x04, 0x0c, 0x20, 0xc0, 0x00, 0x02, 0x0c, 0x80, 0x00, 0x03, 0x08,
|
||||||
|
0x30, 0x00, 0x02, 0x0c, 0xd0, 0x43, 0xca, 0x31, 0x34, 0x27, 0x3f, 0xd1, 0xd5, 0x2e, 0x6f, 0xf4,
|
||||||
|
0xd6, 0x0d, 0x4f, 0xc0, 0x00, 0x02, 0x0c, 0x80, 0x00, 0x03, 0x08, 0x30, 0x80, 0x00, 0x03, 0x20,
|
||||||
|
0xc0, 0x00, 0x02, 0x0c, 0xc0, 0x72, 0x53, 0x73, 0xc0, 0x9d, 0x8e, 0x11, 0x74, 0x14, 0x20, 0x4f,
|
||||||
|
0xf7, 0x83, 0x39, 0x75, 0x7b, 0xe1, 0xe9, 0x5e, 0x18, 0x75, 0xc5, 0x13, 0x30, 0x40, 0x10, 0x01,
|
||||||
|
0x06, 0x10, 0x60, 0x00, 0x01, 0x06, 0x40, 0x80, 0x01, 0x04, 0x18, 0x80, 0x8f, 0x0d, 0x47, 0xaf,
|
||||||
|
0x66, 0xc7, 0x2c, 0xaa, 0x98, 0x19, 0x2d, 0x5a, 0x75, 0x0d, 0x7e, 0x7d, 0xa7, 0x5d, 0x3e, 0x73,
|
||||||
|
0xd5, 0xe7, 0x66, 0xfc, 0xbd, 0x23, 0xf6, 0x76, 0xa7, 0x7d, 0x54, 0xf1, 0xfa, 0x79, 0x02, 0x06,
|
||||||
|
0x08, 0x22, 0xc0, 0x00, 0x02, 0x0c, 0x20, 0xc0, 0x00, 0x08, 0x30, 0x80, 0x00, 0x03, 0xf0, 0xb1,
|
||||||
|
0xe9, 0x71, 0x90, 0x2e, 0x27, 0x43, 0xcd, 0x8c, 0x93, 0xac, 0xba, 0x06, 0x11, 0x27, 0x72, 0x65,
|
||||||
|
0xfb, 0xcc, 0x55, 0x9f, 0x9b, 0xf1, 0xf7, 0x8e, 0xd8, 0xdb, 0x9d, 0xf6, 0x51, 0xc6, 0x36, 0x78,
|
||||||
|
0x02, 0x06, 0x48, 0x4a, 0x80, 0x01, 0x04, 0x18, 0x40, 0x80, 0x01, 0x10, 0x60, 0x00, 0x01, 0x06,
|
||||||
|
0x40, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x78, 0xe8, 0x1f, 0x87, 0x2a, 0x18, 0xc9, 0xe4, 0xf5,
|
||||||
|
0x50, 0x98, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
|
||||||
|
};
|
||||||
|
const int logo_size = sizeof(logo);
|
14
examples/unlimited3d/source/gfx/logo.h
Normal file
14
examples/unlimited3d/source/gfx/logo.h
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
/*
|
||||||
|
This file was autogenerated by raw2c.
|
||||||
|
Visit http://www.devkitpro.org
|
||||||
|
*/
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------
|
||||||
|
#ifndef _logo_h_
|
||||||
|
#define _logo_h_
|
||||||
|
//---------------------------------------------------------------------------------
|
||||||
|
extern const unsigned char logo[];
|
||||||
|
extern const int logo_size;
|
||||||
|
//---------------------------------------------------------------------------------
|
||||||
|
#endif //_logo_h_
|
||||||
|
//---------------------------------------------------------------------------------
|
BIN
examples/unlimited3d/source/gfx/logo.png
Normal file
BIN
examples/unlimited3d/source/gfx/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 622 B |
207
examples/unlimited3d/source/main.c
Normal file
207
examples/unlimited3d/source/main.c
Normal file
|
@ -0,0 +1,207 @@
|
||||||
|
/*===========================================
|
||||||
|
NoNameNo FAKE Unlimited 3D textured Cube rout ;)
|
||||||
|
Still the same technic used in the 2D version
|
||||||
|
============================================*/
|
||||||
|
#include <grrlib.h>
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
#include <wiiuse/wpad.h>
|
||||||
|
|
||||||
|
|
||||||
|
#include "gfx/girl.h"
|
||||||
|
#include "gfx/logo.h"
|
||||||
|
#include "gfx/font.h"
|
||||||
|
|
||||||
|
#define PI 3.14159265358979323846F
|
||||||
|
|
||||||
|
extern GXRModeObj *rmode;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int i;
|
||||||
|
int screen_index = 0;
|
||||||
|
float t=0;
|
||||||
|
int R=81;
|
||||||
|
int r=71;
|
||||||
|
int d=120;
|
||||||
|
float f=0;
|
||||||
|
float ff=0;
|
||||||
|
float spr=0;
|
||||||
|
int n=1;
|
||||||
|
float a=0;
|
||||||
|
u32 col[3];
|
||||||
|
col[0]=0xFFFFFFFF;
|
||||||
|
col[1]=0xFFFFFFFF;
|
||||||
|
col[2]=0xAAAAAAFF;
|
||||||
|
float cubeZ=10.0f;
|
||||||
|
float camZ=30.0f;;
|
||||||
|
|
||||||
|
GRRLIB_Init();
|
||||||
|
WPAD_Init();
|
||||||
|
|
||||||
|
GRRLIB_Settings.antialias = false;
|
||||||
|
|
||||||
|
GRRLIB_texImg *tex_screen[9];
|
||||||
|
for(i=0; i<9; i++) {
|
||||||
|
tex_screen[i] = GRRLIB_CreateEmptyTexture(rmode->fbWidth, rmode->efbHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
GRRLIB_texImg *tex_girl = GRRLIB_LoadTexture(girl);
|
||||||
|
GRRLIB_texImg *tex_logo = GRRLIB_LoadTexture(logo);
|
||||||
|
GRRLIB_texImg *tex_font = GRRLIB_LoadTexture(font);
|
||||||
|
GRRLIB_InitTileSet(tex_font, 16, 16, 32);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
for(i=0;i<=255;i+=1){
|
||||||
|
GRRLIB_Printf((640-(16*16))/2, 200, tex_font, 0xFFFFFF00|i, 1, "HOW MANY 3D CUBE");
|
||||||
|
GRRLIB_Printf((640-(16*20))/2, 216, tex_font, 0xFFFFFF00|i, 1, "CAN YOU DISPLAY WITH");
|
||||||
|
GRRLIB_DrawImg((640-352)/2, 248, tex_logo, 0, 1, 1, 0xFFFFFF00|i);
|
||||||
|
GRRLIB_Printf((640-(16*28))/2, 480-16, tex_font, 0xFFFFFF00|i, 1, "BY NONAMENO FROM GRRLIB TEAM");
|
||||||
|
GRRLIB_Render();
|
||||||
|
}
|
||||||
|
for(i=255;i>=0;i-=2){
|
||||||
|
GRRLIB_Printf((640-(16*16))/2, 200, tex_font, 0xFFFFFF00|i, 1, "HOW MANY 3D CUBE");
|
||||||
|
GRRLIB_Printf((640-(16*20))/2, 216, tex_font, 0xFFFFFF00|i, 1, "CAN YOU DISPLAY WITH");
|
||||||
|
GRRLIB_DrawImg((640-352)/2, 248, tex_logo, 0, 1, 1, 0xFFFFFF00|i);
|
||||||
|
GRRLIB_Printf((640-(16*28))/2, 480-16, tex_font, 0xFFFFFF00|i, 1, "BY NONAMENO FROM GRRLIB TEAM");
|
||||||
|
GRRLIB_Render();
|
||||||
|
}
|
||||||
|
|
||||||
|
GRRLIB_setBackgroundColour(0x00, 0x00, 0x00, 0xFF);
|
||||||
|
|
||||||
|
while(1) {
|
||||||
|
WPAD_ScanPads();
|
||||||
|
GRRLIB_camera3dSettings(0.0f,0.0f,camZ, 0,1,0, 0,0,0);
|
||||||
|
|
||||||
|
GRRLIB_2dMode();
|
||||||
|
GRRLIB_DrawImg(0, 0, tex_screen[screen_index], 0, 1, 1, 0xFFFFFFFF);
|
||||||
|
|
||||||
|
GRRLIB_3dMode(0.1,1000,45,1);
|
||||||
|
GRRLIB_SetBlend(GRRLIB_BLEND_ALPHA);
|
||||||
|
|
||||||
|
|
||||||
|
cubeZ+=0.02f;
|
||||||
|
GRRLIB_objectView((float)(((R + r-ff)*cos(t-f) - d*cos(((R + r-f)/r)*t)))/20.0f,(float)(((R + r-ff)*sin(t) - d*sin(((R + r)/r)*t)-f))/20.0f,sin(cubeZ)*10, a,a*2,a*3);
|
||||||
|
GRRLIB_setTexture(tex_girl,0);
|
||||||
|
GX_Begin(GX_QUADS, GX_VTXFMT0, 24);
|
||||||
|
GX_Position3f32(-1.0f,1.0f,1.0f);
|
||||||
|
GX_Color1u32(col[0]);
|
||||||
|
GX_TexCoord2f32(0.0f,0.0f);
|
||||||
|
GX_Position3f32(1.0f,1.0f,1.0f);
|
||||||
|
GX_Color1u32(col[0]);
|
||||||
|
GX_TexCoord2f32(1.0f,0.0f);
|
||||||
|
GX_Position3f32(1.0f,-1.0f,1.0f);
|
||||||
|
GX_Color1u32(col[0]);
|
||||||
|
GX_TexCoord2f32(1.0f,1.0f);
|
||||||
|
GX_Position3f32(-1.0f,-1.0f,1.0f);
|
||||||
|
GX_Color1u32(col[0]);
|
||||||
|
GX_TexCoord2f32(0.0f,1.0f);
|
||||||
|
|
||||||
|
GX_Position3f32(1.0f,1.0f,-1.0f);
|
||||||
|
GX_Color1u32(col[0]);
|
||||||
|
GX_TexCoord2f32(0.0f,0.0f);
|
||||||
|
GX_Position3f32(-1.0f,1.0f,-1.0f);
|
||||||
|
GX_Color1u32(col[0]);
|
||||||
|
GX_TexCoord2f32(1.0f,0.0f);
|
||||||
|
GX_Position3f32(-1.0f,-1.0f,-1.0f);
|
||||||
|
GX_Color1u32(col[0]);
|
||||||
|
GX_TexCoord2f32(1.0f,1.0f);
|
||||||
|
GX_Position3f32(1.0f,-1.0f,-1.0f);
|
||||||
|
GX_Color1u32(col[0]);
|
||||||
|
GX_TexCoord2f32(0.0f,1.0f);
|
||||||
|
|
||||||
|
GX_Position3f32(1.0f,1.0f,1.0f);
|
||||||
|
GX_Color1u32(col[1]);
|
||||||
|
GX_TexCoord2f32(0.0f,0.0f);
|
||||||
|
GX_Position3f32(1.0f,1.0f,-1.0f);
|
||||||
|
GX_Color1u32(col[1]);
|
||||||
|
GX_TexCoord2f32(1.0f,0.0f);
|
||||||
|
GX_Position3f32(1.0f,-1.0f,-1.0f);
|
||||||
|
GX_Color1u32(col[1]);
|
||||||
|
GX_TexCoord2f32(1.0f,1.0f);
|
||||||
|
GX_Position3f32(1.0f,-1.0f,1.0f);
|
||||||
|
GX_Color1u32(col[1]);
|
||||||
|
GX_TexCoord2f32(0.0f,1.0f);
|
||||||
|
|
||||||
|
GX_Position3f32(-1.0f,1.0f,-1.0f);
|
||||||
|
GX_Color1u32(col[1]);
|
||||||
|
GX_TexCoord2f32(0.0f,0.0f);
|
||||||
|
GX_Position3f32(-1.0f,1.0f,1.0f);
|
||||||
|
GX_Color1u32(col[1]);
|
||||||
|
GX_TexCoord2f32(1.0f,0.0f);
|
||||||
|
GX_Position3f32(-1.0f,-1.0f,1.0f);
|
||||||
|
GX_Color1u32(col[1]);
|
||||||
|
GX_TexCoord2f32(1.0f,1.0f);
|
||||||
|
GX_Position3f32(-1.0f,-1.0f,-1.0f);
|
||||||
|
GX_Color1u32(col[1]);
|
||||||
|
GX_TexCoord2f32(0.0f,1.0f);
|
||||||
|
|
||||||
|
GX_Position3f32(-1.0f,1.0f,-1.0f);
|
||||||
|
GX_Color1u32(col[2]);
|
||||||
|
GX_TexCoord2f32(0.0f,0.0f);
|
||||||
|
GX_Position3f32(1.0f,1.0f,-1.0f);
|
||||||
|
GX_Color1u32(col[2]);
|
||||||
|
GX_TexCoord2f32(1.0f,0.0f);
|
||||||
|
GX_Position3f32(1.0f,1.0f,1.0f);
|
||||||
|
GX_Color1u32(col[2]);
|
||||||
|
GX_TexCoord2f32(1.0f,1.0f);
|
||||||
|
GX_Position3f32(-1.0f,1.0f,1.0f);
|
||||||
|
GX_Color1u32(col[2]);
|
||||||
|
GX_TexCoord2f32(0.0f,1.0f);
|
||||||
|
|
||||||
|
GX_Position3f32(1.0f,-1.0f,-1.0f);
|
||||||
|
GX_Color1u32(col[2]);
|
||||||
|
GX_TexCoord2f32(0.0f,0.0f);
|
||||||
|
GX_Position3f32(-1.0f,-1.0f,-1.0f);
|
||||||
|
GX_Color1u32(col[2]);
|
||||||
|
GX_TexCoord2f32(1.0f,0.0f);
|
||||||
|
GX_Position3f32(-1.0f,-1.0f,1.0f);
|
||||||
|
GX_Color1u32(col[2]);
|
||||||
|
GX_TexCoord2f32(1.0f,1.0f);
|
||||||
|
GX_Position3f32(1.0f,-1.0f,1.0f);
|
||||||
|
GX_Color1u32(col[2]);
|
||||||
|
GX_TexCoord2f32(0.0f,1.0f);
|
||||||
|
GX_End();
|
||||||
|
|
||||||
|
a+=0.5f;
|
||||||
|
|
||||||
|
GRRLIB_2dMode();
|
||||||
|
GRRLIB_Screen2Texture(0, 0, tex_screen[screen_index], GX_FALSE);
|
||||||
|
GRRLIB_Printf((640-(16*6*5))/2+5, 200+5, tex_font, 0x00000088, 5, "%06d",(int)spr);
|
||||||
|
GRRLIB_Printf((640-(16*6*5))/2, 200, tex_font, 0xFFEEEE88, 5, "%06d",(int)spr);
|
||||||
|
|
||||||
|
GRRLIB_Render();
|
||||||
|
screen_index++;
|
||||||
|
screen_index %= 9;
|
||||||
|
spr+=0.1f;
|
||||||
|
t+=0.01f;
|
||||||
|
|
||||||
|
if(t>n*2*PI){
|
||||||
|
n++;
|
||||||
|
f+=0.01f;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(f>2*PI){
|
||||||
|
f=0;
|
||||||
|
ff+=0.02f;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) exit(0);
|
||||||
|
}
|
||||||
|
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
|
||||||
|
GRRLIB_FreeTexture(tex_logo);
|
||||||
|
GRRLIB_FreeTexture(tex_girl);
|
||||||
|
GRRLIB_FreeTexture(tex_font);
|
||||||
|
for(i=0; i<9; i++) {
|
||||||
|
GRRLIB_FreeTexture(tex_screen[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue