git-svn-id: https://svn.code.sf.net/p/yeti3dpro/code@1 6f553e77-8ba3-4953-8e8c-f11ef5ce68d8

This commit is contained in:
buzzphp 2016-07-08 21:54:52 +00:00
commit 7f537e39e4
224 changed files with 468365 additions and 0 deletions

131
MD2Viewer/MD2Viewer.bpr Normal file
View file

@ -0,0 +1,131 @@
<?xml version='1.0' encoding='utf-8' ?>
<!-- C++Builder XML Project -->
<PROJECT>
<MACROS>
<VERSION value="BCB.06.00"/>
<PROJECT value="MD2Viewer.exe"/>
<OBJFILES value="MD2Viewer.obj UnitMain.obj ..\src\sys\BCBTools.obj ..\src\y3d\y3d_all.obj
..\src\game\sprites.obj ..\src\game\data.obj ..\src\game\entities.obj
..\src\game\game.obj ..\src\game\maps.obj ..\src\game\models.obj
..\src\game\screens.obj ..\platform\win32\yeti3dwin32.obj"/>
<RESFILES value="MD2Viewer.res"/>
<DEFFILE value=""/>
<RESDEPEN value="$(RESFILES) UnitMain.dfm"/>
<LIBFILES value=""/>
<LIBRARIES value=""/>
<SPARELIBS value="vcl.lib rtl.lib"/>
<PACKAGES value="vcl.bpi rtl.bpi vclx.bpi bcbsmp.bpi dclocx.bpi"/>
<PATHCPP value=".;..\src\sys;..\src\y3d;..\src\game;..\platform\win32"/>
<PATHPAS value=".;"/>
<PATHRC value=".;"/>
<PATHASM value=".;"/>
<DEBUGLIBPATH value="$(BCB)\lib\debug"/>
<RELEASELIBPATH value="$(BCB)\lib\release"/>
<LINKER value="ilink32"/>
<USERDEFINES value=""/>
<SYSDEFINES value="_RTLDLL;NO_STRICT;USEPACKAGES"/>
<MAINSOURCE value="MD2Viewer.cpp"/>
<INCLUDEPATH value="..\platform\win32;..\src\game;..\src\y3d;..\src\entities;..\src\sys;..\src;..\..\src;&quot;C:\Program Files\Borland\CBuilder6\Projects&quot;;C:\yeti3d\Tools\MD2Viewer;$(BCB)\include;$(BCB)\include\vcl"/>
<LIBPATH value="..\platform\win32;..\src\game;..\src\y3d;..\src\entities;..\src\sys;..\src;..\..\src;&quot;C:\Program Files\Borland\CBuilder6\Projects&quot;;C:\yeti3d\Tools\MD2Viewer;$(BCB)\lib\obj;$(BCB)\lib"/>
<WARNINGS value="-w-par"/>
<OTHERFILES value=""/>
</MACROS>
<OPTIONS>
<CFLAG1 value="-O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -a8 -b- -k- -vi -c -tW -tWM"/>
<PFLAGS value="-$Y- -$L- -$D- -$A8 -v -JPHNE -M"/>
<RFLAGS value=""/>
<AFLAGS value="/mx /w2 /zd"/>
<LFLAGS value="-D&quot;&quot; -aa -Tpe -x -Gn"/>
<OTHERFILES value=""/>
</OPTIONS>
<LINKER>
<ALLOBJ value="c0w32.obj $(PACKAGES) Memmgr.Lib sysinit.obj $(OBJFILES)"/>
<ALLRES value="$(RESFILES)"/>
<ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cp32mti.lib"/>
<OTHERFILES value=""/>
</LINKER>
<FILELIST>
<FILE FILENAME="MD2Viewer.res" FORMNAME="" UNITNAME="MD2Viewer.res" CONTAINERID="ResTool" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="MD2Viewer.cpp" FORMNAME="" UNITNAME="MD2Viewer" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="UnitMain.cpp" FORMNAME="FormMain" UNITNAME="UnitMain" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\src\sys\BCBTools.cpp" FORMNAME="" UNITNAME="BCBTools" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\src\y3d\y3d_all.c" FORMNAME="" UNITNAME="y3d_all" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\src\game\sprites.c" FORMNAME="" UNITNAME="sprites.c" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\src\game\data.c" FORMNAME="" UNITNAME="data.c" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\src\game\entities.c" FORMNAME="" UNITNAME="entities.c" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\src\game\game.c" FORMNAME="" UNITNAME="game.c" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\src\game\maps.c" FORMNAME="" UNITNAME="maps.c" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\src\game\models.c" FORMNAME="" UNITNAME="models.c" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\src\game\screens.c" FORMNAME="" UNITNAME="screens.c" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\platform\win32\yeti3dwin32.c" FORMNAME="" UNITNAME="yeti3dwin32" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
</FILELIST>
<BUILDTOOLS>
</BUILDTOOLS>
<IDEOPTIONS>
[Version Info]
IncludeVerInfo=0
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=1033
CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=
[HistoryLists\hlIncludePath]
Count=2
Item0=..\src\entities;..\src\sys;..\src;..\..\src;C:\Program Files\Borland\CBuilder6\Projects;C:\yeti3d\Tools\MD2Viewer;$(BCB)\include;$(BCB)\include\vcl
Item1=..\..\src;C:\Program Files\Borland\CBuilder6\Projects;C:\yeti3d\Tools\MD2Viewer;$(BCB)\include;$(BCB)\include\vcl
[HistoryLists\hlLibraryPath]
Count=2
Item0=..\src\entities;..\src\sys;..\src;..\..\src;C:\Program Files\Borland\CBuilder6\Projects;C:\yeti3d\Tools\MD2Viewer;$(BCB)\lib\obj;$(BCB)\lib
Item1=..\..\src;C:\Program Files\Borland\CBuilder6\Projects;C:\yeti3d\Tools\MD2Viewer;$(BCB)\lib\obj;$(BCB)\lib
[HistoryLists\hlDebugSourcePath]
Count=1
Item0=$(BCB)\source\vcl
[HistoryLists\hlConditionals]
Count=2
Item0=_DEBUG;__YETI_EDITOR__
Item1=_DEBUG
[Debugging]
DebugSourceDirs=$(BCB)\source\vcl
[Parameters]
RunParams=
Launcher=
UseLauncher=0
DebugCWD=
HostApplication=
RemoteHost=
RemotePath=
RemoteLauncher=
RemoteCWD=
RemoteDebug=0
[Compiler]
ShowInfoMsgs=0
LinkDebugVcl=0
</IDEOPTIONS>
</PROJECT>

34
MD2Viewer/MD2Viewer.cpp Normal file
View file

@ -0,0 +1,34 @@
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
//---------------------------------------------------------------------------
USEFORM("UnitMain.cpp", FormMain);
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
Application->Initialize();
Application->Title = "MD2Viewer - Yeti3D Engine";
Application->CreateForm(__classid(TFormMain), &FormMain);
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
catch (...)
{
try
{
throw Exception("");
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
}
return 0;
}
//---------------------------------------------------------------------------

BIN
MD2Viewer/MD2Viewer.res Normal file

Binary file not shown.

73
MD2Viewer/Ratamahatta.txt Normal file
View file

@ -0,0 +1,73 @@
11-02-98
================================================================
Model Name : Ratamahatta
installation directory : quake2/baseq2/players/Ratamahatta
Author : Brian "EvilBastard" Collins
additional skins by :
'Gearwhore' by MrRogers
'Jaws' by Claudius Brunnecker
Email Address : brian@zono.com
Website Address : http://www.deviousassassins.com/EvilBastard/
Model description :
It's been a long time in the making, but he's finaly done. This PPM is the prize of the Bodyshop Q2 tournament won by Tank Abbot. I hope he likes it ;P
Model Info :
Ratamahatta is a fun loving guy, who like to pull the wings off files, and similarly amusing things. After a long day of gratuitous destruction and rolling around in his own filth, Rat always enjoys a spot of tea.
Additional Credits to :
* Idsoftware
* NST!!! Know it and love it
Thanks to :
Npherno and MrRogers for all the help
Virus[DA] for hosting my website.
Rogue13 and John McPherson for the advise and input.
================================================================
* Play Information *
New Sounds : NO
CTF Skins : YES
VWEP Support : No
* Construction *
Poly Count : 666 tris.md2 / 119 weapon.md2
Vert Count : 344 tris.md2 / 85 weapon.md2
Skin Count : 4 DM, 2 CTF
Base : Forgotten One
Editor used :
Modeling - lightwave
Animation- lightwave + puppetmaster
Skining - NST
Painting - Photoshop, NST
Viewing - Skin View
Known Bugs : None that i know of.
* Copyright / Permissions *
QUAKE(R) and QUAKE II(R) are registered trademarks of id Software, Inc.
Feel free to edit my model as you see fit, just be sure to mention me
in the readme file. This model is not to be distributed as part of any
commercial product.

359
MD2Viewer/UnitMain.cpp Normal file
View file

@ -0,0 +1,359 @@
/*
** Name: Yeti3D
** Desc: Portable GameBoy Advanced 3D Engine
** Auth: Derek J. Evans <derek@theteahouse.com.au>
**
** Copyright (C) 2003-2004 Derek J. Evans. All Rights Reserved.
**
** YY YY EEEEEE TTTTTT IIIIII 33333 DDDDD
** YY YY EE TT II 33 DD DD
** YYYY EEEE TT II 333 DD DD
** YY EE TT II 33 DD DD
** YY EEEEEE TT IIIIII 33333 DDDDD
*/
#include <vcl.h>
#pragma hdrstop
#include "UnitMain.h"
#include "y3d_draw.h"
#include "y3d_quake.h"
#include "y3d_engine.h"
#include "maps.h"
#include "yeti3dwin32.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TFormMain *FormMain;
//---------------------------------------------------------------------------
__fastcall TFormMain::TFormMain(TComponent* Owner) : TForm(Owner) {}
//---------------------------------------------------------------------------
void __fastcall TFormMain::FormCreate(TObject *Sender)
{
PBBackDrop->ControlStyle = PBBackDrop->ControlStyle << csOpaque;
PBScene->ControlStyle = PBScene->ControlStyle << csOpaque;
Caption = Application->Title;
SL = new TStringList;
MD2Model = new TMemoryStream;
YetiModel = new TMemoryStream;
BMSkin = new Graphics::TBitmap;
Bitmap = new Graphics::TBitmap;
Bitmap->PixelFormat = pf16bit;
Bitmap->Width = YETI_FRAMEBUFFER_WIDTH;
Bitmap->Height = YETI_FRAMEBUFFER_HEIGHT;
BMBackDrop = new Graphics::TBitmap;
BitmapLoadFromTexture(BMBackDrop, textures[60], palette);
yeti_init(&yeti,
framebuffer.pixels[0],
framebuffer.pixels[0],
textures, palette,
lua0, lua1, lua2, lua3);
game_load_map(&yeti, &map_e3m1);
game_goto(&yeti.game, GAME_MODE_PLAY);
//yeti_init_map(&yeti);
//yeti_calc_lights(&yeti);
yeti.camera->x = i2fdiv2(MAP_WIDTH ) + FIXHALF;
yeti.camera->y = i2fdiv2(MAP_HEIGHT) + FIXHALF;
//yeti_light(&yeti, yeti.camera->x, yeti.camera->y);
entity = yeti_entity(&yeti, yeti.camera->x, yeti.camera->y, 0);
entity->visual.data = 0;
entity->visual.width = 8;
entity->visual.height = 10;
entity->t = DEG_180;
entity->radius = 0;
entity->visual.ondraw = yeti_model_draw;
LoadFromFile("tris.md2", "skin.jpg");
yeti.camera->y -= i2f(2);
SetZoom(2);
}
//---------------------------------------------------------------------------
void TFormMain::SetZoom(int AZoom)
{
Zoom = EnsureRange(AZoom, 1, 10);
ScrollBox->OnResize(ScrollBox);
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::PBScenePaint(TObject *Sender)
{
PBScene->Canvas->StretchDraw(PBScene->ClientRect, Bitmap);
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::ScrollBoxResize(TObject *Sender)
{
int LWidth = Bitmap->Width * Zoom;
int LHeight = Bitmap->Height * Zoom;
PanelScene->SetBounds(
Max((ScrollBox->ClientWidth - LWidth ) / 2, 0) - ScrollBox->HorzScrollBar->Position,
Max((ScrollBox->ClientHeight - LHeight) / 2, 0) - ScrollBox->VertScrollBar->Position,
LWidth, LHeight);
}
//---------------------------------------------------------------------------
void ModelConvert(TMemoryStream* Dst, TMemoryStream* Src, Graphics::TBitmap* ASkin)
{
#define WRITE(A) {short n = (A); Dst->Write(&n, sizeof(n));}
model_t* model = (model_t*) Src->Memory;
triangle_t* triangles = (triangle_t*)((int)model + model->offsetTriangles);
textureCoordinate_t* texcoords = (textureCoordinate_t*)((int)model + model->offsetTexCoords);
Dst->Clear();
WRITE(7);
WRITE(model->numFrames );
WRITE(model->numVertices);
WRITE(model->numTexCoords);
WRITE(model->numTriangles);
WRITE(model->numVertices * 3);
WRITE(1);
for (int fid = 0; fid < model->numFrames; fid++)
{
frame_t* f = (frame_t*)((int)model + model->offsetFrames + model->frameSize * fid);
for (int vid = 0; vid < model->numVertices; vid++)
{
WRITE(-(f->vertices[vid].vertex[1] * f->scale[1] + f->translate[1]) * 16);
WRITE( (f->vertices[vid].vertex[2] * f->scale[2] + f->translate[2]) * 16 + 256);
WRITE( (f->vertices[vid].vertex[0] * f->scale[0] + f->translate[0]) * 16);
}
}
for (int i = 0; i < model->numTexCoords; i++)
{
int s = texcoords[i].s * i2f(YETI_SKIN_WIDTH ) / model->skinWidth;
int t = texcoords[i].t * i2f(YETI_SKIN_HEIGHT) / model->skinHeight;
//s = CLAMP(s, 0, i2f(YETI_SKIN_WIDTH ) - 1);
t = CLAMP(t, 0, i2f(YETI_SKIN_HEIGHT) - 1);
WRITE(s); WRITE(t);
}
for (int tid = 0; tid < model->numTriangles; tid++)
{
WRITE(triangles[tid].vertexIndices[0]);
WRITE(triangles[tid].vertexIndices[1]);
WRITE(triangles[tid].vertexIndices[2]);
WRITE(triangles[tid].textureIndices[0]);
WRITE(triangles[tid].textureIndices[1]);
WRITE(triangles[tid].textureIndices[2]);
}
for (int Y = 0; Y < ASkin->Height; Y++)
{
for (int X = 0; X < ASkin->Width; X++)
{
int C = ASkin->Canvas->Pixels[X][Y];
int R = GetRValue(C) * 31 / 255;
int G = GetGValue(C) * 31 / 255;
int B = GetBValue(C) * 31 / 255;
WRITE(RGB_SET(R, G, B));
}
}
}
//---------------------------------------------------------------------------
void TFormMain::LoadModel(String AFileName)
{
MD2Model->LoadFromFile(AFileName);
model_t* model = (model_t*) MD2Model->Memory;
Edit1->Text = String((char*)&model->magic, 4);
Edit2->Text = model->version;
Edit3->Text = model->numFrames;
Edit4->Text = model->numTriangles;
Edit5->Text = model->numVertices;
Edit6->Text = model->numTexCoords;
Edit7->Text = model->numSkins;
TBFrame->Max = model->numFrames - 1;
}
void TFormMain::LoadSkin(String AFileName)
{
BitmapLoadFromFile(BMSkin, AFileName);
BMSkin->PixelFormat = pf32bit;
BitmapResize(BMSkin, YETI_SKIN_WIDTH, YETI_SKIN_HEIGHT);
PBSkin->Refresh();
}
void TFormMain::LoadFromFile(String AModelName, String ASkinName)
{
LoadModel(AModelName);
LoadSkin(ASkinName);
entity->visual.data = NULL;
ModelConvert(YetiModel, MD2Model, BMSkin);
model_t* model = (model_t*) MD2Model->Memory;
if (model->numTriangles >= YETI_MODEL_TRANGLE_MAX)
{
throw Exception("The MD2 contains too many triangles to render.");
}
if (model->numVertices >= YETI_MODEL_VERTEX_MAX)
{
throw Exception("The MD2 contains too many vertices to render.");
}
entity->visual.data = YetiModel->Memory;
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::MIOpenClick(TObject *Sender)
{
OpenDialog->FileName = "";
OpenDialog->Title = "Select MD2 File...";
OpenDialog->Filter = "MD2 Files (*.md2)|*.md2";
if (OpenDialog->Execute())
{
String ModelName = OpenDialog->FileName;
OpenDialog->FileName = "";
OpenDialog->Title = "Select Skin Bitmap...";
OpenDialog->Filter = "Bitmap Files (*.bmp)|*.bmp;*.jpg;*.jpeg";
if (OpenDialog->Execute())
{
LoadFromFile(ModelName, OpenDialog->FileName);
}
}
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::TimerTimer(TObject *Sender)
{
if (yeti.keyboard.tick & 1)
{
if (CBAnimate->Checked)
{
if (TBFrame->Position == TBFrame->Max)
TBFrame->Position = TBFrame->Min;
else
TBFrame->Position = TBFrame->Position + 1;
}
}
keyboard_update(&yeti.keyboard);
game_loop(&yeti);
entity->z = yeti.camera->z;
BitmapDrawViewport(Bitmap, &yeti.viewport);
PBScene->OnPaint(PBScene);
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::TBZoomInClick(TObject *Sender)
{
SetZoom(Zoom + 1);
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::TBZoomOutClick(TObject *Sender)
{
SetZoom(Zoom - 1);
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::TBOpenClick(TObject *Sender)
{
MIOpen->Click();
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::TBSaveClick(TObject *Sender)
{
MIExportBin->Click();
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::PBSkinPaint(TObject *Sender)
{
PBSkin->Canvas->StretchDraw(PBSkin->ClientRect, BMSkin);
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::PBBackDropPaint(TObject *Sender)
{
for (int Y = 0; Y < PBBackDrop->ClientHeight; Y += BMBackDrop->Height)
{
for (int X = 0; X < PBBackDrop->ClientWidth; X += BMBackDrop->Width)
{
PBBackDrop->Canvas->Draw(X, Y, BMBackDrop);
}
}
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::MIExitClick(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::MIExportBinClick(TObject *Sender)
{
SaveDialog->FileName = "";
SaveDialog->Title = "Export BIN File...";
SaveDialog->DefaultExt = "bin";
SaveDialog->Filter = "Bin Files (*.bin)|*.bin";
if (SaveDialog->Execute())
{
YetiModel->SaveToFile(SaveDialog->FileName);
}
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::ExportCC1Click(TObject *Sender)
{
SaveDialog->FileName = "";
SaveDialog->Title = "Export C/C++ File...";
SaveDialog->DefaultExt = "c";
SaveDialog->Filter = "C/C++ Files (*.c)|*.c;*.cpp";
if (SaveDialog->Execute())
{
Application->ProcessMessages();
String Name = ChangeFileExt(ExtractFileName(SaveDialog->FileName), "");
ConvertMemoryStreamToStringList(YetiModel, SL, Name);
SL->SaveToFile(SaveDialog->FileName);
}
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::MIAboutClick(TObject *Sender)
{
ShowMessage(YETI_STR_CAPTION);
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::TBFrameChange(TObject *Sender)
{
entity->animation.pos = i2f(TBFrame->Position);
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::PBSceneMouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y)
{
MDP = Point(X, Y);
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::PBSceneMouseMove(TObject *Sender,
TShiftState Shift, int X, int Y)
{
if (PBScene->ControlState.Contains(csLButtonDown))
{
entity->t += i2f(MDP.x - X) * 3;
MDP = Point(X, Y);
}
}
//---------------------------------------------------------------------------

800
MD2Viewer/UnitMain.dfm Normal file
View file

@ -0,0 +1,800 @@
object FormMain: TFormMain
Left = 150
Top = 131
Width = 714
Height = 609
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
KeyPreview = True
Menu = MainMenu
OldCreateOrder = False
Position = poScreenCenter
WindowState = wsMaximized
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object StatusBar: TStatusBar
Left = 0
Top = 544
Width = 706
Height = 19
Panels = <>
SimplePanel = False
end
object ToolBar: TToolBar
Left = 0
Top = 0
Width = 706
Height = 30
AutoSize = True
BorderWidth = 1
Caption = 'ToolBar'
EdgeBorders = [ebTop, ebBottom]
Flat = True
Images = ImageList
TabOrder = 1
object TBNew: TToolButton
Left = 0
Top = 0
Caption = 'TBNew'
Enabled = False
ImageIndex = 0
end
object TBOpen: TToolButton
Left = 23
Top = 0
Caption = 'TBOpen'
ImageIndex = 1
OnClick = TBOpenClick
end
object TBSave: TToolButton
Left = 46
Top = 0
Caption = 'TBSave'
ImageIndex = 2
OnClick = TBSaveClick
end
object ToolButton4: TToolButton
Left = 69
Top = 0
Width = 8
Caption = 'ToolButton4'
ImageIndex = 3
Style = tbsSeparator
end
object TBZoomIn: TToolButton
Left = 77
Top = 0
Caption = 'TBZoomIn'
ImageIndex = 3
OnClick = TBZoomInClick
end
object TBZoomOut: TToolButton
Left = 100
Top = 0
Caption = 'TBZoomOut'
ImageIndex = 4
OnClick = TBZoomOutClick
end
end
object ScrollBox: TScrollBox
Left = 185
Top = 30
Width = 521
Height = 514
HorzScrollBar.Tracking = True
VertScrollBar.Tracking = True
Align = alClient
Color = clBlack
ParentColor = False
TabOrder = 2
OnResize = ScrollBoxResize
object PBBackDrop: TPaintBox
Left = 0
Top = 0
Width = 517
Height = 510
Align = alClient
OnPaint = PBBackDropPaint
end
object PanelScene: TPanel
Left = 56
Top = 64
Width = 105
Height = 97
BevelOuter = bvNone
BorderWidth = 1
Color = clSilver
TabOrder = 0
object PBScene: TPaintBox
Left = 1
Top = 1
Width = 103
Height = 95
Align = alClient
Color = clBlack
ParentColor = False
OnMouseDown = PBSceneMouseDown
OnMouseMove = PBSceneMouseMove
OnPaint = PBScenePaint
end
end
end
object PanelLeft: TPanel
Left = 0
Top = 30
Width = 185
Height = 514
Align = alLeft
BevelOuter = bvNone
TabOrder = 3
object GBMD2Properties: TGroupBox
Left = 8
Top = 8
Width = 169
Height = 193
Caption = ' MD2 Properties '
TabOrder = 0
object LabelVersion: TPanel
Left = 8
Top = 40
Width = 73
Height = 21
Alignment = taRightJustify
BevelOuter = bvNone
Caption = 'version:'
TabOrder = 2
end
object LabelNumTriangles: TPanel
Left = 8
Top = 88
Width = 73
Height = 21
Alignment = taRightJustify
BevelOuter = bvNone
Caption = 'numTriangles:'
TabOrder = 0
end
object LabelNumVertices: TPanel
Left = 8
Top = 112
Width = 73
Height = 21
Alignment = taRightJustify
BevelOuter = bvNone
Caption = 'numVertices:'
TabOrder = 1
end
object Edit3: TEdit
Left = 96
Top = 64
Width = 57
Height = 21
TabStop = False
ParentColor = True
ReadOnly = True
TabOrder = 5
end
object Edit2: TEdit
Left = 96
Top = 40
Width = 57
Height = 21
TabStop = False
ParentColor = True
ReadOnly = True
TabOrder = 4
end
object Edit1: TEdit
Left = 96
Top = 16
Width = 57
Height = 21
TabStop = False
ParentColor = True
ReadOnly = True
TabOrder = 3
end
object LabelTexCoords: TPanel
Left = 8
Top = 136
Width = 73
Height = 21
Alignment = taRightJustify
BevelOuter = bvNone
Caption = 'numTexCoords:'
TabOrder = 6
end
object Edit4: TEdit
Left = 96
Top = 88
Width = 57
Height = 21
TabStop = False
ParentColor = True
ReadOnly = True
TabOrder = 7
end
object Edit5: TEdit
Left = 96
Top = 112
Width = 57
Height = 21
TabStop = False
ParentColor = True
ReadOnly = True
TabOrder = 8
end
object LabelNumFrames: TPanel
Left = 8
Top = 64
Width = 73
Height = 21
Alignment = taRightJustify
BevelOuter = bvNone
Caption = 'numFrames:'
TabOrder = 9
end
object Panel1: TPanel
Left = 8
Top = 160
Width = 73
Height = 21
Alignment = taRightJustify
BevelOuter = bvNone
Caption = 'numSkins:'
TabOrder = 10
end
object Edit6: TEdit
Left = 96
Top = 136
Width = 57
Height = 21
TabStop = False
ParentColor = True
ReadOnly = True
TabOrder = 11
end
object Panel2: TPanel
Left = 8
Top = 16
Width = 73
Height = 21
Alignment = taRightJustify
BevelOuter = bvNone
Caption = 'magic:'
TabOrder = 12
end
object Edit7: TEdit
Left = 96
Top = 160
Width = 57
Height = 21
TabStop = False
ParentColor = True
ReadOnly = True
TabOrder = 13
end
end
object GBSkinImage: TGroupBox
Left = 8
Top = 280
Width = 169
Height = 169
Caption = ' Skin Image '
TabOrder = 1
object PanelSkin: TPanel
Left = 8
Top = 16
Width = 153
Height = 145
BevelOuter = bvLowered
TabOrder = 0
object PBSkin: TPaintBox
Left = 1
Top = 1
Width = 151
Height = 143
Align = alClient
OnPaint = PBSkinPaint
end
end
end
object GBFrameSettings: TGroupBox
Left = 8
Top = 208
Width = 169
Height = 65
Caption = ' Frame Setting '
TabOrder = 2
object TBFrame: TTrackBar
Left = 8
Top = 16
Width = 150
Height = 17
Orientation = trHorizontal
Frequency = 10
Position = 0
SelEnd = 0
SelStart = 0
TabOrder = 0
ThumbLength = 11
TickMarks = tmBottomRight
TickStyle = tsAuto
OnChange = TBFrameChange
end
object CBAnimate: TCheckBox
Left = 64
Top = 40
Width = 89
Height = 17
Caption = 'Auto Animate'
Checked = True
State = cbChecked
TabOrder = 1
end
end
end
object MainMenu: TMainMenu
Left = 208
Top = 32
object MIFile: TMenuItem
Caption = '&File'
object MIOpen: TMenuItem
Caption = '&Open MD2 File...'
OnClick = MIOpenClick
end
object N2: TMenuItem
Caption = '-'
end
object MIExportBin: TMenuItem
Caption = 'Export Yeti3D Bin Model...'
OnClick = MIExportBinClick
end
object ExportCC1: TMenuItem
Caption = 'Export Yeti3D C/C++...'
OnClick = ExportCC1Click
end
object N1: TMenuItem
Caption = '-'
end
object MIExit: TMenuItem
Caption = 'E&xit'
OnClick = MIExitClick
end
end
object MIHelp: TMenuItem
Caption = '&Help'
object MIAbout: TMenuItem
Caption = '&About...'
OnClick = MIAboutClick
end
end
end
object OpenDialog: TOpenDialog
Left = 240
Top = 32
end
object Timer: TTimer
Interval = 35
OnTimer = TimerTimer
Left = 304
Top = 32
end
object ImageList: TImageList
Left = 272
Top = 32
Bitmap = {
494C010105000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000003000000001002000000000000030
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000004A667C00BE9596000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000006B9CC3001E89E8004B7AA300C896
9300000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000004BB4FE0051B5FF002089E9004B7A
A200C69592000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000051B7FE0051B3FF001D87
E6004E7AA000CA97920000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000051B7FE004EB2
FF001F89E6004E7BA200B9949700000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000052B8
FE004BB1FF002787D9005F6A760000000000A8787500C4A39800D5B6A700D0A5
9F00000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000055BDFF00B5D6ED00A3908E00B3978800F0E7C800FEFDDA00FEFDD900FDFC
D800EAD8C200CEAEA30000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000CCB7B700D9B8A500FEF0C200FFFDD600FFFFDA00FFFFDA00FFFF
DF00FFFFEE00F6F0EB00B48D8900000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000C6978F00F6E0B500FFE1A700FDF7D000FFFFDA00FFFFE100FFFF
F200FFFFFA00FFFFFF00DFD0BE00000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000DBBAA800FFE9AC00A99AB3007E97E6006584FB006584FB006584
FB007F98FD00DAE3EE00F2EFD000C79C96000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000E4C7AF00FFEBA4005661CE00002CFF000235FC000335FB000134
FB00002AFD00B0C1E800FAF8D700C6AC9A000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000DEBEAA00FFECB400CFA99500C3AEAD009AAFEA009AAFEA009AAF
EA00C4D1E300EFF2DE00F6F2D200C8A298000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000CA9F9700FDEFC200FFECC000F4D3A600F4D09D00F9E4B800FEF6
CF00FFFFD100FFFFDA00E5D9BB00000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000DDC4AE00FFFFFF00FFF7E900F3CC9800F0BD8900F4CE
9D00FCE6B600FDF6C800BE9D8F00000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000D3BFBA00F6F0DC00FFF2C000FDE6B100FEE9
B500F4DEB700D0AD9D0000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000CAAD9600CFAE9B00DDBFA900DCB8
A800000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000B7818300B781
8300B7818300B7818300B7818300B7818300B7818300B7818300B7818300B781
8300B7818300B7818300B7818300000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000AD5A5900AA54
5400A24D4E00AA959500C1C8C700CCCBCA00CECBCA00CAC8C700C6CAC900B79E
9E009840410099444400A651510000000000000000004A667C00BE9596000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000C7A79C00FEEE
D400F7E3C500F6DFBC00F5DBB400F3D7AB00F3D3A200F1CF9A00F0CF9700F0CF
9800F0CF9800F5D49A00B7818300000000000000000029ABD70035B3DC0023A9
D700000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000BC787100CF666600D268
6800B95A5B009B808000BEA1A000E2D0CE00FEF9F500FFFDFA00F2F6F400D2B3
B300962D2C0099323200C25B5B00B05859006B9CC3001E89E8004B7AA300C896
9300000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000C7A79E00FDEF
D900F6E3CB00F5DFC200F4DBBA00F2D7B200F1D4A900F1D0A200EECC9900EECC
9700EECC9700F3D19900B7818300000000000000000029ABD700AFF6FC0086EF
FA0049C2E40049C2E40049C2E40034B4DD0024AAD70000000000000000000000
00000000000000000000000000000000000000000000BB787100CB656500CE67
6700B85D5D009E7B7C009D434300B7767500E7DFDD00FDFBF900FEFFFD00D9BA
B900962E2E0099333300C05A5A00AF5859004BB4FE0051B5FF002089E9004B7A
A200C69592000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000C7A9A100FEF3
E300F8E7D300F5E3CB00F5DFC300F3DBBB00F2D7B200F1D4AB00F0D0A300EECC
9A00EECC9700F3D19900B7818300000000000000000029ABD700A6E9F5009EFF
FF0097FCFF0099FBFF0095F7FF008DF2FE0083EAFA0049C2E40049C2E4003AB8
DF000000000000000000000000000000000000000000BB787100CB656500CE66
6700B85D5D00A8848300993939009B363600CDBCBB00F2F0EE00FFFFFF00E2C3
C100962D2D0098333300C05A5A00AF5859000000000051B7FE0051B3FF001D87
E6004E7AA000CA97920000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000C9ACA500FFF7
EB00F9EBDA00F7E7D200F6E3CA00F5DFC200F4DBB900F2D7B200F1D4AA00F0D0
A100EFCD9900F3D19800B7818300000000000000000029ABD7008BD7EC00ABFE
FF0090F8FF0091F6FF0090F5FF008FF5FF008FF4FF0090F4FF0095F6FF0075DD
F5002DAFDB0000000000000000000000000000000000BB787100CB656500CE66
6600B75C5C00B28F8E009F48480094323200A69A9A00D5DBD800FAFFFE00E6C9
C800932B2B0096303000BF595900AF585900000000000000000051B7FE004EB2
FF001F89E6004E7BA200B9949700000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000CEB2AA00FFFC
F400FAEFE400F8EADA00F7E7D300F5E2CB00F5DFC200F4DBBB00F1D7B200F1D3
AA00F0D0A100F3D29B00B7818300000000000000000029ABD70029ABD700AAF0
FA0091FAFF0091F6FF0090F5FF008EF4FF008DF2FE008BF1FE008CF1FF0077DF
F60056CAEA0000000000000000000000000000000000BB787100CB656500CF66
6600BB5C5C00C3908F00C2969500B3868600AA8D8E00BAA2A100E1CAC800DCA9
A900A33A3A00A43E3E00C35D5D00AE57580000000000000000000000000052B8
FE004BB1FF002787D9005F6A760000000000A8787500C4A39800D5B6A700D0A5
9F00000000000000000000000000000000000000000000000000D3B7AF00FFFF
FD00FBF4EC00FAEFE300F9EBDA00F7E7D200F5E3C900F5DFC200F4DBBA00F2D7
B100F0D4A900F5D5A300B7818300000000000000000029ABD7007BE5F40029AB
D7009EFEFF008DF7FF008EF6FF008CF4FF008DF2FE008BF1FE008CF1FF0072DD
F50079E1F6002CB0DA00000000000000000000000000BB787100CC656600CB64
6400CB646400CB636400CC676700CD676700CC646400C85B5B00C95E5E00CA61
6100CC656500CD666600CF686800AC5657000000000000000000000000000000
000055BDFF00B5D6ED00A3908E00B3978800EDE4C600FFFFD700FFFFD600FFFE
D700EAD8C200CEAEA30000000000000000000000000000000000D7BBB200FFFF
FF00FEF9F500FBF3EC00FAEFE200F9EADA00F8E7D200F5E3CA00F5DEC200F4DB
BA00F2D8B200F6D9AC00B7818300000000000000000029ABD70093F9FD0029AB
D700A8E9F500A8F0FA00A4F1FB00A1F7FF008CF3FF008AF1FE008CF1FF0070DA
F30005740B0058CDEA00000000000000000000000000BC797200B7535100B25B
5700C6868400D2A4A200D5ABAA00D5AAA900D5ABAA00D5A5A400D5A8A700D5AA
A900D6AEAC00D39C9C00CD666600AC5556000000000000000000000000000000
000000000000CCB7B700D9B8A500FEF0C200FFFFD500B5C4E4006887EE00DDE4
E200FFFFEE00F6F0EB00B48D8900000000000000000000000000DABEB300FFFF
FF00FFFEFD00FDF8F400FBF3EC00F9EFE300F8EADA00F7E7D200F6E2CA00F6DE
C100F4DBB900F8DDB400B7818300000000000000000029ABD7009DFEFF0086F2
FB0029ABD70029ABD70029ABD70029ABD700AFF2FB0090F4FF0088F2FF000574
0B005BE78C0005740B001FA8D6000000000000000000BC787100B14F4C00E4CD
CB00FAF7F700F8F4F300F9F5F400F9F5F400F9F5F400F9F6F500F9F5F400F9F5
F400FBFBFA00DEBEBD00C45C5D00AD5657000000000000000000000000000000
000000000000C6978F00F6E0B500FFE1A700FFFFCA00839CEB00002BFC00CED8
F500FFFFFA00FFFFFF00DFD0BE00000000000000000000000000DEC1B500FFFF
FF00FFFFFF00FFFEFD00FEF9F400FBF3EB00FAEFE200F9EBD900F8E6D100F6E2
C800F7E1C200F0DAB700B7818300000000000000000029ABD7009AFCFF0096FB
FF0095FBFF0095FAFF0090F7FF006CDEF30029ABD7009FE3F40005740B0050D7
7A0045D26C0031C14F0005740B000000000000000000BC787100B3514E00EBD7
D600FCFBFA00F7F0EF00F7F1F000F7F1F000F7F1F000F7F1F000F7F1F000F6F1
F000FBF9F800DEBCBB00C35B5B00AD5657000000000000000000000000000000
000000000000DBBAA800FFE9AC00A99AB3007E97E600456AF3000435FB006584
FB007F98FD00DAE3EE00F2EFD000C79C96000000000000000000E2C5B500FFFF
FF00FFFFFF00FFFFFF00FFFEFD00FDF9F400FBF3EB00FAEEE200FAEDDC00FCEF
D900E6D9C400C6BCA900B7818300000000000000000029ABD7009BFDFF0094FA
FF0092F8FF0091F6FF0092F7FF0093F9FF0084EFFD0029ABD70029ABD700168C
230030C14C001698240034AFDA000000000000000000BC787100B3514E00EBD7
D400F0EFEF00D8D5D400DAD7D700DAD7D700DAD7D700DAD7D700DAD7D700D8D5
D500ECECEB00E0BDBC00C25B5B00AD5657000000000000000000000000000000
000000000000E4C7AF00FFEBA4005661CE00002CFF000235FC000335FB000134
FB00002AFD00B0C1E800FAF8D700C6AC9A000000000000000000E5C7B700FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFEFD00FDF8F300FDF6EC00F1E1D500C6A1
9400B5948900B08F8100B7818300000000000000000029ABD700A4FFFF0094FC
FF0092F9FF0093F8FF008FEDFA0090ECFA0095EEFC0096F1FD009AF4FF000C81
16001AAF2C0008831000000000000000000000000000BC787100B3514E00EBD7
D500F3F1F100DEDAD900DFDBDB00DFDBDB00DFDBDB00DFDBDB00DFDBDB00DDDA
D900EEEEEE00E0BDBC00C35B5B00AD5657000000000000000000000000000000
000000000000DEBEAA00FFECB400CFA99500C3AEAD00647BE1000336FD009AAF
EA00C4D1E300EFF2DE00F6F2D200C8A298000000000000000000E9CBB800FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFEFC00FFFEF900E3CFC900BF8C
7600E8B27000ECA54A00C5876800000000000000000025A8D60029ABD7009EF5
FB009FF7FD0086EAF8002BAED90025A8D60028ABD7002AACD80032B0DA000C90
17000EA01A0000000000000000000000000000000000BC787100B3514E00EAD7
D500F5F4F300E4DFDE00E5E1E000E5E1E000E5E1E000E5E1E000E5E1E000E4DF
DF00F2F1F000DFBDBB00C35B5B00AD5657000000000000000000000000000000
000000000000CA9F9700FDEFC200FFECC000FFE39D007B82CB00002FFF00CAD0
DA00FFFFD100FFFFDA00E5D9BB00000000000000000000000000ECCDBA00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00E4D4D200C89A
7F00FAC57700CD937700000000000000000000000000000000000000000029AB
D70030AED9002CADD800000000000000000000000000000000000A8912000EA1
1A0008810F0000000000000000000000000000000000BC787100B3514E00EBD7
D600F1F0EF00D9D5D500DAD8D700DAD8D700DAD8D700DAD8D700DAD8D700D8D5
D500EDECEB00E1BEBD00C35B5B00AD5657000000000000000000000000000000
00000000000000000000DDC4AE00FFFFFF00FFF9E800CFB6A900A790A800E3C3
A300FCE6B600FDF6C800BE9D8F00000000000000000000000000EACAB600FCF7
F400FCF7F300FBF6F300FBF6F300FAF5F300F9F5F300F9F5F300E1D0CE00C797
7C00CF9B86000000000000000000000000000000000000000000000000000000
000000000000000000000000000005710A0009790F000B8916000A8C1300067A
0D000000000000000000000000000000000000000000BC787000B3514E00E9D6
D400FEFBFB00FAF3F200FAF3F200FAF3F200FAF3F200FAF3F200FAF3F200FAF3
F200FDFAF900DEBCBB00C35C5C00AD5657000000000000000000000000000000
0000000000000000000000000000D3BFBA00F6F0DE00FFF6BD00FFEDAB00FEE9
B500F4DEB700D0AD9D0000000000000000000000000000000000E9C6B100EBCC
B800EBCCB800EBCCB800EBCBB800EACBB800EACBB800EACCB900DABBB000B885
7A00000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000A8504C00C9B6
B500D3D5D400D1CECE00D1CECE00D1CECE00D1CECE00D1CECE00D1CECE00D1CE
CE00D3D4D400CBAEAD00A34D4E00000000000000000000000000000000000000
000000000000000000000000000000000000CAAD9600CFAE9B00DDBFA900DCB8
A80000000000000000000000000000000000424D3E000000000000003E000000
2800000040000000300000000100010000000000800100000000000000000000
000000000000000000000000FFFFFF0000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000009FFF0000000000000FFF000000000000
07FF00000000000083FF000000000000C1FF000000000000E10F000000000000
F003000000000000F801000000000000F801000000000000F800000000000000
F800000000000000F800000000000000F801000000000000FC01000000000000
FE03000000000000FF0F000000000000C001FFFFC0019FFFC0018FFF80000FFF
C001807F800007FFC001800F800083FFC00180078000C1FFC00180078000E10F
C00180038000F003C00180038000F801C00180018000F801C00180018000F800
C00180018000F800C00180038000F800C00180078000F801C003E3C78000FC01
C007FE0F8000FE03C00FFFFFC001FF0F00000000000000000000000000000000
000000000000}
end
object SaveDialog: TSaveDialog
Options = [ofOverwritePrompt, ofHideReadOnly, ofEnableSizing]
Left = 336
Top = 32
end
end

129
MD2Viewer/UnitMain.h Normal file
View file

@ -0,0 +1,129 @@
/*
** Name: Yeti3D
** Desc: Portable GameBoy Advanced 3D Engine
** Auth: Derek J. Evans <derek@theteahouse.com.au>
**
** Copyright (C) 2003-2004 Derek J. Evans. All Rights Reserved.
**
** YY YY EEEEEE TTTTTT IIIIII 33333 DDDDD
** YY YY EE TT II 33 DD DD
** YYYY EEEE TT II 333 DD DD
** YY EE TT II 33 DD DD
** YY EEEEEE TT IIIIII 33333 DDDDD
*/
#ifndef UnitMainH
#define UnitMainH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ComCtrls.hpp>
#include <ExtCtrls.hpp>
#include <ToolWin.hpp>
#include <Menus.hpp>
#include <Dialogs.hpp>
#include <Math.hpp>
#include <JPEG.hpp>
#include "game.h"
#include "BCBTools.h"
#include <ImgList.hpp>
#include <Buttons.hpp>
//---------------------------------------------------------------------------
class TFormMain : public TForm
{
__published: // IDE-managed Components
TStatusBar *StatusBar;
TToolBar *ToolBar;
TToolButton *TBNew;
TToolButton *TBOpen;
TToolButton *TBSave;
TScrollBox *ScrollBox;
TMainMenu *MainMenu;
TMenuItem *MIFile;
TMenuItem *MIOpen;
TOpenDialog *OpenDialog;
TTimer *Timer;
TPanel *PanelScene;
TPaintBox *PBScene;
TImageList *ImageList;
TToolButton *ToolButton4;
TToolButton *TBZoomIn;
TToolButton *TBZoomOut;
TPanel *PanelLeft;
TGroupBox *GBMD2Properties;
TPanel *LabelVersion;
TPanel *LabelNumTriangles;
TPanel *LabelNumVertices;
TEdit *Edit3;
TEdit *Edit2;
TEdit *Edit1;
TGroupBox *GBSkinImage;
TPaintBox *PBBackDrop;
TPanel *LabelTexCoords;
TEdit *Edit4;
TEdit *Edit5;
TPanel *LabelNumFrames;
TSaveDialog *SaveDialog;
TMenuItem *N1;
TMenuItem *MIExit;
TMenuItem *N2;
TMenuItem *MIExportBin;
TMenuItem *MIHelp;
TMenuItem *MIAbout;
TPanel *PanelSkin;
TPaintBox *PBSkin;
TGroupBox *GBFrameSettings;
TTrackBar *TBFrame;
TCheckBox *CBAnimate;
TPanel *Panel1;
TEdit *Edit6;
TPanel *Panel2;
TEdit *Edit7;
TMenuItem *ExportCC1;
void __fastcall FormCreate(TObject *Sender);
void __fastcall PBScenePaint(TObject *Sender);
void __fastcall ScrollBoxResize(TObject *Sender);
void __fastcall MIOpenClick(TObject *Sender);
void __fastcall TimerTimer(TObject *Sender);
void __fastcall TBZoomInClick(TObject *Sender);
void __fastcall TBZoomOutClick(TObject *Sender);
void __fastcall TBOpenClick(TObject *Sender);
void __fastcall PBSkinPaint(TObject *Sender);
void __fastcall PBBackDropPaint(TObject *Sender);
void __fastcall MIExitClick(TObject *Sender);
void __fastcall MIExportBinClick(TObject *Sender);
void __fastcall MIAboutClick(TObject *Sender);
void __fastcall TBSaveClick(TObject *Sender);
void __fastcall TBFrameChange(TObject *Sender);
void __fastcall PBSceneMouseDown(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y);
void __fastcall PBSceneMouseMove(TObject *Sender, TShiftState Shift,
int X, int Y);
void __fastcall ExportCC1Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TFormMain(TComponent* Owner);
int Zoom;
TPoint MDP;
Graphics::TBitmap* BMBackDrop;
Graphics::TBitmap* BMSkin;
Graphics::TBitmap* Bitmap;
TStringList* SL;
entity_t* entity;
TMemoryStream* MD2Model;
TMemoryStream* YetiModel;
pixel_buffer_t framebuffer;
yeti_t yeti;
void LoadSkin(String AFileName);
void LoadModel(String AFileName);
void LoadFromFile(String AModelName, String ASkinName);
void SetZoom(int AZoom);
};
//---------------------------------------------------------------------------
extern PACKAGE TFormMain *FormMain;
//---------------------------------------------------------------------------
#endif

4
MD2Viewer/clean.bat Normal file
View file

@ -0,0 +1,4 @@
del *.obj
del *.~*
del *.tds
del *.exe

BIN
MD2Viewer/skin.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
MD2Viewer/tris.md2 Normal file

Binary file not shown.

790
editor/UnitMain.cpp Normal file
View file

@ -0,0 +1,790 @@
/*
** Name: Yeti3D PRO
** Desc: Portable GameBoy Advanced 3D Engine
** Auth: Derek J. Evans <derek@theteahouse.com.au>
**
** Copyright (C) 2003-2004 Derek J. Evans. All Rights Reserved.
**
** YY YY EEEEEE TTTTTT IIIIII 33333 DDDDD
** YY YY EE TT II 33 DD DD
** YYYY EEEE TT II 333 DD DD
** YY EE TT II 33 DD DD
** YY EEEEEE TT IIIIII 33333 DDDDD
*/
#include <vcl.h>
#pragma hdrstop
#include "UnitMain.h"
#include "UnitPreview.h"
#include "UnitSplash.h"
#include "map.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TFormMain *FormMain;
//---------------------------------------------------------------------------
__fastcall TFormMain::TFormMain(TComponent* Owner) : TForm(Owner) {}
//---------------------------------------------------------------------------
void __fastcall TFormMain::FormCreate(TObject *Sender)
{
TmpBitmap = new Graphics::TBitmap;
SelectionStatus = Rect(-1, -1, -1, -1);
SetFileName("");
PaintBox->ControlStyle = PaintBox->ControlStyle << csOpaque;
SetZoom(11);
UpdateTextureList();
}
//---------------------------------------------------------------------------
void TFormMain::UpdateTextureList()
{
ListView->Items->BeginUpdate();
ListView->Clear();
ILTextures->Clear();
TmpBitmap->PixelFormat = pf32bit;
TmpBitmap->Width = TEXTURE_WIDTH;
TmpBitmap->Height = TEXTURE_HEIGHT;
for (int i = 0; i < TEXTURE_MAX; i++)
{
for (int y = 0; y < TEXTURE_HEIGHT; y++)
{
for (int x = 0; x < TEXTURE_WIDTH; x++)
{
int c = textures[i][TEXTURE_HEIGHT - y - 1][x];
((DWORD*)TmpBitmap->ScanLine[y*64/TEXTURE_HEIGHT])[x*64/TEXTURE_WIDTH] =
RGB(palette[c][2], palette[c][1], palette[c][0]);
}
}
TListItem* LListItem = ListView->Items->Add();
LListItem->Caption = String("#") + i;
LListItem->ImageIndex = ILTextures->Add(TmpBitmap, NULL);
}
ListView->ItemIndex = 0;
ListView->Items->EndUpdate();
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::FormPaint(TObject *Sender)
{
OnPaint = NULL;
//FormPreview->SetFocus();
FormSplash->Execute();
}
//---------------------------------------------------------------------------
void TFormMain::SetZoom(int AZoom)
{
Zoom = EnsureRange(AZoom, 6, 24);
ScrollBox->OnResize(ScrollBox);
}
//---------------------------------------------------------------------------
TRect TFormMain::CellRect(int x, int y)
{
return Bounds(x * Zoom, (MAP_HEIGHT - y - 1) * Zoom, Zoom, Zoom);
}
//---------------------------------------------------------------------------
void TFormMain::CellDraw(int x, int y)
{
TCanvas* LCanvas = PaintBox->Canvas;
cell_t* cell = &yeti->map.item[y][x];
TRect r = CellRect(x, y);
if (CELL_IS_SOLID(cell))
{
LCanvas->Brush->Color = (TColor) RGB(0, 0, 150);
}
else
{
int s = ((cell->top - cell->bot) >> 4);
LCanvas->Brush->Color = (TColor) RGB(s, s, s);
}
TRect s = RectNormalize(&Selection);
if (x >= s.Left && y >= s.Top && x <= s.Right && y <= s.Bottom)
{
cell->swi |= CELL_SWI_SELECTED;
if (cell->swi & CELL_SWI_TERRAIN || cell->swi & CELL_SWI_CAVE)
{
LCanvas->Pen->Color = clLime;
}
else
{
LCanvas->Pen->Color = clGreen;
}
LCanvas->Rectangle(r);
if (x == Selection.left && y == Selection.top)
{
LCanvas->Pen->Color = clRed;
LCanvas->Rectangle(RectInflate(&r, -2, -2));
}
}
else
{
cell->swi &= ~CELL_SWI_SELECTED;
if (CELL_IS_SOLID(cell))
{
LCanvas->FillRect(r);
TRect tmp = r; // Frame3D modifies the rectangle.
Frame3D(LCanvas, tmp, (TColor) RGB(0, 0, 200), (TColor) RGB(0, 0, 100), 1);
//Frame3D(PaintBox->Canvas, tmp, (TColor) RGB(0, 0, 100), (TColor) RGB(0, 0, 200), 1);
}
else
{
LCanvas->Pen->Color = clBlack;
LCanvas->Rectangle(r);
}
}
if (cell->swi & CELL_SWI_LIGHT)
{
LCanvas->Pen->Color = clWhite;
LCanvas->Rectangle(RectInflate(&r, -4, -4));
}
if (cell->ent)
{
if (cell->ent == 1)
{
LCanvas->Pen->Color = clYellow;
}
else
{
LCanvas->Pen->Color = clLime;
}
LCanvas->Brush->Style = bsClear;
LCanvas->Ellipse(RectInflate(&r, -1, -1));
}
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::PaintBoxPaint(TObject *Sender)
{
TRect LClipRect = PaintBox->Canvas->ClipRect;
for (int y = MAP_HEIGHT; y--;)
{
for (int x = MAP_WIDTH; x--;)
{
TRect LTempRect;
if (IntersectRect(LTempRect, LClipRect, CellRect(x, y)))
{
CellDraw(x, y);
}
}
}
if (Selection != SelectionStatus)
{
SelectionStatus = Selection;
StatusBar->Panels->Items[0]->Text = Format("Selected Cell: (%d, %d)", ARRAYOFCONST((
(int)Selection.left,
(int)Selection.top,
(int)Selection.Width(),
(int)Selection.Height())));
StatusBar->Update();
}
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::ScrollBoxResize(TObject *Sender)
{
int LWidth = MAP_WIDTH * Zoom;
int LHeight = MAP_HEIGHT * Zoom;
PanelScene->SetBounds(
Max((ScrollBox->ClientWidth - LWidth) / 2, 0) - ScrollBox->HorzScrollBar->Position,
Max((ScrollBox->ClientHeight - LHeight) / 2, 0) - ScrollBox->VertScrollBar->Position,
LWidth, LHeight);
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::MIExitClick(TObject *Sender)
{
Close();
}
void cell_solid_switch(cell_t* cell, int issolid)
{
if (issolid)
{
if (!CELL_IS_SOLID(cell))
{
cell->tsa = cell->top;
cell->bsa = cell->bot;
cell->top = cell->bot = 0;
}
}
else
{
if (CELL_IS_SOLID(cell))
{
cell->top = cell->tsa;
cell->bot = cell->bsa;
}
}
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::PaintBoxMouseMove(TObject *Sender,
TShiftState Shift, int X, int Y)
{
if (LButton || RButton)
{
PBMouse->SetBounds(X, Y, 0, 0);
ScrollBox->ScrollInView(PBMouse);
}
X = X / Zoom;
Y = MAP_HEIGHT - (Y / Zoom) - 1;
//X = EnsureRange(X, 0, YETI_MAP_WIDTH - 1);
//Y = EnsureRange(Y, 0, YETI_MAP_HEIGHT - 1);
if (TBDraw->Down)
{
if (LButton || RButton)
{
cell_solid_switch(&yeti->map.item[Y][X], LButton);
map_precalc_data(&yeti->map, yeti->visual.map_lod);
CellDraw(X, Y);
Modified = True;
}
}
if (TBArrow->Down && LButton)
{
Selection.Right = X;
Selection.Bottom = Y;
PaintBox->Repaint();
}
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::PaintBoxMouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y)
{
if (Button == mbLeft ) LButton = True;
if (Button == mbRight) RButton = True;
if (TBArrow->Down)
{
Selection = Bounds(X / Zoom, MAP_HEIGHT - (Y / Zoom) - 1, 0, 0);
}
PaintBoxMouseMove(Sender, Shift, X, Y);
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::PaintBoxMouseUp(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y)
{
if (Button == mbLeft ) LButton = False;
if (Button == mbRight) RButton = False;
PaintBox->Repaint();
}
//---------------------------------------------------------------------------
void yeti_lua_init(lua_t lua, palette_t palette,
float LR, float LG, float LB,
float pgamma, float sgamma)
{
int x, y;
float r, g, b;
for (y = 0; y < 64; y++)
{
for (x = 0; x < 256; x++)
{
r = palette[x][0];
g = palette[x][1];
b = palette[x][2];
r = pow(r / 255.0, pgamma) * 255.0;
g = pow(g / 255.0, pgamma) * 255.0;
b = pow(b / 255.0, pgamma) * 255.0;
r = r * LR;
g = g * LG;
b = b * LB;
r = r * y / 32;
g = g * y / 32;
b = b * y / 32;
r = pow(r / 255.0, sgamma) * 255.0;
g = pow(g / 255.0, sgamma) * 255.0;
b = pow(b / 255.0, sgamma) * 255.0;
r = r / 255.0 * 31.0;
g = g / 255.0 * 31.0;
b = b / 255.0 * 31.0;
lua[y][x] = RGB_SET((int)r, (int)g, (int)b);
}
}
}
#define APPLY(A) \
for (int y = R.top; y <= R.bottom; y++) for (int x = R.left; x <= R.right; x++) \
{cell_t* cell = &yeti->map.item[y][x]; A;}
void __fastcall TFormMain::FormKeyDown(TObject *Sender, WORD &Key, TShiftState Shift)
{
TRect R = RectNormalize(&Selection);
unsigned tx = Max(ListView->ItemIndex, 0);
bool sft = Shift.Contains(ssShift);
bool ctl = Shift.Contains(ssCtrl );
cell_t* selc = &yeti->map.item[R.top][R.left];
switch (Key)
{
case 221: {APPLY(cell->bot += 64) Key = 1; break;}
case 219: {APPLY(cell->bot -= 64) Key = 1; break;}
case 'P': {APPLY(cell->top += 64) Key = 1; break;}
case 'O': {APPLY(cell->top -= 64) Key = 1; break;}
case 'L':
{
if (ctl)
APPLY(cell->sw2=((selc->sw2+CELL_SW2_LIGHT1)&CELL_SW2_LIGHT_MASK))
else
APPLY(cell->swi ^= CELL_SWI_LIGHT);
Key = 1;
break;
}
case 'T': {APPLY(cell->swi ^= CELL_SWI_TERRAIN ) Key = 1; break;}
case 'C': {APPLY(cell->swi ^= CELL_SWI_CAVE ) Key = 1; break;}
case 'H': {APPLY(cell->sw2 ^= CELL_SW2_HALFBRIGHT ) Key = 1; break;}
case 'Q': {APPLY(cell->sw2 ^= CELL_SW2_OVERPASS ) Key = 1; break;}
case 'K': {APPLY(if (++cell->wwi>8)cell->wwi=0) Key = 1; break;}
case 'S': {map_smooth_slopes(&yeti->map, R.left, R.top, R.right, R.bottom); Key = 1; break;}
case '6': {APPLY(cell->tos -= 2;) Key = 1; break;}
case '7': {APPLY(cell->tos += 2;) Key = 1; break;}
case '8': {APPLY(cell->bos -= 2;) Key = 1; break;}
case '9': {APPLY(cell->bos += 2;) Key = 1; break;}
#define WALLTX if(!sft)cell->wtb=tx;if(!ctl)cell->wtt=tx;
case 45: {if(tc)tx=(tx-1)%TEXTURE_MAX;APPLY(cell->btx=tx);Key=1;break;}
case 46: {if(tc)tx=(tx+1)%TEXTURE_MAX;APPLY(cell->btx=tx);Key=1;break;}
case 36: {if(tc)tx=(tx-1)%TEXTURE_MAX;APPLY(WALLTX);Key=1;break;}
case 35: {if(tc)tx=(tx+1)%TEXTURE_MAX;APPLY(WALLTX);Key=1;break;}
case 33: {if(tc)tx=(tx-1)%TEXTURE_MAX;APPLY(cell->ttx=tx);Key=1;break;}
case 34: {if(tc)tx=(tx+1)%TEXTURE_MAX;APPLY(cell->ttx=tx);Key=1;break;}
case 'F': {APPLY(cell_solid_switch(cell, true )); Key = 1; break;}
case 'G': {APPLY(cell_solid_switch(cell, false)); Key = 1; break;}
case '1': {APPLY(cell->swi=cell->swi&~CELL_SWI_LUA_MASK|CELL_SWI_LUA_0);Key=1;break;}
case '2': {APPLY(cell->swi=cell->swi&~CELL_SWI_LUA_MASK|CELL_SWI_LUA_1);Key=1;break;}
case '3': {APPLY(cell->swi=cell->swi&~CELL_SWI_LUA_MASK|CELL_SWI_LUA_2);Key=1;break;}
case '4': {APPLY(cell->swi=cell->swi&~CELL_SWI_LUA_MASK|CELL_SWI_LUA_3);Key=1;break;}
case 'E':
{
String Value = yeti->map.item[R.top][R.left].ent;
if (InputQuery("", "Enter Entity ID (0..255):", Value))
{
int ent = Value.ToIntDef(0);
APPLY(cell->ent = ent);
game_spawn_entities(yeti);
Key = 1;
}
break;
}
case VK_LEFT : {Key = 0; break;}
case VK_UP : {Key = 0; break;}
case VK_RIGHT : {Key = 0; break;}
case VK_DOWN : {Key = 0; break;}
//case VK_CONTROL : {Key = 0; break;}
case ' ' : {Key = 0; break;}
case 'A' : {Key = 0; break;}
case 'Z' : {Key = 0; break;}
default:
{
//ShowMessage(Key);
}
}
if (Key == 1)
{
Key = 0;
map_precalc_data(&yeti->map, yeti->visual.map_lod);
PaintBox->Repaint();
FormPreview->TimerTimer(FormPreview->Timer);
Modified = true;
ListView->ItemIndex = tx;
ListView->Selected->MakeVisible(False);
tc = true;
}
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::FormKeyUp(TObject *Sender, WORD &Key, TShiftState Shift)
{
switch(Key)
{
case VK_LEFT : {Key = 0; break;}
case VK_UP : {Key = 0; break;}
case VK_RIGHT : {Key = 0; break;}
case VK_DOWN : {Key = 0; break;}
//case VK_CONTROL: {Key = 0; break;}
case ' ' : {Key = 0; break;}
case 'A' : {Key = 0; break;}
case 'Z' : {Key = 0; break;}
}
}
//---------------------------------------------------------------------------
void TFormMain::ExportToFile(String AFileName)
{
yeti_save_map(yeti, &rommap);
TStringList* SL = new TStringList;
__try
{
String LName = ChangeFileExt(ExtractFileName(AFileName), "");
LName = AnsiReplaceStr(LName, " ", "_");
SL->Add(Format("YETI_ROM rom_map_t map_%s = {", ARRAYOFCONST((LName))));
SL->Add(Format("\"%s\",\"%s\",\"%s\",{", ARRAYOFCONST((
rommap.name,
rommap.auth,
rommap.desc))));
for (int y = 0; y < MAP_HEIGHT; y++)
{
SL->Add("{");
for (int x = 0; x < MAP_WIDTH; x++)
{
rom_cell_t* cell = &rommap.cells[y][x];
SL->Add(Format("{%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d},", ARRAYOFCONST((
cell->swi,
cell->ent,
cell->top,
cell->wtb,
cell->sw2,
cell->bot,
cell->lit,
cell->wtt,
cell->ttx,
cell->wwi,
cell->btx,
cell->tos,
cell->bos
))));
}
String S = SL->Strings[SL->Count - 1];
SL->Strings[SL->Count - 1] = S.SubString(1, S.Length() - 1);
SL->Add("},");
}
String S = SL->Strings[SL->Count - 1];
SL->Strings[SL->Count - 1] = S.SubString(1, S.Length() - 1);
SL->Add("}};");
SL->SaveToFile(AFileName);
}
__finally
{
SL->Free();
}
}
//---------------------------------------------------------------------------
void TFormMain::SetFileName(String AFileName)
{
FileName = AFileName;
if (!AFileName.Length()) AFileName = "untitled";
Caption = Application->Title + " | " + __DATE__ + " | [" + AFileName + "]";
Modified = false;
PaintBox->Repaint();
}
//---------------------------------------------------------------------------
void TFormMain::LoadFromFile(String AFileName)
{
TFileStream* FS = new TFileStream(AFileName, fmOpenRead);
try
{
FS->ReadBuffer(&rommap, sizeof(rommap));
game_load_map(yeti, &rommap);
}
__finally
{
FS->Free();
}
SetFileName(AFileName);
}
//---------------------------------------------------------------------------
void TFormMain::SaveToFile(String AFileName)
{
AFileName = ChangeFileExt(AFileName, ".y3d");
TFileStream* FS = new TFileStream(AFileName, fmCreate);
try
{
yeti_save_map(yeti, &rommap);
FS->WriteBuffer(&rommap, sizeof(rommap));
}
__finally
{
FS->Free();
}
ExportToFile(ChangeFileExt(AFileName, ".c"));
SetFileName(AFileName);
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::MISaveClick(TObject *Sender)
{
if (FileExists(FileName) && !FileIsReadOnly(FileName))
{
SaveToFile(FileName);
}
else
{
MISaveAs->Click();
}
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::MISaveAsClick(TObject *Sender)
{
SaveDialog->FileName = FileName;
if (SaveDialog->Execute()) SaveToFile(SaveDialog->FileName);
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::ExportCFileClick(TObject *Sender)
{
if (FileExists(FileName))
{
ExportDialog->FileName = ChangeFileExt(FileName, ".c");
}
if (ExportDialog->Execute()) ExportToFile(ExportDialog->FileName);
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::MIOpenClick(TObject *Sender)
{
OpenDialog->FileName = FileName;
if (OpenDialog->Execute() && CanClose())
{
LoadFromFile(OpenDialog->FileName);
}
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::MINewClick(TObject *Sender)
{
if (CanClose())
{
map_init(&yeti->map, yeti->visual.map_lod);
game_spawn_entities(yeti);
SetFileName("");
}
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::TBNewClick(TObject *Sender)
{
MINew->Click();
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::TBOpenClick(TObject *Sender)
{
MIOpen->Click();
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::TBSaveClick(TObject *Sender)
{
MISave->Click();
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::MIAboutClick(TObject *Sender)
{
ShowMessage(YETI_STR_CAPTION);
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::FormCloseQuery(TObject *Sender, bool &CanClose)
{
CanClose = True;
if (Modified)
{
switch (Application->MessageBox(
"Current project has been modified. Do you want to save now?",
Application->Title.c_str(), MB_YESNOCANCEL))
{
case IDYES:
{
MISaveAs->Click(); // << This should be Save, but SaveAs is safer.
CanClose = !Modified;
break;
}
case IDNO:
{
CanClose = True;
break;
}
case IDCANCEL:
{
CanClose = False;
break;
}
}
}
}
//---------------------------------------------------------------------------
bool TFormMain::CanClose()
{
bool LCanClose = True;
FormCloseQuery(this, LCanClose);
return LCanClose;
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::ToolButton2Click(TObject *Sender)
{
SetZoom(Zoom + 1);
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::ToolButton3Click(TObject *Sender)
{
SetZoom(Zoom - 1);
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::ListViewChange(TObject *Sender, TListItem *Item, TItemChange Change)
{
tc = false;
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::MISelectAllClick(TObject *Sender)
{
Selection = Rect(0, 0, MAP_WIDTH - 1, MAP_HEIGHT - 1);
PaintBox->Repaint();
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::ListViewMouseMove(TObject *Sender, TShiftState Shift, int X, int Y)
{
ListView->Cursor = ListView->GetItemAt(X, Y) ? crHandPoint : crDefault;
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::MICopyClick(TObject *Sender)
{
TRect R = RectNormalize(&Selection);
MapClip.Length = R.Height() + 1;
for (int i = 0; i < MapClip.Length; i++)
{
MapClip[i].Length = R.Width() + 1;
}
for (int y = R.top; y <= R.bottom; y++)
{
for (int x = R.left; x <= R.right; x++)
{
yeti_save_cell(&yeti->map.item[y][x], &MapClip[y - R.top][x - R.left]);
}
}
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::MIDeleteClick(TObject *Sender)
{
TRect R = RectNormalize(&Selection);
// TODO: Need a range init function.
map_precalc_data(&yeti->map, yeti->visual.map_lod);
Modified = True;
PaintBox->Refresh();
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::MICutClick(TObject *Sender)
{
MICopy->Click();
MIDelete->Click();
}
//---------------------------------------------------------------------------
void SurfaceLoadFromIniFile(surface_t* surface, TIniFile* AIniFile, String ASection)
{
surface_init(surface);
surface->xsize += AIniFile->ReadInteger(ASection, "xsize", 0);
surface->ysize += AIniFile->ReadInteger(ASection, "ysize", 0);
surface->mode = AIniFile->ReadInteger(ASection, "mode" , surface->mode);
surface->xpan = AIniFile->ReadInteger(ASection, "xpan" , surface->xpan);
surface->ypan = AIniFile->ReadInteger(ASection, "ypan" , surface->ypan);
}
void __fastcall TFormMain::MIImportTexturesClick(TObject *Sender)
{
if (OpenPictureDialog->Execute())
{
BitmapLoadFromFile(TmpBitmap, OpenPictureDialog->FileName);
if (TmpBitmap->Width != 64)
{
throw Exception("Texture set bitmap must be 64 pixels wide.");
}
if (TmpBitmap->Height >= (64 * 128))
{
throw Exception("Texture contains more than 128 textures.");
}
TmpBitmap->PixelFormat = pf32bit;
TmpBitmap->PixelFormat = pf8bit;
memset(textures, 0, sizeof(textures));
TMaxLogPalette Palette;
Palette.palVersion = 0x300;
Palette.palNumEntries = 256;
GetPaletteEntries(TmpBitmap->Palette, 0, Palette.palNumEntries, Palette.palPalEntry);
for (int i = Palette.palNumEntries; i--;)
{
palette[i][0] = Palette.palPalEntry[i].peRed;
palette[i][1] = Palette.palPalEntry[i].peGreen;
palette[i][2] = Palette.palPalEntry[i].peBlue;
}
yeti_init_lua(yeti, YETI_GAMMA);
for (int y = 0; y < TmpBitmap->Height; y++)
{
for (int x = 0; x < TmpBitmap->Width; x++)
{
textures[y >> 6][63 - (y & 63)][x & 63] = ((Byte*)TmpBitmap->ScanLine[y])[x];
}
}
TIniFile* LIniFile = new TIniFile(ChangeFileExt(OpenPictureDialog->FileName, ".ini"));
try
{
for (int i = 0; i < yeti->surfaces.length; i++)
{
SurfaceLoadFromIniFile(&yeti->surfaces.item[i], LIniFile, i);
}
}
catch (...)
{
LIniFile->Free();
}
UpdateTextureList();
}
}
//---------------------------------------------------------------------------
void __fastcall TFormMain::TimerTimer(TObject *Sender)
{
PanelCamera->Color = PanelCamera->Color != clWhite ? clWhite : clRed;
}
//---------------------------------------------------------------------------

944
editor/UnitMain.dfm Normal file
View file

@ -0,0 +1,944 @@
object FormMain: TFormMain
Left = 205
Top = 153
Width = 656
Height = 537
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
KeyPreview = True
Menu = MainMenu
OldCreateOrder = False
ShowHint = True
WindowState = wsMaximized
OnCloseQuery = FormCloseQuery
OnCreate = FormCreate
OnKeyDown = FormKeyDown
OnKeyUp = FormKeyUp
OnPaint = FormPaint
PixelsPerInch = 96
TextHeight = 13
object Splitter: TSplitter
Left = 233
Top = 32
Width = 4
Height = 440
Cursor = crHSplit
AutoSnap = False
ResizeStyle = rsUpdate
end
object PanelClient: TPanel
Left = 237
Top = 32
Width = 411
Height = 440
Align = alClient
BevelOuter = bvLowered
TabOrder = 2
object ScrollBox: TScrollBox
Left = 1
Top = 1
Width = 409
Height = 438
HorzScrollBar.Tracking = True
VertScrollBar.Tracking = True
Align = alClient
BorderStyle = bsNone
Color = clBlack
ParentColor = False
TabOrder = 0
OnResize = ScrollBoxResize
object PanelScene: TPanel
Left = 16
Top = 16
Width = 201
Height = 169
BevelOuter = bvNone
FullRepaint = False
TabOrder = 0
object PaintBox: TPaintBox
Left = 0
Top = 0
Width = 201
Height = 169
Align = alClient
OnMouseDown = PaintBoxMouseDown
OnMouseMove = PaintBoxMouseMove
OnMouseUp = PaintBoxMouseUp
OnPaint = PaintBoxPaint
end
object PBMouse: TPaintBox
Left = 120
Top = 80
Width = 25
Height = 33
Enabled = False
end
object PanelCamera: TPanel
Left = 40
Top = 40
Width = 9
Height = 9
Hint = 'You are here!'
BevelOuter = bvNone
Color = clWhite
Enabled = False
TabOrder = 0
end
end
end
end
object StatusBar: TStatusBar
Left = 0
Top = 472
Width = 648
Height = 19
Panels = <
item
Width = 50
end>
SimplePanel = False
end
object ToolBar: TToolBar
Left = 0
Top = 0
Width = 648
AutoSize = True
BorderWidth = 2
Caption = 'ToolBar'
Color = clBtnFace
Flat = True
Images = ImageList
ParentColor = False
ParentShowHint = False
ShowHint = False
TabOrder = 0
object TBNew: TToolButton
Left = 0
Top = 0
Hint = 'New Project'
Caption = 'TBNew'
ImageIndex = 0
OnClick = TBNewClick
end
object TBOpen: TToolButton
Left = 23
Top = 0
Hint = 'Open Project'
Caption = 'TBOpen'
ImageIndex = 1
OnClick = TBOpenClick
end
object TBSave: TToolButton
Left = 46
Top = 0
Hint = 'Save Project'
Caption = 'TBSave'
ImageIndex = 2
OnClick = TBSaveClick
end
object ToolButton4: TToolButton
Left = 69
Top = 0
Width = 8
Caption = 'ToolButton4'
ImageIndex = 3
Style = tbsSeparator
end
object TBCut: TToolButton
Left = 77
Top = 0
Caption = 'TBCut'
Enabled = False
ImageIndex = 3
end
object TBCopy: TToolButton
Left = 100
Top = 0
Caption = 'TBCopy'
Enabled = False
ImageIndex = 4
end
object TBPaste: TToolButton
Left = 123
Top = 0
Caption = 'TBPaste'
Enabled = False
ImageIndex = 5
end
object TBDelete: TToolButton
Left = 146
Top = 0
Caption = 'TBDelete'
Enabled = False
ImageIndex = 6
end
object ToolButton9: TToolButton
Left = 169
Top = 0
Width = 8
Caption = 'ToolButton9'
ImageIndex = 7
Style = tbsSeparator
end
object TBArrow: TToolButton
Left = 177
Top = 0
Hint = 'Select Area'
Caption = 'TBArrow'
Down = True
Grouped = True
ImageIndex = 7
Style = tbsCheck
end
object TBDraw: TToolButton
Left = 200
Top = 0
Hint = 'Draw Walls'
Caption = 'TBDraw'
Grouped = True
ImageIndex = 8
Style = tbsCheck
end
object ToolButton1: TToolButton
Left = 223
Top = 0
Width = 8
Caption = 'ToolButton1'
ImageIndex = 9
Style = tbsSeparator
end
object ToolButton2: TToolButton
Left = 231
Top = 0
Caption = 'ToolButton2'
ImageIndex = 9
OnClick = ToolButton2Click
end
object ToolButton3: TToolButton
Left = 254
Top = 0
Caption = 'ToolButton3'
ImageIndex = 10
OnClick = ToolButton3Click
end
end
object PageControl: TPageControl
Left = 0
Top = 32
Width = 233
Height = 440
ActivePage = TabSheet1
Align = alLeft
TabIndex = 0
TabOrder = 3
TabPosition = tpBottom
object TabSheet1: TTabSheet
Caption = 'Textures'
object ListView: TListView
Left = 0
Top = 0
Width = 225
Height = 414
Align = alClient
Color = clBlack
Columns = <>
Font.Charset = DEFAULT_CHARSET
Font.Color = clWhite
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
HideSelection = False
IconOptions.AutoArrange = True
LargeImages = ILTextures
ReadOnly = True
ParentFont = False
SmallImages = ILTextures
TabOrder = 0
OnChange = ListViewChange
OnMouseMove = ListViewMouseMove
end
end
end
object MainMenu: TMainMenu
Left = 312
Top = 48
object MIFile: TMenuItem
Caption = '&File'
object MINew: TMenuItem
Caption = '&New'
ShortCut = 16462
OnClick = MINewClick
end
object MIOpen: TMenuItem
Caption = '&Open...'
ShortCut = 16463
OnClick = MIOpenClick
end
object N1: TMenuItem
Caption = '-'
end
object MISave: TMenuItem
Caption = '&Save'
ShortCut = 16467
OnClick = MISaveClick
end
object MISaveAs: TMenuItem
Caption = 'Save &As...'
OnClick = MISaveAsClick
end
object N6: TMenuItem
Caption = '-'
end
object MIImportTextures: TMenuItem
Caption = 'Import Texture Set...'
OnClick = MIImportTexturesClick
end
object N3: TMenuItem
Caption = '-'
end
object ExportCFile: TMenuItem
Caption = '&Export C File...'
Visible = False
OnClick = ExportCFileClick
end
object N2: TMenuItem
Caption = '-'
end
object MIExit: TMenuItem
Caption = 'E&xit'
OnClick = MIExitClick
end
end
object MIEdit: TMenuItem
Caption = '&Edit'
object MIUndo: TMenuItem
Caption = '&Undo'
Enabled = False
ShortCut = 16474
end
object MIRedo: TMenuItem
Caption = '&Redo'
Enabled = False
end
object N4: TMenuItem
Caption = '-'
end
object MICut: TMenuItem
Caption = 'Cu&t'
Enabled = False
ShortCut = 16472
OnClick = MICutClick
end
object MICopy: TMenuItem
Caption = '&Copy'
Enabled = False
ShortCut = 16451
OnClick = MICopyClick
end
object MIPaste: TMenuItem
Caption = '&Paste'
Enabled = False
ShortCut = 16470
end
object MIDelete: TMenuItem
Caption = '&Delete'
Enabled = False
OnClick = MIDeleteClick
end
object N5: TMenuItem
Caption = '-'
end
object MISelectAll: TMenuItem
Caption = 'Select &All'
ShortCut = 16449
OnClick = MISelectAllClick
end
end
object MIHelp: TMenuItem
Caption = '&Help'
object MIAbout: TMenuItem
Caption = '&About...'
OnClick = MIAboutClick
end
end
end
object ImageList: TImageList
Left = 344
Top = 48
Bitmap = {
494C01010B000E00040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000004000000001002000000000000040
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000004A667C00BE9596000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000004A667C00BE9596000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000A4676900A4676900A4676900A467
6900A4676900A4676900A4676900A4676900A4676900A4676900A4676900A467
6900A46769000000000000000000000000006B9CC3001E89E8004B7AA300C896
9300000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000006B9CC3001E89E8004B7AA300C896
9300000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000A4676900FCEACE00F0D8BA00DCC1
A000C4AA8900BFA48000CFAF8200DCB58100E2B87E00E7BC7E00E9BD7F00EFC4
8100A46769000000000000000000000000004BB4FE0051B5FF002089E9004B7A
A200C69592000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000004BB4FE0051B5FF002089E9004B7A
A200C69592000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000A0675B00FEEFDA00F6E0C600302D
2D00212527003745460099846800AD926F00C2A07400DCB27A00E7BC7E00EFC4
8100A46769000000000000000000000000000000000051B7FE0051B3FF001D87
E6004E7AA000CA97920000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000051B7FE0051B3FF001D87
E6004E7AA000CA97920000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000A0675B00FFF4E500F7E5CF009C8F
80000D466300036292000B3B54004B474100917B5E00B5976C00D1AB7400E9BF
7D00A4676900000000000000000000000000000000000000000051B7FE004EB2
FF001F89E6004E7BA200B9949700000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000051B7FE004EB2
FF001F89E6004E7BA200B9949700000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000A7756B00FFFBF000F8EADC00EEDD
CA0022576C00165E8200745D65007D5254005E3F390086725800A78C6600CEAA
7300A065670000000000000000000000000000000000000000000000000052B8
FE004BB1FF002787D9005F6A760000000000A8787500C4A39800D5B6A700D0A5
9F000000000000000000000000000000000000000000000000000000000052B8
FE004BB1FF002787D9005F6A760000000000A8787500C4A39800D5B6A700D0A5
9F00000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000A7756B00FFFFFC00FAF0E600F8EA
DA008F9F9D0062555D00DD908C00B87979008E5757005B3D37007D6B51009A81
5D00925C5E000000000000000000000000000000000000000000000000000000
000055BDFF00B5D6ED00A3908E00B3978800EDE4C600FFFFD700FFFFD600FFFE
D700EAD8C200CEAEA30000000000000000000000000000000000000000000000
000055BDFF00B5D6ED00A3908E00B3978800F0E7C800FEFDDA00FEFDD900FDFC
D800EAD8C200CEAEA30000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000BC826800FFFFFF00FEF7F200FAEF
E600F0E5D5006B5D6200E9A4A100CF909000B275750087535300583C35007A69
5000815354000000000000000000000000000000000000000000000000000000
000000000000CCB7B700D9B8A500FEF0C200FFFFD500B5C4E4006887EE00DDE4
E200FFFFEE00F6F0EB00B48D8900000000000000000000000000000000000000
000000000000CCB7B700D9B8A500FEF0C200FFFDD600FFFFDA00FFFFDA00FFFF
DF00FFFFEE00F6F0EB00B48D8900000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000BC826800FFFFFF00FFFEFC00FCF6
F000FAEFE600EBDCCE008C5E5D00E2A1A100CE8F8F00B4767600865252005C3F
3800764C4E000000000000000000000000000000000000000000000000000000
000000000000C6978F00F6E0B500FFE1A700FFFFCA00839CEB00002BFC00CED8
F500FFFFFA00FFFFFF00DFD0BE00000000000000000000000000000000000000
000000000000C6978F00F6E0B500FFE1A700FDF7D000FFFFDA00FFFFE100FFFF
F200FFFFFA00FFFFFF00DFD0BE00000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000D1926D00FFFFFF00FFFFFF00FFFE
FC00FEF7F000FAEFE500E1CEC00087595800E1A1A100CC8E8E00B07474008651
5100633B3C000000000000000000000000000000000000000000000000000000
000000000000DBBAA800FFE9AC00A99AB3007E97E600456AF3000435FB006584
FB007F98FD00DAE3EE00F2EFD000C79C96000000000000000000000000000000
000000000000DBBAA800FFE9AC00A99AB3007E97E6006584FB006584FB006584
FB007F98FD00DAE3EE00F2EFD000C79C96000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000D1926D00FFFFFF00FFFFFF00FFFF
FF00FFFEFC00FCF7F000FAEFE500D7C1B5008A5B5B00E6A6A600CA8B8B00B675
75007E4442003E41450000000000000000000000000000000000000000000000
000000000000E4C7AF00FFEBA4005661CE00002CFF000235FC000335FB000134
FB00002AFD00B0C1E800FAF8D700C6AC9A000000000000000000000000000000
000000000000E4C7AF00FFEBA4005661CE00002CFF000235FC000335FB000134
FB00002AFD00B0C1E800FAF8D700C6AC9A000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000DA9D7500FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFEFC00FCF6EF00FCF3E600CFB5AA0097666600EFAAA9008C6D
73001E799F000C98BD000C98BD00000000000000000000000000000000000000
000000000000DEBEAA00FFECB400CFA99500C3AEAD00647BE1000336FD009AAF
EA00C4D1E300EFF2DE00F6F2D200C8A298000000000000000000000000000000
000000000000DEBEAA00FFECB400CFA99500C3AEAD009AAFEA009AAFEA009AAF
EA00C4D1E300EFF2DE00F6F2D200C8A298000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000DA9D7500FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFEFB00FFFEF700DAC1BA00955F56009E5D58002D84
A70006BBF000008EDE00000F9500000081000000000000000000000000000000
000000000000CA9F9700FDEFC200FFECC000FFE39D007B82CB00002FFF00CAD0
DA00FFFFD100FFFFDA00E5D9BB00000000000000000000000000000000000000
000000000000CA9F9700FDEFC200FFECC000F4D3A600F4D09D00F9E4B800FEF6
CF00FFFFD100FFFFDA00E5D9BB00000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000E7AB7900FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00DCC7C500A56B5F00D1914F00068F
C1000393DE000320BA000318B200010B99000000000000000000000000000000
00000000000000000000DDC4AE00FFFFFF00FFF9E800CFB6A900A790A800E3C3
A300FCE6B600FDF6C800BE9D8F00000000000000000000000000000000000000
00000000000000000000DDC4AE00FFFFFF00FFF7E900F3CC9800F0BD8900F4CE
9D00FCE6B600FDF6C800BE9D8F00000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000E7AB7900FBF4F000FBF4EF00FAF3
EF00FAF3EF00F8F2EF00F7F2EF00F7F2EF00D8C2C000A56B5F00C1836C000000
00000263BF002F45ED001031D300010A95000000000000000000000000000000
0000000000000000000000000000D3BFBA00F6F0DE00FFF6BD00FFEDAB00FEE9
B500F4DEB700D0AD9D0000000000000000000000000000000000000000000000
0000000000000000000000000000D3BFBA00F6F0DC00FFF2C000FDE6B100FEE9
B500F4DEB700D0AD9D0000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000E7AB7900D1926D00D1926D00D192
6D00D1926D00D1926D00D1926D00D1926D00D1926D00A56B5F00000000000000
0000000000002732D0000C19B400000000000000000000000000000000000000
000000000000000000000000000000000000CAAD9600CFAE9B00DDBFA900DCB8
A800000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000CAAD9600CFAE9B00DDBFA900DCB8
A800000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000B48E88008D5E5D008D5E5D008D5E5D008D5E5D008D5E5D008D5E
5D008D5E5D008D5E5D008D5E5D00000000000000000000000000000000002F9F
D8002F9FD800A4787400A4787400A4787400A4787400A4787400A4787400A478
7400A4787400A4787400A4787400000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000732DE000732DE000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000B48E8800FFFAEB00F9F1E200F9F0DF00F7EEDC00F7EEDB00F7ED
DA00F8EFDB00F2E5D1008E5F5E000000000000000000000000002F9FD8008DD4
EE0081D2F000C9C7BC00FCEDDD00FAF2E400F8F1E000F7EEDD00F7EEDB00F7ED
DB00F7ECDA00F8EDD900A478740000000000000000000732DE000732DE000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000732DE000732DE000000000000000000D6820000D68200000000
0000D6820000D682000000000000D6820000D682000000000000D6820000D682
000000000000D6820000D6820000000000000000000000000000000000000000
000000000000B48E8800F9F1E400F5E2CD00F5E0CA00F4DFC900F3DEC500F2DD
C300F2E2CD00EBDBC9008E5F5E0000000000000000002F9FD800A3E8F80097F3
FF008BF2FF00C9C7BC00F6E4DA00F6E5D200F6DFC600F5DEC500F4DDC300F4DC
BF00F2DEC600F0E3D000A478740000000000000000000732DE000732DE000732
DE00000000000000000000000000000000000000000000000000000000000000
00000732DE000732DE00000000000000000000000000D6820000D68200000000
0000D6820000D682000000000000D6820000D682000000000000D6820000D682
000000000000D6820000D6820000000000000000000000000000000000000000
000000000000B48E8800FBF3E600FDD2A700FDD2A700FDD2A700FDD2A700FDD2
A700FDD2A700EADCCB008E5F5E0000000000000000002F9FD800A1E7F80093ED
FF0085ECFF00C9C7BC00F8E8DF00F9E4CE00F9DBBD00F9DBBD00F9DBBD00F8D9
B800F5DDC200F0E4D200A478740000000000000000000732DE000732DD000732
DE000732DE000000000000000000000000000000000000000000000000000732
DE000732DE000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000B48E88008D5E5D008D5E
5D008D5E5D00B48E8800FDF7ED00F8E2C900F9E0C600F8DEC500F8DEC300F7DC
BF00F4E4D000ECDDCE00996D670000000000000000002F9FD800ACE9F800A2F1
FF0095F0FF00C9C7BC00F9EBE400F9E6D300F9DDC200F9DEC200F8DDC100F7DB
BD00F5DFC600F2E6D600A47874000000000000000000000000000534ED000732
DF000732DE000732DE00000000000000000000000000000000000732DE000732
DE000000000000000000000000000000000000000000D6820000D68200000000
0000000000000000000000000000D6820000D682000000000000000000000000
000000000000D6820000D68200000000000000000000B48E8800FFFAEB00F9F1
E200F9F0DF00B48E8800FEF8F000FAE3CB00FAE2C800FAE1C700F9DFC600F9DE
C300F6E6D400EDE0D200996D680000000000000000002F9FD800B5EBF800AFF3
FF00A3F2FF00C9C7BC00FAEFE900FAEDDE00FAE5D000F9E5CF00F9E3CD00F8E1
CA00F5E4D000F3E8DB00A4787400000000000000000000000000000000000000
00000732DE000732DE000732DD00000000000732DD000732DE000732DE000000
00000000000000000000000000000000000000000000D6820000D68200000000
0000000000000000000000000000D6820000D682000000000000000000000000
000000000000D6820000D68200000000000000000000B48E8800F9F1E400F5E2
CD00F5E0CA00B48E8800FEFBF500FDD2A700FDD2A700FDD2A700FDD2A700FDD2
A700FDD2A700F0E5DA00A57A750000000000000000002F9FD800BFECF800BEF5
FF00B0F4FF00C9C7BC00FCF4F000FCE8D200FCDBBB00FBDCBC00FADBBB00FAD9
B700F8E1C800F7EEE300A4787400000000000000000000000000000000000000
0000000000000732DD000633E6000633E6000633E9000732DC00000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000B48E8800FBF3E600FDD2
A700FDD2A700B48E8800FFFDFB00FDEAD800FCE7D400FBE6D300FAE6D100FDE9
D300FDF4E600E8E0D900A579740000000000000000002F9FD800C7EEF800CBF7
FF00BEF6FF00C9C7BC00FEF7F400FEF7F000FBF0E500FBEFE300FAEDE000FAEE
E100F9F0E500E8E3DD00A4787400000000000000000000000000000000000000
000000000000000000000633E3000732E3000534EF0000000000000000000000
00000000000000000000000000000000000000000000D6820000D68200000000
0000D6820000D682000000000000D6820000D682000000000000D6820000D682
000000000000D6820000D68200000000000000000000B48E8800FDF7ED00F8E2
C900F9E0C600B48E8800FFFFFF00FEFFFF00FCFCFC00FBFAF900FBFBF800EBDF
DB00D3C2C000BAA9AA00B281750000000000000000002F9FD800CEEFF800DBFB
FF00CDF9FF00C9C7BC00FEF8F500FFFFFF00FEFFFE00FCFAF900FBFBF900F0E7
E200D4BFB600C5AFA200A4787400000000000000000000000000000000000000
0000000000000732DD000534ED000533E9000434EF000434F500000000000000
00000000000000000000000000000000000000000000D6820000D68200000000
0000D6820000D682000000000000D6820000D682000000000000D6820000D682
000000000000D6820000D68200000000000000000000B48E8800FEF8F000FAE3
CB00FAE2C800B48E8800FFFFFF00FFFFFF00FFFEFE00FFFDFA00FFFEFB00B48E
8800B48E8800B48E8800B48E880000000000000000002F9FD800D4F0F800E9FD
FF00DBFBFF00C9C7BC00FFFAF800FFFFFF00FFFFFF00FFFFFF00FFFFFF00DECA
C500E0A87000F7935B0000000000000000000000000000000000000000000000
00000434F4000534EF000533EB0000000000000000000434F4000335F8000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000B48E8800FEFBF500FDD2
A700FDD2A700B48E8800FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00B48E
8800EBB56F00C68C78000000000000000000000000002F9FD800DAF1F800F8FF
FF00E9FEFF00C9C7BC00FCF0E900FCF5F100FCF4F000FBF3F000FBF4F100E3C4
BA00C7AF89002F9FD80000000000000000000000000000000000000000000335
FC000534EF000434F800000000000000000000000000000000000335FC000335
FB000000000000000000000000000000000000000000D6820000D68200000000
0000000000000000000000000000D6820000D682000000000000000000000000
000000000000D6820000D68200000000000000000000B48E8800FFFDFB00FDEA
D800FCE7D400B48E8800B48E8800B48E8800B48E8800B48E8800B48E8800B48E
8800BC878200000000000000000000000000000000002F9FD800DBF0F800FFFF
FF00F5FFFF00C9C7BC00C9C7BC00C9C7BC00C9C7BC00C9C7BC00C9C7BC00C9C7
BC0085C4DA002F9FD800000000000000000000000000000000000335FB000335
FB000335FC000000000000000000000000000000000000000000000000000335
FB000335FB0000000000000000000000000000000000D6820000D68200000000
0000000000000000000000000000D6820000D682000000000000000000000000
000000000000D6820000D68200000000000000000000B48E8800FFFFFF00FEFF
FF00FCFCFC00FBFAF900FBFBF800EBDFDB00D3C2C000BAA9AA00B28175000000
000000000000000000000000000000000000000000002F9FD800DDF1F900F7F5
F400B0C7CB00A9C4CB00A7C4CA00A6C4CA00A5C4CA00A2C2C800B3D1D600DFFD
FE0089D9F5002F9FD8000000000000000000000000000335FB000335FB000335
FB00000000000000000000000000000000000000000000000000000000000000
0000000000000335FB0000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000B48E8800FFFFFF00FFFF
FF00FFFEFE00FFFDFA00FFFEFB00B48E8800B48E8800B48E8800B48E88000000
000000000000000000000000000000000000000000002F9FD800E4F8FF00DFCB
C200BBA39800CFC1BC00CFC1BB00CFC1BB00CFC1BB00CEBEB700B99E9200E6E8
E30091DBF7002F9FD80000000000000000000335FB000335FB000335FB000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000D6820000D68200000000
0000D6820000D682000000000000D6820000D682000000000000D6820000D682
000000000000D6820000D68200000000000000000000B48E8800FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00B48E8800EBB56F00C68C7800000000000000
00000000000000000000000000000000000000000000000000002F9FD800B4D2
E100969E9F00E2D8D300FAF9F800F9F8F700F9F8F700D0C5BF00849DA5008CCF
E7002F9FD8000000000000000000000000000335FB000335FB00000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000D6820000D68200000000
0000D6820000D682000000000000D6820000D682000000000000D6820000D682
000000000000D6820000D68200000000000000000000B48E8800B48E8800B48E
8800B48E8800B48E8800B48E8800B48E8800BC87820000000000000000000000
0000000000000000000000000000000000000000000000000000000000002F9F
D8002F9FD8009F9189009F9189009F9189009F9189009F9189002F9FD8002F9F
D800000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000B7818300B781
8300B7818300B7818300B7818300B7818300B7818300B7818300B7818300B781
8300B7818300B7818300B7818300000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000AD5A5900AA54
5400A24D4E00AA959500C1C8C700CCCBCA00CECBCA00CAC8C700C6CAC900B79E
9E009840410099444400A6515100000000000000000000000000AC490600B652
0500B4500500AF4B0600000000000000000000000000AC490600B4500500B14E
0500AA4706000000000000000000000000000000000000000000C7A79C00FEEE
D400F7E3C500F6DFBC00F5DBB400F3D7AB00F3D3A200F1CF9A00F0CF9700F0CF
9800F0CF9800F5D49A00B7818300000000000000000029ABD70035B3DC0023A9
D700000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000BC787100CF666600D268
6800B95A5B009B808000BEA1A000E2D0CE00FEF9F500FFFDFA00F2F6F400D2B3
B300962D2C0099323200C25B5B00B05859000000000000000000B24E05000000
000000000000A9460700AA46070000000000AA460700AE490600000000000000
0000AC4806000000000000000000000000000000000000000000C7A79E00FDEF
D900F6E3CB00F5DFC200F4DBBA00F2D7B200F1D4A900F1D0A200EECC9900EECC
9700EECC9700F3D19900B7818300000000000000000029ABD700AFF6FC0086EF
FA0049C2E40049C2E40049C2E40034B4DD0024AAD70000000000000000000000
00000000000000000000000000000000000000000000BB787100CB656500CE67
6700B85D5D009E7B7C009D434300B7767500E7DFDD00FDFBF900FEFFFD00D9BA
B900962E2E0099333300C05A5A00AF5859000000000000000000B24E05000000
00000000000000000000AA46070000000000AA47070000000000000000000000
0000AB4706000000000000000000000000000000000000000000C7A9A100FEF3
E300F8E7D300F5E3CB00F5DFC300F3DBBB00F2D7B200F1D4AB00F0D0A300EECC
9A00EECC9700F3D19900B7818300000000000000000029ABD700A6E9F5009EFF
FF0097FCFF0099FBFF0095F7FF008DF2FE0083EAFA0049C2E40049C2E4003AB8
DF000000000000000000000000000000000000000000BB787100CB656500CE66
6700B85D5D00A8848300993939009B363600CDBCBB00F2F0EE00FFFFFF00E2C3
C100962D2D0098333300C05A5A00AF5859000000000000000000B24F0500A744
07000000000000000000A945070000000000AA4707000000000000000000A13E
0800AB4807000000000000000000000000000000000000000000C9ACA500FFF7
EB00F9EBDA00F7E7D200F6E3CA00F5DFC200F4DBB900F2D7B200F1D4AA00F0D0
A100EFCD9900F3D19800B7818300000000000000000029ABD7008BD7EC00ABFE
FF0090F8FF0091F6FF0090F5FF008FF5FF008FF4FF0090F4FF0095F6FF0075DD
F5002DAFDB0000000000000000000000000000000000BB787100CB656500CE66
6600B75C5C00B28F8E009F48480094323200A69A9A00D5DBD800FAFFFE00E6C9
C800932B2B0096303000BF595900AF585900000000000000000000000000B552
0500B04C0600B5500500B34C030000000000B14B0300B34E0500AB480600AA47
0700000000000000000000000000000000000000000000000000CEB2AA00FFFC
F400FAEFE400F8EADA00F7E7D300F5E2CB00F5DFC200F4DBBB00F1D7B200F1D3
AA00F0D0A100F3D29B00B7818300000000000000000029ABD70029ABD700AAF0
FA0091FAFF0091F6FF0090F5FF008EF4FF008DF2FE008BF1FE008CF1FF0077DF
F60056CAEA0000000000000000000000000000000000BB787100CB656500CF66
6600BB5C5C00C3908F00C2969500B3868600AA8D8E00BAA2A100E1CAC800DCA9
A900A33A3A00A43E3E00C35D5D00AE5758000000000000000000000000000000
0000AE4A0500B44800009F480E00834627009F460F00B3470100AC4806000000
0000000000000000000000000000000000000000000000000000D3B7AF00FFFF
FD00FBF4EC00FAEFE300F9EBDA00F7E7D200F5E3C900F5DFC200F4DBBA00F2D7
B100F0D4A900F5D5A300B7818300000000000000000029ABD7007BE5F40029AB
D7009EFEFF008DF7FF008EF6FF008CF4FF008DF2FE008BF1FE008CF1FF0072DD
F50079E1F6002CB0DA00000000000000000000000000BB787100CC656600CB64
6400CB646400CB636400CC676700CD676700CC646400C85B5B00C95E5E00CA61
6100CC656500CD666600CF686800AC5657000000000000000000000000000000
0000000000000000000082635300AD9D9E00AA47070000000000000000000000
0000000000000000000000000000000000000000000000000000D7BBB200FFFF
FF00FEF9F500FBF3EC00FAEFE200F9EADA00F8E7D200F5E3CA00F5DEC200F4DB
BA00F2D8B200F6D9AC00B7818300000000000000000029ABD70093F9FD0029AB
D700A8E9F500A8F0FA00A4F1FB00A1F7FF008CF3FF008AF1FE008CF1FF0070DA
F30005740B0058CDEA00000000000000000000000000BC797200B7535100B25B
5700C6868400D2A4A200D5ABAA00D5AAA900D5ABAA00D5A5A400D5A8A700D5AA
A900D6AEAC00D39C9C00CD666600AC5556000000000000000000000000000000
00000000000066594F00C2B1B000CCB6B50088746C00705E5300000000000000
0000000000000000000000000000000000000000000000000000DABEB300FFFF
FF00FFFEFD00FDF8F400FBF3EC00F9EFE300F8EADA00F7E7D200F6E2CA00F6DE
C100F4DBB900F8DDB400B7818300000000000000000029ABD7009DFEFF0086F2
FB0029ABD70029ABD70029ABD70029ABD700AFF2FB0090F4FF0088F2FF000574
0B005BE78C0005740B001FA8D6000000000000000000BC787100B14F4C00E4CD
CB00FAF7F700F8F4F300F9F5F400F9F5F400F9F5F400F9F6F500F9F5F400F9F5
F400FBFBFA00DEBEBD00C45C5D00AD5657000000000000000000000000000000
0000000000009F8F8800ECDEE000907D7400BEA5A300AE949000665549000000
0000000000000000000000000000000000000000000000000000DEC1B500FFFF
FF00FFFFFF00FFFEFD00FEF9F400FBF3EB00FAEFE200F9EBD900F8E6D100F6E2
C800F7E1C200F0DAB700B7818300000000000000000029ABD7009AFCFF0096FB
FF0095FBFF0095FAFF0090F7FF006CDEF30029ABD7009FE3F40005740B0050D7
7A0045D26C0031C14F0005740B000000000000000000BC787100B3514E00EBD7
D600FCFBFA00F7F0EF00F7F1F000F7F1F000F7F1F000F7F1F000F7F1F000F6F1
F000FBF9F800DEBCBB00C35B5B00AD5657000000000000000000000000000000
0000705C4F00E9E2E100BFB1AD0066514200B49D9800D3B7B800806A5F000000
0000000000000000000000000000000000000000000000000000E2C5B500FFFF
FF00FFFFFF00FFFFFF00FFFEFD00FDF9F400FBF3EB00FAEEE200FAEDDC00FCEF
D900E6D9C400C6BCA900B7818300000000000000000029ABD7009BFDFF0094FA
FF0092F8FF0091F6FF0092F7FF0093F9FF0084EFFD0029ABD70029ABD700168C
230030C14C001698240034AFDA000000000000000000BC787100B3514E00EBD7
D400F0EFEF00D8D5D400DAD7D700DAD7D700DAD7D700DAD7D700DAD7D700D8D5
D500ECECEB00E0BDBC00C25B5B00AD565700000000000000000000000000A78E
8900A69A9200EDEBE900786557000000000079655800CEB4B300A78E8900A78E
8900000000000000000000000000000000000000000000000000E5C7B700FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFEFD00FDF8F300FDF6EC00F1E1D500C6A1
9400B5948900B08F8100B7818300000000000000000029ABD700A4FFFF0094FC
FF0092F9FF0093F8FF008FEDFA0090ECFA0095EEFC0096F1FD009AF4FF000C81
16001AAF2C0008831000000000000000000000000000BC787100B3514E00EBD7
D500F3F1F100DEDAD900DFDBDB00DFDBDB00DFDBDB00DFDBDB00DFDBDB00DDDA
D900EEEEEE00E0BDBC00C35B5B00AD565700000000000000000000000000715D
5000D8D2CF00ACA098000000000000000000000000009A857D00C3AAA800715D
5000000000000000000000000000000000000000000000000000E9CBB800FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFEFC00FFFEF900E3CFC900BF8C
7600E8B27000ECA54A00C5876800000000000000000025A8D60029ABD7009EF5
FB009FF7FD0086EAF8002BAED90025A8D60028ABD7002AACD80032B0DA000C90
17000EA01A0000000000000000000000000000000000BC787100B3514E00EAD7
D500F5F4F300E4DFDE00E5E1E000E5E1E000E5E1E000E5E1E000E5E1E000E4DF
DF00F2F1F000DFBDBB00C35B5B00AD5657000000000000000000000000008574
6800C1B8B2006C584A000000000000000000000000006C584A00AE9793008772
6800000000000000000000000000000000000000000000000000ECCDBA00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00E4D4D200C89A
7F00FAC57700CD937700000000000000000000000000000000000000000029AB
D70030AED9002CADD800000000000000000000000000000000000A8912000EA1
1A0008810F0000000000000000000000000000000000BC787100B3514E00EBD7
D600F1F0EF00D9D5D500DAD8D700DAD8D700DAD8D700DAD8D700DAD8D700D8D5
D500EDECEB00E1BEBD00C35B5B00AD5657000000000000000000000000008676
69008A7A6E000000000000000000000000000000000000000000856F64008671
6600000000000000000000000000000000000000000000000000EACAB600FCF7
F400FCF7F300FBF6F300FBF6F300FAF5F300F9F5F300F9F5F300E1D0CE00C797
7C00CF9B86000000000000000000000000000000000000000000000000000000
000000000000000000000000000005710A0009790F000B8916000A8C1300067A
0D000000000000000000000000000000000000000000BC787000B3514E00E9D6
D400FEFBFB00FAF3F200FAF3F200FAF3F200FAF3F200FAF3F200FAF3F200FAF3
F200FDFAF900DEBCBB00C35C5C00AD5657000000000000000000000000006F5B
4C0000000000000000000000000000000000000000000000000000000000705C
4E00000000000000000000000000000000000000000000000000E9C6B100EBCC
B800EBCCB800EBCCB800EBCBB800EACBB800EACBB800EACCB900DABBB000B885
7A00000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000A8504C00C9B6
B500D3D5D400D1CECE00D1CECE00D1CECE00D1CECE00D1CECE00D1CECE00D1CE
CE00D3D4D400CBAEAD00A34D4E00000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000424D3E000000000000003E000000
2800000040000000400000000100010000000000000200000000000000000000
000000000000000000000000FFFFFF0000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000FFFF9FFF9FFF000000070FFF0FFF0000
000707FF07FF0000000783FF83FF00000007C1FFC1FF00000007E10FE10F0000
0007F003F00300000007F801F80100000007F801F80100000007F800F8000000
0003F800F80000000001F800F80000000000F801F80100000000FC01FC010000
0010FE03FE0300000039FF0FFF0F0000F801E001FFFCFFFFF801C0019FF99249
F80180018FF39249F801800187E7FFFF80018001C3CF9E7980018001F11F9E79
80018001F83FFFFF80018001FC7F924980018001F83F924980018003F19FFFFF
80038003E3CF9E7980078003C7E79E79801F80038FFBFFFF801F80031FFF9249
803FC0073FFF9249807FE00FFFFFFFFFC001FFFFC001C387C0018FFF8000D937
C001807F8000DD77C001800F8000CD67C00180078000E10FC00180078000F01F
C00180038000FC7FC00180038000F83FC00180018000F81FC00180018000F01F
C00180018000E10FC00180038000E38FC00180078000E38FC003E3C78000E7CF
C007FE0F8000EFEFC00FFFFFC001FFFF00000000000000000000000000000000
000000000000}
end
object ExportDialog: TSaveDialog
DefaultExt = 'c'
Filter = 'C Files (*.c)|*.c'
Options = [ofOverwritePrompt, ofHideReadOnly, ofEnableSizing]
Left = 280
Top = 48
end
object SaveDialog: TSaveDialog
DefaultExt = 'y3d'
Filter = 'Yeti3D Maps (*.y3d)|*.y3d'
Options = [ofOverwritePrompt, ofHideReadOnly, ofEnableSizing]
Left = 248
Top = 48
end
object OpenDialog: TOpenDialog
DefaultExt = 'y3d'
Filter = 'Yeti3D Maps (*.y3d)|*.y3d'
Left = 216
Top = 48
end
object ILTextures: TImageList
Height = 64
Width = 64
Left = 216
Top = 80
end
object OpenPictureDialog: TOpenPictureDialog
Left = 248
Top = 80
end
object Timer: TTimer
Interval = 300
OnTimer = TimerTimer
Left = 216
Top = 112
end
end

161
editor/UnitMain.h Normal file
View file

@ -0,0 +1,161 @@
/*
** Name: Yeti3D PRO
** Desc: Portable GameBoy Advanced 3D Engine
** Auth: Derek J. Evans <derek@theteahouse.com.au>
**
** Copyright (C) 2003-2004 Derek J. Evans. All Rights Reserved.
**
** YY YY EEEEEE TTTTTT IIIIII 33333 DDDDD
** YY YY EE TT II 33 DD DD
** YYYY EEEE TT II 333 DD DD
** YY EE TT II 33 DD DD
** YY EEEEEE TT IIIIII 33333 DDDDD
*/
#ifndef UnitMainH
#define UnitMainH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include <ComCtrls.hpp>
#include <ToolWin.hpp>
#include <Menus.hpp>
#include <ImgList.hpp>
#include <Dialogs.hpp>
#include <Math.hpp>
#include <StrUtils.hpp>
#include <ExtDlgs.hpp>
#include <IniFiles.hpp>
#include "BCBTools.h"
//---------------------------------------------------------------------------
class TFormMain : public TForm
{
__published: // IDE-managed Components
TStatusBar *StatusBar;
TToolBar *ToolBar;
TPanel *PanelClient;
TScrollBox *ScrollBox;
TMainMenu *MainMenu;
TMenuItem *MIFile;
TMenuItem *MINew;
TMenuItem *MIOpen;
TMenuItem *N1;
TMenuItem *MISave;
TMenuItem *MISaveAs;
TMenuItem *N2;
TMenuItem *MIExit;
TMenuItem *MIEdit;
TMenuItem *MIHelp;
TToolButton *TBNew;
TToolButton *TBOpen;
TToolButton *TBSave;
TToolButton *ToolButton4;
TToolButton *TBCut;
TToolButton *TBCopy;
TToolButton *TBPaste;
TToolButton *TBDelete;
TToolButton *ToolButton9;
TToolButton *TBArrow;
TToolButton *TBDraw;
TPanel *PanelScene;
TPaintBox *PaintBox;
TMenuItem *MIAbout;
TImageList *ImageList;
TSaveDialog *ExportDialog;
TMenuItem *N3;
TMenuItem *ExportCFile;
TSaveDialog *SaveDialog;
TOpenDialog *OpenDialog;
TPanel *PanelCamera;
TMenuItem *MIUndo;
TMenuItem *MIRedo;
TMenuItem *N4;
TMenuItem *MICut;
TMenuItem *MICopy;
TMenuItem *MIPaste;
TMenuItem *MIDelete;
TMenuItem *N5;
TMenuItem *MISelectAll;
TSplitter *Splitter;
TImageList *ILTextures;
TToolButton *ToolButton1;
TToolButton *ToolButton2;
TToolButton *ToolButton3;
TPaintBox *PBMouse;
TMenuItem *N6;
TMenuItem *MIImportTextures;
TOpenPictureDialog *OpenPictureDialog;
TTimer *Timer;
TPageControl *PageControl;
TTabSheet *TabSheet1;
TListView *ListView;
void __fastcall FormCreate(TObject *Sender);
void __fastcall FormPaint(TObject *Sender);
void __fastcall PaintBoxPaint(TObject *Sender);
void __fastcall ScrollBoxResize(TObject *Sender);
void __fastcall MIExitClick(TObject *Sender);
void __fastcall PaintBoxMouseMove(TObject *Sender, TShiftState Shift,
int X, int Y);
void __fastcall PaintBoxMouseDown(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y);
void __fastcall PaintBoxMouseUp(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y);
void __fastcall FormKeyDown(TObject *Sender, WORD &Key,
TShiftState Shift);
void __fastcall FormKeyUp(TObject *Sender, WORD &Key, TShiftState Shift);
void __fastcall ExportCFileClick(TObject *Sender);
void __fastcall MISaveAsClick(TObject *Sender);
void __fastcall MIOpenClick(TObject *Sender);
void __fastcall MINewClick(TObject *Sender);
void __fastcall TBNewClick(TObject *Sender);
void __fastcall TBOpenClick(TObject *Sender);
void __fastcall TBSaveClick(TObject *Sender);
void __fastcall MISaveClick(TObject *Sender);
void __fastcall MIAboutClick(TObject *Sender);
void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
void __fastcall ToolButton2Click(TObject *Sender);
void __fastcall ToolButton3Click(TObject *Sender);
void __fastcall ListViewChange(TObject *Sender, TListItem *Item,
TItemChange Change);
void __fastcall MISelectAllClick(TObject *Sender);
void __fastcall ListViewMouseMove(TObject *Sender, TShiftState Shift,
int X, int Y);
void __fastcall MICopyClick(TObject *Sender);
void __fastcall MIDeleteClick(TObject *Sender);
void __fastcall MICutClick(TObject *Sender);
void __fastcall MIImportTexturesClick(TObject *Sender);
void __fastcall TimerTimer(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TFormMain(TComponent* Owner);
bool tc;
bool Modified;
DynamicArray<DynamicArray<rom_cell_t> > MapClip;
Graphics::TBitmap* TmpBitmap;
String FileName;
rom_map_t rommap;
yeti_t* yeti;
bool LButton;
bool RButton;
int Zoom;
TRect Selection;
TRect SelectionStatus;
void UpdateTextureList();
void SetZoom(int AZoom);
TRect CellRect(int x, int y);
void CellDraw(int x, int y);
void SetFileName(String AFileName);
void SaveToFile(String AFileName);
void LoadFromFile(String AFileName);
void ExportToFile(String AFileName);
bool CanClose();
};
//---------------------------------------------------------------------------
extern PACKAGE TFormMain *FormMain;
//---------------------------------------------------------------------------
#endif

136
editor/UnitPreview.cpp Normal file
View file

@ -0,0 +1,136 @@
/*
** Name: Yeti3D
** Desc: Portable GameBoy Advanced 3D Engine
** Auth: Derek J. Evans <derek@theteahouse.com.au>
**
** Copyright (C) 2003-2004 Derek J. Evans. All Rights Reserved.
**
** YY YY EEEEEE TTTTTT IIIIII 33333 DDDDD
** YY YY EE TT II 33 DD DD
** YYYY EEEE TT II 333 DD DD
** YY EE TT II 33 DD DD
** YY EEEEEE TT IIIIII 33333 DDDDD
*/
#include <vcl.h>
#pragma hdrstop
#include "UnitPreview.h"
#include "UnitMain.h"
#include "yeti3dwin32.h"
#include "maps.h"
#include "y3d_file.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TFormPreview *FormPreview;
//---------------------------------------------------------------------------
__fastcall TFormPreview::TFormPreview(TComponent* Owner): TForm(Owner){}
//---------------------------------------------------------------------------
void __fastcall TFormPreview::FormCreate(TObject *Sender)
{
Timer->Interval = YETI_VIEWPORT_INTERVAL;
Timer->Enabled = True;
Bitmap = new Graphics::TBitmap;
Bitmap->PixelFormat = pf16bit;
Bitmap->Width = YETI_FRAMEBUFFER_WIDTH;
Bitmap->Height = YETI_FRAMEBUFFER_HEIGHT;
ClientWidth = Bitmap->Width;
ClientHeight = Bitmap->Height;
SetBounds(
Screen->DesktopWidth - Width - 16,
Screen->DesktopHeight - Height - 16,
Width, Height);
yeti_init(&yeti,
framebuffer.pixels[0],
framebuffer.pixels[0],
textures,
palette);
yeti_init_lua(&yeti, YETI_GAMMA);
game_load_map(&yeti, &map_e2m3);
game_goto(&yeti.game, GAME_MODE_PLAY);
FormMain->yeti = &yeti;
}
//---------------------------------------------------------------------------
void __fastcall TFormPreview::TimerTimer(TObject *Sender)
{
if (Application->Active)
{
//pixel_buffer_clear(yeti.viewport.back);
keyboard_update(&yeti.keyboard);
if (yeti.keyboard.state.a)
{
yeti.keyboard.state.a = FALSE;
yeti.keyboard.state.l = FALSE;
yeti.keyboard.state.r = FALSE;
}
yeti.keyboard.state.select = FALSE;
game_loop(&yeti);
BitmapDrawViewport(Bitmap, &yeti.viewport);
FormPaint(this);
FormMain->PanelCamera->SetBounds(
f2fl(yeti.camera->x) * FormMain->Zoom - 3,
(MAP_HEIGHT - f2fl(yeti.camera->y) - 0) * FormMain->Zoom - 3,
7, 7);
FormMain->ScrollBox->ScrollInView(FormMain->PanelCamera);
}
}
//---------------------------------------------------------------------------
void __fastcall TFormPreview::FormPaint(TObject *Sender)
{
Canvas->Draw(0, 0, Bitmap);
}
//---------------------------------------------------------------------------
void __fastcall TFormPreview::FormKeyDown(TObject *Sender, WORD &Key, TShiftState Shift)
{
FormMain->OnKeyDown(FormMain, Key, Shift);
}
//---------------------------------------------------------------------------
void __fastcall TFormPreview::FormKeyUp(TObject *Sender, WORD &Key, TShiftState Shift)
{
FormMain->OnKeyUp(FormMain, Key, Shift);
}
//---------------------------------------------------------------------------
void __fastcall TFormPreview::FormMouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y)
{
if (Button == mbLeft)
{
MDP = Point(X, Y);
Screen->Cursor = crSize;
}
}
//---------------------------------------------------------------------------
void __fastcall TFormPreview::FormMouseMove(TObject *Sender, TShiftState Shift, int X, int Y)
{
if (Screen->Cursor == crSize)
{
SetBounds(
Left + (X - MDP.x),
Top + (Y - MDP.y),
Width, Height);
}
}
//---------------------------------------------------------------------------
void __fastcall TFormPreview::FormMouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y)
{
if (Button == mbLeft)
{
Screen->Cursor = crDefault;
}
}
//---------------------------------------------------------------------------

34
editor/UnitPreview.dfm Normal file
View file

@ -0,0 +1,34 @@
object FormPreview: TFormPreview
Left = 635
Top = 541
BorderIcons = []
BorderStyle = bsDialog
Caption = 'Preview Window'
ClientHeight = 172
ClientWidth = 221
Color = clBlack
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
FormStyle = fsStayOnTop
KeyPreview = True
OldCreateOrder = False
Visible = True
OnCreate = FormCreate
OnKeyDown = FormKeyDown
OnKeyUp = FormKeyUp
OnMouseDown = FormMouseDown
OnMouseMove = FormMouseMove
OnMouseUp = FormMouseUp
OnPaint = FormPaint
PixelsPerInch = 96
TextHeight = 13
object Timer: TTimer
Enabled = False
OnTimer = TimerTimer
Left = 8
Top = 8
end
end

53
editor/UnitPreview.h Normal file
View file

@ -0,0 +1,53 @@
/*
** Name: Yeti3D
** Desc: Portable GameBoy Advanced 3D Engine
** Auth: Derek J. Evans <derek@theteahouse.com.au>
**
** Copyright (C) 2003-2004 Derek J. Evans. All Rights Reserved.
**
** YY YY EEEEEE TTTTTT IIIIII 33333 DDDDD
** YY YY EE TT II 33 DD DD
** YYYY EEEE TT II 333 DD DD
** YY EE TT II 33 DD DD
** YY EEEEEE TT IIIIII 33333 DDDDD
*/
#ifndef UnitPreviewH
#define UnitPreviewH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include "game.h"
#include "y3d_draw.h"
//---------------------------------------------------------------------------
class TFormPreview : public TForm
{
__published: // IDE-managed Components
TTimer *Timer;
void __fastcall TimerTimer(TObject *Sender);
void __fastcall FormPaint(TObject *Sender);
void __fastcall FormCreate(TObject *Sender);
void __fastcall FormKeyDown(TObject *Sender, WORD &Key,
TShiftState Shift);
void __fastcall FormKeyUp(TObject *Sender, WORD &Key, TShiftState Shift);
void __fastcall FormMouseDown(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y);
void __fastcall FormMouseMove(TObject *Sender, TShiftState Shift, int X,
int Y);
void __fastcall FormMouseUp(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y);
private: // User declarations
public: // User declarations
pixel_buffer_t framebuffer;
yeti_t yeti;
Graphics::TBitmap* Bitmap;
TPoint MDP;
__fastcall TFormPreview(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TFormPreview *FormPreview;
//---------------------------------------------------------------------------
#endif

62
editor/UnitSplash.cpp Normal file
View file

@ -0,0 +1,62 @@
/*
** Name: Yeti3D PRO
** Desc: Portable GameBoy Advanced 3D Engine
** Auth: Derek J. Evans <derek@theteahouse.com.au>
**
** Copyright (C) 2003-2004 Derek J. Evans. All Rights Reserved.
**
** YY YY EEEEEE TTTTTT IIIIII 33333 DDDDD
** YY YY EE TT II 33 DD DD
** YYYY EEEE TT II 333 DD DD
** YY EE TT II 33 DD DD
** YY EEEEEE TT IIIIII 33333 DDDDD
*/
#include <vcl.h>
#pragma hdrstop
#include "UnitSplash.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TFormSplash *FormSplash;
//---------------------------------------------------------------------------
__fastcall TFormSplash::TFormSplash(TComponent* Owner) : TForm(Owner) {}
//---------------------------------------------------------------------------
void TFormSplash::Execute()
{
String LFileName = ExtractFilePath(Application->ExeName) + "splash.bmp";
if (FileExists(LFileName))
{
Image->Picture->LoadFromFile(LFileName);
ClientWidth = Image->Picture->Width;
ClientHeight = Image->Picture->Height;
SetBounds(
(Screen->Width - Width) / 2,
(Screen->Height - Height) / 2,
Width, Height);
Timer->Enabled = True;
Show();
Update();
Application->ProcessMessages();
}
}
//---------------------------------------------------------------------------
void __fastcall TFormSplash::TimerTimer(TObject *Sender)
{
Hide();
}
//---------------------------------------------------------------------------
void __fastcall TFormSplash::FormDeactivate(TObject *Sender)
{
Hide();
}
//---------------------------------------------------------------------------
void __fastcall TFormSplash::FormHide(TObject *Sender)
{
Timer->Enabled = False;
Image->Picture->Assign(NULL);
}
//---------------------------------------------------------------------------

33
editor/UnitSplash.dfm Normal file
View file

@ -0,0 +1,33 @@
object FormSplash: TFormSplash
Left = 293
Top = 328
BorderStyle = bsNone
ClientHeight = 220
ClientWidth = 388
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
FormStyle = fsStayOnTop
OldCreateOrder = False
OnDeactivate = FormDeactivate
OnHide = FormHide
PixelsPerInch = 96
TextHeight = 13
object Image: TImage
Left = 0
Top = 0
Width = 388
Height = 220
Align = alClient
end
object Timer: TTimer
Enabled = False
Interval = 3000
OnTimer = TimerTimer
Left = 8
Top = 8
end
end

41
editor/UnitSplash.h Normal file
View file

@ -0,0 +1,41 @@
/*
** Name: Yeti3D PRO
** Desc: Portable GameBoy Advanced 3D Engine
** Auth: Derek J. Evans <derek@theteahouse.com.au>
**
** Copyright (C) 2003-2004 Derek J. Evans. All Rights Reserved.
**
** YY YY EEEEEE TTTTTT IIIIII 33333 DDDDD
** YY YY EE TT II 33 DD DD
** YYYY EEEE TT II 333 DD DD
** YY EE TT II 33 DD DD
** YY EEEEEE TT IIIIII 33333 DDDDD
*/
#ifndef UnitSplashH
#define UnitSplashH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
//---------------------------------------------------------------------------
class TFormSplash : public TForm
{
__published: // IDE-managed Components
TTimer *Timer;
TImage *Image;
void __fastcall TimerTimer(TObject *Sender);
void __fastcall FormDeactivate(TObject *Sender);
void __fastcall FormHide(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TFormSplash(TComponent* Owner);
void Execute();
};
//---------------------------------------------------------------------------
extern PACKAGE TFormSplash *FormSplash;
//---------------------------------------------------------------------------
#endif

143
editor/YetiEditor.bpr Normal file
View file

@ -0,0 +1,143 @@
<?xml version='1.0' encoding='utf-8' ?>
<!-- C++Builder XML Project -->
<PROJECT>
<MACROS>
<VERSION value="BCB.06.00"/>
<PROJECT value="YetiEditor.exe"/>
<OBJFILES value="YetiEditor.obj UnitMain.obj UnitPreview.obj ..\src\sys\BCBTools.obj
..\platform\win32\yeti3dwin32.obj ..\src\y3d\y3d_all.obj
..\src\game\sprites.obj ..\src\game\data.obj ..\src\game\entities.obj
..\src\game\game.obj ..\src\game\maps.obj ..\src\game\models.obj
..\src\game\screens.obj UnitSplash.obj"/>
<RESFILES value=""/>
<DEFFILE value=""/>
<RESDEPEN value="$(RESFILES) UnitMain.dfm UnitPreview.dfm UnitSplash.dfm"/>
<LIBFILES value=""/>
<LIBRARIES value="rtl.lib vcl.lib"/>
<SPARELIBS value="vcl.lib rtl.lib"/>
<PACKAGES value="vcl.bpi rtl.bpi vclx.bpi bcbsmp.bpi dclocx.bpi"/>
<PATHCPP value=".;..\src\sys;..\platform\win32;..\src\y3d;..\src\game"/>
<PATHPAS value=".;"/>
<PATHRC value=".;"/>
<PATHASM value=".;"/>
<DEBUGLIBPATH value="$(BCB)\lib\debug"/>
<RELEASELIBPATH value="$(BCB)\lib\release"/>
<LINKER value="ilink32"/>
<USERDEFINES value="__YETI_EDITOR__"/>
<SYSDEFINES value="NO_STRICT"/>
<MAINSOURCE value="YetiEditor.cpp"/>
<INCLUDEPATH value="..\src\game;..\src\y3d;&quot;C:\Program Files\Borland\CBuilder6\Projects&quot;;..\platform\win32;..\src\sys;..\src;$(BCB)\include;$(BCB)\include\vcl"/>
<LIBPATH value="..\src\game;..\src\y3d;&quot;C:\Program Files\Borland\CBuilder6\Projects&quot;;..\platform\win32;..\src\sys;..\src;$(BCB)\lib\obj;$(BCB)\lib;..\src\ethos"/>
<WARNINGS value="-w-par"/>
<OTHERFILES value=""/>
</MACROS>
<OPTIONS>
<CFLAG1 value="-O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -a8 -5 -b- -k- -vi -c -tW -tWM"/>
<PFLAGS value="-$Y- -$L- -$D- -$A8 -v -JPHNE -M"/>
<RFLAGS value=""/>
<AFLAGS value="/mx /w2 /zd"/>
<LFLAGS value="-D&quot;&quot; -aa -Tpe -x -Gn"/>
<OTHERFILES value=""/>
</OPTIONS>
<LINKER>
<ALLOBJ value="c0w32.obj sysinit.obj $(OBJFILES)"/>
<ALLRES value="$(RESFILES)"/>
<ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib"/>
<OTHERFILES value=""/>
</LINKER>
<FILELIST>
<FILE FILENAME="YetiEditor.cpp" FORMNAME="" UNITNAME="YetiEditor" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="UnitMain.cpp" FORMNAME="FormMain" UNITNAME="UnitMain" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="UnitPreview.cpp" FORMNAME="FormPreview" UNITNAME="UnitPreview" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\src\sys\BCBTools.cpp" FORMNAME="" UNITNAME="BCBTools" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\platform\win32\yeti3dwin32.c" FORMNAME="" UNITNAME="yeti3dwin32" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\src\y3d\y3d_all.c" FORMNAME="" UNITNAME="y3d_all" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\src\game\sprites.c" FORMNAME="" UNITNAME="sprites.c" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\src\game\data.c" FORMNAME="" UNITNAME="data.c" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\src\game\entities.c" FORMNAME="" UNITNAME="entities.c" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\src\game\game.c" FORMNAME="" UNITNAME="game.c" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\src\game\maps.c" FORMNAME="" UNITNAME="maps.c" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\src\game\models.c" FORMNAME="" UNITNAME="models.c" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="..\src\game\screens.c" FORMNAME="" UNITNAME="screens.c" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="UnitSplash.cpp" FORMNAME="FormSplash" UNITNAME="UnitSplash" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
</FILELIST>
<BUILDTOOLS>
</BUILDTOOLS>
<IDEOPTIONS>
[Version Info]
IncludeVerInfo=0
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=1033
CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=
[HistoryLists\hlIncludePath]
Count=6
Item0=..\src\game;..\src\y3d;C:\Program Files\Borland\CBuilder6\Projects;..\platform\win32;..\src\sys;..\src;$(BCB)\include;$(BCB)\include\vcl
Item1=C:\Program Files\Borland\CBuilder6\Projects;..\platform\win32;..\src\sys;..\src;$(BCB)\include;$(BCB)\include\vcl
Item2=..\src\ethos;C:\Program Files\Borland\CBuilder6\Projects;..\platform\win32;..\src\sys;..\src;$(BCB)\include;$(BCB)\include\vcl
Item3=..\src\sys;..\src;$(BCB)\include;$(BCB)\include\vcl
Item4=..\src;$(BCB)\include;$(BCB)\include\vcl
Item5=$(BCB)\include;$(BCB)\include\vcl
[HistoryLists\hlLibraryPath]
Count=6
Item0=..\src\game;..\src\y3d;C:\Program Files\Borland\CBuilder6\Projects;..\platform\win32;..\src\sys;..\src;$(BCB)\lib\obj;$(BCB)\lib;..\src\ethos
Item1=C:\Program Files\Borland\CBuilder6\Projects;..\platform\win32;..\src\sys;..\src;$(BCB)\lib\obj;$(BCB)\lib;..\src\ethos
Item2=..\src\ethos;C:\Program Files\Borland\CBuilder6\Projects;..\platform\win32;..\src\sys;..\src;$(BCB)\lib\obj;$(BCB)\lib
Item3=..\src\sys;..\src;$(BCB)\lib\obj;$(BCB)\lib
Item4=..\src;$(BCB)\lib\obj;$(BCB)\lib
Item5=$(BCB)\lib\obj;$(BCB)\lib
[HistoryLists\hlDebugSourcePath]
Count=1
Item0=$(BCB)\source\vcl
[HistoryLists\hlConditionals]
Count=4
Item0=__YETI_EDITOR__
Item1=__YETI_EDITOR__;_DEBUG
Item2=_DEBUG;__YETI_EDITOR__
Item3=_DEBUG
[Debugging]
DebugSourceDirs=$(BCB)\source\vcl
[Parameters]
RunParams=
Launcher=
UseLauncher=0
DebugCWD=
HostApplication=
RemoteHost=
RemotePath=
RemoteLauncher=
RemoteCWD=
RemoteDebug=0
[Compiler]
ShowInfoMsgs=0
LinkDebugVcl=0
</IDEOPTIONS>
</PROJECT>

60
editor/YetiEditor.cpp Normal file
View file

@ -0,0 +1,60 @@
/*
Copyright (C) 2003 - Derek John Evans
This file is part of Yeti3D Portable Engine
Yeti3D is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Original Source: 2003 - Derek J. Evans <derek@theteahouse.com.au>
Prepared for public release: 10/24/2003 - Derek J. Evans <derek@theteahouse.com.au>
*/
#include <vcl.h>
#pragma hdrstop
//---------------------------------------------------------------------------
USEFORM("UnitMain.cpp", FormMain);
USEFORM("UnitPreview.cpp", FormPreview);
USEFORM("UnitSplash.cpp", FormSplash);
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
Application->Initialize();
Application->Title = "Yeti3D World Editor";
Application->CreateForm(__classid(TFormMain), &FormMain);
Application->CreateForm(__classid(TFormPreview), &FormPreview);
Application->CreateForm(__classid(TFormSplash), &FormSplash);
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
catch (...)
{
try
{
throw Exception("");
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
}
return 0;
}
//---------------------------------------------------------------------------

BIN
editor/car.y3d Normal file

Binary file not shown.

4227
editor/cave.c Normal file

File diff suppressed because it is too large Load diff

BIN
editor/cave.y3d Normal file

Binary file not shown.

BIN
editor/church.y3d Normal file

Binary file not shown.

BIN
editor/city.y3d Normal file

Binary file not shown.

4
editor/clean.bat Normal file
View file

@ -0,0 +1,4 @@
del *.obj
del *.~*
del *.tds
del *.exe

BIN
editor/gpldemo.y3d Normal file

Binary file not shown.

BIN
editor/new.y3d Normal file

Binary file not shown.

79
editor/readme.txt Normal file
View file

@ -0,0 +1,79 @@
YETI3D EDITOR
=============
This is the first version of the Yeti3D Editor. Its very ruff, but usable. The
editing keys are the same as the CUBE world editor.
There are two editing modes. Selection and Wall Drawing. (Swap modes using the toolbar buttons).
Wall Drawing is used to get a ruff wall layout using the mouse. Left button draws a wall,
right button deletes a wall.
Selection allows you to select a range of cells for editing using the keys below.
O = Move Ceiling down
P = Move Ceiling up
[ = Move Floor down
] = Move Floor up
6 = Move ceiling terrain down. (Requires cave switch to be on)
7 = Move ceiling terrain up. (Requires cave switch to be on)
8 = Move floor terrain down. (Requires terrain switch to be on)
9 = Move floor terrain up. (Requires terrain switch to be on)
INSERT = Floor texture id incease.
DELETE = Floor texture id decrease.
HOME = Wall texture id increase.
END = Wall texture id decrease.
PAGE UP = Ceiling texture id increase.
PAGE DN = Ceiling texture id decrease.
T = Toggle terrain switch for the selected cells.
C = Toggle cave (ceiling terrain) switch for the selected cells.
S = Apply a smoothing function to both the terrain and cave offset.
K = Iterate the 9 preset corner offsets. The cell corner edited is the lower left corner
as seen in the 2D editor window.
L = Toggle the light switch for the selected cells.
F = Fill the selected cells with walls.
G = Clear the selected cells.
E = Insert entity id. Enter the entity id from 0..255. 0 = no entity. Entities show up as
little green circles in cells.
1-4 = Change selected cell lighting.
ARROWS = Camera movement.
SPACE = Camera Jump.
CTRL = Shoot.
Loading and saving are avaliable from the menu. You will need to export maps to C files so
they can be reloaded. NOTE: You can not load exported C files. You must save maps as y3d files.
DESIGN TIPS
===========
Start a new map using the NEW command from the menu. Switch to WALL drawing mode using the toolbar
button.
Sketch a ruff layout of your map plan. ie: Major & minor rooms/locations. Outside/Inside locations
& hallways/passages linking the player to each. You dont need to use up the entire map, as empty
spaces can later be used for hidden rooms/extra bonus levels.
Give the player a sence of direction & add multiple paths so a player can skip areas that may be
difficult to pass.
Add lighting. I tend to find lighing door ways the best idea since it allows the player to see
were to go without lighting the entire world. Placing lights 2 cells away from walls gives nicer
spots on the floor. Group lights together to increase the brightness of a light.
WARNINGS!
>>>> MAKE SURE YOU SAVE YOUR MAPS & BACKUP!
>>>> FOR NOW, DONT EDIT THE EDGES OF THE MAP. LIGHT RAYS WILL SHOOT OUT INTO NOWHERE.
This is a very ruff copy of the editor, so play it safe. Organsize map names from the start.
ie: E2M1.y3d E1M5.y3d
Mmm, thats about it. This version only has ~30 textures and they are Quake's, so they need to be
changed.
Regards
Derek Evans

BIN
editor/sand.y3d Normal file

Binary file not shown.

BIN
editor/splash.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 KiB

BIN
editor/terrain.y3d Normal file

Binary file not shown.

BIN
editor/test0.y3d Normal file

Binary file not shown.

BIN
editor/test1.y3d Normal file

Binary file not shown.

BIN
editor/test2.y3d Normal file

Binary file not shown.

BIN
editor/test3.y3d Normal file

Binary file not shown.

BIN
editor/test4.y3d Normal file

Binary file not shown.

BIN
editor/test5.y3d Normal file

Binary file not shown.

BIN
editor/thelab.y3d Normal file

Binary file not shown.

BIN
editor/thq.y3d Normal file

Binary file not shown.

BIN
editor/wacked.y3d Normal file

Binary file not shown.

BIN
platform/win32/Charles.zip Normal file

Binary file not shown.

171
platform/win32/main.c Normal file
View file

@ -0,0 +1,171 @@
/*
** Name: Yeti3D
** Desc: Portable GameBoy Advanced 3D Engine
** Auth: Derek J. Evans <derek@theteahouse.com.au>
**
** Copyright (C) 2003-2004 Derek J. Evans. All Rights Reserved.
**
** YY YY EEEEEE TTTTTT IIIIII 33333 DDDDD
** YY YY EE TT II 33 DD DD
** YYYY EEEE TT II 333 DD DD
** YY EE TT II 33 DD DD
** YY EEEEEE TT IIIIII 33333 DDDDD
*/
#include <windows.h>
#include <mmsystem.h>
#include "yeti3dwin32.h"
#include "Charles/charles.h"
char* lpszClassName = "Yeti3D";
char* lpszCaption = YETI_STR_TITLE;
char* lpszMessage =
YETI_STR_TITLE " " YETI_STR_VERSION " (Win32 Version)\n"
"Compilied using Watcom C/C++ v11 (Release Build)\n\n"
YETI_STR_COPYRIGHT "\n"
"Website: " YETI_STR_URL "\n";
HDIB* dib;
framebuffer_t framebuffer;
yeti_t yeti;
WNDCLASS wc;
MSG msg;
HWND hWnd;
void DibDraw(HDC hdc, int x, int y, HDIB dib)
{
HDC hdcMem = CreateCompatibleDC(hdc);
HANDLE oldBitmap = SelectObject(hdcMem, DibBitmapHandle(dib));
BitBlt (hdc, x, y, x + DibWidth(dib), y + DibHeight(dib), hdcMem, 0, 0, SRCCOPY);
SelectObject(hdcMem, oldBitmap);
DeleteDC(hdcMem);
}
void d3d_flip(void)
{
HDC dc;
static unsigned MarkTime;
if ((int)(MarkTime - timeGetTime()) < 0)
{
MarkTime = timeGetTime() + YETI_VIEWPORT_INTERVAL;
keyboard_update(&yeti.keyboard);
game_loop(&yeti);
viewport_to_video(
(u16*) DibPixelPtr(dib, 0, 0),
(int)DibPixelPtr(dib, 0, 1) - (int)DibPixelPtr(dib, 0, 0),
&yeti.viewport,
31 << 10,
31 << 5,
31);
dc = GetDC(hWnd);
if (dc)
{
DibDraw(dc, 0, 0, dib);
ReleaseDC(hWnd, dc);
}
}
}
LRESULT CALLBACK WindowProc(HWND hWnd, unsigned uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_KEYDOWN:
{
switch (wParam)
{
case VK_ESCAPE:
{
DestroyWindow(hWnd);
break;
}
}
break;
}
case WM_DESTROY:
{
PostQuitMessage(0);
break;
}
default:
{
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
}
return 0;
}
WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
MessageBox(0, lpszMessage, lpszCaption, MB_OK);
lpszMessage = 0;
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = WindowProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = sizeof(DWORD);
wc.hInstance = hInstance;
wc.hIcon = NULL;
wc.hCursor = NULL;
wc.hbrBackground = GetStockObject(BLACK_BRUSH);
wc.lpszMenuName = NULL;
wc.lpszClassName = lpszClassName;
if (!RegisterClass(&wc)) lpszMessage = "Could not register class.";
else
{
hWnd = CreateWindow(
lpszClassName,
lpszCaption,
WS_VISIBLE | WS_POPUPWINDOW,
0, //(GetSystemMetrics(SM_CXSCREEN) - YETI_VIEWPORT_WIDTH) >> 1,
0, //(GetSystemMetrics(SM_CYSCREEN) - YETI_VIEWPORT_HEIGHT) >> 1,
YETI_VIEWPORT_WIDTH, YETI_VIEWPORT_HEIGHT,
NULL,
NULL,
hInstance,
NULL);
if (!hWnd) lpszMessage = "Could not create window.";
else
{
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
wglSetDisplayMode(YETI_VIEWPORT_WIDTH, YETI_VIEWPORT_HEIGHT, 16);
dib = DibCreate(YETI_VIEWPORT_WIDTH, YETI_VIEWPORT_HEIGHT, 16, 0);
yeti_init(&yeti, &framebuffer, &framebuffer, textures, palette, lua0, lua1, lua2, lua3);
game_init(&yeti);
while (msg.message != WM_QUIT)
{
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
else
{
d3d_flip();
}
}
}
}
if (lpszMessage)
{
MessageBox(0, lpszMessage, lpszCaption, MB_OK);
}
return msg.wParam;
}

View file

@ -0,0 +1,68 @@
/*
** Name: Yeti3D
** Desc: Portable GameBoy Advanced 3D Engine
** Auth: Derek J. Evans <derek@theteahouse.com.au>
**
** Copyright (C) 2003-2004 Derek J. Evans. All Rights Reserved.
**
** YY YY EEEEEE TTTTTT IIIIII 33333 DDDDD
** YY YY EE TT II 33 DD DD
** YYYY EEEE TT II 333 DD DD
** YY EE TT II 33 DD DD
** YY EEEEEE TT IIIIII 33333 DDDDD
*/
#include "yeti3dwin32.h"
/*
** Name: keyboard_update
** Desc: Updates a keyboard structure with the latest keyboard states. These
** are standard Quake keys.
** Note: Win32 only.
*/
#define ISKEYDOWN(A) (GetAsyncKeyState(A)<0)
void keyboard_update(keyboard_t* kb)
{
kb->state.up = ISKEYDOWN(VK_UP);
kb->state.down = ISKEYDOWN(VK_DOWN);
kb->state.left = ISKEYDOWN(VK_LEFT);
kb->state.right = ISKEYDOWN(VK_RIGHT);
kb->state.a = ISKEYDOWN(VK_CONTROL);
kb->state.select = ISKEYDOWN(VK_RETURN);
kb->state.b = ISKEYDOWN(' ');
kb->state.l = ISKEYDOWN('A');
kb->state.r = ISKEYDOWN('Z') || ISKEYDOWN('Y'); // Support for Germans KB's
kb->state.rotate = ISKEYDOWN('R');
GetCursorPos((PPOINT)&kb->state.mouse);
}
/*
** Name: wglSetDisplayMode
** Desc:
*/
void wglSetDisplayMode(int width, int height, int bpp)
{
DEVMODE dm;
dm.dmSize = sizeof(dm);
dm.dmPelsWidth = width;
dm.dmPelsHeight = height;
dm.dmBitsPerPel = bpp;
dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL;
ChangeDisplaySettings(&dm, CDS_FULLSCREEN);
ShowCursor(0);
}
/*
** Name: wglResetDisplaymode
** Desc:
*/
void wglResetDisplaymode(void)
{
ChangeDisplaySettings(NULL, CDS_FULLSCREEN);
}

View file

@ -0,0 +1,44 @@
/*
** Name: Yeti3D
** Desc: Portable GameBoy Advanced 3D Engine
** Auth: Derek J. Evans <derek@theteahouse.com.au>
**
** Copyright (C) 2003-2004 Derek J. Evans. All Rights Reserved.
**
** YY YY EEEEEE TTTTTT IIIIII 33333 DDDDD
** YY YY EE TT II 33 DD DD
** YYYY EEEE TT II 333 DD DD
** YY EE TT II 33 DD DD
** YY EEEEEE TT IIIIII 33333 DDDDD
*/
#ifndef __YETI3DWIN32_H__
#define __YETI3DWIN32_H__
/******************************************************************************/
#include <windows.h>
#include "y3d_keyboard.h"
/******************************************************************************/
#ifdef __cplusplus
extern "C"{
#endif
/******************************************************************************/
void keyboard_update(keyboard_t* kb);
void wglSetDisplayMode(int width, int height, int bpp);
void wglResetDisplaymode(void);
/******************************************************************************/
#ifdef __cplusplus
};
#endif
/******************************************************************************/
#endif

18
readme.txt Normal file
View file

@ -0,0 +1,18 @@
YETI3D PRO Source Code
Dated: 17/8/2004
Here is a copy of Yeti3D PRO taken from a backup CD dated 17/8/2004.
Only the core source code is provided. None of the original sprites or MD2
models are provided, except the ANSI C data files.
I have included the World Editor and MD2 Model Converter tools which require
Borland C++Builder 6+ to compile. You should be able to get them running
on older versions with some hacking.
I have included the Win32 platform code which will show you how to get a
basic Yeti3D PRO system running.
This project is as old as the hills and I doubt this was the last version.
Use this code as you will.

13
src/game/ai/boost.c Normal file
View file

@ -0,0 +1,13 @@
void boost_tick(yeti_t* yeti, entity_t* e)
{
pickup_tick(yeti, e, 256);
}
void boost_init(yeti_t* yeti, entity_t* e)
{
e->tt = i2f(8);
e->visual.data = model_boost;
e->visual.ondraw = yeti_model_draw;
e->ontick = boost_tick;
//e->onhit = guard_hit;
}

46
src/game/ai/bullet.c Normal file
View file

@ -0,0 +1,46 @@
void bullet_hit(yeti_t* yeti, entity_t* e1, entity_t* e2)
{
}
void bullet_wall(yeti_t* yeti, entity_t* e, cell_t* c)
{
explode_init(yeti, e);
}
void bullet_tick(yeti_t* yeti, entity_t* e)
{
if (!e->xx && !e->yy) explode_init(yeti, e);
}
void bullet_shoot_at(entity_t* e, int x, int y, int z)
{
entity_look_at2(e, x, y, z);
entity_set_velocity(e);
}
void bullet_shoot(yeti_t* yeti, entity_t* e)
{
entity_t* b = YETI_BULLET(yeti);
entity_destroy(b);
b->t = e->t;
b->p = -e->p >> 1;
b->x = e->x + (b->xx >> 1);
b->y = e->y + (b->yy >> 1);
b->z = e->z - 100;
entity_set_velocity(b);
b->visual.data = spr_flare0;
b->visual.width = 200;
b->visual.height = 200;
b->visual.mode = DRAW_MODE_COLORKEY_BLEND;
b->radius = 10;
b->ontick = bullet_tick;
b->onwall = bullet_wall;
b->onhit = bullet_hit;
b->emitlight = TRUE;
}

3
src/game/ai/clean.bat Normal file
View file

@ -0,0 +1,3 @@
del *.obj
del *.~*

17
src/game/ai/death.c Normal file
View file

@ -0,0 +1,17 @@
void death_tick(yeti_t* yeti, entity_t* e)
{
animation_tick(&e->animation);
if (!e->animation.nloops)
{
e->radius = 0;
e->ontick = NULL;
}
}
void death_init(yeti_t* yeti, entity_t* e)
{
entity_freeze(e);
animation_mode(&e->animation, MD2_ANIM_DEATH1 + yeti->keyboard.tick % 3, 80, 1);
e->ontick = death_tick;
}

83
src/game/ai/explode.c Normal file
View file

@ -0,0 +1,83 @@
void explode_tick(yeti_t* yeti, entity_t* e)
{
u16* animation[] = {
spr_expl0, spr_expl1, spr_expl2, spr_expl3,
spr_expl4, spr_expl5, spr_expl6, spr_expl7,
spr_expl8, spr_expl9, spr_expl10, spr_expl11,
spr_expl12, spr_expl13, spr_expl14, spr_expl15};
e->visual.data = animation[f2i(e->animation.pos)];
animation_tick(&e->animation);
if (e->animation.nloops)
{
e->visual.width += 48;
e->visual.height += 48;
}
else
{
entity_destroy(e);
}
}
void explode_init(yeti_t* yeti, entity_t* e)
{
e->x -= e->xx;
e->y -= e->yy;
e->z -= e->zz;
entity_reinit(e);
e->radius = 0;
e->visual.width = 16;
e->visual.height = 16;
e->visual.mode = DRAW_MODE_COLORKEY_BLEND;
e->ontick = explode_tick;
e->onhit = 0;
e->onwall = 0;
sound_play(SOUND_EXPLOSION);
animation_init(&e->animation, 0, 0, 16, 200, 1);
}
void splat_tick(yeti_t* yeti, entity_t* e)
{
u16* animation[] = {
spr_splat00, spr_splat01, spr_splat02, spr_splat03,
spr_splat04, spr_splat05, spr_splat06, spr_splat07,
spr_splat08, spr_splat09, spr_splat10, spr_splat11,
spr_splat12, spr_splat13, spr_splat14, spr_splat15,
spr_splat16, spr_splat17, spr_splat18, spr_splat19,
spr_splat20, spr_splat21, spr_splat22, spr_splat23,
spr_splat24, spr_splat25, spr_splat26, spr_splat27,
spr_splat28, spr_splat29, spr_splat30, spr_splat31};
e->visual.data = animation[f2i(e->animation.pos)];
animation_tick(&e->animation);
if (e->animation.nloops)
{
e->visual.width += 32;
e->visual.height += 32;
}
else
{
entity_destroy(e);
}
}
void splat_init(yeti_t* yeti, entity_t* e)
{
entity_reinit(e);
e->radius = 0;
e->visual.width = 32;
e->visual.height = 32;
e->visual.mode = DRAW_MODE_COLORKEY;
e->ontick = splat_tick;
e->onhit = 0;
e->onwall = 0;
sound_play(SOUND_EXPLOSION);
animation_init(&e->animation, 0, 0, 32, 300, LOOP_ONCE);
}

11
src/game/ai/pickup.c Normal file
View file

@ -0,0 +1,11 @@
/*
** Name: pickup_tick
** Desc: A standard pickup behaviour. Entity is placed at a choosen position
** from the ground and bobs up & down.
*/
void pickup_tick(yeti_t* yeti, entity_t* e, int z)
{
cell_t* cell = ENTITY_CELL(yeti, e);
e->z = cell_bot(cell, e) + (fixsin(yeti->keyboard.tick << 12) >> 3) + z;
}

13
src/game/ai/quad.c Normal file
View file

@ -0,0 +1,13 @@
void quad_tick(yeti_t* yeti, entity_t* e)
{
pickup_tick(yeti, e, 170);
}
void quad_init(yeti_t* yeti, entity_t* e)
{
e->tt = i2f(8);
e->visual.data = model_quad;
e->visual.ondraw = yeti_model_draw;
e->ontick = quad_tick;
//e->onhit = guard_hit;
}

11
src/game/ai/sheba.c Normal file
View file

@ -0,0 +1,11 @@
void sheba_tick(yeti_t* yeti, entity_t* e)
{
u16* animation[] = {spr_sheba0, spr_sheba1, spr_sheba2, spr_sheba3};
e->visual.data = animation[(yeti->keyboard.tick >> 2) & 3];
}
void sheba_init(yeti_t* yeti, entity_t* e)
{
static_sprite_init(yeti, e, NULL, TRUE, i2f(2), 256, i2f(2), i2f(2));
e->ontick = sheba_tick;
}

View file

@ -0,0 +1,14 @@
/*
** Name: static_model_init
** Desc: Initilize a static 3D model.
*/
void static_model_init(yeti_t* yeti, entity_t* e, void* model, int castshadow, int eos)
{
cell_t* cell = ENTITY_CELL(yeti, e);
e->visual.data = model;
e->visual.ondraw = yeti_model_draw;
e->z = cell_bot(cell, e);
e->castshadow = castshadow;
cell->eos = eos;
}

View file

@ -0,0 +1,16 @@
/*
** Name: static_sprite_init
** Desc: Initilize a static 2D sprite.
*/
void static_sprite_init(yeti_t* yeti, entity_t* e, void* sprite, int castshadow, int eos, int z, int width, int height)
{
cell_t* cell = ENTITY_CELL(yeti, e);
e->visual.width = width;
e->visual.height = height;
e->visual.data = sprite;
e->visual.mode = DRAW_MODE_COLORKEY;
e->z = cell_bot(cell, e) + z;
e->castshadow = castshadow;
cell->eos = eos;
}

13
src/game/ai/teleporter.c Normal file
View file

@ -0,0 +1,13 @@
void teleporter_tick(yeti_t* yeti, entity_t* e)
{
pickup_tick(yeti, e, 128);
}
void teleporter_init(yeti_t* yeti, entity_t* e)
{
e->tt = i2f(4);
e->visual.data = model_teleporter;
e->visual.ondraw = yeti_model_draw;
e->visual.mode = DRAW_MODE_BLEND;
e->ontick = teleporter_tick;
}

36
src/game/ai/torch.c Normal file
View file

@ -0,0 +1,36 @@
void torch0_tick(yeti_t* yeti, entity_t* e)
{
u16* animation[] = {spr_torch0, spr_torch1, spr_torch2, spr_torch3};
e->visual.data = animation[(yeti->keyboard.tick >> 2) & 3];
}
void torch0_init(yeti_t* yeti, entity_t* e)
{
cell_t* cell = ENTITY_CELL(yeti, e);
e->visual.width = i2f(2);
e->visual.height = i2f(2);
e->visual.mode = DRAW_MODE_COLORKEY;
e->radius = 0;
e->ontick = torch0_tick;
e->z = cell_bot(cell, e) + 128;
cell->eos = i2f(1);
}
void torch1_tick(yeti_t* yeti, entity_t* e)
{
u16* animation[] = {spr_torch4, spr_torch5, spr_torch6, spr_torch7};
e->visual.data = animation[(yeti->keyboard.tick >> 2) & 3];
}
void torch1_init(yeti_t* yeti, entity_t* e)
{
cell_t* cell = ENTITY_CELL(yeti, e);
e->visual.width = i2f(3);
e->visual.height = i2f(3);
e->visual.mode = DRAW_MODE_COLORKEY;
e->radius = 0;
e->ontick = torch1_tick;
e->z = cell_bot(cell, e) + 240;
cell->eos = i2f(1);
}

3
src/game/clean.bat Normal file
View file

@ -0,0 +1,3 @@
del *.obj
del *.~*

8499
src/game/data.c Normal file

File diff suppressed because it is too large Load diff

4
src/game/data.h Normal file
View file

@ -0,0 +1,4 @@
#ifndef __DATA_H__
#define __DATA_H__
#include "y3d_yeti.h"
#endif

112
src/game/entities.c Normal file
View file

@ -0,0 +1,112 @@
/*
** Name: Yeti3D
** Desc: Portable GameBoy Advanced 3D Engine
** Auth: Derek J. Evans <derek@theteahouse.com.au>
**
** Copyright (C) 2003-2004 Derek J. Evans. All Rights Reserved.
**
** YY YY EEEEEE TTTTTT IIIIII 33333 DDDDD
** YY YY EE TT II 33 DD DD
** YYYY EEEE TT II 333 DD DD
** YY EE TT II 33 DD DD
** YY EEEEEE TT IIIIII 33333 DDDDD
*/
#include "y3d_draw.h"
#include "y3d_engine.h"
#include "y3d_quake.h"
#include "y3d_sound.h"
#include "entities.h"
#include "models.h"
#include "sprites.h"
/******************************************************************************/
#include "ai/static_model.c"
#include "ai/static_sprite.c"
#include "ai/sheba.c"
#include "ai/torch.c"
#include "ai/pickup.c"
#include "ai/boost.c"
#include "ai/quad.c"
#include "ai/teleporter.c"
#include "ai/bullet.c"
#include "ai/explode.c"
#include "ai/death.c"
/******************************************************************************/
void barrontree_init(yeti_t* yeti, entity_t* e)
{
#ifdef __GBA__
static_sprite_init(yeti, e, spr_tree1, TRUE, 512, 512, 450, i2f(4));
#else
static_model_init(yeti, e, model_barrontree, TRUE, 512);
#endif
}
void leafyplant_init(yeti_t* yeti, entity_t* e)
{
#ifdef __GBA__
#else
static_model_init(yeti, e, model_leafyplant, TRUE, 128);
#endif
}
void cactus_init(yeti_t* yeti, entity_t* e)
{
#ifdef __GBA__
#else
static_model_init(yeti, e, model_cactus, TRUE, 512);
#endif
}
void potplant_init(yeti_t* yeti, entity_t* e)
{
static_model_init(yeti, e, model_potplant, FALSE, 128);
}
void pillar_init(yeti_t* yeti, entity_t* e)
{
static_model_init(yeti, e, model_pillar, TRUE, i2f(4));
}
void overpass_init(yeti_t* yeti, entity_t* e)
{
cell_t* cell = ENTITY_CELL(yeti, e);
static_model_init(yeti, e, model_overpass, TRUE, 0);
e->z = cell_bot(cell, e) + i2f(4);
cell->eos = i2f(4);
cell->hos = cell->eos - 64;
}
void bridge_init(yeti_t* yeti, entity_t* e)
{
cell_t* cell = ENTITY_CELL(yeti, e);
static_model_init(yeti, e, model_bridge, TRUE, 0);
e->z = cell_bot(cell, e) + i2f(2);
cell->eos = i2f(2);
cell->hos = cell->eos - 64;
}
void emptypot_init(yeti_t* yeti, entity_t* e)
{
static_model_init(yeti, e, model_emptypot, FALSE, 128);
}
void pinechair_init(yeti_t* yeti, entity_t* e)
{
static_model_init(yeti, e, model_pinechair, FALSE, 128);
}
void crate_init(yeti_t* yeti, entity_t* e)
{
static_model_init(yeti, e, model_crate, FALSE, 128);
e->t = DEG_45;
}
/******************************************************************************/

64
src/game/entities.h Normal file
View file

@ -0,0 +1,64 @@
/*
** Name: Yeti3D
** Desc: Portable GameBoy Advanced 3D Engine
** Auth: Derek J. Evans <derek@theteahouse.com.au>
**
** Copyright (C) 2003-2004 Derek J. Evans. All Rights Reserved.
**
** YY YY EEEEEE TTTTTT IIIIII 33333 DDDDD
** YY YY EE TT II 33 DD DD
** YYYY EEEE TT II 333 DD DD
** YY EE TT II 33 DD DD
** YY EEEEEE TT IIIIII 33333 DDDDD
*/
#ifndef __ENTITIES_H__
#define __ENTITIES_H__
/******************************************************************************/
#include "y3d_yeti.h"
/******************************************************************************/
#ifdef __cplusplus
extern "C"{
#endif
/******************************************************************************/
extern void boost_init(yeti_t* yeti, entity_t* e);
extern void quad_init(yeti_t* yeti, entity_t* e);
extern void teleporter_init(yeti_t* yeti, entity_t* e);
extern void sheba_init(yeti_t* yeti, entity_t* e);
extern void torch0_init(yeti_t* yeti, entity_t* e);
extern void torch1_init(yeti_t* yeti, entity_t* e);
extern void barrontree_init(yeti_t* yeti, entity_t* e);
extern void leafyplant_init(yeti_t* yeti, entity_t* e);
extern void cactus_init(yeti_t* yeti, entity_t* e);
extern void potplant_init(yeti_t* yeti, entity_t* e);
extern void overpass_init(yeti_t* yeti, entity_t* e);
extern void bridge_init(yeti_t* yeti, entity_t* e);
extern void pillar_init(yeti_t* yeti, entity_t* e);
extern void emptypot_init(yeti_t* yeti, entity_t* e);
extern void pinechair_init(yeti_t* yeti, entity_t* e);
extern void crate_init(yeti_t* yeti, entity_t* e);
extern void bullet_shoot(yeti_t* yeti, entity_t* e);
extern void bullet_tick(yeti_t* yeti, entity_t* e);
extern void explode_init(yeti_t* yeti, entity_t* e);
extern void splat_init(yeti_t* yeti, entity_t* e);
extern void death_init(yeti_t* yeti, entity_t* e);
/******************************************************************************/
#ifdef __cplusplus
};
#endif
/******************************************************************************/
#endif

706
src/game/game.c Normal file
View file

@ -0,0 +1,706 @@
/*
** Name: Yeti3D
** Desc: Portable GameBoy Advanced 3D Engine
** Auth: Derek J. Evans <derek@theteahouse.com.au>
**
** Copyright (C) 2003-2004 Derek J. Evans. All Rights Reserved.
**
** YY YY EEEEEE TTTTTT IIIIII 33333 DDDDD
** YY YY EE TT II 33 DD DD
** YYYY EEEE TT II 333 DD DD
** YY EE TT II 33 DD DD
** YY EEEEEE TT IIIIII 33333 DDDDD
*/
#include "y3d_ansic.h"
#include "y3d_sound.h"
#include "y3d_image.h"
#include "y3d_draw.h"
#include "y3d_quake.h"
#include "y3d_engine.h"
#include "game.h"
#include "maps.h"
#include "models.h"
#include "sprites.h"
#include "entities.h"
#include "screens.h"
/******************************************************************************/
void entity_default(yeti_t* yeti, entity_t* e, int isjumping, int iscrawling, int xyfriction)
{
cell_t* cell = ENTITY_CELL(yeti, e);
int bot = cell_bot(cell, e) + (iscrawling ? yeti->game.crawling : yeti->game.walking);
int top = cell_top(cell, e) - yeti->game.ceiling;
//if (TEXTURE_IS_LIQUID(cell->btx)) bot -= 32;
if (e == yeti->player)
{
e->r = ansic_friction(e->r, 64);
e->p = ansic_friction(e->p, 30);
}
if (e->z <= bot)
{
e->z -= (e->z - bot) >> 2;
e->zz -= e->zz >> 2;
if (isjumping && e->z < top)
{
e->z = bot;
e->zz += yeti->game.jumping;
}
if (TEXTURE_IS_LIQUID(cell->btx))
{
//xyfriction += 20;
}
}
else
{
e->zz += yeti->game.gravity;
}
if (e->z >= top)
{
e->z -= (e->z - top) >> 2;
}
e->xx = ansic_friction(e->xx, xyfriction);
e->yy = ansic_friction(e->yy, xyfriction);
e->tt = ansic_friction(e->tt, 110);
if (e->state.pain > i2f(1)) death_init(yeti, e);
}
/******************************************************************************/
void camera_exit_tick(yeti_t* yeti, entity_t* e)
{
cell_t* cell = ENTITY_CELL(yeti, e);
e->z = cell_bot(cell, e) + i2f(2);
entity_look_at2(e, yeti->player->x, yeti->player->y, yeti->player->z);
}
void camera_exit_init(entity_t* e)
{
e->ontick = camera_exit_tick;
}
/******************************************************************************/
void player_tick(yeti_t* yeti, entity_t* e)
{
int i, x, y;
cell_t* cell = ENTITY_CELL(yeti, e);
#ifndef __YETI_EDITOR__
switch (cell->ent)
{
case ENTITY_SECRET:
{
message_init(&yeti->message, "You found a secret");
break;
}
case ENTITY_EXIT:
{
cell->ent = 0;
message_init(&yeti->message, "Level Completed");
if (map_find_ent(&yeti->map, ENTITY_EXIT_CAMERA, &x, &y))
{
entity_t* e = yeti_entity(yeti, i2f(x) + FIXHALF, i2f(y) + FIXHALF, 0);
camera_exit_init(e);
yeti->camera = e;
game_goto(&yeti->game, GAME_MODE_ENDLEVEL);
}
break;
}
}
#endif
if (yeti->keyboard.state.rotate)
{
i = yeti->keyboard.state.mouse.x << 7;
//yeti->camera->x = (fixcos(yeti->keyboard.tick << 7) * 28) + i2f(32);
//yeti->camera->y = (fixsin(yeti->keyboard.tick << 7) * 28) + i2f(32);
//yeti->camera->z = i2f(2);
entity_force_towards(e,
yeti->player2->x + fixcos(yeti->keyboard.tick << 8) * 3,
yeti->player2->y + fixsin(yeti->keyboard.tick << 8) * 2,
yeti->player2->z + (fixcos(yeti->keyboard.tick << 8) >> 0), 4);
entity_look_at2(e,
yeti->player2->x,
yeti->player2->y,
yeti->player2->z);
e->r = fixcos(yeti->keyboard.tick << 8) << 5;
}
else
{
animation_tick(&e->animation);
if (e->animation.mode == 1 && !e->animation.nloops)
{
animation_init(&e->animation, 0, 0, 8, 192, LOOP_FOREVER);
}
e->visual.data = NULL;// yeti->camera == yeti->player ? model_rocket : NULL;
e->visual.altpitch = TRUE;
e->visual.ondraw = yeti_model_draw;
if (yeti->keyboard.state.l ) e->p -= i2f(2);
if (yeti->keyboard.state.r ) e->p += i2f(2);
if (yeti->keyboard.state.left ) entity_turn_left(e);
if (yeti->keyboard.state.right ) entity_turn_right(e);
if (yeti->keyboard.state.up ) entity_move_forward(e);
if (yeti->keyboard.state.down ) entity_move_backwards(e);
if (KEYPRESS_A(yeti) && yeti->game.hud.ammo > 0)
{
yeti->game.hud.ammo--;
bullet_shoot(yeti, e);
sound_play(SOUND_ROCKETLAUNCH);
animation_init(&e->animation, 1, 8, 17, 192, 1);
}
i = KEYPRESS_B(yeti);
if (i) sound_play(SOUND_JUMP);
entity_default(yeti, e, i, FALSE, 40);
}
}
void player_init(entity_t* e)
{
e->radius = 0;
e->ontick = player_tick;
animation_init(&e->animation, 0, 0, 8, 192, LOOP_FOREVER);
}
/******************************************************************************/
extern void guard_attack_init(entity_t* e);
void guard_base_init(entity_t* e)
{
e->visual.ondraw = yeti_model_draw;
e->radius = 128;
}
void guard_pain_tick(yeti_t* yeti, entity_t* e)
{
animation_tick(&e->animation);
entity_default(yeti, e, FALSE, FALSE, 60);
if (!e->animation.nloops)
{
guard_attack_init(e);
}
}
void guard_pain_init(yeti_t* yeti, entity_t* e)
{
guard_base_init(e);
animation_mode(&e->animation, MD2_ANIM_PAIN1 + (yeti->keyboard.tick & 3), 100, 1);
e->ontick = guard_pain_tick;
e->onhit = NULL;
}
void guard_attack_hit(yeti_t* yeti, entity_t* e1, entity_t* e2)
{
if (e2->ontick == bullet_tick)
{
e1->state.pain += 80;
splat_init(yeti, e2);
guard_pain_init(yeti, e1);
}
}
void guard_attack_tick(yeti_t* yeti, entity_t* e)
{
animation_tick(&e->animation);
entity_turn_towards(e, yeti->player->x, yeti->player->y);
entity_move_forward(e);
entity_default(yeti, e, FALSE, FALSE, 60);
}
void guard_attack_init(entity_t* e)
{
guard_base_init(e);
e->ontick = guard_attack_tick;
e->onhit = guard_attack_hit;
animation_mode(&e->animation, MD2_ANIM_RUN, 80, LOOP_FOREVER);
}
int entity_line_of_sight(entity_t* e1, entity_t* e2, map_t* map)
{
return map_line_of_sight(map, e1->x, e1->y, e2->x, e2->y);
}
void guard_stand_tick(yeti_t* yeti, entity_t* e)
{
animation_tick(&e->animation);
if (e->animation.mode != MD2_ANIM_RUN)
{
animation_mode(&e->animation, MD2_ANIM_RUN, 80, LOOP_FOREVER);
}
entity_default(yeti, e, FALSE, FALSE, 60);
{
int i = yeti->keyboard.tick << 6;
entity_turn_towards(e,
(fixcos(i) * 28) + i2f(32),
(fixsin(i) * 28) + i2f(32));
entity_force_towards(e,
(fixcos(i) * 28) + i2f(32),
(fixsin(i) * 28) + i2f(32), i2f(-5), 5);
//entity_move_forward(e);
}
/*
if (entity_line_of_sight(e, yeti->player, &yeti->map))
{
#ifndef __YETI_EDITOR__
guard_attack_init(e);
#endif
}
*/
}
void guard_stand_init(entity_t* e)
{
guard_base_init(e);
e->ontick = guard_stand_tick;
e->onhit = guard_attack_hit;
animation_mode(&e->animation, MD2_ANIM_RUN, 80, LOOP_FOREVER);
}
void guard_init(entity_t* e)
{
guard_stand_init(e);
}
/******************************************************************************/
/*
void tigger_init(entity_t* e)
{
e->visual.data = model_tigger;
guard_init(e);
}
void chicken_init(entity_t* e)
{
e->visual.data = model_chicken;
guard_init(e);
}
void rabbit_init(entity_t* e)
{
e->visual.data = model_prabbit;
guard_init(e);
}
void potator_init(entity_t* e)
{
e->visual.data = model_potator;
guard_init(e);
}
void karrot_init(entity_t* e)
{
e->visual.data = model_karrot;
guard_init(e);
}
void penguin_init(entity_t* e)
{
e->visual.data = model_penguin;
guard_init(e);
}
void scarlet_init(entity_t* e)
{
e->visual.data = model_scarlet;
guard_init(e);
}
void banana_init(entity_t* e)
{
e->visual.data = model_banana;
guard_init(e);
}
void goblin_init(entity_t* e)
{
e->visual.data = model_goblin;
guard_init(e);
}
void pm_init(entity_t* e)
{
e->visual.data = model_pm;
guard_init(e);
}
*/
void bauul_init(entity_t* e)
{
e->visual.data = model_ogro;//model_bauul;
guard_init(e);
}
void ogro_init(entity_t* e)
{
e->visual.data = model_ogro;
guard_init(e);
}
void rat_init(entity_t* e)
{
e->visual.data = model_rat;
guard_init(e);
}
/******************************************************************************/
void light_tick(yeti_t* yeti, entity_t* e)
{
int xx = yeti->camera->x - e->x;
int yy = yeti->camera->y - e->y;
xx = (SQR(xx) + SQR(yy)) >> 11;
e->visual.width = e->visual.height = CLAMP(xx, i2f(3), i2f(8));
}
void light_init(yeti_t* yeti, entity_t* e)
{
cell_t* cell = ENTITY_CELL(yeti, e);
//e->alwaysontop = TRUE;
e->z = cell_top(cell, e);
e->visual.data = spr_flare3;
e->visual.mode = DRAW_MODE_COLORKEY_BLEND;
e->ontick = light_tick;
}
/******************************************************************************/
/*
** Name: game_spawn_entities
** Desc: This is the function that you need to modify to create new entities.
** You iterate the entire map and create/init entities for each map cell.
** Each init function should then setup the default entity settings.
*/
void game_spawn_entities(yeti_t* yeti)
{
//#ifndef __YETI_EDITOR__
int x, y;
yeti->entities.length = 1;
for (y = 0; y < MAP_HEIGHT; y++)
{
for (x = 0; x < MAP_WIDTH; x++)
{
int ent = yeti->map.item[y][x].ent;
int xx = i2f(x) + FIXHALF;
int yy = i2f(y) + FIXHALF;
switch (ent)
{
case ENTITY_EXIT :
teleporter_init(yeti, yeti_entity(yeti, xx, yy, 0));
break;
case ENTITY_LIGHT :
light_init(yeti, yeti_entity(yeti, xx, yy, 0));
break;
}
//if (ent == 4) rabbit_init (yeti_entity(yeti, xx, yy, 0));
//if (ent == 5) potator_init(yeti_entity(yeti, xx, yy, 0));
//if (ent == 6) karrot_init (yeti_entity(yeti, xx, yy, 0));
//if (ent == 7) penguin_init(yeti_entity(yeti, xx, yy, 0));
//if (ent == 8) scarlet_init(yeti_entity(yeti, xx, yy, 0));
//if (ent == 9) banana_init (yeti_entity(yeti, xx, yy, 0));
if (ent == 10)
{
yeti->player2 = yeti_entity(yeti, xx, yy, 0);
bauul_init(yeti->player2);
}
if (ent == 11) ogro_init (yeti_entity(yeti, xx, yy, 0));
if (ent == 12) rat_init (yeti_entity(yeti, xx, yy, 0));
//if (ent == 13) pm_init (yeti_entity(yeti, xx, yy, 0));
if (ent == 20) boost_init (yeti, yeti_entity(yeti, xx, yy, 0));
if (ent == 21) quad_init (yeti, yeti_entity(yeti, xx, yy, 0));
//if (ent == 30) jeep_init (yeti_entity(yeti, xx, yy, 0));
if (ent == 100) torch0_init (yeti, yeti_entity(yeti, xx, yy, 0));
if (ent == 101) torch1_init (yeti, yeti_entity(yeti, xx, yy, 0));
if (ent == 102) sheba_init (yeti, yeti_entity(yeti, xx, yy, 0));
if (ent == 103) leafyplant_init (yeti, yeti_entity(yeti, xx, yy, 0));
if (ent == 104) barrontree_init (yeti, yeti_entity(yeti, xx, yy, 0));
if (ent == 105) cactus_init (yeti, yeti_entity(yeti, xx, yy, 0));
if (ent == 106) potplant_init (yeti, yeti_entity(yeti, xx, yy, 0));
if (ent == 150) pinechair_init (yeti, yeti_entity(yeti, xx, yy, 0));
if (ent == 151) pillar_init (yeti, yeti_entity(yeti, xx, yy, 0));
if (ent == 152) emptypot_init (yeti, yeti_entity(yeti, xx, yy, 0));
//if (ent == 153) overpass_init (yeti, yeti_entity(yeti, xx, yy, 0));
if (ent == 154) crate_init (yeti, yeti_entity(yeti, xx, yy, 0));
if (ent == 155) bridge_init (yeti, yeti_entity(yeti, xx, yy, 0));
}
}
//#endif
}
void hud_init(hud_t* hud)
{
hud->health = 100;
hud->ammo = 150;
}
void game_load_map(yeti_t* yeti, rom_map_t* map)
{
yeti->game.gravity = -16; // Gravity force.
yeti->game.jumping = 80; // Jumping force.
yeti->game.crawling = i2f(1); // Crawling height.
yeti->game.walking = 384; // Walking height.
yeti->game.ceiling = 200; // Crouch distance.
yeti->skyimage = spr_sky2;
yeti_load_map(yeti, map);
player_init(yeti->player);
game_spawn_entities(yeti);
hud_init(&yeti->game.hud);
// TODO: This message should come from the map data.
sprintf(yeti->message.s, "Game On", yeti->game.episode + 1);
message_init(&yeti->message, yeti->message.s);
}
/******************************************************************************/
int game_mode(game_t* game)
{
return f2i(game->tick);
}
void game_goto(game_t* game, int mode)
{
game->prevmode = game_mode(game);
game->tick = i2f(mode);
sound_play(SOUND_ITEMPICK);
}
void game_goback(game_t* game)
{
game_goto(game, game->prevmode);
}
void game_cycle(game_t* game, int speed)
{
game->tick = fixtrunc(game->tick) | fixfrac(game->tick + speed);
}
void game_menu(yeti_t* yeti, s8* index)
{
if (index)
{
if (KEYPRESS_UP(yeti)) {(*index)--; sound_play(SOUND_TICK);}
if (KEYPRESS_DN(yeti)) {(*index)++; sound_play(SOUND_TICK);}
}
}
/******************************************************************************/
void game_init(yeti_t* yeti)
{
yeti->game.episode = 0;
// TODO: Change this to the correct start mode.
yeti->game.tick = i2f(GAME_MODE_START_LEVEL);
}
/******************************************************************************/
void game_draw(yeti_t* yeti)
{
switch (game_mode(&yeti->game))
{
case GAME_MODE_PLAY : screen_play (yeti); break;
case GAME_MODE_PUBLISHER : screen_publisher (yeti); break;
case GAME_MODE_YETI3D : screen_yeti3d (yeti); break;
case GAME_MODE_TITLE : screen_title (yeti); break;
case GAME_MODE_MENU : screen_menu (yeti); break;
case GAME_MODE_PAUSED : screen_paused (yeti); break;
case GAME_MODE_CREDITS : screen_credits (yeti); break;
case GAME_MODE_OPTIONS : screen_view_options (yeti); break;
case GAME_MODE_SKILL : screen_skill (yeti); break;
case GAME_MODE_EPISODE : screen_episode (yeti); break;
case GAME_MODE_LOADGAME : screen_load_game (yeti); break;
case GAME_MODE_QUITGAME : screen_quit_game (yeti); break;
case GAME_MODE_ENDLEVEL : screen_end_level (yeti); break;
}
//image_draw_at(yeti->viewport.back->pixels[0], spr_test, 0, 0, 0);
}
void game_tick(yeti_t* yeti)
{
switch (game_mode(&yeti->game))
{
case GAME_MODE_PUBLISHER:
{
yeti->game.tick += 1;
if (KEYPRESS_A(yeti)) game_goto(&yeti->game, GAME_MODE_YETI3D);
break;
}
case GAME_MODE_YETI3D:
{
yeti->game.tick += 2;
if (KEYPRESS_A(yeti)) game_goto(&yeti->game, GAME_MODE_TITLE);
break;
}
case GAME_MODE_TITLE:
{
yeti->game.tick += 2;
if (KEYPRESS_A(yeti)) game_goto(&yeti->game, GAME_MODE_MENU);
break;
}
case GAME_MODE_MENU:
{
game_cycle(&yeti->game, 2);
if (KEYPRESS_A(yeti))
{
switch (yeti->game.menu.main)
{
case 0: game_goto(&yeti->game, GAME_MODE_EPISODE); break;
case 1: game_goto(&yeti->game, GAME_MODE_OPTIONS); break;
case 2: game_goto(&yeti->game, GAME_MODE_LOADGAME); break;
case 3: game_goto(&yeti->game, GAME_MODE_CREDITS); break;
}
}
game_menu(yeti, &yeti->game.menu.main);
if (KEYPRESS_B (yeti)) game_goto(&yeti->game, GAME_MODE_TITLE);
break;
}
case GAME_MODE_EPISODE:
{
game_cycle(&yeti->game, 2);
if (KEYPRESS_A (yeti)) game_goto(&yeti->game, GAME_MODE_SKILL);
if (KEYPRESS_B (yeti)) game_goto(&yeti->game, GAME_MODE_MENU);
game_menu(yeti, &yeti->game.menu.episode);
break;
}
case GAME_MODE_SKILL:
{
game_cycle(&yeti->game, 2);
if (KEYPRESS_A (yeti)) game_goto(&yeti->game, GAME_MODE_START_LEVEL);
if (KEYPRESS_B (yeti)) game_goto(&yeti->game, GAME_MODE_EPISODE);
game_menu(yeti, &yeti->game.menu.skill);
break;
}
case GAME_MODE_PLAY:
{
yeti_tick(yeti);
if (KEYPRESS_SELECT(yeti)) game_goto(&yeti->game, GAME_MODE_PAUSED);
break;
}
case GAME_MODE_START_LEVEL:
{
game_load_map(yeti, maps[yeti->game.episode]);
game_goto(&yeti->game, GAME_MODE_PLAY);
break;
}
case GAME_MODE_PAUSED:
{
if (KEYPRESS_SELECT(yeti)) game_goto(&yeti->game, GAME_MODE_PLAY);
if (KEYPRESS_A (yeti))
{
switch (yeti->game.menu.paused)
{
case 0: game_goto(&yeti->game, GAME_MODE_PLAY ); break;
case 1: game_goto(&yeti->game, GAME_MODE_OPTIONS ); break;
case 2: game_goto(&yeti->game, GAME_MODE_LOADGAME); break;
case 3: game_goto(&yeti->game, GAME_MODE_QUITGAME); break;
}
}
if (KEYPRESS_B (yeti)) game_goback(&yeti->game);
game_menu(yeti, &yeti->game.menu.paused);
break;
}
case GAME_MODE_CREDITS:
{
game_cycle(&yeti->game, 2);
if (KEYPRESS_A (yeti)) game_goback(&yeti->game);
if (KEYPRESS_B (yeti)) game_goback(&yeti->game);
break;
}
case GAME_MODE_OPTIONS:
{
game_cycle(&yeti->game, 2);
if (KEYPRESS_A (yeti)) game_goback(&yeti->game);
if (KEYPRESS_B (yeti)) game_goback(&yeti->game);
game_menu(yeti, &yeti->game.menu.option);
break;
}
case GAME_MODE_LOADGAME:
{
game_cycle(&yeti->game, 2);
if (KEYPRESS_A (yeti)) game_goback(&yeti->game);
if (KEYPRESS_B (yeti)) game_goback(&yeti->game);
break;
}
case GAME_MODE_QUITGAME:
{
game_cycle(&yeti->game, 2);
if (KEYPRESS_A (yeti)) game_goback(&yeti->game);
if (KEYPRESS_B (yeti)) game_goback(&yeti->game);
break;
}
case GAME_MODE_ENDLEVEL:
{
pixel_buffer_clear(yeti->viewport.back);
yeti_tick(yeti);
if (KEYPRESS_A(yeti))
{
yeti->game.episode++;
if (yeti->game.episode > 11) yeti->game.episode = 0;
game_goto(&yeti->game, GAME_MODE_START_LEVEL);
}
break;
}
}
keyboard_tick(&yeti->keyboard);
}
/*
** Name: game_loop
** Desc: The generic game loop function. Only used by platforms that can run
** the engine at full speed.
*/
void game_loop(yeti_t* yeti)
{
game_tick(yeti);
game_draw(yeti);
}

68
src/game/game.h Normal file
View file

@ -0,0 +1,68 @@
/*
** Name: Yeti3D
** Desc: Portable GameBoy Advanced 3D Engine
** Auth: Derek J. Evans <derek@theteahouse.com.au>
**
** Copyright (C) 2003-2004 Derek J. Evans. All Rights Reserved.
**
** YY YY EEEEEE TTTTTT IIIIII 33333 DDDDD
** YY YY EE TT II 33 DD DD
** YYYY EEEE TT II 333 DD DD
** YY EE TT II 33 DD DD
** YY EEEEEE TT IIIIII 33333 DDDDD
*/
#ifndef __GAME_H__
#define __GAME_H__
/******************************************************************************/
#include "y3d/y3d_yeti.h"
/******************************************************************************/
#ifdef __cplusplus
extern "C"{
#endif
#define GAME_EPISODE_MAX 27
/******************************************************************************/
#define GAME_MODE_PUBLISHER 0
#define GAME_MODE_YETI3D 1
#define GAME_MODE_TITLE 2
#define GAME_MODE_MENU 3
#define GAME_MODE_PLAY 4
#define GAME_MODE_CREDITS 5
#define GAME_MODE_OPTIONS 6
#define GAME_MODE_SKILL 7
#define GAME_MODE_EPISODE 8
#define GAME_MODE_PAUSED 9
#define GAME_MODE_LOADGAME 10
#define GAME_MODE_QUITGAME 11
#define GAME_MODE_START_LEVEL 12
#define GAME_MODE_ENDGAME 13
#define GAME_MODE_ENDLEVEL 14
/******************************************************************************/
extern void game_init(yeti_t* yeti);
extern void game_draw(yeti_t* yeti);
extern void game_tick(yeti_t* yeti);
extern void game_loop(yeti_t* yeti);
extern void game_goto(game_t* game, int mode);
extern void game_load_map(yeti_t* yeti, rom_map_t* map);
extern void game_spawn_entities(yeti_t* yeti);
/******************************************************************************/
#ifdef __cplusplus
} // extern "C"
#endif
/******************************************************************************/
#endif

59
src/game/maps.c Normal file
View file

@ -0,0 +1,59 @@
/*
** Name: Yeti3D
** Desc: Portable GameBoy Advanced 3D Engine
** Auth: Derek J. Evans <derek@theteahouse.com.au>
**
** Copyright (C) 2003-2004 Derek J. Evans. All Rights Reserved.
**
** YY YY EEEEEE TTTTTT IIIIII 33333 DDDDD
** YY YY EE TT II 33 DD DD
** YYYY EEEE TT II 333 DD DD
** YY EE TT II 33 DD DD
** YY EEEEEE TT IIIIII 33333 DDDDD
*/
#include "maps.h"
/******************************************************************************/
#define YETI_ROM
#include "maps/e1m1.c"
#include "maps/e1m2.c"
#include "maps/e1m3.c"
#include "maps/e1m4.c"
#include "maps/e1m5.c"
#include "maps/e1m6.c"
#include "maps/e1m7.c"
#include "maps/e1m8.c"
#include "maps/e1m9.c"
#include "maps/e2m1.c"
#include "maps/e2m2.c"
#include "maps/e2m3.c"
#include "maps/e2m4.c"
#include "maps/e2m5.c"
#include "maps/e2m6.c"
#include "maps/e2m7.c"
#include "maps/e2m8.c"
#include "maps/e2m9.c"
#include "maps/e3m1.c"
#include "maps/e3m2.c"
#include "maps/e3m3.c"
#include "maps/e3m4.c"
#include "maps/e3m5.c"
#include "maps/e3m6.c"
#include "maps/e3m7.c"
#include "maps/e3m8.c"
#include "maps/e3m9.c"
rom_map_t* maps[] =
{
&map_e2m3,
&map_e1m9, &map_e2m1, &map_e1m8, &map_e1m7, &map_e1m6, &map_e1m5, &map_e1m2, &map_e1m3, &map_e1m4,
&map_e1m1, &map_e2m2, &map_e2m3, &map_e2m4, &map_e2m5, &map_e2m6, &map_e2m7, &map_e2m8, &map_e2m9,
&map_e3m1, &map_e3m2, &map_e3m3, &map_e3m4, &map_e3m5, &map_e3m6, &map_e3m7, &map_e3m8, &map_e3m9
};
/******************************************************************************/

59
src/game/maps.h Normal file
View file

@ -0,0 +1,59 @@
/*
** Name: Yeti3D
** Desc: Portable GameBoy Advanced 3D Engine
** Auth: Derek J. Evans <derek@theteahouse.com.au>
**
** Copyright (C) 2003-2004 Derek J. Evans. All Rights Reserved.
**
** YY YY EEEEEE TTTTTT IIIIII 33333 DDDDD
** YY YY EE TT II 33 DD DD
** YYYY EEEE TT II 333 DD DD
** YY EE TT II 33 DD DD
** YY EEEEEE TT IIIIII 33333 DDDDD
*/
#ifndef __MAPS_H__
#define __MAPS_H__
#include "y3d/y3d_yeti.h"
/******************************************************************************/
extern rom_map_t* maps[];
extern rom_map_t map_e1m1;
extern rom_map_t map_e1m2;
extern rom_map_t map_e1m3;
extern rom_map_t map_e1m4;
extern rom_map_t map_e1m5;
extern rom_map_t map_e1m6;
extern rom_map_t map_e1m7;
extern rom_map_t map_e1m8;
extern rom_map_t map_e1m9;
extern rom_map_t map_e2m1;
extern rom_map_t map_e2m2;
extern rom_map_t map_e2m3;
extern rom_map_t map_e2m4;
extern rom_map_t map_e2m5;
extern rom_map_t map_e2m6;
extern rom_map_t map_e2m7;
extern rom_map_t map_e2m8;
extern rom_map_t map_e2m9;
extern rom_map_t map_e3m1;
extern rom_map_t map_e3m2;
extern rom_map_t map_e3m3;
extern rom_map_t map_e3m4;
extern rom_map_t map_e3m5;
extern rom_map_t map_e3m6;
extern rom_map_t map_e3m7;
extern rom_map_t map_e3m8;
extern rom_map_t map_e3m9;
/******************************************************************************/
#endif

4227
src/game/maps/e1m1.c Normal file

File diff suppressed because it is too large Load diff

BIN
src/game/maps/e1m1.y3d Normal file

Binary file not shown.

4227
src/game/maps/e1m2.c Normal file

File diff suppressed because it is too large Load diff

BIN
src/game/maps/e1m2.y3d Normal file

Binary file not shown.

4227
src/game/maps/e1m3.c Normal file

File diff suppressed because it is too large Load diff

BIN
src/game/maps/e1m3.y3d Normal file

Binary file not shown.

4227
src/game/maps/e1m4.c Normal file

File diff suppressed because it is too large Load diff

BIN
src/game/maps/e1m4.y3d Normal file

Binary file not shown.

4227
src/game/maps/e1m5.c Normal file

File diff suppressed because it is too large Load diff

BIN
src/game/maps/e1m5.y3d Normal file

Binary file not shown.

4227
src/game/maps/e1m6.c Normal file

File diff suppressed because it is too large Load diff

BIN
src/game/maps/e1m6.y3d Normal file

Binary file not shown.

4227
src/game/maps/e1m7.c Normal file

File diff suppressed because it is too large Load diff

BIN
src/game/maps/e1m7.y3d Normal file

Binary file not shown.

4227
src/game/maps/e1m8.c Normal file

File diff suppressed because it is too large Load diff

BIN
src/game/maps/e1m8.y3d Normal file

Binary file not shown.

4227
src/game/maps/e1m9.c Normal file

File diff suppressed because it is too large Load diff

BIN
src/game/maps/e1m9.y3d Normal file

Binary file not shown.

4227
src/game/maps/e2m1.c Normal file

File diff suppressed because it is too large Load diff

BIN
src/game/maps/e2m1.y3d Normal file

Binary file not shown.

4227
src/game/maps/e2m2.c Normal file

File diff suppressed because it is too large Load diff

BIN
src/game/maps/e2m2.y3d Normal file

Binary file not shown.

4227
src/game/maps/e2m3.c Normal file

File diff suppressed because it is too large Load diff

BIN
src/game/maps/e2m3.y3d Normal file

Binary file not shown.

4227
src/game/maps/e2m4.c Normal file

File diff suppressed because it is too large Load diff

BIN
src/game/maps/e2m4.y3d Normal file

Binary file not shown.

4227
src/game/maps/e2m5.c Normal file

File diff suppressed because it is too large Load diff

BIN
src/game/maps/e2m5.y3d Normal file

Binary file not shown.

4227
src/game/maps/e2m6.c Normal file

File diff suppressed because it is too large Load diff

BIN
src/game/maps/e2m6.y3d Normal file

Binary file not shown.

4227
src/game/maps/e2m7.c Normal file

File diff suppressed because it is too large Load diff

BIN
src/game/maps/e2m7.y3d Normal file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show more