00001
00002
00003
00004
00005
00006
00007 #pragma warning( disable : 4311 4312 4133)
00008
00009 #define _WIN32_WINNT 0x0500
00010
00011 #include <stdlib.h>
00012 #include <stdio.h>
00013 #include <math.h>
00014 #include <setjmp.h>
00015 #include <windows.h>
00016 #include <commctrl.h>
00017
00018 #include "menuid.h"
00019 #include "strings.h"
00020 #include "astruct.h"
00021 #include "memory.h"
00022 #include "supercls.h"
00023
00024 #define RAD2DEG (180.0/PI)
00025 #define DEG2RAD (PI/180.0)
00026
00027 #define WM_DRAWROBOT (WM_USER+1000)
00028
00029 #define WINDOW_ID_XSIZE 48
00030 #define WINDOW_ID_YSIZE 20
00031 #define WINDOW_ID_VSIZE 60
00032
00033 #ifdef MODULE_ANIMATE
00034 char IniFilename[256],TempPath[256],
00035 IniSection[] = "APREFERENCES",
00036 IniRenderSection[] = "RPREFERENCES";
00037 char szMainClass[]="OFX:AnimatorClass",
00038 szViewClass[]="OFX:AnimatorViewClass",
00039 szTriViewClass[]="OFX:AnimatorTriViewClass",
00040 szToolboxClass[]="OFX:AnimatorToolboxClass",
00041 szToolBtnClass[]="OFX:AnimatorToolBtnClass",
00042 szQuicktimeClass[]="OFX:AnimatorQuicktimeClass";
00043 HDC ghdc_triview_Bitmap[3]={NULL,NULL,NULL},ghdc_view_Bitmap=NULL;
00044 HBITMAP ghbm_triview[3]={NULL,NULL,NULL},ghbm_view=NULL,
00045 ghCameraBitmap=NULL,ghLightBitmap=NULL;
00046 int EDIT_ACTION=NO,LOADOPERATION=NO,CursorToggle=0,current_message = -1,
00047 icon_arrow_ids=YES,do_NOT_abort=FALSE,EditUpdateInUse=FALSE,
00048 UNDO_ACTIVE=NO,UNDO_TYPE=0;
00049 char ruler_name[8];
00050 double ruler=(double)UNIT;
00051 long rulerx=0,rulery=0,rulerz=0,
00052 lrulerx=0,lrulery=0,lrulerz=0,
00053 draw_grid_on=0,grid_on=0,grid_size=UNIT;
00054 long NpointerX=0,NpointerY=0,NpointerZ=0;
00055 unsigned int FirstTimeRender=1,rendered_flag=0,fail_op=NO,
00056 tool=NOTOOL,subtool=NOTOOL,
00057 DrawStatus=0,AllDrawStatus=3,LastAnimatorTool=NOTOOL;
00058 long Nframes=1,CurrentFrame=1,
00059 global_quickdraw=1,preview_playing=NO,
00060 show_camera_fov=1,show_light_cones=1,opengl_visible=0,
00061 coords_visible=0,tools_visible=1,select_visible=0,
00062 keyframer_docked=1,keyframer_docked_and_visible=0,
00063 edit_splinetween=0,MaxNodeID=0,FramesPerSec=30,
00064 use_director=1;
00065 short APsliderH;
00066 double PIo180,
00067 SelectedPathPhi=0.0,
00068 SelectedPathTheta=0.0,
00069 SelectedPathAlpha=0.0;
00070 point SelectedPathOffset={0,0,0};
00071 node *MainNp=NULL,*FirstNp=NULL,
00072 *SelectedNode=NULL,*SelectedCamera=NULL;
00073 XIP *MainIp=NULL,*FirstIp=NULL;
00074 object *SelectedPath=NULL;
00075 pathpoint *SelectedPathPoint=NULL;
00076 short Nnodes=0,Nground=0,Ncameras=0,Nskys=0,Nrobots=0,
00077 fileID=0,ANIM=0,NimageProcesses=0;
00078 long Ndirectors=0;
00079 HBITMAP hbmName[6]={NULL,NULL,NULL,NULL,NULL,NULL};
00080 char res_str[256];
00081 #define WHERE
00082 #else
00083 extern char IniFilename[],TempPath[],
00084 IniSection[],
00085 IniRenderSection[];
00086 extern char szMainClass[],
00087 szViewClass[],
00088 szTriViewClass[],
00089 szToolboxClass[],
00090 szToolBtnClass[],
00091 szQuicktimeClass[];
00092 extern HDC ghdc_triview_Bitmap[],ghdc_view_Bitmap;
00093 extern HBITMAP ghbm_triview[],ghbm_view,ghCameraBitmap,ghLightBitmap;
00094 extern int EDIT_ACTION,LOADOPERATION,CursorToggle,current_message,
00095 icon_arrow_ids,do_NOT_abort,EditUpdateInUse,
00096 UNDO_ACTIVE,UNDO_TYPE;
00097 extern char ruler_name[];
00098 extern double ruler;
00099 extern long rulerx,rulery,rulerz,
00100 lrulerx,lrulery,lrulerz,
00101 draw_grid_on,grid_on,grid_size;
00102 extern long NpointerX,NpointerY,NpointerZ,
00103 TVpointX,TVpointY,TVpointZ,
00104 TVsizeX,TVsizeY,TVsizeZ,
00105 Nframes,CurrentFrame,
00106 global_quickdraw,preview_playing,
00107 show_camera_fov,show_light_cones,opengl_visible,
00108 coords_visible,tools_visible,select_visible,
00109 keyframer_docked,keyframer_docked_and_visible,
00110 edit_splinetween,MaxNodeID,FramesPerSec,
00111 use_director;
00112 extern unsigned int FirstTimeRender,rendered_flag,fail_op,
00113 tool,subtool,DrawStatus,AllDrawStatus,LastAnimatorTool;
00114 extern double PIo180,
00115 SelectedPathPhi,
00116 SelectedPathTheta,
00117 SelectedPathAlpha;
00118 extern point SelectedPathOffset;
00119 extern node *MainNp,*FirstNp,*SelectedNode,*SelectedCamera;
00120 extern XIP *MainIp,*FirstIp;
00121 extern object *SelectedPath;
00122 extern pathpoint *SelectedPathPoint;
00123 extern short Nnodes,Nground,Nrobots,
00124 Nskys,Ncameras,fileID,ANIM,NimageProcesses;
00125 extern long Ndirectors;
00126 extern HBITMAP hbmName[];
00127 extern char res_str[];
00128 #define WHERE extern
00129 #endif
00130 WHERE FILE *debug;
00131 WHERE ANI_STRUCTURE AniStructure;
00132 WHERE X__MEMORY_MANAGER EviMemoryManager;
00133 WHERE jmp_buf r_buf;
00134 WHERE int stackdepth;
00135 WHERE HMODULE hLibSpin;
00136 WHERE HWND ghwnd_main,ghwnd_triview[3],ghwnd_current,
00137 ghwnd_view,ghwnd_xscl,ghwnd_info,ghwndTools,
00138 ghwndCoord1,
00139 ghwndTimeline,ghwndTimelineChild,ghwndDlgTools,
00140 ghwndQuicktime,ghwndOpenGLview,ghwndTooltip,
00141 ghwndSkEdit,ghwndRobotView;
00142 WHERE HPALETTE ghpaletteScreen;
00143 WHERE HFONT ghFont1,ghFont2;
00144 WHERE HBRUSH ghbrushScreen,ghbrushWindow,
00145 ghSelectedBrush,ghDeselectedBrush,ghInvertBrush,
00146 ghRobotBrush;
00147 WHERE HPEN ghSelectedPen,ghDeselectedPen,ghEditPen,
00148 ghInvertPen,ghWireframePen,ghCursorPen,
00149 ghDotSelectedPen,ghDotDeselectedPen,ghDotInvertPen;
00150 WHERE COLORREF gScreenColourRef,gGridColourRef1,gGridColourRef2;
00151 WHERE HINSTANCE ghinst_main;
00152 WHERE BOOL StartedInAnimator,bToolpannelLeft,bToolpannelSmall,
00153 bBackgroundImage,bAbortedDrawing,bEmbedImageMaps;
00154 WHERE BOOL tool_move_flag,tool_down_flag;
00155 WHERE long Xres,Yres;
00156 WHERE long WindowBox_view;
00157 WHERE int View,ActiveView,BigCameraView,
00158 ToolbuttonSize,ToolpannelSpace,
00159 WindowLeftOrigin,WindowTopOrigin,
00160 WindowGap,
00161 TriviewSpaceX,TriviewSpaceY,
00162 Window0sizeX,Window0sizeY,
00163 Textheight,Textwidth,
00164 WindowSizeX[3],WindowSizeY[3],
00165 WindowCentreX[3],WindowCentreY[3],
00166 WindowViewXsize,WindowViewYsize,
00167 InfoWindowSize,KeyframerSize,KeyframerYpos,
00168 WindowsXmin[3],WindowsYmin[3],
00169 WindowViewXmin,WindowViewYmin,
00170 WindowViewSliderXsize,WindowViewSliderYsize,
00171 WindowViewSliderXpos,WindowViewSliderYpos,
00172 SelectPointSize;
00173 WHERE double WindowPixelSize;
00174 WHERE long TVpointX,TVpointY,TVpointZ,
00175 TVcentreX,TVcentreY,TVcentreZ,
00176 TVsizeX,TVsizeY,TVsizeZ;
00177 WHERE jmp_buf j_buf;
00178 WHERE HCURSOR ghcurWait,ghcurCross,ghcurX,
00179 ghcurPan,ghcurZout,ghcurZin,ghcurZoom,
00180 ghcurArrow,ghcurArrow1,
00181 ghcurMove,ghcurRotate,ghcurScale,
00182 ghcurTracker,ghcurDirector,
00183 ghcurPathed,ghcurSkeletor,
00184 ghcurSave,ghcurInsert,
00185 ghcurTools[NTOOLS];
00186 WHERE char gszHomeDir[MAX_DIR],gszUndoFile[MAX_FILE];
00187 WHERE char gszSTGfile[MAX_FILE],gszSTGdir[MAX_DIR];
00188 WHERE char gszSCEfile[MAX_FILE],gszSCEdir[MAX_DIR];
00189 WHERE char gszPTHfile[MAX_FILE],gszPTHdir[MAX_DIR];
00190 WHERE char gszSCRfile[MAX_FILE],gszSCRdir[MAX_DIR];
00191 WHERE char gszIMGfile[MAX_FILE],gszIMGdir[MAX_DIR];
00192 WHERE char gszMAPfile[MAX_FILE],gszMAPdir[MAX_DIR];
00193 WHERE char gszDLLfile[MAX_FILE],gszDLLdir[MAX_DIR];
00194 WHERE char gszXIPfile[MAX_FILE],gszXIPdir[MAX_DIR];
00195 WHERE char gszANIfile[MAX_FILE],gszANIdir[MAX_DIR];
00196 WHERE char gszPSTfile[MAX_FILE],gszPSTdir[MAX_DIR];
00197 WHERE char gszPZEfile[MAX_FILE],gszPZEdir[MAX_DIR];
00198 WHERE char gszPAKfile[MAX_FILE],gszPAKdir[MAX_DIR];
00199 WHERE char gszRSQfile[MAX_FILE],gszRSQdir[MAX_DIR];
00200 WHERE int gCurTool,gCurCommand,gCurSelect;
00201 WHERE TOOLFLAGS gToolFlags;
00202 WHERE PREFERENCES Preferences;
00203 #undef WHERE
00204
00205 #include "protos.h"
00206 #include "lists.h"