Add 'src/s2d_engine/' from commit 'c27118308f2c910289943e564d47cd8378d224e8'
git-subtree-dir: src/s2d_engine git-subtree-mainline:932a4ddb6fgit-subtree-split:c27118308f
This commit is contained in:
commit
9f739e45c0
36 files changed
+12933
No files matched your search
@@ -0,0 +1,2 @@
|
||||
build/*
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
# Makefile for s2d_engine.a
|
||||
|
||||
TARGET = s2d_engine.a
|
||||
|
||||
BUILD_DIR ?= build
|
||||
DUMMY != mkdir -p $(BUILD_DIR)
|
||||
|
||||
C_FILES = $(wildcard ./*.c)
|
||||
O_FILES = $(foreach file,$(C_FILES),$(BUILD_DIR)/$(file:.c=.o))
|
||||
|
||||
CROSS := mips-linux-gnu-
|
||||
CC = $(CROSS)gcc
|
||||
AR = $(CROSS)ar
|
||||
|
||||
INCLUDE_BASE := ../../
|
||||
I_DIRS = src include/n64/PR include/n64 include/libc include .
|
||||
FULL_I_DIRS = $(addprefix $(INCLUDE_BASE),$(I_DIRS))
|
||||
I_FLAGS = $(foreach i,$(FULL_I_DIRS),-I$(i))
|
||||
|
||||
TARGET_CFLAGS = -nostdinc -I include/libc -DTARGET_N64 -DF3DEX_GBI_2 -DNON_MATCHING -DAVOID_UB
|
||||
CFLAGS := -Wall $(TARGET_CFLAGS) $(I_FLAGS) -march=vr4300 -mtune=vr4300 -mfix4300 -mabi=32 -mno-shared -G 0 -fno-PIC -mno-abicalls -fno-zero-initialized-in-bss -fno-toplevel-reorder -Wno-missing-braces
|
||||
|
||||
default: all
|
||||
|
||||
all: $(BUILD_DIR)/$(TARGET)
|
||||
|
||||
$(BUILD_DIR)/$(TARGET): $(O_FILES)
|
||||
$(AR) rcs -o $@ $(O_FILES)
|
||||
|
||||
$(BUILD_DIR)/%.o: %.c
|
||||
$(CC) -c $(CFLAGS) -o $@ $<
|
||||
|
||||
print-% : ; $(info $* is a $(flavor $*) variable set to [$($*)]) @true
|
||||
@@ -0,0 +1,54 @@
|
||||
# S2DEX Text Engine
|
||||
|
||||
## How to "Install"
|
||||
- Clone this repo into a folder in your SM64 decomp or homebrew repo
|
||||
- Include that folder in your makefile's `SRC_DIRS`
|
||||
- Add that folder to the linker script (`sm64.ld`) or specfile
|
||||
- Wherever you're including your font (I use actors/group0.c for SM64), insert:
|
||||
```c
|
||||
#include "src/s2d_engine/config.h"
|
||||
#include FONT_C_FILE
|
||||
```
|
||||
- You're ready to use S2DEX Text Engine!
|
||||
|
||||
## Simple Usage (Sample Program)
|
||||
```c
|
||||
#include "s2d_engine/init.h"
|
||||
#include "s2d_engine/s2d_draw.h"
|
||||
#include "s2d_engine/s2d_print.h"
|
||||
|
||||
char myString[] = "This is a " SCALE "200" "test string!\n"
|
||||
"Supports a bunch of standard " ROTATE "-36" "escape characters!\n"
|
||||
"\tIncluding " COLOR "255 0 0 0" "Colorful text!\n"
|
||||
COLOR "255 255 255 0" DROPSHADOW "And look at these shadows!";
|
||||
|
||||
// ...
|
||||
void render_game(void) {
|
||||
// do game rendering and stuff
|
||||
// ...
|
||||
|
||||
// initialized S2DEX; only needed once before all prints
|
||||
s2d_init();
|
||||
|
||||
// Allows you to print from anywhere in the game
|
||||
// as long as this is run directly afterwards
|
||||
s2d_handle_deferred();
|
||||
|
||||
// reloads the original microcode; only needed once after all prints
|
||||
s2d_stop();
|
||||
}
|
||||
|
||||
void some_actor_function(void) {
|
||||
s2d_print_deferred(50, 50, myString); // It's that easy!
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
## Command Usage
|
||||
(All numbers must be in base 10)
|
||||
- `SCALE "N"` - Scales text by an percentage (`25` for 25%, `200` for 200%, `-50` for upside down at 50%, etc.)
|
||||
- `TRANSLATE "X Y"` - Moves the rest of the string to the specified X and Y position
|
||||
- `COLOR "R G B A"` - Sets the text color to the specified value
|
||||
- `DROPSHADOW` - Toggles a drop shadow that shares the color of the current text
|
||||
- `ROTATE "N"` - (Deprecated due to plugin incompatibility) Rotates each glyph by N degrees (Can be negative, useful for italics)
|
||||
@@ -0,0 +1,96 @@
|
||||
#include <ultra64.h>
|
||||
|
||||
#ifndef S2D_CONFIG_H
|
||||
#define S2D_CONFIG_H
|
||||
|
||||
/**
|
||||
* SET YOUR FONT NAME HERE
|
||||
*/
|
||||
#define FONTNAME delfino
|
||||
|
||||
|
||||
/***********
|
||||
* Helpful defines to change
|
||||
***********/
|
||||
|
||||
#define BASE_SCALE 1.0f
|
||||
|
||||
/******************************
|
||||
*
|
||||
* ONLY CHANGE THE BELOW CONTENTS IF YOU'RE DEVELOPING
|
||||
* FOR A GAME THAT ISN'T SM64
|
||||
*
|
||||
*****************************/
|
||||
|
||||
// magic macros and font header inclusion
|
||||
#define GLUE(a, b) a##b
|
||||
#define GLUE2(a, b) GLUE(a, b)
|
||||
#define STR(x) #x
|
||||
#define STR2(x) STR(x)
|
||||
|
||||
#define __headername(hd) fonts/hd.h
|
||||
#define __fontinclude(f) src/s2d_engine/fonts/f.c
|
||||
|
||||
#define _FONT_HEADER STR2(__headername(FONTNAME))
|
||||
#define FONT_C_FILE STR2(__fontinclude(FONTNAME))
|
||||
|
||||
#include _FONT_HEADER
|
||||
|
||||
// get your font symbols defined here
|
||||
#define s2d_font GLUE2(FONTNAME, _obj)
|
||||
#define s2d_dropshadow GLUE2(FONTNAME, _obj_dropshadow)
|
||||
#define s2d_tex GLUE2(FONTNAME, _tex)
|
||||
#define s2d_kerning_table GLUE2(FONTNAME, _kerning_table)
|
||||
|
||||
extern char s2d_kerning_table[];
|
||||
|
||||
// Debug: bypass custom matrix setup
|
||||
#define s2d_mat GLUE2(FONTNAME, _mtx)
|
||||
|
||||
// Homebrew users: use this to rename your gdl head
|
||||
#define gdl_head gDisplayListHead
|
||||
extern Gfx *gdl_head;
|
||||
|
||||
#include "src/game/game_init.h"
|
||||
#define CONTROLLER_INPUT gPlayer1Controller->buttonPressed
|
||||
#define CONTROLLER_HELD_INPUT gPlayer1Controller->buttonDown
|
||||
|
||||
// Other games/Homebrew users: change these values
|
||||
|
||||
// an allocator function of the format void *alloc(size_t bytes)
|
||||
#define alloc alloc_display_list
|
||||
extern void *alloc(size_t);
|
||||
|
||||
// your init functions for the RDP/RSP
|
||||
#define my_rdp_init my_rdp_init
|
||||
#define my_rsp_init my_rsp_init
|
||||
extern void my_rsp_init(void);
|
||||
extern void my_rdp_init(void);
|
||||
|
||||
// The frame timer that is used to time s2d_type_print
|
||||
#define s2d_timer gGlobalTimer
|
||||
extern u32 s2d_timer;
|
||||
|
||||
// The equivalent vsprintf in your game (defaults to libultra _Printf)
|
||||
#define vsprintf(dst, str, fmt, args) _Printf(proutSprintf, dst, fmt, args)
|
||||
extern char *proutSprintf(char *dst, const char *src, size_t count);
|
||||
|
||||
|
||||
// tab glyph width and height
|
||||
#define TAB_WIDTH_H TEX_WIDTH * 2
|
||||
#define TAB_WIDTH_V TEX_WIDTH / 2
|
||||
|
||||
// Set these to optimize s2d texture "cache"
|
||||
#define TEX_WIDTH 16
|
||||
#define TEX_HEIGHT 16
|
||||
#define TEX_BITDEPTH 8
|
||||
|
||||
#define seg2virt segmented_to_virtual
|
||||
#define IS_RUNNING_ON_EMULATOR (IO_READ(DPC_PIPEBUSY_REG) == 0)
|
||||
|
||||
// Texture resolution (pixels on the texture per pixel on the framebuffer)
|
||||
#define TEX_RES 1
|
||||
|
||||
#define _NUM_CACHE (4096 / (TEX_WIDTH * TEX_HEIGHT * (TEX_BITDEPTH / 8)))
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifndef DEBUG_H
|
||||
#define DEBUG_H
|
||||
|
||||
// #define init_cond (CONTROLLER_HELD_INPUT & R_CBUTTONS)
|
||||
// #define tex_cond (CONTROLLER_HELD_INPUT & D_CBUTTONS)
|
||||
// #define mtx_cond (CONTROLLER_HELD_INPUT & L_TRIG)
|
||||
// #define spr_cond (CONTROLLER_HELD_INPUT & U_JPAD)
|
||||
// #define deinit_cond (CONTROLLER_HELD_INPUT & U_CBUTTONS)
|
||||
#define tex_cond (1)
|
||||
#define mtx_cond (1)
|
||||
#define spr_cond (1)
|
||||
#define init_cond (1)
|
||||
#define deinit_cond (1)
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,92 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <ultra64.h>
|
||||
#include "mtx.h"
|
||||
#include "debug.h"
|
||||
|
||||
#include "s2d_draw.h"
|
||||
|
||||
#define s(sprite) ((uObjSprite *)seg2virt(&sprite))
|
||||
#define t(texture) ((uObjTxtr *)seg2virt(&texture))
|
||||
|
||||
void f3d_rdp_init(void) {
|
||||
gDPPipeSync(gdl_head++);
|
||||
gDPSetCycleType(gdl_head++, G_CYC_1CYCLE);
|
||||
gDPSetRenderMode(gdl_head++, G_RM_XLU_SPRITE, G_RM_XLU_SPRITE2);
|
||||
gDPSetTextureLUT(gdl_head++, G_TT_NONE);
|
||||
gDPSetTexturePersp(gdl_head++, G_TP_NONE);
|
||||
gDPSetCombineLERP(gdl_head++,
|
||||
0, 0, 0, ENVIRONMENT,
|
||||
0, 0, 0, TEXEL0,
|
||||
0, 0, 0, ENVIRONMENT,
|
||||
0, 0, 0, TEXEL0
|
||||
);
|
||||
}
|
||||
|
||||
void setup_f3d_texture(int idx) {
|
||||
gDPPipeSync(gdl_head++);
|
||||
|
||||
|
||||
gDPSetEnvColor(gdl_head++, s2d_red, s2d_green, s2d_blue, s2d_alpha);
|
||||
|
||||
gDPLoadTextureBlock(
|
||||
gdl_head++,
|
||||
t(s2d_tex[idx])->block.image,
|
||||
s(s2d_font)->s.imageFmt,
|
||||
G_IM_SIZ_8b,
|
||||
s(s2d_font)->s.imageW >> 5,
|
||||
s(s2d_font)->s.imageH >> 5,
|
||||
s(s2d_font)->s.imagePal,
|
||||
G_TX_WRAP,
|
||||
G_TX_WRAP,
|
||||
G_TX_NOMASK,
|
||||
G_TX_NOMASK,
|
||||
G_TX_NOLOD,
|
||||
G_TX_NOLOD);
|
||||
gDPLoadSync(gdl_head++);
|
||||
}
|
||||
|
||||
#define CLAMP_0(x) ((x < 0) ? 0 : x)
|
||||
|
||||
void texrect(int x, int y, float scale) {
|
||||
#define qs510(n) ((s16)((n)*0x0400))
|
||||
gSPScisTextureRectangle (
|
||||
gdl_head++,
|
||||
x << 2,
|
||||
y << 2,
|
||||
(u32)(x + ((f32) ((s(s2d_font)->s.imageW >> 5) - 1) * scale)) << 2,
|
||||
(u32)(y + ((f32) ((s(s2d_font)->s.imageH >> 5) - 1) * scale)) << 2,
|
||||
G_TX_RENDERTILE,
|
||||
0,
|
||||
0,
|
||||
qs510(1.0f / myScale), qs510(1.0f / myScale));
|
||||
}
|
||||
|
||||
void draw_f3d_dropshadow(char c, int x, int y, uObjMtx *ds) {
|
||||
setup_f3d_texture(c);
|
||||
|
||||
if (s2d_red != 0
|
||||
&& s2d_green != 0
|
||||
&& s2d_blue != 0
|
||||
) {
|
||||
gDPPipeSync(gdl_head++);
|
||||
gDPSetEnvColor(gdl_head++,
|
||||
CLAMP_0(s2d_red - 100),
|
||||
CLAMP_0(s2d_green - 100),
|
||||
CLAMP_0(s2d_blue - 100),
|
||||
s2d_alpha);
|
||||
texrect(x, y, myScale);
|
||||
gDPPipeSync(gdl_head++);
|
||||
gDPSetEnvColor(gdl_head++, s2d_red, s2d_green, s2d_blue, s2d_alpha);
|
||||
}
|
||||
}
|
||||
|
||||
void draw_f3d_glyph(char c, int x, int y, uObjMtx *mt) {
|
||||
setup_f3d_texture(c);
|
||||
|
||||
texrect(x, y, myScale);
|
||||
gDPPipeSync(gdl_head++);
|
||||
}
|
||||
|
||||
#undef s
|
||||
#undef t
|
||||
@@ -0,0 +1,32 @@
|
||||
#include <ultra64.h>
|
||||
// jk i dont think this file is needed lol
|
||||
// update: it was needed :(
|
||||
// update 2: gu.h already has macros for this :(
|
||||
|
||||
// hopefully I'll only need s15.16
|
||||
// ^ clueless
|
||||
|
||||
// Q to float
|
||||
|
||||
// To convert a number from Qm.n format to floating point:
|
||||
|
||||
// Convert the number to floating point as if it were an integer, in other words remove the binary point
|
||||
// Multiply by 2^−n
|
||||
|
||||
f32 qtof(int q, int decimal_n) {
|
||||
f32 mul = (1.0f / (float) (1 << decimal_n));
|
||||
return ((float)q) * mul;
|
||||
}
|
||||
|
||||
// Float to Q
|
||||
|
||||
// To convert a number from floating point to Qm.n format:
|
||||
|
||||
// Multiply the floating point number by 2^n
|
||||
// Round to the nearest integer
|
||||
int ftoq(f32 f, int decimal_n) {
|
||||
f *= (float) (1 << decimal_n);
|
||||
return (int)f;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
#include <ultra64.h>
|
||||
|
||||
extern f32 qtof(int q);
|
||||
|
||||
extern int ftoq(f32 f);
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,136 @@
|
||||
#include <PR/ultratypes.h>
|
||||
#include <PR/gs2dex.h>
|
||||
extern uObjTxtr comicsans_tex[];
|
||||
extern uObjMtx comicsans_mtx;
|
||||
extern uObjSprite comicsans_obj;
|
||||
extern void call_comicsans_sprite_dl(int idx, int x, int y, uObjMtx *buffer, int buf_idx);
|
||||
extern u8 comicsans_tex_0[];
|
||||
extern u8 comicsans_tex_1[];
|
||||
extern u8 comicsans_tex_2[];
|
||||
extern u8 comicsans_tex_3[];
|
||||
extern u8 comicsans_tex_4[];
|
||||
extern u8 comicsans_tex_5[];
|
||||
extern u8 comicsans_tex_6[];
|
||||
extern u8 comicsans_tex_7[];
|
||||
extern u8 comicsans_tex_8[];
|
||||
extern u8 comicsans_tex_9[];
|
||||
extern u8 comicsans_tex_10[];
|
||||
extern u8 comicsans_tex_11[];
|
||||
extern u8 comicsans_tex_12[];
|
||||
extern u8 comicsans_tex_13[];
|
||||
extern u8 comicsans_tex_14[];
|
||||
extern u8 comicsans_tex_15[];
|
||||
extern u8 comicsans_tex_16[];
|
||||
extern u8 comicsans_tex_17[];
|
||||
extern u8 comicsans_tex_18[];
|
||||
extern u8 comicsans_tex_19[];
|
||||
extern u8 comicsans_tex_20[];
|
||||
extern u8 comicsans_tex_21[];
|
||||
extern u8 comicsans_tex_22[];
|
||||
extern u8 comicsans_tex_23[];
|
||||
extern u8 comicsans_tex_24[];
|
||||
extern u8 comicsans_tex_25[];
|
||||
extern u8 comicsans_tex_26[];
|
||||
extern u8 comicsans_tex_27[];
|
||||
extern u8 comicsans_tex_28[];
|
||||
extern u8 comicsans_tex_29[];
|
||||
extern u8 comicsans_tex_30[];
|
||||
extern u8 comicsans_tex_31[];
|
||||
extern u8 comicsans_tex_32[];
|
||||
extern u8 comicsans_tex_33[];
|
||||
extern u8 comicsans_tex_34[];
|
||||
extern u8 comicsans_tex_35[];
|
||||
extern u8 comicsans_tex_36[];
|
||||
extern u8 comicsans_tex_37[];
|
||||
extern u8 comicsans_tex_38[];
|
||||
extern u8 comicsans_tex_39[];
|
||||
extern u8 comicsans_tex_40[];
|
||||
extern u8 comicsans_tex_41[];
|
||||
extern u8 comicsans_tex_42[];
|
||||
extern u8 comicsans_tex_43[];
|
||||
extern u8 comicsans_tex_44[];
|
||||
extern u8 comicsans_tex_45[];
|
||||
extern u8 comicsans_tex_46[];
|
||||
extern u8 comicsans_tex_47[];
|
||||
extern u8 comicsans_tex_48[];
|
||||
extern u8 comicsans_tex_49[];
|
||||
extern u8 comicsans_tex_50[];
|
||||
extern u8 comicsans_tex_51[];
|
||||
extern u8 comicsans_tex_52[];
|
||||
extern u8 comicsans_tex_53[];
|
||||
extern u8 comicsans_tex_54[];
|
||||
extern u8 comicsans_tex_55[];
|
||||
extern u8 comicsans_tex_56[];
|
||||
extern u8 comicsans_tex_57[];
|
||||
extern u8 comicsans_tex_58[];
|
||||
extern u8 comicsans_tex_59[];
|
||||
extern u8 comicsans_tex_60[];
|
||||
extern u8 comicsans_tex_61[];
|
||||
extern u8 comicsans_tex_62[];
|
||||
extern u8 comicsans_tex_63[];
|
||||
extern u8 comicsans_tex_64[];
|
||||
extern u8 comicsans_tex_65[];
|
||||
extern u8 comicsans_tex_66[];
|
||||
extern u8 comicsans_tex_67[];
|
||||
extern u8 comicsans_tex_68[];
|
||||
extern u8 comicsans_tex_69[];
|
||||
extern u8 comicsans_tex_70[];
|
||||
extern u8 comicsans_tex_71[];
|
||||
extern u8 comicsans_tex_72[];
|
||||
extern u8 comicsans_tex_73[];
|
||||
extern u8 comicsans_tex_74[];
|
||||
extern u8 comicsans_tex_75[];
|
||||
extern u8 comicsans_tex_76[];
|
||||
extern u8 comicsans_tex_77[];
|
||||
extern u8 comicsans_tex_78[];
|
||||
extern u8 comicsans_tex_79[];
|
||||
extern u8 comicsans_tex_80[];
|
||||
extern u8 comicsans_tex_81[];
|
||||
extern u8 comicsans_tex_82[];
|
||||
extern u8 comicsans_tex_83[];
|
||||
extern u8 comicsans_tex_84[];
|
||||
extern u8 comicsans_tex_85[];
|
||||
extern u8 comicsans_tex_86[];
|
||||
extern u8 comicsans_tex_87[];
|
||||
extern u8 comicsans_tex_88[];
|
||||
extern u8 comicsans_tex_89[];
|
||||
extern u8 comicsans_tex_90[];
|
||||
extern u8 comicsans_tex_91[];
|
||||
extern u8 comicsans_tex_92[];
|
||||
extern u8 comicsans_tex_93[];
|
||||
extern u8 comicsans_tex_94[];
|
||||
extern u8 comicsans_tex_95[];
|
||||
extern u8 comicsans_tex_96[];
|
||||
extern u8 comicsans_tex_97[];
|
||||
extern u8 comicsans_tex_98[];
|
||||
extern u8 comicsans_tex_99[];
|
||||
extern u8 comicsans_tex_100[];
|
||||
extern u8 comicsans_tex_101[];
|
||||
extern u8 comicsans_tex_102[];
|
||||
extern u8 comicsans_tex_103[];
|
||||
extern u8 comicsans_tex_104[];
|
||||
extern u8 comicsans_tex_105[];
|
||||
extern u8 comicsans_tex_106[];
|
||||
extern u8 comicsans_tex_107[];
|
||||
extern u8 comicsans_tex_108[];
|
||||
extern u8 comicsans_tex_109[];
|
||||
extern u8 comicsans_tex_110[];
|
||||
extern u8 comicsans_tex_111[];
|
||||
extern u8 comicsans_tex_112[];
|
||||
extern u8 comicsans_tex_113[];
|
||||
extern u8 comicsans_tex_114[];
|
||||
extern u8 comicsans_tex_115[];
|
||||
extern u8 comicsans_tex_116[];
|
||||
extern u8 comicsans_tex_117[];
|
||||
extern u8 comicsans_tex_118[];
|
||||
extern u8 comicsans_tex_119[];
|
||||
extern u8 comicsans_tex_120[];
|
||||
extern u8 comicsans_tex_121[];
|
||||
extern u8 comicsans_tex_122[];
|
||||
extern u8 comicsans_tex_123[];
|
||||
extern u8 comicsans_tex_124[];
|
||||
extern u8 comicsans_tex_125[];
|
||||
extern u8 comicsans_tex_126[];
|
||||
extern u8 comicsans_tex_127[];
|
||||
|
||||
extern uObjSprite comicsans_obj_dropshadow;
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,136 @@
|
||||
#include <PR/ultratypes.h>
|
||||
#include <PR/gs2dex.h>
|
||||
extern uObjTxtr delfino_tex[];
|
||||
extern uObjMtx delfino_mtx;
|
||||
extern uObjSprite delfino_obj;
|
||||
extern void call_delfino_sprite_dl(int idx, int x, int y, uObjMtx *buffer, int buf_idx);
|
||||
extern u8 delfino_tex_0[];
|
||||
extern u8 delfino_tex_1[];
|
||||
extern u8 delfino_tex_2[];
|
||||
extern u8 delfino_tex_3[];
|
||||
extern u8 delfino_tex_4[];
|
||||
extern u8 delfino_tex_5[];
|
||||
extern u8 delfino_tex_6[];
|
||||
extern u8 delfino_tex_7[];
|
||||
extern u8 delfino_tex_8[];
|
||||
extern u8 delfino_tex_9[];
|
||||
extern u8 delfino_tex_10[];
|
||||
extern u8 delfino_tex_11[];
|
||||
extern u8 delfino_tex_12[];
|
||||
extern u8 delfino_tex_13[];
|
||||
extern u8 delfino_tex_14[];
|
||||
extern u8 delfino_tex_15[];
|
||||
extern u8 delfino_tex_16[];
|
||||
extern u8 delfino_tex_17[];
|
||||
extern u8 delfino_tex_18[];
|
||||
extern u8 delfino_tex_19[];
|
||||
extern u8 delfino_tex_20[];
|
||||
extern u8 delfino_tex_21[];
|
||||
extern u8 delfino_tex_22[];
|
||||
extern u8 delfino_tex_23[];
|
||||
extern u8 delfino_tex_24[];
|
||||
extern u8 delfino_tex_25[];
|
||||
extern u8 delfino_tex_26[];
|
||||
extern u8 delfino_tex_27[];
|
||||
extern u8 delfino_tex_28[];
|
||||
extern u8 delfino_tex_29[];
|
||||
extern u8 delfino_tex_30[];
|
||||
extern u8 delfino_tex_31[];
|
||||
extern u8 delfino_tex_32[];
|
||||
extern u8 delfino_tex_33[];
|
||||
extern u8 delfino_tex_34[];
|
||||
extern u8 delfino_tex_35[];
|
||||
extern u8 delfino_tex_36[];
|
||||
extern u8 delfino_tex_37[];
|
||||
extern u8 delfino_tex_38[];
|
||||
extern u8 delfino_tex_39[];
|
||||
extern u8 delfino_tex_40[];
|
||||
extern u8 delfino_tex_41[];
|
||||
extern u8 delfino_tex_42[];
|
||||
extern u8 delfino_tex_43[];
|
||||
extern u8 delfino_tex_44[];
|
||||
extern u8 delfino_tex_45[];
|
||||
extern u8 delfino_tex_46[];
|
||||
extern u8 delfino_tex_47[];
|
||||
extern u8 delfino_tex_48[];
|
||||
extern u8 delfino_tex_49[];
|
||||
extern u8 delfino_tex_50[];
|
||||
extern u8 delfino_tex_51[];
|
||||
extern u8 delfino_tex_52[];
|
||||
extern u8 delfino_tex_53[];
|
||||
extern u8 delfino_tex_54[];
|
||||
extern u8 delfino_tex_55[];
|
||||
extern u8 delfino_tex_56[];
|
||||
extern u8 delfino_tex_57[];
|
||||
extern u8 delfino_tex_58[];
|
||||
extern u8 delfino_tex_59[];
|
||||
extern u8 delfino_tex_60[];
|
||||
extern u8 delfino_tex_61[];
|
||||
extern u8 delfino_tex_62[];
|
||||
extern u8 delfino_tex_63[];
|
||||
extern u8 delfino_tex_64[];
|
||||
extern u8 delfino_tex_65[];
|
||||
extern u8 delfino_tex_66[];
|
||||
extern u8 delfino_tex_67[];
|
||||
extern u8 delfino_tex_68[];
|
||||
extern u8 delfino_tex_69[];
|
||||
extern u8 delfino_tex_70[];
|
||||
extern u8 delfino_tex_71[];
|
||||
extern u8 delfino_tex_72[];
|
||||
extern u8 delfino_tex_73[];
|
||||
extern u8 delfino_tex_74[];
|
||||
extern u8 delfino_tex_75[];
|
||||
extern u8 delfino_tex_76[];
|
||||
extern u8 delfino_tex_77[];
|
||||
extern u8 delfino_tex_78[];
|
||||
extern u8 delfino_tex_79[];
|
||||
extern u8 delfino_tex_80[];
|
||||
extern u8 delfino_tex_81[];
|
||||
extern u8 delfino_tex_82[];
|
||||
extern u8 delfino_tex_83[];
|
||||
extern u8 delfino_tex_84[];
|
||||
extern u8 delfino_tex_85[];
|
||||
extern u8 delfino_tex_86[];
|
||||
extern u8 delfino_tex_87[];
|
||||
extern u8 delfino_tex_88[];
|
||||
extern u8 delfino_tex_89[];
|
||||
extern u8 delfino_tex_90[];
|
||||
extern u8 delfino_tex_91[];
|
||||
extern u8 delfino_tex_92[];
|
||||
extern u8 delfino_tex_93[];
|
||||
extern u8 delfino_tex_94[];
|
||||
extern u8 delfino_tex_95[];
|
||||
extern u8 delfino_tex_96[];
|
||||
extern u8 delfino_tex_97[];
|
||||
extern u8 delfino_tex_98[];
|
||||
extern u8 delfino_tex_99[];
|
||||
extern u8 delfino_tex_100[];
|
||||
extern u8 delfino_tex_101[];
|
||||
extern u8 delfino_tex_102[];
|
||||
extern u8 delfino_tex_103[];
|
||||
extern u8 delfino_tex_104[];
|
||||
extern u8 delfino_tex_105[];
|
||||
extern u8 delfino_tex_106[];
|
||||
extern u8 delfino_tex_107[];
|
||||
extern u8 delfino_tex_108[];
|
||||
extern u8 delfino_tex_109[];
|
||||
extern u8 delfino_tex_110[];
|
||||
extern u8 delfino_tex_111[];
|
||||
extern u8 delfino_tex_112[];
|
||||
extern u8 delfino_tex_113[];
|
||||
extern u8 delfino_tex_114[];
|
||||
extern u8 delfino_tex_115[];
|
||||
extern u8 delfino_tex_116[];
|
||||
extern u8 delfino_tex_117[];
|
||||
extern u8 delfino_tex_118[];
|
||||
extern u8 delfino_tex_119[];
|
||||
extern u8 delfino_tex_120[];
|
||||
extern u8 delfino_tex_121[];
|
||||
extern u8 delfino_tex_122[];
|
||||
extern u8 delfino_tex_123[];
|
||||
extern u8 delfino_tex_124[];
|
||||
extern u8 delfino_tex_125[];
|
||||
extern u8 delfino_tex_126[];
|
||||
extern u8 delfino_tex_127[];
|
||||
|
||||
extern uObjSprite delfino_obj_dropshadow;
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,136 @@
|
||||
#include <PR/ultratypes.h>
|
||||
#include <PR/gs2dex.h>
|
||||
extern uObjTxtr impact_tex[];
|
||||
extern uObjMtx impact_mtx;
|
||||
extern uObjSprite impact_obj;
|
||||
extern void call_impact_sprite_dl(int idx, int x, int y, uObjMtx *buffer, int buf_idx);
|
||||
extern u8 impact_tex_0[];
|
||||
extern u8 impact_tex_1[];
|
||||
extern u8 impact_tex_2[];
|
||||
extern u8 impact_tex_3[];
|
||||
extern u8 impact_tex_4[];
|
||||
extern u8 impact_tex_5[];
|
||||
extern u8 impact_tex_6[];
|
||||
extern u8 impact_tex_7[];
|
||||
extern u8 impact_tex_8[];
|
||||
extern u8 impact_tex_9[];
|
||||
extern u8 impact_tex_10[];
|
||||
extern u8 impact_tex_11[];
|
||||
extern u8 impact_tex_12[];
|
||||
extern u8 impact_tex_13[];
|
||||
extern u8 impact_tex_14[];
|
||||
extern u8 impact_tex_15[];
|
||||
extern u8 impact_tex_16[];
|
||||
extern u8 impact_tex_17[];
|
||||
extern u8 impact_tex_18[];
|
||||
extern u8 impact_tex_19[];
|
||||
extern u8 impact_tex_20[];
|
||||
extern u8 impact_tex_21[];
|
||||
extern u8 impact_tex_22[];
|
||||
extern u8 impact_tex_23[];
|
||||
extern u8 impact_tex_24[];
|
||||
extern u8 impact_tex_25[];
|
||||
extern u8 impact_tex_26[];
|
||||
extern u8 impact_tex_27[];
|
||||
extern u8 impact_tex_28[];
|
||||
extern u8 impact_tex_29[];
|
||||
extern u8 impact_tex_30[];
|
||||
extern u8 impact_tex_31[];
|
||||
extern u8 impact_tex_32[];
|
||||
extern u8 impact_tex_33[];
|
||||
extern u8 impact_tex_34[];
|
||||
extern u8 impact_tex_35[];
|
||||
extern u8 impact_tex_36[];
|
||||
extern u8 impact_tex_37[];
|
||||
extern u8 impact_tex_38[];
|
||||
extern u8 impact_tex_39[];
|
||||
extern u8 impact_tex_40[];
|
||||
extern u8 impact_tex_41[];
|
||||
extern u8 impact_tex_42[];
|
||||
extern u8 impact_tex_43[];
|
||||
extern u8 impact_tex_44[];
|
||||
extern u8 impact_tex_45[];
|
||||
extern u8 impact_tex_46[];
|
||||
extern u8 impact_tex_47[];
|
||||
extern u8 impact_tex_48[];
|
||||
extern u8 impact_tex_49[];
|
||||
extern u8 impact_tex_50[];
|
||||
extern u8 impact_tex_51[];
|
||||
extern u8 impact_tex_52[];
|
||||
extern u8 impact_tex_53[];
|
||||
extern u8 impact_tex_54[];
|
||||
extern u8 impact_tex_55[];
|
||||
extern u8 impact_tex_56[];
|
||||
extern u8 impact_tex_57[];
|
||||
extern u8 impact_tex_58[];
|
||||
extern u8 impact_tex_59[];
|
||||
extern u8 impact_tex_60[];
|
||||
extern u8 impact_tex_61[];
|
||||
extern u8 impact_tex_62[];
|
||||
extern u8 impact_tex_63[];
|
||||
extern u8 impact_tex_64[];
|
||||
extern u8 impact_tex_65[];
|
||||
extern u8 impact_tex_66[];
|
||||
extern u8 impact_tex_67[];
|
||||
extern u8 impact_tex_68[];
|
||||
extern u8 impact_tex_69[];
|
||||
extern u8 impact_tex_70[];
|
||||
extern u8 impact_tex_71[];
|
||||
extern u8 impact_tex_72[];
|
||||
extern u8 impact_tex_73[];
|
||||
extern u8 impact_tex_74[];
|
||||
extern u8 impact_tex_75[];
|
||||
extern u8 impact_tex_76[];
|
||||
extern u8 impact_tex_77[];
|
||||
extern u8 impact_tex_78[];
|
||||
extern u8 impact_tex_79[];
|
||||
extern u8 impact_tex_80[];
|
||||
extern u8 impact_tex_81[];
|
||||
extern u8 impact_tex_82[];
|
||||
extern u8 impact_tex_83[];
|
||||
extern u8 impact_tex_84[];
|
||||
extern u8 impact_tex_85[];
|
||||
extern u8 impact_tex_86[];
|
||||
extern u8 impact_tex_87[];
|
||||
extern u8 impact_tex_88[];
|
||||
extern u8 impact_tex_89[];
|
||||
extern u8 impact_tex_90[];
|
||||
extern u8 impact_tex_91[];
|
||||
extern u8 impact_tex_92[];
|
||||
extern u8 impact_tex_93[];
|
||||
extern u8 impact_tex_94[];
|
||||
extern u8 impact_tex_95[];
|
||||
extern u8 impact_tex_96[];
|
||||
extern u8 impact_tex_97[];
|
||||
extern u8 impact_tex_98[];
|
||||
extern u8 impact_tex_99[];
|
||||
extern u8 impact_tex_100[];
|
||||
extern u8 impact_tex_101[];
|
||||
extern u8 impact_tex_102[];
|
||||
extern u8 impact_tex_103[];
|
||||
extern u8 impact_tex_104[];
|
||||
extern u8 impact_tex_105[];
|
||||
extern u8 impact_tex_106[];
|
||||
extern u8 impact_tex_107[];
|
||||
extern u8 impact_tex_108[];
|
||||
extern u8 impact_tex_109[];
|
||||
extern u8 impact_tex_110[];
|
||||
extern u8 impact_tex_111[];
|
||||
extern u8 impact_tex_112[];
|
||||
extern u8 impact_tex_113[];
|
||||
extern u8 impact_tex_114[];
|
||||
extern u8 impact_tex_115[];
|
||||
extern u8 impact_tex_116[];
|
||||
extern u8 impact_tex_117[];
|
||||
extern u8 impact_tex_118[];
|
||||
extern u8 impact_tex_119[];
|
||||
extern u8 impact_tex_120[];
|
||||
extern u8 impact_tex_121[];
|
||||
extern u8 impact_tex_122[];
|
||||
extern u8 impact_tex_123[];
|
||||
extern u8 impact_tex_124[];
|
||||
extern u8 impact_tex_125[];
|
||||
extern u8 impact_tex_126[];
|
||||
extern u8 impact_tex_127[];
|
||||
|
||||
extern uObjSprite impact_obj_dropshadow;
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,136 @@
|
||||
#include <PR/ultratypes.h>
|
||||
#include <PR/gs2dex.h>
|
||||
extern uObjTxtr papyrus_tex[];
|
||||
extern uObjMtx papyrus_mtx;
|
||||
extern uObjSprite papyrus_obj;
|
||||
extern void call_papyrus_sprite_dl(int idx, int x, int y, uObjMtx *buffer, int buf_idx);
|
||||
extern u8 papyrus_tex_0[];
|
||||
extern u8 papyrus_tex_1[];
|
||||
extern u8 papyrus_tex_2[];
|
||||
extern u8 papyrus_tex_3[];
|
||||
extern u8 papyrus_tex_4[];
|
||||
extern u8 papyrus_tex_5[];
|
||||
extern u8 papyrus_tex_6[];
|
||||
extern u8 papyrus_tex_7[];
|
||||
extern u8 papyrus_tex_8[];
|
||||
extern u8 papyrus_tex_9[];
|
||||
extern u8 papyrus_tex_10[];
|
||||
extern u8 papyrus_tex_11[];
|
||||
extern u8 papyrus_tex_12[];
|
||||
extern u8 papyrus_tex_13[];
|
||||
extern u8 papyrus_tex_14[];
|
||||
extern u8 papyrus_tex_15[];
|
||||
extern u8 papyrus_tex_16[];
|
||||
extern u8 papyrus_tex_17[];
|
||||
extern u8 papyrus_tex_18[];
|
||||
extern u8 papyrus_tex_19[];
|
||||
extern u8 papyrus_tex_20[];
|
||||
extern u8 papyrus_tex_21[];
|
||||
extern u8 papyrus_tex_22[];
|
||||
extern u8 papyrus_tex_23[];
|
||||
extern u8 papyrus_tex_24[];
|
||||
extern u8 papyrus_tex_25[];
|
||||
extern u8 papyrus_tex_26[];
|
||||
extern u8 papyrus_tex_27[];
|
||||
extern u8 papyrus_tex_28[];
|
||||
extern u8 papyrus_tex_29[];
|
||||
extern u8 papyrus_tex_30[];
|
||||
extern u8 papyrus_tex_31[];
|
||||
extern u8 papyrus_tex_32[];
|
||||
extern u8 papyrus_tex_33[];
|
||||
extern u8 papyrus_tex_34[];
|
||||
extern u8 papyrus_tex_35[];
|
||||
extern u8 papyrus_tex_36[];
|
||||
extern u8 papyrus_tex_37[];
|
||||
extern u8 papyrus_tex_38[];
|
||||
extern u8 papyrus_tex_39[];
|
||||
extern u8 papyrus_tex_40[];
|
||||
extern u8 papyrus_tex_41[];
|
||||
extern u8 papyrus_tex_42[];
|
||||
extern u8 papyrus_tex_43[];
|
||||
extern u8 papyrus_tex_44[];
|
||||
extern u8 papyrus_tex_45[];
|
||||
extern u8 papyrus_tex_46[];
|
||||
extern u8 papyrus_tex_47[];
|
||||
extern u8 papyrus_tex_48[];
|
||||
extern u8 papyrus_tex_49[];
|
||||
extern u8 papyrus_tex_50[];
|
||||
extern u8 papyrus_tex_51[];
|
||||
extern u8 papyrus_tex_52[];
|
||||
extern u8 papyrus_tex_53[];
|
||||
extern u8 papyrus_tex_54[];
|
||||
extern u8 papyrus_tex_55[];
|
||||
extern u8 papyrus_tex_56[];
|
||||
extern u8 papyrus_tex_57[];
|
||||
extern u8 papyrus_tex_58[];
|
||||
extern u8 papyrus_tex_59[];
|
||||
extern u8 papyrus_tex_60[];
|
||||
extern u8 papyrus_tex_61[];
|
||||
extern u8 papyrus_tex_62[];
|
||||
extern u8 papyrus_tex_63[];
|
||||
extern u8 papyrus_tex_64[];
|
||||
extern u8 papyrus_tex_65[];
|
||||
extern u8 papyrus_tex_66[];
|
||||
extern u8 papyrus_tex_67[];
|
||||
extern u8 papyrus_tex_68[];
|
||||
extern u8 papyrus_tex_69[];
|
||||
extern u8 papyrus_tex_70[];
|
||||
extern u8 papyrus_tex_71[];
|
||||
extern u8 papyrus_tex_72[];
|
||||
extern u8 papyrus_tex_73[];
|
||||
extern u8 papyrus_tex_74[];
|
||||
extern u8 papyrus_tex_75[];
|
||||
extern u8 papyrus_tex_76[];
|
||||
extern u8 papyrus_tex_77[];
|
||||
extern u8 papyrus_tex_78[];
|
||||
extern u8 papyrus_tex_79[];
|
||||
extern u8 papyrus_tex_80[];
|
||||
extern u8 papyrus_tex_81[];
|
||||
extern u8 papyrus_tex_82[];
|
||||
extern u8 papyrus_tex_83[];
|
||||
extern u8 papyrus_tex_84[];
|
||||
extern u8 papyrus_tex_85[];
|
||||
extern u8 papyrus_tex_86[];
|
||||
extern u8 papyrus_tex_87[];
|
||||
extern u8 papyrus_tex_88[];
|
||||
extern u8 papyrus_tex_89[];
|
||||
extern u8 papyrus_tex_90[];
|
||||
extern u8 papyrus_tex_91[];
|
||||
extern u8 papyrus_tex_92[];
|
||||
extern u8 papyrus_tex_93[];
|
||||
extern u8 papyrus_tex_94[];
|
||||
extern u8 papyrus_tex_95[];
|
||||
extern u8 papyrus_tex_96[];
|
||||
extern u8 papyrus_tex_97[];
|
||||
extern u8 papyrus_tex_98[];
|
||||
extern u8 papyrus_tex_99[];
|
||||
extern u8 papyrus_tex_100[];
|
||||
extern u8 papyrus_tex_101[];
|
||||
extern u8 papyrus_tex_102[];
|
||||
extern u8 papyrus_tex_103[];
|
||||
extern u8 papyrus_tex_104[];
|
||||
extern u8 papyrus_tex_105[];
|
||||
extern u8 papyrus_tex_106[];
|
||||
extern u8 papyrus_tex_107[];
|
||||
extern u8 papyrus_tex_108[];
|
||||
extern u8 papyrus_tex_109[];
|
||||
extern u8 papyrus_tex_110[];
|
||||
extern u8 papyrus_tex_111[];
|
||||
extern u8 papyrus_tex_112[];
|
||||
extern u8 papyrus_tex_113[];
|
||||
extern u8 papyrus_tex_114[];
|
||||
extern u8 papyrus_tex_115[];
|
||||
extern u8 papyrus_tex_116[];
|
||||
extern u8 papyrus_tex_117[];
|
||||
extern u8 papyrus_tex_118[];
|
||||
extern u8 papyrus_tex_119[];
|
||||
extern u8 papyrus_tex_120[];
|
||||
extern u8 papyrus_tex_121[];
|
||||
extern u8 papyrus_tex_122[];
|
||||
extern u8 papyrus_tex_123[];
|
||||
extern u8 papyrus_tex_124[];
|
||||
extern u8 papyrus_tex_125[];
|
||||
extern u8 papyrus_tex_126[];
|
||||
extern u8 papyrus_tex_127[];
|
||||
|
||||
extern uObjSprite papyrus_obj_dropshadow;
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,136 @@
|
||||
#include <PR/ultratypes.h>
|
||||
#include <PR/gs2dex.h>
|
||||
extern uObjTxtr timesnewroman_tex[];
|
||||
extern uObjMtx timesnewroman_mtx;
|
||||
extern uObjSprite timesnewroman_obj;
|
||||
extern void call_timesnewroman_sprite_dl(int idx, int x, int y, uObjMtx *buffer, int buf_idx);
|
||||
extern u8 timesnewroman_tex_0[];
|
||||
extern u8 timesnewroman_tex_1[];
|
||||
extern u8 timesnewroman_tex_2[];
|
||||
extern u8 timesnewroman_tex_3[];
|
||||
extern u8 timesnewroman_tex_4[];
|
||||
extern u8 timesnewroman_tex_5[];
|
||||
extern u8 timesnewroman_tex_6[];
|
||||
extern u8 timesnewroman_tex_7[];
|
||||
extern u8 timesnewroman_tex_8[];
|
||||
extern u8 timesnewroman_tex_9[];
|
||||
extern u8 timesnewroman_tex_10[];
|
||||
extern u8 timesnewroman_tex_11[];
|
||||
extern u8 timesnewroman_tex_12[];
|
||||
extern u8 timesnewroman_tex_13[];
|
||||
extern u8 timesnewroman_tex_14[];
|
||||
extern u8 timesnewroman_tex_15[];
|
||||
extern u8 timesnewroman_tex_16[];
|
||||
extern u8 timesnewroman_tex_17[];
|
||||
extern u8 timesnewroman_tex_18[];
|
||||
extern u8 timesnewroman_tex_19[];
|
||||
extern u8 timesnewroman_tex_20[];
|
||||
extern u8 timesnewroman_tex_21[];
|
||||
extern u8 timesnewroman_tex_22[];
|
||||
extern u8 timesnewroman_tex_23[];
|
||||
extern u8 timesnewroman_tex_24[];
|
||||
extern u8 timesnewroman_tex_25[];
|
||||
extern u8 timesnewroman_tex_26[];
|
||||
extern u8 timesnewroman_tex_27[];
|
||||
extern u8 timesnewroman_tex_28[];
|
||||
extern u8 timesnewroman_tex_29[];
|
||||
extern u8 timesnewroman_tex_30[];
|
||||
extern u8 timesnewroman_tex_31[];
|
||||
extern u8 timesnewroman_tex_32[];
|
||||
extern u8 timesnewroman_tex_33[];
|
||||
extern u8 timesnewroman_tex_34[];
|
||||
extern u8 timesnewroman_tex_35[];
|
||||
extern u8 timesnewroman_tex_36[];
|
||||
extern u8 timesnewroman_tex_37[];
|
||||
extern u8 timesnewroman_tex_38[];
|
||||
extern u8 timesnewroman_tex_39[];
|
||||
extern u8 timesnewroman_tex_40[];
|
||||
extern u8 timesnewroman_tex_41[];
|
||||
extern u8 timesnewroman_tex_42[];
|
||||
extern u8 timesnewroman_tex_43[];
|
||||
extern u8 timesnewroman_tex_44[];
|
||||
extern u8 timesnewroman_tex_45[];
|
||||
extern u8 timesnewroman_tex_46[];
|
||||
extern u8 timesnewroman_tex_47[];
|
||||
extern u8 timesnewroman_tex_48[];
|
||||
extern u8 timesnewroman_tex_49[];
|
||||
extern u8 timesnewroman_tex_50[];
|
||||
extern u8 timesnewroman_tex_51[];
|
||||
extern u8 timesnewroman_tex_52[];
|
||||
extern u8 timesnewroman_tex_53[];
|
||||
extern u8 timesnewroman_tex_54[];
|
||||
extern u8 timesnewroman_tex_55[];
|
||||
extern u8 timesnewroman_tex_56[];
|
||||
extern u8 timesnewroman_tex_57[];
|
||||
extern u8 timesnewroman_tex_58[];
|
||||
extern u8 timesnewroman_tex_59[];
|
||||
extern u8 timesnewroman_tex_60[];
|
||||
extern u8 timesnewroman_tex_61[];
|
||||
extern u8 timesnewroman_tex_62[];
|
||||
extern u8 timesnewroman_tex_63[];
|
||||
extern u8 timesnewroman_tex_64[];
|
||||
extern u8 timesnewroman_tex_65[];
|
||||
extern u8 timesnewroman_tex_66[];
|
||||
extern u8 timesnewroman_tex_67[];
|
||||
extern u8 timesnewroman_tex_68[];
|
||||
extern u8 timesnewroman_tex_69[];
|
||||
extern u8 timesnewroman_tex_70[];
|
||||
extern u8 timesnewroman_tex_71[];
|
||||
extern u8 timesnewroman_tex_72[];
|
||||
extern u8 timesnewroman_tex_73[];
|
||||
extern u8 timesnewroman_tex_74[];
|
||||
extern u8 timesnewroman_tex_75[];
|
||||
extern u8 timesnewroman_tex_76[];
|
||||
extern u8 timesnewroman_tex_77[];
|
||||
extern u8 timesnewroman_tex_78[];
|
||||
extern u8 timesnewroman_tex_79[];
|
||||
extern u8 timesnewroman_tex_80[];
|
||||
extern u8 timesnewroman_tex_81[];
|
||||
extern u8 timesnewroman_tex_82[];
|
||||
extern u8 timesnewroman_tex_83[];
|
||||
extern u8 timesnewroman_tex_84[];
|
||||
extern u8 timesnewroman_tex_85[];
|
||||
extern u8 timesnewroman_tex_86[];
|
||||
extern u8 timesnewroman_tex_87[];
|
||||
extern u8 timesnewroman_tex_88[];
|
||||
extern u8 timesnewroman_tex_89[];
|
||||
extern u8 timesnewroman_tex_90[];
|
||||
extern u8 timesnewroman_tex_91[];
|
||||
extern u8 timesnewroman_tex_92[];
|
||||
extern u8 timesnewroman_tex_93[];
|
||||
extern u8 timesnewroman_tex_94[];
|
||||
extern u8 timesnewroman_tex_95[];
|
||||
extern u8 timesnewroman_tex_96[];
|
||||
extern u8 timesnewroman_tex_97[];
|
||||
extern u8 timesnewroman_tex_98[];
|
||||
extern u8 timesnewroman_tex_99[];
|
||||
extern u8 timesnewroman_tex_100[];
|
||||
extern u8 timesnewroman_tex_101[];
|
||||
extern u8 timesnewroman_tex_102[];
|
||||
extern u8 timesnewroman_tex_103[];
|
||||
extern u8 timesnewroman_tex_104[];
|
||||
extern u8 timesnewroman_tex_105[];
|
||||
extern u8 timesnewroman_tex_106[];
|
||||
extern u8 timesnewroman_tex_107[];
|
||||
extern u8 timesnewroman_tex_108[];
|
||||
extern u8 timesnewroman_tex_109[];
|
||||
extern u8 timesnewroman_tex_110[];
|
||||
extern u8 timesnewroman_tex_111[];
|
||||
extern u8 timesnewroman_tex_112[];
|
||||
extern u8 timesnewroman_tex_113[];
|
||||
extern u8 timesnewroman_tex_114[];
|
||||
extern u8 timesnewroman_tex_115[];
|
||||
extern u8 timesnewroman_tex_116[];
|
||||
extern u8 timesnewroman_tex_117[];
|
||||
extern u8 timesnewroman_tex_118[];
|
||||
extern u8 timesnewroman_tex_119[];
|
||||
extern u8 timesnewroman_tex_120[];
|
||||
extern u8 timesnewroman_tex_121[];
|
||||
extern u8 timesnewroman_tex_122[];
|
||||
extern u8 timesnewroman_tex_123[];
|
||||
extern u8 timesnewroman_tex_124[];
|
||||
extern u8 timesnewroman_tex_125[];
|
||||
extern u8 timesnewroman_tex_126[];
|
||||
extern u8 timesnewroman_tex_127[];
|
||||
|
||||
extern uObjSprite timesnewroman_obj_dropshadow;
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,136 @@
|
||||
#include <PR/ultratypes.h>
|
||||
#include <PR/gs2dex.h>
|
||||
extern uObjTxtr ubuntu_tex[];
|
||||
extern uObjMtx ubuntu_mtx;
|
||||
extern uObjSprite ubuntu_obj;
|
||||
extern void call_ubuntu_sprite_dl(int idx, int x, int y, uObjMtx *buffer, int buf_idx);
|
||||
extern u8 ubuntu_tex_0[];
|
||||
extern u8 ubuntu_tex_1[];
|
||||
extern u8 ubuntu_tex_2[];
|
||||
extern u8 ubuntu_tex_3[];
|
||||
extern u8 ubuntu_tex_4[];
|
||||
extern u8 ubuntu_tex_5[];
|
||||
extern u8 ubuntu_tex_6[];
|
||||
extern u8 ubuntu_tex_7[];
|
||||
extern u8 ubuntu_tex_8[];
|
||||
extern u8 ubuntu_tex_9[];
|
||||
extern u8 ubuntu_tex_10[];
|
||||
extern u8 ubuntu_tex_11[];
|
||||
extern u8 ubuntu_tex_12[];
|
||||
extern u8 ubuntu_tex_13[];
|
||||
extern u8 ubuntu_tex_14[];
|
||||
extern u8 ubuntu_tex_15[];
|
||||
extern u8 ubuntu_tex_16[];
|
||||
extern u8 ubuntu_tex_17[];
|
||||
extern u8 ubuntu_tex_18[];
|
||||
extern u8 ubuntu_tex_19[];
|
||||
extern u8 ubuntu_tex_20[];
|
||||
extern u8 ubuntu_tex_21[];
|
||||
extern u8 ubuntu_tex_22[];
|
||||
extern u8 ubuntu_tex_23[];
|
||||
extern u8 ubuntu_tex_24[];
|
||||
extern u8 ubuntu_tex_25[];
|
||||
extern u8 ubuntu_tex_26[];
|
||||
extern u8 ubuntu_tex_27[];
|
||||
extern u8 ubuntu_tex_28[];
|
||||
extern u8 ubuntu_tex_29[];
|
||||
extern u8 ubuntu_tex_30[];
|
||||
extern u8 ubuntu_tex_31[];
|
||||
extern u8 ubuntu_tex_32[];
|
||||
extern u8 ubuntu_tex_33[];
|
||||
extern u8 ubuntu_tex_34[];
|
||||
extern u8 ubuntu_tex_35[];
|
||||
extern u8 ubuntu_tex_36[];
|
||||
extern u8 ubuntu_tex_37[];
|
||||
extern u8 ubuntu_tex_38[];
|
||||
extern u8 ubuntu_tex_39[];
|
||||
extern u8 ubuntu_tex_40[];
|
||||
extern u8 ubuntu_tex_41[];
|
||||
extern u8 ubuntu_tex_42[];
|
||||
extern u8 ubuntu_tex_43[];
|
||||
extern u8 ubuntu_tex_44[];
|
||||
extern u8 ubuntu_tex_45[];
|
||||
extern u8 ubuntu_tex_46[];
|
||||
extern u8 ubuntu_tex_47[];
|
||||
extern u8 ubuntu_tex_48[];
|
||||
extern u8 ubuntu_tex_49[];
|
||||
extern u8 ubuntu_tex_50[];
|
||||
extern u8 ubuntu_tex_51[];
|
||||
extern u8 ubuntu_tex_52[];
|
||||
extern u8 ubuntu_tex_53[];
|
||||
extern u8 ubuntu_tex_54[];
|
||||
extern u8 ubuntu_tex_55[];
|
||||
extern u8 ubuntu_tex_56[];
|
||||
extern u8 ubuntu_tex_57[];
|
||||
extern u8 ubuntu_tex_58[];
|
||||
extern u8 ubuntu_tex_59[];
|
||||
extern u8 ubuntu_tex_60[];
|
||||
extern u8 ubuntu_tex_61[];
|
||||
extern u8 ubuntu_tex_62[];
|
||||
extern u8 ubuntu_tex_63[];
|
||||
extern u8 ubuntu_tex_64[];
|
||||
extern u8 ubuntu_tex_65[];
|
||||
extern u8 ubuntu_tex_66[];
|
||||
extern u8 ubuntu_tex_67[];
|
||||
extern u8 ubuntu_tex_68[];
|
||||
extern u8 ubuntu_tex_69[];
|
||||
extern u8 ubuntu_tex_70[];
|
||||
extern u8 ubuntu_tex_71[];
|
||||
extern u8 ubuntu_tex_72[];
|
||||
extern u8 ubuntu_tex_73[];
|
||||
extern u8 ubuntu_tex_74[];
|
||||
extern u8 ubuntu_tex_75[];
|
||||
extern u8 ubuntu_tex_76[];
|
||||
extern u8 ubuntu_tex_77[];
|
||||
extern u8 ubuntu_tex_78[];
|
||||
extern u8 ubuntu_tex_79[];
|
||||
extern u8 ubuntu_tex_80[];
|
||||
extern u8 ubuntu_tex_81[];
|
||||
extern u8 ubuntu_tex_82[];
|
||||
extern u8 ubuntu_tex_83[];
|
||||
extern u8 ubuntu_tex_84[];
|
||||
extern u8 ubuntu_tex_85[];
|
||||
extern u8 ubuntu_tex_86[];
|
||||
extern u8 ubuntu_tex_87[];
|
||||
extern u8 ubuntu_tex_88[];
|
||||
extern u8 ubuntu_tex_89[];
|
||||
extern u8 ubuntu_tex_90[];
|
||||
extern u8 ubuntu_tex_91[];
|
||||
extern u8 ubuntu_tex_92[];
|
||||
extern u8 ubuntu_tex_93[];
|
||||
extern u8 ubuntu_tex_94[];
|
||||
extern u8 ubuntu_tex_95[];
|
||||
extern u8 ubuntu_tex_96[];
|
||||
extern u8 ubuntu_tex_97[];
|
||||
extern u8 ubuntu_tex_98[];
|
||||
extern u8 ubuntu_tex_99[];
|
||||
extern u8 ubuntu_tex_100[];
|
||||
extern u8 ubuntu_tex_101[];
|
||||
extern u8 ubuntu_tex_102[];
|
||||
extern u8 ubuntu_tex_103[];
|
||||
extern u8 ubuntu_tex_104[];
|
||||
extern u8 ubuntu_tex_105[];
|
||||
extern u8 ubuntu_tex_106[];
|
||||
extern u8 ubuntu_tex_107[];
|
||||
extern u8 ubuntu_tex_108[];
|
||||
extern u8 ubuntu_tex_109[];
|
||||
extern u8 ubuntu_tex_110[];
|
||||
extern u8 ubuntu_tex_111[];
|
||||
extern u8 ubuntu_tex_112[];
|
||||
extern u8 ubuntu_tex_113[];
|
||||
extern u8 ubuntu_tex_114[];
|
||||
extern u8 ubuntu_tex_115[];
|
||||
extern u8 ubuntu_tex_116[];
|
||||
extern u8 ubuntu_tex_117[];
|
||||
extern u8 ubuntu_tex_118[];
|
||||
extern u8 ubuntu_tex_119[];
|
||||
extern u8 ubuntu_tex_120[];
|
||||
extern u8 ubuntu_tex_121[];
|
||||
extern u8 ubuntu_tex_122[];
|
||||
extern u8 ubuntu_tex_123[];
|
||||
extern u8 ubuntu_tex_124[];
|
||||
extern u8 ubuntu_tex_125[];
|
||||
extern u8 ubuntu_tex_126[];
|
||||
extern u8 ubuntu_tex_127[];
|
||||
|
||||
extern uObjSprite ubuntu_obj_dropshadow;
|
||||
@@ -0,0 +1,24 @@
|
||||
#include <ultra64.h>
|
||||
#include <PR/gs2dex.h>
|
||||
#include "config.h"
|
||||
#include "init.h"
|
||||
#include "debug.h"
|
||||
#include "s2d_error.h"
|
||||
|
||||
void s2d_init(void) {
|
||||
s2d_error_y = TEX_HEIGHT;
|
||||
if (IS_RUNNING_ON_EMULATOR)
|
||||
gSPLoadUcode(gdl_head++, s2d_text, s2d_data);
|
||||
}
|
||||
|
||||
void s2d_stop(void) {
|
||||
if (IS_RUNNING_ON_EMULATOR) {
|
||||
gSPLoadUcode(gdl_head++, zex_text, zex_data);
|
||||
if deinit_cond {
|
||||
my_rdp_init();
|
||||
my_rsp_init();
|
||||
}
|
||||
}
|
||||
s2d_reset_defer_index();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#include <ultra64.h>
|
||||
#include <PR/gs2dex.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#define s2d_text gspS2DEX2_fifoTextStart
|
||||
#define s2d_data gspS2DEX2_fifoDataStart
|
||||
#define zex_text gspF3DZEX2_PosLight_fifoTextStart
|
||||
#define zex_data gspF3DZEX2_PosLight_fifoDataStart
|
||||
|
||||
extern void s2d_init(void);
|
||||
|
||||
extern void s2d_stop(void);
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
#include <ultra64.h>
|
||||
#include <PR/gs2dex.h>
|
||||
#include <PR/gu.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#define ftoq FTOFIX32
|
||||
#define qtof FIX32TOF
|
||||
|
||||
#define qu510(n) ((u16)((n)*0x0400))
|
||||
|
||||
void mat2_dst_mul(uObjMtx *dst, uObjMtx *m1, uObjMtx *m2) {
|
||||
dst->m.A = ftoq((qtof(m1->m.A) * qtof(m2->m.A)) + (qtof(m1->m.B) * qtof(m2->m.C)));
|
||||
dst->m.B = ftoq((qtof(m1->m.A) * qtof(m2->m.B)) + (qtof(m1->m.B) * qtof(m2->m.D)));
|
||||
dst->m.C = ftoq((qtof(m1->m.C) * qtof(m2->m.A)) + (qtof(m1->m.D) * qtof(m2->m.C)));
|
||||
dst->m.D = ftoq((qtof(m1->m.C) * qtof(m2->m.B)) + (qtof(m1->m.D) * qtof(m2->m.D)));
|
||||
}
|
||||
|
||||
void mat2_dst_add(uObjMtx *dst, uObjMtx *m1, uObjMtx *m2) {
|
||||
dst->m.A = (m1->m.A + m2->m.A);
|
||||
dst->m.B = (m1->m.B + m2->m.B);
|
||||
dst->m.C = (m1->m.C + m2->m.C);
|
||||
dst->m.D = (m1->m.D + m2->m.D);
|
||||
}
|
||||
|
||||
void mat2_copy(uObjMtx *dst, uObjMtx *src) {
|
||||
dst->m.A = src->m.A;
|
||||
dst->m.B = src->m.B;
|
||||
dst->m.C = src->m.C;
|
||||
dst->m.D = src->m.D;
|
||||
dst->m.X = src->m.X;
|
||||
dst->m.Y = src->m.Y;
|
||||
dst->m.BaseScaleX = src->m.BaseScaleX;
|
||||
dst->m.BaseScaleY = src->m.BaseScaleY;
|
||||
}
|
||||
|
||||
void mat2_ident(uObjMtx *dst, float scale) {
|
||||
dst->m.A = FTOFIX32(scale);
|
||||
dst->m.D = FTOFIX32(scale);
|
||||
dst->m.B = 0;
|
||||
dst->m.C = 0;
|
||||
|
||||
dst->m.X = 0;
|
||||
dst->m.Y = 0;
|
||||
|
||||
dst->m.BaseScaleX = qu510(scale);
|
||||
dst->m.BaseScaleY = qu510(scale);
|
||||
}
|
||||
// cos -sin sin cos
|
||||
void mat2_rotate(uObjMtx *dst, f32 degrees) {
|
||||
dst->m.A = ftoq(cosf(degrees));
|
||||
dst->m.B = ftoq(sinf(degrees));
|
||||
dst->m.C = ftoq(-sinf(degrees));
|
||||
dst->m.D = ftoq(cosf(degrees));
|
||||
}
|
||||
|
||||
void mat2_mul(uObjMtx *m1, uObjMtx *m2) {
|
||||
mat2_dst_mul(m1, m1, m2);
|
||||
}
|
||||
|
||||
void mat2_add(uObjMtx *m1, uObjMtx *m2) {
|
||||
mat2_dst_mul(m1, m1, m2);
|
||||
}
|
||||
|
||||
void mat2_scale(uObjMtx *dst, int scale) {
|
||||
dst->m.A *= scale;
|
||||
dst->m.D *= scale;
|
||||
|
||||
dst->m.BaseScaleX *= scale;
|
||||
dst->m.BaseScaleY *= scale;
|
||||
}
|
||||
|
||||
#define FTOFIX16(x) (long)((x) * (float)(1 << 2))
|
||||
#define FIX16TOF(x) ((float)(x) * (1.0f / (float)(1 << 2)))
|
||||
void mat2_translate(uObjMtx *m, int x, int y) {
|
||||
m->m.X = x<<2;
|
||||
m->m.Y = y<<2;
|
||||
}
|
||||
|
||||
void mat2_translate_vec(uObjMtx *m, f32 degrees, f32 mag) {
|
||||
m->m.X += FTOFIX16(mag * cosf(degrees));
|
||||
m->m.Y += FTOFIX16(mag * sinf(degrees));
|
||||
}
|
||||
|
||||
typedef float Mat4[4][4];
|
||||
void gu_to_gs2dex(uObjMtx *m1, Mat4 m2) {
|
||||
m1->m.A = m1->m.BaseScaleX = FTOFIX32(m2[0][0]);
|
||||
m1->m.B = FTOFIX32(m2[0][1]);
|
||||
m1->m.C = FTOFIX32(m2[1][0]);
|
||||
m1->m.D = m1->m.BaseScaleY = FTOFIX32(m2[1][1]);
|
||||
|
||||
m1->m.X = FTOFIX16(m2[3][0]);
|
||||
m1->m.Y = FTOFIX16(m2[3][1]);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
#include <ultra64.h>
|
||||
#include <PR/gs2dex.h>
|
||||
#include <PR/gu.h>
|
||||
// #include "stack.h"
|
||||
typedef float Mat4[4][4];
|
||||
|
||||
extern void mat2_dst_mul(uObjMtx *dst, uObjMtx *m1, uObjMtx *m2);
|
||||
|
||||
extern void mat2_dst_add(uObjMtx *dst, uObjMtx *m1, uObjMtx *m2);
|
||||
|
||||
extern void mat2_ident(uObjMtx *dst, float scale);
|
||||
|
||||
extern void mat2_mul(uObjMtx *m1, uObjMtx *m2);
|
||||
|
||||
extern void mat2_add(uObjMtx *m1, uObjMtx *m2);
|
||||
|
||||
extern void mat2_scale(uObjMtx *dst, int scale);
|
||||
|
||||
extern void get_final_mat(uObjMtx *dst);
|
||||
|
||||
extern void mat2_translate(uObjMtx *m, int x, int y);
|
||||
|
||||
extern void mat2_rotate(uObjMtx *dst, f32 degrees);
|
||||
|
||||
extern void mat2_translate_vec(uObjMtx *m, f32 degrees, f32 mag);
|
||||
@@ -0,0 +1,39 @@
|
||||
#include "config.h"
|
||||
#include "s2d_error.h"
|
||||
#include "s2d_print.h"
|
||||
|
||||
#define S2D_BUFFERSIZE 100
|
||||
|
||||
struct s2d_pos {
|
||||
int x;
|
||||
int y;
|
||||
};
|
||||
static struct s2d_pos s2d_positions[S2D_BUFFERSIZE];
|
||||
static char *s2d_charBuffer[S2D_BUFFERSIZE];
|
||||
static int s2d_charBuffer_index = 0;
|
||||
|
||||
void s2d_reset_defer_index(void) {
|
||||
s2d_charBuffer_index = 0;
|
||||
}
|
||||
|
||||
// TODO: these DO NOT work
|
||||
// pls debug :)
|
||||
void s2d_print_deferred(int x, int y, const char *str) {
|
||||
s2d_charBuffer[s2d_charBuffer_index] = str;
|
||||
s2d_positions[s2d_charBuffer_index].x = x;
|
||||
s2d_positions[s2d_charBuffer_index].y = y;
|
||||
|
||||
s2d_charBuffer_index++;
|
||||
}
|
||||
|
||||
void s2d_handle_deferred(void) {
|
||||
for (int i = 0; i < s2d_charBuffer_index; i++) {
|
||||
s2d_print_alloc(
|
||||
s2d_positions[i].x,
|
||||
s2d_positions[i].y,
|
||||
ALIGN_LEFT,
|
||||
s2d_charBuffer[i]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
#include "config.h"
|
||||
#include <ultra64.h>
|
||||
#include "mtx.h"
|
||||
#include "debug.h"
|
||||
|
||||
float myScale = 1.0f;
|
||||
int myDegrees = 0;
|
||||
uObjMtx final_mtx, rot_mtx;
|
||||
int s2d_red = 255, s2d_green = 255, s2d_blue = 255, s2d_alpha = 255;
|
||||
int drop_shadow = FALSE;
|
||||
int drop_x = 0;
|
||||
int drop_y = 0;
|
||||
|
||||
Gfx s2d_text_init_dl[] = {
|
||||
gsDPPipeSync(),
|
||||
gsDPSetTexturePersp(G_TP_NONE),
|
||||
gsDPSetTextureLOD(G_TL_TILE),
|
||||
gsDPSetTextureLUT(G_TT_NONE),
|
||||
gsDPSetTextureConvert(G_TC_FILT),
|
||||
gsDPSetAlphaCompare(G_AC_THRESHOLD),
|
||||
gsDPSetBlendColor(0, 0, 0, 0x01),
|
||||
|
||||
gsDPSetCombineLERP(
|
||||
0, 0, 0, ENVIRONMENT,
|
||||
0, 0, 0, TEXEL0,
|
||||
0, 0, 0, ENVIRONMENT,
|
||||
0, 0, 0, TEXEL0
|
||||
),
|
||||
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
void s2d_rdp_init(void) {
|
||||
gDPPipeSync(gdl_head++);
|
||||
gDPSetTextureFilter(gdl_head++, G_TF_POINT);
|
||||
gDPSetCycleType(gdl_head++, G_CYC_1CYCLE);
|
||||
gDPSetRenderMode(gdl_head++, G_RM_XLU_SPRITE, G_RM_XLU_SPRITE2);
|
||||
if (init_cond) {
|
||||
gSPDisplayList(gdl_head++, s2d_text_init_dl);
|
||||
gSPObjRenderMode(gdl_head++, G_OBJRM_XLU);
|
||||
}
|
||||
}
|
||||
|
||||
void setup_s2d_texture(int idx) {
|
||||
gDPPipeSync(gdl_head++);
|
||||
gDPSetEnvColor(gdl_head++, s2d_red, s2d_green, s2d_blue, s2d_alpha);
|
||||
gSPObjLoadTxtr(gdl_head++, &s2d_tex[idx]);
|
||||
}
|
||||
|
||||
void mtx_pipeline(uObjMtx *m, int x, int y) {
|
||||
gDPPipeSync(gdl_head++);
|
||||
|
||||
mat2_ident(m, 1.0f / myScale);
|
||||
mat2_translate(m, x, y);
|
||||
|
||||
gSPObjSubMatrix(gdl_head++, &m->m.X);
|
||||
}
|
||||
|
||||
#define CLAMP_0(x) ((x < 0) ? 0 : x)
|
||||
|
||||
void draw_s2d_dropshadow(char c, int x, int y, uObjMtx *ds) {
|
||||
if (mtx_cond) mtx_pipeline(ds, x, y);
|
||||
if (tex_cond) setup_s2d_texture(c);
|
||||
|
||||
if (s2d_red != 0
|
||||
&& s2d_green != 0
|
||||
&& s2d_blue != 0
|
||||
) {
|
||||
gDPPipeSync(gdl_head++);
|
||||
gDPSetEnvColor(gdl_head++,
|
||||
CLAMP_0(s2d_red - 100),
|
||||
CLAMP_0(s2d_green - 100),
|
||||
CLAMP_0(s2d_blue - 100),
|
||||
s2d_alpha);
|
||||
if (spr_cond) gSPObjRectangleR(gdl_head++, &s2d_font);
|
||||
gDPSetEnvColor(gdl_head++, s2d_red, s2d_green, s2d_blue, s2d_alpha);
|
||||
}
|
||||
}
|
||||
|
||||
void draw_s2d_glyph(char c, int x, int y, uObjMtx *mt) {
|
||||
if (mtx_cond) mtx_pipeline(mt, x, y);
|
||||
if (tex_cond) setup_s2d_texture(c);
|
||||
|
||||
if (spr_cond) gSPObjRectangleR(gdl_head++, &s2d_font);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef S2D_DRAW_H
|
||||
#define S2D_DRAW_H
|
||||
#include <ultra64.h>
|
||||
|
||||
extern float myScale;
|
||||
extern int myDegrees;
|
||||
extern int drop_shadow;
|
||||
extern int drop_x, drop_y;
|
||||
|
||||
extern uObjMtx final_mtx, rot_mtx;
|
||||
|
||||
extern int s2d_red, s2d_green, s2d_blue, s2d_alpha;
|
||||
|
||||
extern void s2d_rdp_init(void);
|
||||
|
||||
extern void setup_font_texture(int idx);
|
||||
|
||||
extern void mtx_pipeline(uObjMtx *m, int x, int y);
|
||||
|
||||
extern void draw_s2d_glyph(char c, int x, int y, uObjMtx *mt);
|
||||
extern void draw_s2d_shadow(char c, int x, int y, uObjMtx *ds);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,23 @@
|
||||
#include "config.h"
|
||||
#include "s2d_print.h"
|
||||
#include "s2d_error.h"
|
||||
|
||||
int s2d_error_y = TEX_HEIGHT;
|
||||
|
||||
int s2d_check_align(int align) {
|
||||
if (align < ALIGN_LEFT || align > ALIGN_RIGHT) {
|
||||
s2d_print_alloc(TEX_WIDTH, s2d_error_y, ALIGN_LEFT, "ERROR: invalid alignment");
|
||||
s2d_error_y += TEX_HEIGHT;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int s2d_check_str(const char *str) {
|
||||
if (str == NULL || ((u32)str & 0x80000000) == 0) {
|
||||
s2d_print_alloc(TEX_WIDTH, s2d_error_y, ALIGN_LEFT, "ERROR: bad string, or no string specified");
|
||||
s2d_error_y += TEX_HEIGHT;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
#ifndef S2D_ERROR_H
|
||||
#define S2D_ERROR_H
|
||||
|
||||
extern int s2d_check_align(int align);
|
||||
extern int s2d_check_str(const char *str);
|
||||
|
||||
extern int s2d_error_y;
|
||||
|
||||
#endif
|
||||
Whitespace-only changes.
@@ -0,0 +1,352 @@
|
||||
#include <ultra64.h>
|
||||
#include <PR/gs2dex.h>
|
||||
#include <PR/gu.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "s2d_draw.h"
|
||||
#include "s2d_print.h"
|
||||
#include "s2d_ustdlib.h"
|
||||
#include "s2d_error.h"
|
||||
|
||||
static int s2d_width(const char *str, int line, int len);
|
||||
|
||||
enum S2DPrintModes {
|
||||
MODE_DRAW_DROPSHADOW,
|
||||
MODE_DRAW_NORMALTEXT,
|
||||
};
|
||||
|
||||
static int s2d_snprint(int x, int y, int align, const char *str, uObjMtx *buf, int len, int mode) {
|
||||
char *p = str;
|
||||
int tmp_len = 0;
|
||||
int orig_x = x;
|
||||
int orig_y = y;
|
||||
int line = 0;
|
||||
char button = '\0';
|
||||
|
||||
if (*p == '\0') return;
|
||||
|
||||
if (IS_RUNNING_ON_EMULATOR) {
|
||||
s2d_rdp_init();
|
||||
} else {
|
||||
f3d_rdp_init();
|
||||
}
|
||||
|
||||
// resets parameters
|
||||
s2d_red = s2d_green = s2d_blue = 255;
|
||||
s2d_alpha = 255;
|
||||
drop_shadow = FALSE;
|
||||
|
||||
switch (align) {
|
||||
case ALIGN_CENTER:
|
||||
x = orig_x - s2d_width(str, line, len) / 2;
|
||||
break;
|
||||
case ALIGN_RIGHT:
|
||||
x = orig_x - s2d_width(str, line, len);
|
||||
}
|
||||
|
||||
do {
|
||||
char current_char = *p;
|
||||
|
||||
switch (current_char) {
|
||||
case CH_SCALE:
|
||||
CH_SKIP(p);
|
||||
myScale = (f32)s2d_atoi(p, &p) / 100.0f;
|
||||
break;
|
||||
case CH_ROT:
|
||||
CH_SKIP(p);
|
||||
myDegrees = s2d_atoi(p, &p);
|
||||
break;
|
||||
case CH_TRANSLATE:
|
||||
CH_SKIP(p);
|
||||
orig_x = s2d_atoi(p, &p);
|
||||
line++;
|
||||
switch (align) {
|
||||
case ALIGN_LEFT:
|
||||
x = orig_x;
|
||||
break;
|
||||
case ALIGN_CENTER:
|
||||
x = orig_x - s2d_width(str, line, len) / 2;
|
||||
break;
|
||||
case ALIGN_RIGHT:
|
||||
x = orig_x - s2d_width(str, line, len);
|
||||
}
|
||||
CH_SKIP(p);
|
||||
CH_SKIP(p);
|
||||
orig_y = s2d_atoi(p, &p);
|
||||
y = orig_y;
|
||||
break;
|
||||
case CH_COLOR:
|
||||
CH_SKIP(p);
|
||||
s2d_red = s2d_atoi(p, &p);
|
||||
CH_SKIP(p); CH_SKIP(p);
|
||||
|
||||
s2d_green = s2d_atoi(p, &p);
|
||||
CH_SKIP(p); CH_SKIP(p);
|
||||
|
||||
s2d_blue = s2d_atoi(p, &p);
|
||||
CH_SKIP(p); CH_SKIP(p);
|
||||
|
||||
s2d_alpha = s2d_atoi(p, &p);
|
||||
break;
|
||||
case CH_DROPSHADOW:
|
||||
drop_shadow = 1;
|
||||
|
||||
// WIP: drop shadow custom offset
|
||||
// TODO: unique offset per string; fix negative offsets
|
||||
CH_SKIP(p);
|
||||
drop_x = s2d_atoi(p, &p);
|
||||
CH_SKIP(p); CH_SKIP(p);
|
||||
drop_y = s2d_atoi(p, &p);
|
||||
break;
|
||||
case CH_BUTTON:
|
||||
if (len - tmp_len == 1) break;
|
||||
if (len - tmp_len > 2) {
|
||||
CH_SKIP(p);
|
||||
break;
|
||||
}
|
||||
button = p[1];
|
||||
CH_SKIP(p);
|
||||
switch (button) {
|
||||
case 'A':
|
||||
if (!(CONTROLLER_HELD_INPUT & A_BUTTON)) return 1;
|
||||
break;
|
||||
case 'B':
|
||||
if (!(CONTROLLER_HELD_INPUT & B_BUTTON)) return 1;
|
||||
break;
|
||||
case 'Z':
|
||||
if (!(CONTROLLER_HELD_INPUT & Z_TRIG)) return 1;
|
||||
break;
|
||||
case 'L':
|
||||
if (!(CONTROLLER_HELD_INPUT & L_TRIG)) return 1;
|
||||
break;
|
||||
case 'R':
|
||||
if (!(CONTROLLER_HELD_INPUT & R_TRIG)) return 1;
|
||||
break;
|
||||
case 'S':
|
||||
if (!(CONTROLLER_HELD_INPUT & START_BUTTON)) return 1;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case '\n':
|
||||
line++;
|
||||
switch (align) {
|
||||
case ALIGN_LEFT:
|
||||
x = orig_x;
|
||||
break;
|
||||
case ALIGN_CENTER:
|
||||
x = orig_x - s2d_width(str, line, len) / 2;
|
||||
break;
|
||||
case ALIGN_RIGHT:
|
||||
x = orig_x - s2d_width(str, line, len);
|
||||
}
|
||||
y += TEX_HEIGHT / TEX_RES;
|
||||
break;
|
||||
case '\t':
|
||||
x += TAB_WIDTH_H / TEX_RES;
|
||||
break;
|
||||
case '\v':
|
||||
x += TAB_WIDTH_V / TEX_RES;
|
||||
y += TEX_HEIGHT / TEX_RES;
|
||||
break;
|
||||
// case CH_SEPARATOR:
|
||||
// CH_SKIP(p);
|
||||
// break;
|
||||
case CH_RESET:
|
||||
s2d_red = s2d_green = s2d_blue = 255;
|
||||
s2d_alpha = 255;
|
||||
drop_shadow = FALSE;
|
||||
drop_x = 0;
|
||||
drop_y = 0;
|
||||
myScale = 1;
|
||||
myDegrees = 0;
|
||||
break;
|
||||
default:
|
||||
if (current_char != '\0' && current_char != CH_SEPARATOR) {
|
||||
char *tbl = segmented_to_virtual(s2d_kerning_table);
|
||||
|
||||
if (IS_RUNNING_ON_EMULATOR) {
|
||||
if (drop_shadow && mode == MODE_DRAW_DROPSHADOW) {
|
||||
draw_s2d_dropshadow(current_char, x + drop_x, y + drop_y, (buf++));
|
||||
} else if (mode == MODE_DRAW_NORMALTEXT) {
|
||||
draw_s2d_glyph(current_char, x, y, (buf++));
|
||||
}
|
||||
} else {
|
||||
if (drop_shadow && mode == MODE_DRAW_DROPSHADOW) {
|
||||
draw_f3d_dropshadow(current_char, x + drop_x, y + drop_y, (buf++));
|
||||
} else if (mode == MODE_DRAW_NORMALTEXT) {
|
||||
draw_f3d_glyph(current_char, x, y, (buf++));
|
||||
}
|
||||
}
|
||||
|
||||
(x += (tbl[(int) current_char] * (BASE_SCALE * myScale)));
|
||||
}
|
||||
}
|
||||
if (*p == '\0') break;
|
||||
p++;
|
||||
tmp_len++;
|
||||
} while (tmp_len < len);
|
||||
myScale = 1.0f;
|
||||
myDegrees = 0;
|
||||
drop_shadow = FALSE;
|
||||
drop_x = 0;
|
||||
drop_y = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int s2d_string_has_dropshadow(const char *str) {
|
||||
char *p = str;
|
||||
|
||||
int result = FALSE;
|
||||
|
||||
do {if (*p == CH_DROPSHADOW) result = TRUE;} while (*(++p) != '\0');
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// deprecated
|
||||
void s2d_print(int x, int y, int align, const char *str, uObjMtx *buf) {
|
||||
if (s2d_check_align(align) != 0) return;
|
||||
if (s2d_check_str(str) != 0) return;
|
||||
|
||||
s2d_snprint(x, y, align, str, buf, s2d_strlen(str), MODE_DRAW_DROPSHADOW);
|
||||
s2d_snprint(x, y, align, str, buf, s2d_strlen(str), MODE_DRAW_NORMALTEXT);
|
||||
}
|
||||
|
||||
void s2d_print_alloc(int x, int y, int align, const char *str) {
|
||||
int len;
|
||||
|
||||
if (s2d_check_align(align) != 0) return;
|
||||
if (s2d_check_str(str) != 0) return;
|
||||
|
||||
len = s2d_strlen(str);
|
||||
|
||||
if (s2d_string_has_dropshadow(str)) {
|
||||
uObjMtx *b = alloc(sizeof(uObjMtx) * len);
|
||||
s2d_snprint(x, y, align, str, b, len, MODE_DRAW_DROPSHADOW);
|
||||
}
|
||||
|
||||
uObjMtx *b2 = alloc(sizeof(uObjMtx) * len);
|
||||
s2d_snprint(x, y, align, str, b2, len, MODE_DRAW_NORMALTEXT);
|
||||
}
|
||||
|
||||
// deprecated
|
||||
void s2d_type_print(int x, int y, int align, const char *str, uObjMtx *buf, int *pos) {
|
||||
int len;
|
||||
|
||||
if (s2d_check_align(align) != 0) return;
|
||||
if (s2d_check_str(str) != 0) return;
|
||||
|
||||
len = s2d_strlen(str);
|
||||
|
||||
s2d_snprint(x, y, align, str, buf, *pos, MODE_DRAW_DROPSHADOW);
|
||||
|
||||
int result = s2d_snprint(x, y, align, str, buf, *pos, MODE_DRAW_NORMALTEXT);
|
||||
if (s2d_timer % 2 == 0) {
|
||||
if (*pos < len && result != 1) {
|
||||
(*pos)++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void s2d_type_print_alloc(int x, int y, int align, const char *str, int *pos) {
|
||||
int len;
|
||||
|
||||
if (s2d_check_align(align) != 0) return;
|
||||
if (s2d_check_str(str) != 0) return;
|
||||
|
||||
len = s2d_strlen(str);
|
||||
|
||||
uObjMtx *b = alloc(sizeof(uObjMtx) * (*pos));
|
||||
|
||||
if (s2d_string_has_dropshadow(str)) {
|
||||
uObjMtx *b_d = alloc(sizeof(uObjMtx) * (*pos));
|
||||
s2d_snprint(x, y, align, str, b_d, *pos, MODE_DRAW_DROPSHADOW);
|
||||
}
|
||||
|
||||
int result = s2d_snprint(x, y, align, str, b, *pos, MODE_DRAW_NORMALTEXT);
|
||||
if (s2d_timer % 2 == 0) {
|
||||
if (*pos < len && result != 1) {
|
||||
(*pos)++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// broken atm
|
||||
static int s2d_width(const char *str, int line, int len) {
|
||||
char *p = str;
|
||||
int tmp_len = 0;
|
||||
int curLine = 0;
|
||||
int width = 0;
|
||||
int scale = 1;
|
||||
|
||||
if (*p == '\0') return width;
|
||||
|
||||
do {
|
||||
char current_char = *p;
|
||||
switch (current_char) {
|
||||
case CH_SCALE:
|
||||
CH_SKIP(p);
|
||||
scale = s2d_atoi(p, &p);
|
||||
break;
|
||||
case CH_ROT:
|
||||
CH_SKIP(p);
|
||||
s2d_atoi(p, &p);
|
||||
break;
|
||||
case CH_TRANSLATE:
|
||||
CH_SKIP(p);
|
||||
s2d_atoi(p, &p);
|
||||
curLine++;
|
||||
CH_SKIP(p);
|
||||
CH_SKIP(p);
|
||||
s2d_atoi(p, &p);
|
||||
break;
|
||||
case CH_COLOR:
|
||||
CH_SKIP(p);
|
||||
s2d_atoi(p, &p);
|
||||
CH_SKIP(p); CH_SKIP(p);
|
||||
s2d_atoi(p, &p);
|
||||
CH_SKIP(p); CH_SKIP(p);
|
||||
s2d_atoi(p, &p);
|
||||
CH_SKIP(p); CH_SKIP(p);
|
||||
s2d_atoi(p, &p);
|
||||
break;
|
||||
case CH_DROPSHADOW:
|
||||
case CH_RESET:
|
||||
break;
|
||||
case '\n':
|
||||
curLine++;
|
||||
break;
|
||||
case '\t':
|
||||
if (curLine == line)
|
||||
width += TAB_WIDTH_H / TEX_RES;
|
||||
break;
|
||||
case '\v':
|
||||
if (curLine == line)
|
||||
width += TAB_WIDTH_V / TEX_RES;
|
||||
break;
|
||||
default:
|
||||
if (current_char != '\0' && curLine == line)
|
||||
width += s2d_kerning_table[(int) current_char] * scale;
|
||||
}
|
||||
if (*p == '\0') break;
|
||||
p++;
|
||||
tmp_len++;
|
||||
} while (tmp_len < len && curLine <= line);
|
||||
return width;
|
||||
}
|
||||
|
||||
// void s2d_vsprint(int x, int y, int align, uObjMtx *buf, const char *str, ...) {
|
||||
// int last_chr;
|
||||
// va_list args;
|
||||
// char *dst = alloc(s2d_strlen(str) * 2);
|
||||
// va_start(args, str);
|
||||
// last_chr = vsprintf(dst, str, str, args);
|
||||
// if (last_chr >= 0) {
|
||||
// dst[last_chr] = '\0';
|
||||
// }
|
||||
// s2d_print(x, y, align, dst, buf);
|
||||
// }
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
#include <ultra64.h>
|
||||
#include <PR/gs2dex.h>
|
||||
|
||||
#define SCALE "\x80" // SCALE (an integer percentage; 100 -> 100%, 25 -> 25%, etc.)
|
||||
#define ROTATE "\x81" // ROTATE (degrees) // TODO: maybe add axis?
|
||||
#define TRANSLATE "\x82" // TRANSLATE (x) (y)
|
||||
#define COLOR "\x83" // COLOR (r) (g) (b) (a)
|
||||
#define DROPSHADOW "\x84" // DROPSHADOW (no args)
|
||||
#define BACKGROUND "\x85" // BACKGROUND (w) (h) (alpha)
|
||||
#define SEPARATOR "\x86"
|
||||
#define RESET "\x87"
|
||||
#define BUTTON "\x88"
|
||||
|
||||
#define CH_SCALE '\x80'
|
||||
#define CH_ROT '\x81'
|
||||
#define CH_TRANSLATE '\x82'
|
||||
#define CH_COLOR '\x83'
|
||||
#define CH_DROPSHADOW '\x84'
|
||||
#define CH_BACKGROUND '\x85'
|
||||
#define CH_SEPARATOR '\x86'
|
||||
#define CH_RESET '\x87'
|
||||
#define CH_BUTTON '\x88'
|
||||
|
||||
// ASCII standard escape codes
|
||||
#define CH_NEWLINE '\n'
|
||||
|
||||
#define CH_GET_NEXT(x) (*(++x))
|
||||
#define CH_SKIP(x) {x++;}
|
||||
|
||||
#define ALIGN_LEFT 0
|
||||
#define ALIGN_CENTER 1
|
||||
#define ALIGN_RIGHT 2
|
||||
|
||||
extern void s2d_print_alloc(int x, int y, int align, const char *str);
|
||||
extern void s2d_type_print(int x, int y, int align, const char *str, uObjMtx *buf, int *pos);
|
||||
@@ -0,0 +1,55 @@
|
||||
// ustdlib means un-standard library
|
||||
// i'm going to abuse so much of my power here lol
|
||||
#include "s2d_print.h"
|
||||
// int s2d_atoi(char *s, char **s2) {
|
||||
// int ret = 0;
|
||||
// int isNegative = (*s == '-');
|
||||
// if (isNegative) {
|
||||
// s++;
|
||||
// (*s2)++;
|
||||
// }
|
||||
// while (*s != '\0' && *s != ' ' && *s >= '0' && *s <= '9') {
|
||||
// ret *= 10;
|
||||
// ret += *s - '0';
|
||||
// s++;
|
||||
// (*s2)++;
|
||||
// }
|
||||
// if (isNegative) ret *= -1;
|
||||
// return ret;
|
||||
// }
|
||||
|
||||
int s2d_atoi(char *s, char **s2) {
|
||||
int ret = 0;
|
||||
int isNegative = (*s == '-');
|
||||
if (isNegative) {
|
||||
s++;
|
||||
(*s2)++;
|
||||
}
|
||||
for (; *s != '\0' && *s != ' ' && *s != CH_SEPARATOR && *s >= '0' && *s <= '9'; s++) {
|
||||
ret *= 10;
|
||||
if (*s >= '0' && *s <= '9')
|
||||
ret += *s - '0';
|
||||
else break;
|
||||
if (!(*(s+1) != '\0' && *(s+1) != CH_SEPARATOR && *(s+1) != ' ' && *(s+1) >= '0' && *(s+1) <= '9')) break;
|
||||
(*s2)++;
|
||||
}
|
||||
if (isNegative) ret *= -1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int s2d_ilen(char *s) {
|
||||
int ret = 0;
|
||||
char *p = s;
|
||||
while (*p >= '0' && *p <= '9' && *p != CH_SEPARATOR) {
|
||||
ret++;
|
||||
p++;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int s2d_strlen(char *s) {
|
||||
int result = 0;
|
||||
char *p = s;
|
||||
do {result++;} while (*(++p) != '\0');
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
extern int s2d_atoi(char *s, char **s2);
|
||||
|
||||
extern int s2d_ilen(char *s);
|
||||
|
||||
extern int s2d_strlen(char *s);
|
||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,227 @@
|
||||
// int s2d_atoi(char *s, char **s2) {
|
||||
// int ret = 0;
|
||||
// int isNegative = (*s == '-');
|
||||
// if (isNegative) {s++; (*s2)++;}
|
||||
// for (; *s != '\0' && *s != ' ' && *s >= '0' && *s <= '9'; s++) {
|
||||
// ret *= 10;
|
||||
// if (*s >= '0' && *s <= '9')
|
||||
// ret += *s - '0';
|
||||
// else break;
|
||||
// if (!(*(s+1) != '\0' && *(s+1) != ' ' && *(s+1) >= '0' && *(s+1) <= '9')) break;
|
||||
// (*s2)++;
|
||||
// }
|
||||
// if (isNegative) ret *= -1;
|
||||
// return ret;
|
||||
// }
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#define SCALE "\x80" // SCALE (some scale)
|
||||
#define ROTATE "\x81" // ROTATE (degrees) // TODO: maybe add axis?
|
||||
#define TRANSLATE "\x82" // TRANSLATE (x) (y)
|
||||
|
||||
#define CH_SCALE '\x80'
|
||||
#define CH_ROT '\x81'
|
||||
#define CH_TRANSLATE '\x82'
|
||||
|
||||
#define CH_GET_NEXT(x) (*(++x))
|
||||
#define CH_SKIP(x) ((++x))
|
||||
|
||||
int saved_degrees = 0;
|
||||
|
||||
int myScale = 1;
|
||||
int myDegrees = 0;
|
||||
|
||||
char *t = "TEST CRINGE";
|
||||
int s2d_atoi(char *s, char **s2) {
|
||||
int ret = 0;
|
||||
int isNegative = (*s == '-');
|
||||
if (isNegative) {
|
||||
s++;
|
||||
(*s2)++;
|
||||
}
|
||||
for (; *s != '\0' && *s != ' ' && *s >= '0' && *s <= '9'; s++) {
|
||||
ret *= 10;
|
||||
if (*s >= '0' && *s <= '9')
|
||||
ret += *s - '0';
|
||||
else break;
|
||||
if (!(*(s+1) != '\0' && *(s+1) != ' ' && *(s+1) >= '0' && *(s+1) <= '9')) break;
|
||||
(*s2)++;
|
||||
}
|
||||
if (isNegative) ret *= -1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern unsigned int gGlobalTimer;
|
||||
|
||||
void s2d_print(int x, int y, char *str) {
|
||||
char *p = str;
|
||||
int tx = 0, ty = 0;
|
||||
// int r = 0, g = 0, b = 0, a = 0;
|
||||
if (*p == '\0') return;
|
||||
do {
|
||||
char r = *p;
|
||||
int s, rd;
|
||||
switch (r) {
|
||||
case CH_SCALE:
|
||||
CH_SKIP(p);
|
||||
s = s2d_atoi(p, &p);
|
||||
myScale = s;
|
||||
break;
|
||||
case CH_ROT:
|
||||
CH_SKIP(p);
|
||||
rd = s2d_atoi(p, &p);
|
||||
saved_degrees = rd;
|
||||
myDegrees = rd;
|
||||
break;
|
||||
case CH_TRANSLATE:
|
||||
CH_SKIP(p);
|
||||
x = s2d_atoi(p, &p);
|
||||
CH_SKIP(p);
|
||||
CH_SKIP(p);
|
||||
y = s2d_atoi(p, &p);
|
||||
break;
|
||||
// case CH_COLOR:
|
||||
// CH_SKIP(p);
|
||||
// s2d_red = s2d_atoi(p, &p);
|
||||
// CH_SKIP(p); CH_SKIP(p);
|
||||
|
||||
// s2d_green = s2d_atoi(p, &p);
|
||||
// CH_SKIP(p); CH_SKIP(p);
|
||||
|
||||
// s2d_blue = s2d_atoi(p, &p);
|
||||
// CH_SKIP(p); CH_SKIP(p);
|
||||
|
||||
// s2d_alpha = s2d_atoi(p, &p);
|
||||
// break;
|
||||
|
||||
// break;
|
||||
default:
|
||||
break;
|
||||
// if (myDegrees == 0)
|
||||
// // draw_s2d_glyph(r, (x += (8 * myScale)) + tx, y + ty, (buf++));
|
||||
// else
|
||||
// draw_s2d_glyph(r, (x += ((8 * myScale))) + tx, y + ty, (buf++));
|
||||
}
|
||||
p++;
|
||||
// myDegrees += saved_degrees;
|
||||
} while (*p != '\0');
|
||||
myScale = 1;
|
||||
myDegrees = 0;
|
||||
saved_degrees = 0;
|
||||
tx = 0;
|
||||
ty = 0;
|
||||
}
|
||||
|
||||
int s2d_ilen(char *s) {
|
||||
int ret = 0;
|
||||
char *p = s;
|
||||
while (*p >= '0' && *p <= '9') {
|
||||
ret++;
|
||||
p++;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int s2d_atoi2(char *s) {
|
||||
int ret = 0;
|
||||
int isNegative = (*s == '-');
|
||||
if (isNegative) {
|
||||
s++;
|
||||
}
|
||||
for (; *s != '\0' && *s != ' ' && *s >= '0' && *s <= '9'; s++) {
|
||||
ret *= 10;
|
||||
if (*s >= '0' && *s <= '9')
|
||||
ret += *s - '0';
|
||||
else break;
|
||||
if (!(*(s+1) != '\0' && *(s+1) != ' ' && *(s+1) >= '0' && *(s+1) <= '9')) break;
|
||||
}
|
||||
// (*s2)--;
|
||||
if (isNegative) ret *= -1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void s2d_type_print(int x, int y, char *str, int *pos) {
|
||||
char *temp_str = str;
|
||||
char tmp = temp_str[*pos];
|
||||
int len = strlen(str);
|
||||
char current_transformation;
|
||||
int cur_transform_index;
|
||||
switch(tmp) {
|
||||
case CH_SCALE:
|
||||
current_transformation = CH_SCALE;
|
||||
cur_transform_index = *pos;
|
||||
// temp_str[*pos] = ' ';
|
||||
printf("SCALE %c %d\n", str[*pos + 1], s2d_ilen(str + *pos + 1));
|
||||
(*pos) += s2d_ilen(str + *pos+2) + 1;
|
||||
break;
|
||||
case CH_ROT:
|
||||
printf("ROTATE %s %d\n", str + *pos + 1, s2d_ilen(str + *pos + 1));
|
||||
(*pos) += s2d_ilen(str + *pos + 2);
|
||||
break;
|
||||
}
|
||||
// temp_str[*pos] = '\0';
|
||||
// s2d_print(x, y, temp_str);
|
||||
// // temp_str[cur_transform_index] = current_transformation;
|
||||
// temp_str[*pos] = tmp;
|
||||
|
||||
// if (gGlobalTimer % 5 == 0) {
|
||||
if (*pos < len)
|
||||
(*pos)++;
|
||||
// }
|
||||
printf("%d %c\n", *pos, str[*pos]);
|
||||
}
|
||||
|
||||
|
||||
char sss[] = SCALE "2";
|
||||
// SCALE "4"
|
||||
// "big chungus";
|
||||
|
||||
char myS[] = "small test"
|
||||
ROTATE "2"
|
||||
"big test"
|
||||
ROTATE "26"
|
||||
"italic chungus";
|
||||
|
||||
char my2[] = "small test"
|
||||
ROTATE "2"
|
||||
"big test"
|
||||
ROTATE "0000046"
|
||||
"big italic chungus"
|
||||
ROTATE "124335";
|
||||
|
||||
int pos = 0;
|
||||
int main(void) {
|
||||
// printf("%d\n", s2d_atoi(s, &s));
|
||||
// printf("%s\n", s);
|
||||
// s2d_print(0,0, t);
|
||||
char laStrBuf[0x100];
|
||||
char ff[0x100];
|
||||
sprintf(ff,
|
||||
"%s %d:"
|
||||
TRANSLATE "134 93" "%s:"
|
||||
, "Floor", 213, "Seed");
|
||||
sprintf(
|
||||
laStrBuf,
|
||||
"%s"
|
||||
TRANSLATE "138 93" "%s"
|
||||
TRANSLATE "138 110" "%s"
|
||||
TRANSLATE "138 130" "%s"
|
||||
, "The Basement", "LLRRABAB", "Continue", "End Run");
|
||||
|
||||
while (pos != strlen(laStrBuf)) {
|
||||
// s2d_type_print(0, 0, myS, &pos);
|
||||
printf("%d %s\n",s2d_ilen(laStrBuf + pos), laStrBuf + pos);
|
||||
pos++;
|
||||
}
|
||||
pos = 0;
|
||||
while (pos != strlen(ff)) {
|
||||
// s2d_type_print(0, 0, myS, &pos);
|
||||
printf("%d %s\n",s2d_ilen(ff + pos), ff + pos);
|
||||
pos++;
|
||||
}
|
||||
// laStrBuf[strlen(laStrBuf)] = "\x1";
|
||||
// laStrBuf[strlen(laStrBuf)+1] = "\x1";
|
||||
// printf("%s\n", laStrBuf);
|
||||
// printf("%d\n", s2d_ilen(sss + 1));
|
||||
}
|
||||
Reference in new issue
Block a user