forked from KolibriOS/kolibrios
tinygl: add some double functions, add bcc32 example
libimg: small optimize git-svn-id: svn://kolibrios.org@8408 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
eac740c648
commit
9a54fc6aed
19
programs/bcc32/examples/tinygl_1/Makefile
Normal file
19
programs/bcc32/examples/tinygl_1/Makefile
Normal file
@ -0,0 +1,19 @@
|
||||
# Path to /programs
|
||||
SVN_PROGR:=../../..
|
||||
|
||||
# Path to /programs/bcc32
|
||||
SVN_BCC32:=$(SVN_PROGR)/bcc32
|
||||
|
||||
# Path to t2fasm
|
||||
T2FASM:=$(SVN_BCC32)/t2fasm
|
||||
|
||||
# Path to include
|
||||
INCLUDE:=$(SVN_BCC32)/include
|
||||
|
||||
# Path to Bin folder
|
||||
KOS32_BCC:=/home/autobuild/borlandcpp/bin
|
||||
|
||||
# Filename without .cpp
|
||||
FILENAME:=tinygl_1
|
||||
|
||||
include $(SVN_BCC32)/Makefile_app
|
92
programs/bcc32/examples/tinygl_1/tinygl_1.cpp
Normal file
92
programs/bcc32/examples/tinygl_1/tinygl_1.cpp
Normal file
@ -0,0 +1,92 @@
|
||||
#include <kolibri.h>
|
||||
#include <kos_heap.h>
|
||||
#include <load_lib.h>
|
||||
#include <l_tinygl.h>
|
||||
|
||||
using namespace Kolibri;
|
||||
|
||||
const char header[] = "Test tinygl library, [<-] and [->] - rotate";
|
||||
char library_path[2048];
|
||||
|
||||
namespace Kolibri{
|
||||
char CurrentDirectoryPath[2048];
|
||||
}
|
||||
|
||||
TinyGLContext ctx1;
|
||||
float angle_z = 0.0, delt_size = 3.0;
|
||||
|
||||
void draw_3d()
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT); //очистим буфер цвета и глубины
|
||||
|
||||
glPushMatrix();
|
||||
glRotatef(angle_z,0.0,0.0,1.0);
|
||||
|
||||
glColor3f(1.0, 0.0, 0.0);
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor3f(0.0, 0.0, 1.0);
|
||||
glVertex3f(0.0, 0.5, 0.1);
|
||||
glVertex3f(0.475, 0.823, 0.1);
|
||||
glVertex3f(0.433, 0.25, 0.1);
|
||||
|
||||
glColor3f(0.0, 1.0, 0.0);
|
||||
glVertex3f(0.5, 0.0, 0.1);
|
||||
glVertex3f(0.823,-0.475, 0.1);
|
||||
glVertex3f(0.25, -0.433, 0.1);
|
||||
|
||||
glColor3f(1.0, 0.0, 0.0);
|
||||
glVertex3f(0.0, -0.5, 0.1);
|
||||
glVertex3f(-0.475,-0.823,0.1);
|
||||
glVertex3f(-0.433,-0.25, 0.1);
|
||||
|
||||
glVertex3f(-0.5, 0.0, 0.1);
|
||||
glColor3f(1.0, 1.0, 0.0);
|
||||
glVertex3f(-0.823, 0.475, 0.1);
|
||||
glColor3f(1.0, 1.0, 1.0);
|
||||
glVertex3f(-0.25, 0.433, 0.1);
|
||||
glEnd();
|
||||
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
bool KolibriOnStart(TStartData &kos_start, TThreadData /*th*/)
|
||||
{
|
||||
kos_start.Left = 10;
|
||||
kos_start.Top = 40;
|
||||
kos_start.Width = 330;
|
||||
kos_start.Height = 275;
|
||||
kos_start.WinData.WindowColor = 0xd0d0d0;
|
||||
kos_start.WinData.WindowType = 0x33; // 0x34 - fixed, 0x33 - not fixed
|
||||
kos_start.WinData.Title = header;
|
||||
if(LoadLibrary("tinygl.obj", library_path, "/sys/lib/tinygl.obj", &import_tinygl))
|
||||
{
|
||||
kosglMakeCurrent(0,0,kos_start.Width,kos_start.Height,&ctx1);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glClearColor(0.2,0.0,0.2,0.0);
|
||||
draw_3d();
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
|
||||
void KolibriOnPaint(void)
|
||||
{
|
||||
kosglSwapBuffers();
|
||||
}
|
||||
|
||||
void KolibriOnKeyPress(TThreadData /*th*/)
|
||||
{
|
||||
long key = GetKey();
|
||||
switch(key){
|
||||
case 176: //Left
|
||||
angle_z+=delt_size;
|
||||
draw_3d();
|
||||
kosglSwapBuffers();
|
||||
break;
|
||||
case 179: //Right
|
||||
angle_z-=delt_size;
|
||||
draw_3d();
|
||||
kosglSwapBuffers();
|
||||
//break;
|
||||
};
|
||||
}
|
15
programs/bcc32/examples/tinygl_1/tinygl_1_cpp.bat
Normal file
15
programs/bcc32/examples/tinygl_1/tinygl_1_cpp.bat
Normal file
@ -0,0 +1,15 @@
|
||||
Set NAME=tinygl_1
|
||||
Set BCC_DIR=..\..\..\bcc32
|
||||
kos32-bcc -S -v- -R- -6 -a4 -O2 -Og -Oi -Ov -OS -k- -D__KOLIBRI__ -I..\..\..\bcc32\include %NAME%.cpp
|
||||
|
||||
echo STACKSIZE equ 8192> kos_make.inc
|
||||
echo include "%BCC_DIR%\include\kos_start.inc">> kos_make.inc
|
||||
echo include "%BCC_DIR%\include\kos_func.inc">> kos_make.inc
|
||||
echo include "%BCC_DIR%\include\kos_heap.inc">> kos_make.inc
|
||||
|
||||
echo include "kos_make.inc" > f_%NAME%.asm
|
||||
t2fasm < %NAME%.asm >> f_%NAME%.asm
|
||||
fasm f_%NAME%.asm %NAME%.kex
|
||||
if exist %NAME%.kex kpack %NAME%.kex
|
||||
if exist %NAME%.kex del kos_make.inc
|
||||
pause
|
804
programs/bcc32/include/l_tinygl.h
Normal file
804
programs/bcc32/include/l_tinygl.h
Normal file
@ -0,0 +1,804 @@
|
||||
#ifndef __L_TINYGL_H_INCLUDED_
|
||||
#define __L_TINYGL_H_INCLUDED_
|
||||
//
|
||||
// tinygl.obj
|
||||
//
|
||||
|
||||
enum {
|
||||
/* Boolean values */
|
||||
GL_FALSE = 0,
|
||||
GL_TRUE = 1,
|
||||
|
||||
/* Data types */
|
||||
GL_BYTE = 0x1400,
|
||||
GL_UNSIGNED_BYTE = 0x1401,
|
||||
GL_SHORT = 0x1402,
|
||||
GL_UNSIGNED_SHORT = 0x1403,
|
||||
GL_INT = 0x1404,
|
||||
GL_UNSIGNED_INT = 0x1405,
|
||||
GL_FLOAT = 0x1406,
|
||||
GL_DOUBLE = 0x140A,
|
||||
GL_2_BYTES = 0x1407,
|
||||
GL_3_BYTES = 0x1408,
|
||||
GL_4_BYTES = 0x1409,
|
||||
|
||||
/* Primitives */
|
||||
GL_LINES = 0x0001,
|
||||
GL_POINTS = 0x0000,
|
||||
GL_LINE_STRIP = 0x0003,
|
||||
GL_LINE_LOOP = 0x0002,
|
||||
GL_TRIANGLES = 0x0004,
|
||||
GL_TRIANGLE_STRIP = 0x0005,
|
||||
GL_TRIANGLE_FAN = 0x0006,
|
||||
GL_QUADS = 0x0007,
|
||||
GL_QUAD_STRIP = 0x0008,
|
||||
GL_POLYGON = 0x0009,
|
||||
GL_EDGE_FLAG = 0x0B43,
|
||||
|
||||
/* Vertex Arrays */
|
||||
GL_VERTEX_ARRAY = 0x8074,
|
||||
GL_NORMAL_ARRAY = 0x8075,
|
||||
GL_COLOR_ARRAY = 0x8076,
|
||||
GL_INDEX_ARRAY = 0x8077,
|
||||
GL_TEXTURE_COORD_ARRAY = 0x8078,
|
||||
GL_EDGE_FLAG_ARRAY = 0x8079,
|
||||
GL_VERTEX_ARRAY_SIZE = 0x807A,
|
||||
GL_VERTEX_ARRAY_TYPE = 0x807B,
|
||||
GL_VERTEX_ARRAY_STRIDE = 0x807C,
|
||||
GL_VERTEX_ARRAY_COUNT = 0x807D,
|
||||
GL_NORMAL_ARRAY_TYPE = 0x807E,
|
||||
GL_NORMAL_ARRAY_STRIDE = 0x807F,
|
||||
GL_NORMAL_ARRAY_COUNT = 0x8080,
|
||||
GL_COLOR_ARRAY_SIZE = 0x8081,
|
||||
GL_COLOR_ARRAY_TYPE = 0x8082,
|
||||
GL_COLOR_ARRAY_STRIDE = 0x8083,
|
||||
GL_COLOR_ARRAY_COUNT = 0x8084,
|
||||
GL_INDEX_ARRAY_TYPE = 0x8085,
|
||||
GL_INDEX_ARRAY_STRIDE = 0x8086,
|
||||
GL_INDEX_ARRAY_COUNT = 0x8087,
|
||||
GL_TEXTURE_COORD_ARRAY_SIZE = 0x8088,
|
||||
GL_TEXTURE_COORD_ARRAY_TYPE = 0x8089,
|
||||
GL_TEXTURE_COORD_ARRAY_STRIDE = 0x808A,
|
||||
GL_TEXTURE_COORD_ARRAY_COUNT = 0x808B,
|
||||
GL_EDGE_FLAG_ARRAY_STRIDE = 0x808C,
|
||||
GL_EDGE_FLAG_ARRAY_COUNT = 0x808D,
|
||||
GL_VERTEX_ARRAY_POINTER = 0x808E,
|
||||
GL_NORMAL_ARRAY_POINTER = 0x808F,
|
||||
GL_COLOR_ARRAY_POINTER = 0x8090,
|
||||
GL_INDEX_ARRAY_POINTER = 0x8091,
|
||||
GL_TEXTURE_COORD_ARRAY_POINTER = 0x8092,
|
||||
GL_EDGE_FLAG_ARRAY_POINTER = 0x8093,
|
||||
GL_V2F = 0x2A20,
|
||||
GL_V3F = 0x2A21,
|
||||
GL_C4UB_V2F = 0x2A22,
|
||||
GL_C4UB_V3F = 0x2A23,
|
||||
GL_C3F_V3F = 0x2A24,
|
||||
GL_N3F_V3F = 0x2A25,
|
||||
GL_C4F_N3F_V3F = 0x2A26,
|
||||
GL_T2F_V3F = 0x2A27,
|
||||
GL_T4F_V4F = 0x2A28,
|
||||
GL_T2F_C4UB_V3F = 0x2A29,
|
||||
GL_T2F_C3F_V3F = 0x2A2A,
|
||||
GL_T2F_N3F_V3F = 0x2A2B,
|
||||
GL_T2F_C4F_N3F_V3F = 0x2A2C,
|
||||
GL_T4F_C4F_N3F_V4F = 0x2A2D,
|
||||
|
||||
/* Matrix Mode */
|
||||
GL_MATRIX_MODE = 0x0BA0,
|
||||
GL_MODELVIEW = 0x1700,
|
||||
GL_PROJECTION = 0x1701,
|
||||
GL_TEXTURE = 0x1702,
|
||||
|
||||
/* Points */
|
||||
GL_POINT_SMOOTH = 0x0B10,
|
||||
GL_POINT_SIZE = 0x0B11,
|
||||
GL_POINT_SIZE_GRANULARITY = 0x0B13,
|
||||
GL_POINT_SIZE_RANGE = 0x0B12,
|
||||
|
||||
/* Lines */
|
||||
GL_LINE_SMOOTH = 0x0B20,
|
||||
GL_LINE_STIPPLE = 0x0B24,
|
||||
GL_LINE_STIPPLE_PATTERN = 0x0B25,
|
||||
GL_LINE_STIPPLE_REPEAT = 0x0B26,
|
||||
GL_LINE_WIDTH = 0x0B21,
|
||||
GL_LINE_WIDTH_GRANULARITY = 0x0B23,
|
||||
GL_LINE_WIDTH_RANGE = 0x0B22,
|
||||
|
||||
/* Polygons */
|
||||
GL_POINT = 0x1B00,
|
||||
GL_LINE = 0x1B01,
|
||||
GL_FILL = 0x1B02,
|
||||
GL_CCW = 0x0901,
|
||||
GL_CW = 0x0900,
|
||||
GL_FRONT = 0x0404,
|
||||
GL_BACK = 0x0405,
|
||||
GL_CULL_FACE = 0x0B44,
|
||||
GL_CULL_FACE_MODE = 0x0B45,
|
||||
GL_POLYGON_SMOOTH = 0x0B41,
|
||||
GL_POLYGON_STIPPLE = 0x0B42,
|
||||
GL_FRONT_FACE = 0x0B46,
|
||||
GL_POLYGON_MODE = 0x0B40,
|
||||
GL_POLYGON_OFFSET_FACTOR = 0x3038,
|
||||
GL_POLYGON_OFFSET_UNITS = 0x2A00,
|
||||
GL_POLYGON_OFFSET_POINT = 0x2A01,
|
||||
GL_POLYGON_OFFSET_LINE = 0x2A02,
|
||||
GL_POLYGON_OFFSET_FILL = 0x8037,
|
||||
|
||||
/* Display Lists */
|
||||
GL_COMPILE = 0x1300,
|
||||
GL_COMPILE_AND_EXECUTE = 0x1301,
|
||||
GL_LIST_BASE = 0x0B32,
|
||||
GL_LIST_INDEX = 0x0B33,
|
||||
GL_LIST_MODE = 0x0B30,
|
||||
|
||||
/* Depth buffer */
|
||||
GL_NEVER = 0x0200,
|
||||
GL_LESS = 0x0201,
|
||||
GL_GEQUAL = 0x0206,
|
||||
GL_LEQUAL = 0x0203,
|
||||
GL_GREATER = 0x0204,
|
||||
GL_NOTEQUAL = 0x0205,
|
||||
GL_EQUAL = 0x0202,
|
||||
GL_ALWAYS = 0x0207,
|
||||
GL_DEPTH_TEST = 0x0B71,
|
||||
GL_DEPTH_BITS = 0x0D56,
|
||||
GL_DEPTH_CLEAR_VALUE = 0x0B73,
|
||||
GL_DEPTH_FUNC = 0x0B74,
|
||||
GL_DEPTH_RANGE = 0x0B70,
|
||||
GL_DEPTH_WRITEMASK = 0x0B72,
|
||||
GL_DEPTH_COMPONENT = 0x1902,
|
||||
|
||||
/* Lighting */
|
||||
GL_LIGHTING = 0x0B50,
|
||||
GL_LIGHT0 = 0x4000,
|
||||
GL_LIGHT1 = 0x4001,
|
||||
GL_LIGHT2 = 0x4002,
|
||||
GL_LIGHT3 = 0x4003,
|
||||
GL_LIGHT4 = 0x4004,
|
||||
GL_LIGHT5 = 0x4005,
|
||||
GL_LIGHT6 = 0x4006,
|
||||
GL_LIGHT7 = 0x4007,
|
||||
GL_SPOT_EXPONENT = 0x1205,
|
||||
GL_SPOT_CUTOFF = 0x1206,
|
||||
GL_CONSTANT_ATTENUATION = 0x1207,
|
||||
GL_LINEAR_ATTENUATION = 0x1208,
|
||||
GL_QUADRATIC_ATTENUATION = 0x1209,
|
||||
GL_AMBIENT = 0x1200,
|
||||
GL_DIFFUSE = 0x1201,
|
||||
GL_SPECULAR = 0x1202,
|
||||
GL_SHININESS = 0x1601,
|
||||
GL_EMISSION = 0x1600,
|
||||
GL_POSITION = 0x1203,
|
||||
GL_SPOT_DIRECTION = 0x1204,
|
||||
GL_AMBIENT_AND_DIFFUSE = 0x1602,
|
||||
GL_COLOR_INDEXES = 0x1603,
|
||||
GL_LIGHT_MODEL_TWO_SIDE = 0x0B52,
|
||||
GL_LIGHT_MODEL_LOCAL_VIEWER = 0x0B51,
|
||||
GL_LIGHT_MODEL_AMBIENT = 0x0B53,
|
||||
GL_FRONT_AND_BACK = 0x0408,
|
||||
GL_SHADE_MODEL = 0x0B54,
|
||||
GL_FLAT = 0x1D00,
|
||||
GL_SMOOTH = 0x1D01,
|
||||
GL_COLOR_MATERIAL = 0x0B57,
|
||||
GL_COLOR_MATERIAL_FACE = 0x0B55,
|
||||
GL_COLOR_MATERIAL_PARAMETER = 0x0B56,
|
||||
GL_NORMALIZE = 0x0BA1,
|
||||
|
||||
/* User clipping planes */
|
||||
GL_CLIP_PLANE0 = 0x3000,
|
||||
GL_CLIP_PLANE1 = 0x3001,
|
||||
GL_CLIP_PLANE2 = 0x3002,
|
||||
GL_CLIP_PLANE3 = 0x3003,
|
||||
GL_CLIP_PLANE4 = 0x3004,
|
||||
GL_CLIP_PLANE5 = 0x3005,
|
||||
|
||||
/* Accumulation buffer */
|
||||
GL_ACCUM_RED_BITS = 0x0D58,
|
||||
GL_ACCUM_GREEN_BITS = 0x0D59,
|
||||
GL_ACCUM_BLUE_BITS = 0x0D5A,
|
||||
GL_ACCUM_ALPHA_BITS = 0x0D5B,
|
||||
GL_ACCUM_CLEAR_VALUE = 0x0B80,
|
||||
GL_ACCUM = 0x0100,
|
||||
GL_ADD = 0x0104,
|
||||
GL_LOAD = 0x0101,
|
||||
GL_MULT = 0x0103,
|
||||
GL_RETURN = 0x0102,
|
||||
|
||||
/* Alpha testing */
|
||||
GL_ALPHA_TEST = 0x0BC0,
|
||||
GL_ALPHA_TEST_REF = 0x0BC2,
|
||||
GL_ALPHA_TEST_FUNC = 0x0BC1,
|
||||
|
||||
/* Blending */
|
||||
GL_BLEND = 0x0BE2,
|
||||
GL_BLEND_SRC = 0x0BE1,
|
||||
GL_BLEND_DST = 0x0BE0,
|
||||
GL_ZERO = 0,
|
||||
GL_ONE = 1,
|
||||
GL_SRC_COLOR = 0x0300,
|
||||
GL_ONE_MINUS_SRC_COLOR = 0x0301,
|
||||
GL_DST_COLOR = 0x0306,
|
||||
GL_ONE_MINUS_DST_COLOR = 0x0307,
|
||||
GL_SRC_ALPHA = 0x0302,
|
||||
GL_ONE_MINUS_SRC_ALPHA = 0x0303,
|
||||
GL_DST_ALPHA = 0x0304,
|
||||
GL_ONE_MINUS_DST_ALPHA = 0x0305,
|
||||
GL_SRC_ALPHA_SATURATE = 0x0308,
|
||||
GL_CONSTANT_COLOR = 0x8001,
|
||||
GL_ONE_MINUS_CONSTANT_COLOR = 0x8002,
|
||||
GL_CONSTANT_ALPHA = 0x8003,
|
||||
GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004,
|
||||
|
||||
/* Render Mode */
|
||||
GL_FEEDBACK = 0x1C01,
|
||||
GL_RENDER = 0x1C00,
|
||||
GL_SELECT = 0x1C02,
|
||||
|
||||
/* Feedback */
|
||||
GL_2D = 0x0600,
|
||||
GL_3D = 0x0601,
|
||||
GL_3D_COLOR = 0x0602,
|
||||
GL_3D_COLOR_TEXTURE = 0x0603,
|
||||
GL_4D_COLOR_TEXTURE = 0x0604,
|
||||
GL_POINT_TOKEN = 0x0701,
|
||||
GL_LINE_TOKEN = 0x0702,
|
||||
GL_LINE_RESET_TOKEN = 0x0707,
|
||||
GL_POLYGON_TOKEN = 0x0703,
|
||||
GL_BITMAP_TOKEN = 0x0704,
|
||||
GL_DRAW_PIXEL_TOKEN = 0x0705,
|
||||
GL_COPY_PIXEL_TOKEN = 0x0706,
|
||||
GL_PASS_THROUGH_TOKEN = 0x0700,
|
||||
|
||||
/* Fog */
|
||||
GL_FOG = 0x0B60,
|
||||
GL_FOG_MODE = 0x0B65,
|
||||
GL_FOG_DENSITY = 0x0B62,
|
||||
GL_FOG_COLOR = 0x0B66,
|
||||
GL_FOG_INDEX = 0x0B61,
|
||||
GL_FOG_START = 0x0B63,
|
||||
GL_FOG_END = 0x0B64,
|
||||
GL_LINEAR = 0x2601,
|
||||
GL_EXP = 0x0800,
|
||||
GL_EXP2 = 0x0801,
|
||||
|
||||
/* Logic Ops */
|
||||
GL_LOGIC_OP = 0x0BF1,
|
||||
GL_LOGIC_OP_MODE = 0x0BF0,
|
||||
GL_CLEAR = 0x1500,
|
||||
GL_SET = 0x150F,
|
||||
GL_COPY = 0x1503,
|
||||
GL_COPY_INVERTED = 0x150C,
|
||||
GL_NOOP = 0x1505,
|
||||
GL_INVERT = 0x150A,
|
||||
GL_AND = 0x1501,
|
||||
GL_NAND = 0x150E,
|
||||
GL_OR = 0x1507,
|
||||
GL_NOR = 0x1508,
|
||||
GL_XOR = 0x1506,
|
||||
GL_EQUIV = 0x1509,
|
||||
GL_AND_REVERSE = 0x1502,
|
||||
GL_AND_INVERTED = 0x1504,
|
||||
GL_OR_REVERSE = 0x150B,
|
||||
GL_OR_INVERTED = 0x150D,
|
||||
|
||||
/* Stencil */
|
||||
GL_STENCIL_TEST = 0x0B90,
|
||||
GL_STENCIL_WRITEMASK = 0x0B98,
|
||||
GL_STENCIL_BITS = 0x0D57,
|
||||
GL_STENCIL_FUNC = 0x0B92,
|
||||
GL_STENCIL_VALUE_MASK = 0x0B93,
|
||||
GL_STENCIL_REF = 0x0B97,
|
||||
GL_STENCIL_FAIL = 0x0B94,
|
||||
GL_STENCIL_PASS_DEPTH_PASS = 0x0B96,
|
||||
GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95,
|
||||
GL_STENCIL_CLEAR_VALUE = 0x0B91,
|
||||
GL_STENCIL_INDEX = 0x1901,
|
||||
GL_KEEP = 0x1E00,
|
||||
GL_REPLACE = 0x1E01,
|
||||
GL_INCR = 0x1E02,
|
||||
GL_DECR = 0x1E03,
|
||||
|
||||
/* Buffers, Pixel Drawing/Reading */
|
||||
GL_NONE = 0,
|
||||
GL_LEFT = 0x0406,
|
||||
GL_RIGHT = 0x0407,
|
||||
/*GL_FRONT = 0x0404, */
|
||||
/*GL_BACK = 0x0405, */
|
||||
/*GL_FRONT_AND_BACK = 0x0408, */
|
||||
GL_FRONT_LEFT = 0x0400,
|
||||
GL_FRONT_RIGHT = 0x0401,
|
||||
GL_BACK_LEFT = 0x0402,
|
||||
GL_BACK_RIGHT = 0x0403,
|
||||
GL_AUX0 = 0x0409,
|
||||
GL_AUX1 = 0x040A,
|
||||
GL_AUX2 = 0x040B,
|
||||
GL_AUX3 = 0x040C,
|
||||
GL_COLOR_INDEX = 0x1900,
|
||||
GL_RED = 0x1903,
|
||||
GL_GREEN = 0x1904,
|
||||
GL_BLUE = 0x1905,
|
||||
GL_ALPHA = 0x1906,
|
||||
GL_LUMINANCE = 0x1909,
|
||||
GL_LUMINANCE_ALPHA = 0x190A,
|
||||
GL_ALPHA_BITS = 0x0D55,
|
||||
GL_RED_BITS = 0x0D52,
|
||||
GL_GREEN_BITS = 0x0D53,
|
||||
GL_BLUE_BITS = 0x0D54,
|
||||
GL_INDEX_BITS = 0x0D51,
|
||||
GL_SUBPIXEL_BITS = 0x0D50,
|
||||
GL_AUX_BUFFERS = 0x0C00,
|
||||
GL_READ_BUFFER = 0x0C02,
|
||||
GL_DRAW_BUFFER = 0x0C01,
|
||||
GL_DOUBLEBUFFER = 0x0C32,
|
||||
GL_STEREO = 0x0C33,
|
||||
GL_BITMAP = 0x1A00,
|
||||
GL_COLOR = 0x1800,
|
||||
GL_DEPTH = 0x1801,
|
||||
GL_STENCIL = 0x1802,
|
||||
GL_DITHER = 0x0BD0,
|
||||
GL_RGB = 0x1907,
|
||||
GL_RGBA = 0x1908,
|
||||
|
||||
/* Implementation limits */
|
||||
GL_MAX_LIST_NESTING = 0x0B31,
|
||||
GL_MAX_ATTRIB_STACK_DEPTH = 0x0D35,
|
||||
GL_MAX_MODELVIEW_STACK_DEPTH = 0x0D36,
|
||||
GL_MAX_NAME_STACK_DEPTH = 0x0D37,
|
||||
GL_MAX_PROJECTION_STACK_DEPTH = 0x0D38,
|
||||
GL_MAX_TEXTURE_STACK_DEPTH = 0x0D39,
|
||||
GL_MAX_EVAL_ORDER = 0x0D30,
|
||||
GL_MAX_LIGHTS = 0x0D31,
|
||||
GL_MAX_CLIP_PLANES = 0x0D32,
|
||||
GL_MAX_TEXTURE_SIZE = 0x0D33,
|
||||
GL_MAX_PIXEL_MAP_TABLE = 0x0D34,
|
||||
GL_MAX_VIEWPORT_DIMS = 0x0D3A,
|
||||
GL_MAX_CLIENT_ATTRIB_STACK_DEPTH= 0x0D3B,
|
||||
|
||||
/* Gets */
|
||||
GL_ATTRIB_STACK_DEPTH = 0x0BB0,
|
||||
GL_COLOR_CLEAR_VALUE = 0x0C22,
|
||||
GL_COLOR_WRITEMASK = 0x0C23,
|
||||
GL_CURRENT_INDEX = 0x0B01,
|
||||
GL_CURRENT_COLOR = 0x0B00,
|
||||
GL_CURRENT_NORMAL = 0x0B02,
|
||||
GL_CURRENT_RASTER_COLOR = 0x0B04,
|
||||
GL_CURRENT_RASTER_DISTANCE = 0x0B09,
|
||||
GL_CURRENT_RASTER_INDEX = 0x0B05,
|
||||
GL_CURRENT_RASTER_POSITION = 0x0B07,
|
||||
GL_CURRENT_RASTER_TEXTURE_COORDS = 0x0B06,
|
||||
GL_CURRENT_RASTER_POSITION_VALID = 0x0B08,
|
||||
GL_CURRENT_TEXTURE_COORDS = 0x0B03,
|
||||
GL_INDEX_CLEAR_VALUE = 0x0C20,
|
||||
GL_INDEX_MODE = 0x0C30,
|
||||
GL_INDEX_WRITEMASK = 0x0C21,
|
||||
GL_MODELVIEW_MATRIX = 0x0BA6,
|
||||
GL_MODELVIEW_STACK_DEPTH = 0x0BA3,
|
||||
GL_NAME_STACK_DEPTH = 0x0D70,
|
||||
GL_PROJECTION_MATRIX = 0x0BA7,
|
||||
GL_PROJECTION_STACK_DEPTH = 0x0BA4,
|
||||
GL_RENDER_MODE = 0x0C40,
|
||||
GL_RGBA_MODE = 0x0C31,
|
||||
GL_TEXTURE_MATRIX = 0x0BA8,
|
||||
GL_TEXTURE_STACK_DEPTH = 0x0BA5,
|
||||
GL_VIEWPORT = 0x0BA2,
|
||||
|
||||
|
||||
/* Evaluators */
|
||||
GL_AUTO_NORMAL = 0x0D80,
|
||||
GL_MAP1_COLOR_4 = 0x0D90,
|
||||
GL_MAP1_GRID_DOMAIN = 0x0DD0,
|
||||
GL_MAP1_GRID_SEGMENTS = 0x0DD1,
|
||||
GL_MAP1_INDEX = 0x0D91,
|
||||
GL_MAP1_NORMAL = 0x0D92,
|
||||
GL_MAP1_TEXTURE_COORD_1 = 0x0D93,
|
||||
GL_MAP1_TEXTURE_COORD_2 = 0x0D94,
|
||||
GL_MAP1_TEXTURE_COORD_3 = 0x0D95,
|
||||
GL_MAP1_TEXTURE_COORD_4 = 0x0D96,
|
||||
GL_MAP1_VERTEX_3 = 0x0D97,
|
||||
GL_MAP1_VERTEX_4 = 0x0D98,
|
||||
GL_MAP2_COLOR_4 = 0x0DB0,
|
||||
GL_MAP2_GRID_DOMAIN = 0x0DD2,
|
||||
GL_MAP2_GRID_SEGMENTS = 0x0DD3,
|
||||
GL_MAP2_INDEX = 0x0DB1,
|
||||
GL_MAP2_NORMAL = 0x0DB2,
|
||||
GL_MAP2_TEXTURE_COORD_1 = 0x0DB3,
|
||||
GL_MAP2_TEXTURE_COORD_2 = 0x0DB4,
|
||||
GL_MAP2_TEXTURE_COORD_3 = 0x0DB5,
|
||||
GL_MAP2_TEXTURE_COORD_4 = 0x0DB6,
|
||||
GL_MAP2_VERTEX_3 = 0x0DB7,
|
||||
GL_MAP2_VERTEX_4 = 0x0DB8,
|
||||
GL_COEFF = 0x0A00,
|
||||
GL_DOMAIN = 0x0A02,
|
||||
GL_ORDER = 0x0A01,
|
||||
|
||||
/* Hints */
|
||||
GL_FOG_HINT = 0x0C54,
|
||||
GL_LINE_SMOOTH_HINT = 0x0C52,
|
||||
GL_PERSPECTIVE_CORRECTION_HINT = 0x0C50,
|
||||
GL_POINT_SMOOTH_HINT = 0x0C51,
|
||||
GL_POLYGON_SMOOTH_HINT = 0x0C53,
|
||||
GL_DONT_CARE = 0x1100,
|
||||
GL_FASTEST = 0x1101,
|
||||
GL_NICEST = 0x1102,
|
||||
|
||||
/* Scissor box */
|
||||
GL_SCISSOR_TEST = 0x0C11,
|
||||
GL_SCISSOR_BOX = 0x0C10,
|
||||
|
||||
/* Pixel Mode / Transfer */
|
||||
GL_MAP_COLOR = 0x0D10,
|
||||
GL_MAP_STENCIL = 0x0D11,
|
||||
GL_INDEX_SHIFT = 0x0D12,
|
||||
GL_INDEX_OFFSET = 0x0D13,
|
||||
GL_RED_SCALE = 0x0D14,
|
||||
GL_RED_BIAS = 0x0D15,
|
||||
GL_GREEN_SCALE = 0x0D18,
|
||||
GL_GREEN_BIAS = 0x0D19,
|
||||
GL_BLUE_SCALE = 0x0D1A,
|
||||
GL_BLUE_BIAS = 0x0D1B,
|
||||
GL_ALPHA_SCALE = 0x0D1C,
|
||||
GL_ALPHA_BIAS = 0x0D1D,
|
||||
GL_DEPTH_SCALE = 0x0D1E,
|
||||
GL_DEPTH_BIAS = 0x0D1F,
|
||||
GL_PIXEL_MAP_S_TO_S_SIZE = 0x0CB1,
|
||||
GL_PIXEL_MAP_I_TO_I_SIZE = 0x0CB0,
|
||||
GL_PIXEL_MAP_I_TO_R_SIZE = 0x0CB2,
|
||||
GL_PIXEL_MAP_I_TO_G_SIZE = 0x0CB3,
|
||||
GL_PIXEL_MAP_I_TO_B_SIZE = 0x0CB4,
|
||||
GL_PIXEL_MAP_I_TO_A_SIZE = 0x0CB5,
|
||||
GL_PIXEL_MAP_R_TO_R_SIZE = 0x0CB6,
|
||||
GL_PIXEL_MAP_G_TO_G_SIZE = 0x0CB7,
|
||||
GL_PIXEL_MAP_B_TO_B_SIZE = 0x0CB8,
|
||||
GL_PIXEL_MAP_A_TO_A_SIZE = 0x0CB9,
|
||||
GL_PIXEL_MAP_S_TO_S = 0x0C71,
|
||||
GL_PIXEL_MAP_I_TO_I = 0x0C70,
|
||||
GL_PIXEL_MAP_I_TO_R = 0x0C72,
|
||||
GL_PIXEL_MAP_I_TO_G = 0x0C73,
|
||||
GL_PIXEL_MAP_I_TO_B = 0x0C74,
|
||||
GL_PIXEL_MAP_I_TO_A = 0x0C75,
|
||||
GL_PIXEL_MAP_R_TO_R = 0x0C76,
|
||||
GL_PIXEL_MAP_G_TO_G = 0x0C77,
|
||||
GL_PIXEL_MAP_B_TO_B = 0x0C78,
|
||||
GL_PIXEL_MAP_A_TO_A = 0x0C79,
|
||||
GL_PACK_ALIGNMENT = 0x0D05,
|
||||
GL_PACK_LSB_FIRST = 0x0D01,
|
||||
GL_PACK_ROW_LENGTH = 0x0D02,
|
||||
GL_PACK_SKIP_PIXELS = 0x0D04,
|
||||
GL_PACK_SKIP_ROWS = 0x0D03,
|
||||
GL_PACK_SWAP_BYTES = 0x0D00,
|
||||
GL_UNPACK_ALIGNMENT = 0x0CF5,
|
||||
GL_UNPACK_LSB_FIRST = 0x0CF1,
|
||||
GL_UNPACK_ROW_LENGTH = 0x0CF2,
|
||||
GL_UNPACK_SKIP_PIXELS = 0x0CF4,
|
||||
GL_UNPACK_SKIP_ROWS = 0x0CF3,
|
||||
GL_UNPACK_SWAP_BYTES = 0x0CF0,
|
||||
GL_ZOOM_X = 0x0D16,
|
||||
GL_ZOOM_Y = 0x0D17,
|
||||
|
||||
/* Texture mapping */
|
||||
GL_TEXTURE_ENV = 0x2300,
|
||||
GL_TEXTURE_ENV_MODE = 0x2200,
|
||||
GL_TEXTURE_1D = 0x0DE0,
|
||||
GL_TEXTURE_2D = 0x0DE1,
|
||||
GL_TEXTURE_WRAP_S = 0x2802,
|
||||
GL_TEXTURE_WRAP_T = 0x2803,
|
||||
GL_TEXTURE_MAG_FILTER = 0x2800,
|
||||
GL_TEXTURE_MIN_FILTER = 0x2801,
|
||||
GL_TEXTURE_ENV_COLOR = 0x2201,
|
||||
GL_TEXTURE_GEN_S = 0x0C60,
|
||||
GL_TEXTURE_GEN_T = 0x0C61,
|
||||
GL_TEXTURE_GEN_MODE = 0x2500,
|
||||
GL_TEXTURE_BORDER_COLOR = 0x1004,
|
||||
GL_TEXTURE_WIDTH = 0x1000,
|
||||
GL_TEXTURE_HEIGHT = 0x1001,
|
||||
GL_TEXTURE_BORDER = 0x1005,
|
||||
GL_TEXTURE_COMPONENTS = 0x1003,
|
||||
GL_NEAREST_MIPMAP_NEAREST = 0x2700,
|
||||
GL_NEAREST_MIPMAP_LINEAR = 0x2702,
|
||||
GL_LINEAR_MIPMAP_NEAREST = 0x2701,
|
||||
GL_LINEAR_MIPMAP_LINEAR = 0x2703,
|
||||
GL_OBJECT_LINEAR = 0x2401,
|
||||
GL_OBJECT_PLANE = 0x2501,
|
||||
GL_EYE_LINEAR = 0x2400,
|
||||
GL_EYE_PLANE = 0x2502,
|
||||
GL_SPHERE_MAP = 0x2402,
|
||||
GL_DECAL = 0x2101,
|
||||
GL_MODULATE = 0x2100,
|
||||
GL_NEAREST = 0x2600,
|
||||
GL_REPEAT = 0x2901,
|
||||
GL_CLAMP = 0x2900,
|
||||
GL_S = 0x2000,
|
||||
GL_T = 0x2001,
|
||||
GL_R = 0x2002,
|
||||
GL_Q = 0x2003,
|
||||
GL_TEXTURE_GEN_R = 0x0C62,
|
||||
GL_TEXTURE_GEN_Q = 0x0C63,
|
||||
|
||||
GL_PROXY_TEXTURE_1D = 0x8063,
|
||||
GL_PROXY_TEXTURE_2D = 0x8064,
|
||||
GL_TEXTURE_PRIORITY = 0x8066,
|
||||
GL_TEXTURE_RESIDENT = 0x8067,
|
||||
GL_TEXTURE_1D_BINDING = 0x8068,
|
||||
GL_TEXTURE_2D_BINDING = 0x8069,
|
||||
|
||||
/* Internal texture formats */
|
||||
GL_ALPHA4 = 0x803B,
|
||||
GL_ALPHA8 = 0x803C,
|
||||
GL_ALPHA12 = 0x803D,
|
||||
GL_ALPHA16 = 0x803E,
|
||||
GL_LUMINANCE4 = 0x803F,
|
||||
GL_LUMINANCE8 = 0x8040,
|
||||
GL_LUMINANCE12 = 0x8041,
|
||||
GL_LUMINANCE16 = 0x8042,
|
||||
GL_LUMINANCE4_ALPHA4 = 0x8043,
|
||||
GL_LUMINANCE6_ALPHA2 = 0x8044,
|
||||
GL_LUMINANCE8_ALPHA8 = 0x8045,
|
||||
GL_LUMINANCE12_ALPHA4 = 0x8046,
|
||||
GL_LUMINANCE12_ALPHA12 = 0x8047,
|
||||
GL_LUMINANCE16_ALPHA16 = 0x8048,
|
||||
GL_INTENSITY = 0x8049,
|
||||
GL_INTENSITY4 = 0x804A,
|
||||
GL_INTENSITY8 = 0x804B,
|
||||
GL_INTENSITY12 = 0x804C,
|
||||
GL_INTENSITY16 = 0x804D,
|
||||
GL_R3_G3_B2 = 0x2A10,
|
||||
GL_RGB4 = 0x804F,
|
||||
GL_RGB5 = 0x8050,
|
||||
GL_RGB8 = 0x8051,
|
||||
GL_RGB10 = 0x8052,
|
||||
GL_RGB12 = 0x8053,
|
||||
GL_RGB16 = 0x8054,
|
||||
GL_RGBA2 = 0x8055,
|
||||
GL_RGBA4 = 0x8056,
|
||||
GL_RGB5_A1 = 0x8057,
|
||||
GL_RGBA8 = 0x8058,
|
||||
GL_RGB10_A2 = 0x8059,
|
||||
GL_RGBA12 = 0x805A,
|
||||
GL_RGBA16 = 0x805B,
|
||||
|
||||
/* Utility */
|
||||
GL_VENDOR = 0x1F00,
|
||||
GL_RENDERER = 0x1F01,
|
||||
GL_VERSION = 0x1F02,
|
||||
GL_EXTENSIONS = 0x1F03,
|
||||
|
||||
/* Errors */
|
||||
GL_INVALID_VALUE = 0x0501,
|
||||
GL_INVALID_ENUM = 0x0500,
|
||||
GL_INVALID_OPERATION = 0x0502,
|
||||
GL_STACK_OVERFLOW = 0x0503,
|
||||
GL_STACK_UNDERFLOW = 0x0504,
|
||||
GL_OUT_OF_MEMORY = 0x0505,
|
||||
|
||||
/*
|
||||
* 1.0 Extensions
|
||||
*/
|
||||
/* GL_EXT_blend_minmax and GL_EXT_blend_color */
|
||||
GL_CONSTANT_COLOR_EXT = 0x8001,
|
||||
GL_ONE_MINUS_CONSTANT_COLOR_EXT = 0x8002,
|
||||
GL_CONSTANT_ALPHA_EXT = 0x8003,
|
||||
GL_ONE_MINUS_CONSTANT_ALPHA_EXT = 0x8004,
|
||||
GL_BLEND_EQUATION_EXT = 0x8009,
|
||||
GL_MIN_EXT = 0x8007,
|
||||
GL_MAX_EXT = 0x8008,
|
||||
GL_FUNC_ADD_EXT = 0x8006,
|
||||
GL_FUNC_SUBTRACT_EXT = 0x800A,
|
||||
GL_FUNC_REVERSE_SUBTRACT_EXT = 0x800B,
|
||||
GL_BLEND_COLOR_EXT = 0x8005,
|
||||
|
||||
/* GL_EXT_polygon_offset */
|
||||
GL_POLYGON_OFFSET_EXT = 0x8037,
|
||||
GL_POLYGON_OFFSET_FACTOR_EXT = 0x8038,
|
||||
GL_POLYGON_OFFSET_BIAS_EXT = 0x8039,
|
||||
|
||||
/* GL_EXT_vertex_array */
|
||||
GL_VERTEX_ARRAY_EXT = 0x8074,
|
||||
GL_NORMAL_ARRAY_EXT = 0x8075,
|
||||
GL_COLOR_ARRAY_EXT = 0x8076,
|
||||
GL_INDEX_ARRAY_EXT = 0x8077,
|
||||
GL_TEXTURE_COORD_ARRAY_EXT = 0x8078,
|
||||
GL_EDGE_FLAG_ARRAY_EXT = 0x8079,
|
||||
GL_VERTEX_ARRAY_SIZE_EXT = 0x807A,
|
||||
GL_VERTEX_ARRAY_TYPE_EXT = 0x807B,
|
||||
GL_VERTEX_ARRAY_STRIDE_EXT = 0x807C,
|
||||
GL_VERTEX_ARRAY_COUNT_EXT = 0x807D,
|
||||
GL_NORMAL_ARRAY_TYPE_EXT = 0x807E,
|
||||
GL_NORMAL_ARRAY_STRIDE_EXT = 0x807F,
|
||||
GL_NORMAL_ARRAY_COUNT_EXT = 0x8080,
|
||||
GL_COLOR_ARRAY_SIZE_EXT = 0x8081,
|
||||
GL_COLOR_ARRAY_TYPE_EXT = 0x8082,
|
||||
GL_COLOR_ARRAY_STRIDE_EXT = 0x8083,
|
||||
GL_COLOR_ARRAY_COUNT_EXT = 0x8084,
|
||||
GL_INDEX_ARRAY_TYPE_EXT = 0x8085,
|
||||
GL_INDEX_ARRAY_STRIDE_EXT = 0x8086,
|
||||
GL_INDEX_ARRAY_COUNT_EXT = 0x8087,
|
||||
GL_TEXTURE_COORD_ARRAY_SIZE_EXT = 0x8088,
|
||||
GL_TEXTURE_COORD_ARRAY_TYPE_EXT = 0x8089,
|
||||
GL_TEXTURE_COORD_ARRAY_STRIDE_EXT= 0x808A,
|
||||
GL_TEXTURE_COORD_ARRAY_COUNT_EXT= 0x808B,
|
||||
GL_EDGE_FLAG_ARRAY_STRIDE_EXT = 0x808C,
|
||||
GL_EDGE_FLAG_ARRAY_COUNT_EXT = 0x808D,
|
||||
GL_VERTEX_ARRAY_POINTER_EXT = 0x808E,
|
||||
GL_NORMAL_ARRAY_POINTER_EXT = 0x808F,
|
||||
GL_COLOR_ARRAY_POINTER_EXT = 0x8090,
|
||||
GL_INDEX_ARRAY_POINTER_EXT = 0x8091,
|
||||
GL_TEXTURE_COORD_ARRAY_POINTER_EXT= 0x8092,
|
||||
GL_EDGE_FLAG_ARRAY_POINTER_EXT = 0x8093
|
||||
|
||||
};
|
||||
|
||||
enum {
|
||||
GL_CURRENT_BIT = 0x00000001,
|
||||
GL_POINT_BIT = 0x00000002,
|
||||
GL_LINE_BIT = 0x00000004,
|
||||
GL_POLYGON_BIT = 0x00000008,
|
||||
GL_POLYGON_STIPPLE_BIT = 0x00000010,
|
||||
GL_PIXEL_MODE_BIT = 0x00000020,
|
||||
GL_LIGHTING_BIT = 0x00000040,
|
||||
GL_FOG_BIT = 0x00000080,
|
||||
GL_DEPTH_BUFFER_BIT = 0x00000100,
|
||||
GL_ACCUM_BUFFER_BIT = 0x00000200,
|
||||
GL_STENCIL_BUFFER_BIT = 0x00000400,
|
||||
GL_VIEWPORT_BIT = 0x00000800,
|
||||
GL_TRANSFORM_BIT = 0x00001000,
|
||||
GL_ENABLE_BIT = 0x00002000,
|
||||
GL_COLOR_BUFFER_BIT = 0x00004000,
|
||||
GL_HINT_BIT = 0x00008000,
|
||||
GL_EVAL_BIT = 0x00010000,
|
||||
GL_LIST_BIT = 0x00020000,
|
||||
GL_TEXTURE_BIT = 0x00040000,
|
||||
GL_SCISSOR_BIT = 0x00080000,
|
||||
GL_ALL_ATTRIB_BITS = 0x000fffff
|
||||
};
|
||||
|
||||
struct ZBuffer
|
||||
{
|
||||
long int xsize, ysize;
|
||||
int linesize; //line size, in bytes
|
||||
int mode;
|
||||
|
||||
unsigned short int* zbuf;
|
||||
unsigned char* pbuf; //PIXEL
|
||||
int frame_buffer_allocated;
|
||||
|
||||
int nb_colors;
|
||||
unsigned char* dctable;
|
||||
int* ctable;
|
||||
unsigned char* current_texture; //PIXEL
|
||||
unsigned int s_log2;
|
||||
unsigned int s_bound;
|
||||
unsigned int t_bound;
|
||||
};
|
||||
|
||||
struct TinyGLContext
|
||||
{
|
||||
ZBuffer* gl_context;
|
||||
long int xsize, ysize;
|
||||
long int dx, dy, x, y;
|
||||
};
|
||||
|
||||
//
|
||||
// tinygl - import table
|
||||
//
|
||||
#define import_tinygl glEnable
|
||||
void (__stdcall* glEnable)(int code) = (void (__stdcall*)(int))&"glEnable";
|
||||
void (__stdcall* glDisable)(int code) = (void (__stdcall*)(int))&"glDisable";
|
||||
void (__stdcall* glShadeModel)(int mode) = (void (__stdcall*)(int))&"glShadeModel";
|
||||
void (__stdcall* glCullFace)(int mode) = (void (__stdcall*)(int))&"glCullFace";
|
||||
void (__stdcall* glPolygonMode)(int face, int mode) = (void (__stdcall*)(int, int))&"glPolygonMode";
|
||||
void (__stdcall* glBegin)(int type) = (void (__stdcall*)(int))&"glBegin";
|
||||
void (__stdcall* glEnd)() = (void (__stdcall*)())&"glEnd";
|
||||
void (__stdcall* glVertex2f)(float x, float y) = (void (__stdcall*)(float, float))&"glVertex2f";
|
||||
void (__stdcall* glVertex2d)(double x, double y) = (void (__stdcall*)(double, double))&"glVertex2d";
|
||||
void (__stdcall* glVertex2fv)(float* v) = (void (__stdcall*)(float*))&"glVertex2fv";
|
||||
void (__stdcall* glVertex2dv)(double* v) = (void (__stdcall*)(double*))&"glVertex2dv";
|
||||
void (__stdcall* glVertex3f)(float x, float y, float z) = (void (__stdcall*)(float, float, float))&"glVertex3f";
|
||||
void (__stdcall* glVertex3d)(double x, double y, double z) = (void (__stdcall*)(double, double, double))&"glVertex3d";
|
||||
void (__stdcall* glVertex3fv)(float* v) = (void (__stdcall*)(float*))&"glVertex3fv";
|
||||
void (__stdcall* glVertex3dv)(double* v) = (void (__stdcall*)(double*))&"glVertex3dv";
|
||||
void (__stdcall* glVertex4f)(float x, float y, float z, float w) = (void (__stdcall*)(float, float, float, float))&"glVertex4f";
|
||||
void (__stdcall* glVertex4d)(double x, double y, double z, double w) = (void (__stdcall*)(double, double, double, double))&"glVertex4d";
|
||||
void (__stdcall* glVertex4fv)(float* v) = (void (__stdcall*)(float*))&"glVertex4fv";
|
||||
void (__stdcall* glVertex4dv)(double* v) = (void (__stdcall*)(double*))&"glVertex4dv";
|
||||
void (__stdcall* glColor3f)(float r, float g, float b) = (void (__stdcall*)(float, float, float))&"glColor3f";
|
||||
//void (__stdcall* glColor3d)(...) = (void (__stdcall*)(...))&"glColor3d";
|
||||
//void (__stdcall* glColor3fv)(...) = (void (__stdcall*)(...))&"glColor3fv";
|
||||
//void (__stdcall* glColor3dv)(...) = (void (__stdcall*)(...))&"glColor3dv";
|
||||
void (__stdcall* glColor3ub)(unsigned char r, unsigned char g, unsigned char b) = (void (__stdcall*)(unsigned char, unsigned char, unsigned char))&"glColor3ub";
|
||||
//void (__stdcall* glColor4f)(...) = (void (__stdcall*)(...))&"glColor4f";
|
||||
//void (__stdcall* glColor4d)(...) = (void (__stdcall*)(...))&"glColor4d";
|
||||
//void (__stdcall* glColor4fv)(...) = (void (__stdcall*)(...))&"glColor4fv";
|
||||
//void (__stdcall* glColor4dv)(...) = (void (__stdcall*)(...))&"glColor4dv";
|
||||
void (__stdcall* glNormal3f)(float x, float y, float z) = (void (__stdcall*)(float, float, float))&"glNormal3f";
|
||||
//void (__stdcall* glNormal3d)(...) = (void (__stdcall*)(...))&"glNormal3d";
|
||||
//void (__stdcall* glNormal3fv)(...) = (void (__stdcall*)(...))&"glNormal3fv";
|
||||
//void (__stdcall* glNormal3dv)(...) = (void (__stdcall*)(...))&"glNormal3dv";
|
||||
//void (__stdcall* glTexCoord1f)(...) = (void (__stdcall*)(...))&"glTexCoord1f";
|
||||
//void (__stdcall* glTexCoord1d)(...) = (void (__stdcall*)(...))&"glTexCoord1d";
|
||||
//void (__stdcall* glTexCoord1fv)(...) = (void (__stdcall*)(...))&"glTexCoord1fv";
|
||||
//void (__stdcall* glTexCoord1dv)(...) = (void (__stdcall*)(...))&"glTexCoord1dv";
|
||||
void (__stdcall* glTexCoord2f)(float s, float t) = (void (__stdcall*)(float, float))&"glTexCoord2f";
|
||||
//void (__stdcall* glTexCoord2d)(...) = (void (__stdcall*)(...))&"glTexCoord2d";
|
||||
void (__stdcall* glTexCoord2fv)(float* v) = (void (__stdcall*)(float*))&"glTexCoord2fv";
|
||||
//void (__stdcall* glTexCoord2dv)(...) = (void (__stdcall*)(...))&"glTexCoord2dv";
|
||||
//void (__stdcall* glTexCoord3f)(...) = (void (__stdcall*)(...))&"glTexCoord3f";
|
||||
//void (__stdcall* glTexCoord3d)(...) = (void (__stdcall*)(...))&"glTexCoord3d";
|
||||
//void (__stdcall* glTexCoord3fv)(...) = (void (__stdcall*)(...))&"glTexCoord3fv";
|
||||
//void (__stdcall* glTexCoord3dv)(...) = (void (__stdcall*)(...))&"glTexCoord3dv";
|
||||
void (__stdcall* glTexCoord4f)(float s, float t, float r, float q) = (void (__stdcall*)(float, float, float, float))&"glTexCoord4f";
|
||||
//void (__stdcall* glTexCoord4d)(...) = (void (__stdcall*)(...))&"glTexCoord4d";
|
||||
//void (__stdcall* glTexCoord4fv)(...) = (void (__stdcall*)(...))&"glTexCoord4fv";
|
||||
//void (__stdcall* glTexCoord4dv)(...) = (void (__stdcall*)(...))&"glTexCoord4dv";
|
||||
void (__stdcall* glEdgeFlag)(int flag) = (void (__stdcall*)(int))&"glEdgeFlag";
|
||||
void (__stdcall* glMatrixMode)(int mode) = (void (__stdcall*)(int))&"glMatrixMode";
|
||||
void (__stdcall* glLoadMatrixf)(const float* m) = (void (__stdcall*)(const float*))&"glLoadMatrixf";
|
||||
void (__stdcall* glLoadIdentity)() = (void (__stdcall*)())&"glLoadIdentity";
|
||||
//void (__stdcall* glMultMatrixf)(...) = (void (__stdcall*)(...))&"glMultMatrixf";
|
||||
void (__stdcall* glPushMatrix)() = (void (__stdcall*)())&"glPushMatrix";
|
||||
void (__stdcall* glPopMatrix)() = (void (__stdcall*)())&"glPopMatrix";
|
||||
void (__stdcall* glRotatef)(float angle, float x, float y, float z) = (void (__stdcall*)(float, float, float, float))&"glRotatef";
|
||||
void (__stdcall* glTranslatef)(float x, float y, float z) = (void (__stdcall*)(float, float, float))&"glTranslatef";
|
||||
void (__stdcall* glScalef)(float x, float y, float z) = (void (__stdcall*)(float, float, float))&"glScalef";
|
||||
void (__stdcall* glViewport)(int x, int y, int width, int height) = (void (__stdcall*)(int, int, int, int))&"glViewport";
|
||||
void (__stdcall* glFrustum)(double l, double r, double b, double t, double n, double f) = (void (__stdcall*)(double, double, double, double, double, double))&"glFrustum";
|
||||
void (__stdcall* glGenLists)(int range) = (void (__stdcall*)(int))&"glGenLists";
|
||||
//void (__stdcall* glIsList)(...) = (void (__stdcall*)(...))&"glIsList";
|
||||
void (__stdcall* glNewList)(unsigned int list, int mode) = (void (__stdcall*)(unsigned int, int))&"glNewList";
|
||||
void (__stdcall* glEndList)() = (void (__stdcall*)())&"glEndList";
|
||||
void (__stdcall* glCallList)(unsigned int list) = (void (__stdcall*)(unsigned int))&"glCallList";
|
||||
void (__stdcall* glClear)(int mask) = (void (__stdcall*)(int))&"glClear";
|
||||
void (__stdcall* glClearColor)(float r, float g, float b, float a) = (void (__stdcall*)(float, float, float, float))&"glClearColor";
|
||||
//void (__stdcall* glClearDepth)(...) = (void (__stdcall*)(...))&"glClearDepth";
|
||||
void (__stdcall* glRenderMode)(int mode) = (void (__stdcall*)(int))&"glRenderMode";
|
||||
//void (__stdcall* glSelectBuffer)(...) = (void (__stdcall*)(...))&"glSelectBuffer";
|
||||
//void (__stdcall* glInitNames)(...) = (void (__stdcall*)(...))&"glInitNames";
|
||||
//void (__stdcall* glPushName)(...) = (void (__stdcall*)(...))&"glPushName";
|
||||
//void (__stdcall* glPopName)(...) = (void (__stdcall*)(...))&"glPopName";
|
||||
//void (__stdcall* glLoadName)(...) = (void (__stdcall*)(...))&"glLoadName";
|
||||
void (__stdcall* glGenTextures)(int n, unsigned int* textures) = (void (__stdcall*)(int, unsigned int *))&"glGenTextures";
|
||||
//void (__stdcall* glDeleteTextures)(...) = (void (__stdcall*)(...))&"glDeleteTextures";
|
||||
void (__stdcall* glBindTexture)(int target, int texture) = (void (__stdcall*)(int, int))&"glBindTexture";
|
||||
void (__stdcall* glTexImage2D)(int target, int level, int components, int width, int height, int border, int format, int type, void *pixels) = (void (__stdcall*)(int, int, int, int, int, int, int, int, void*))&"glTexImage2D";
|
||||
void (__stdcall* glTexEnvi)(int target, int pname, int param) = (void (__stdcall*)(int, int, int))&"glTexEnvi";
|
||||
void (__stdcall* glTexParameteri)(int target, int pname, int param) = (void (__stdcall*)(int, int, int))&"glTexParameteri";
|
||||
//void (__stdcall* glPixelStorei)(...) = (void (__stdcall*)(...))&"glPixelStorei";
|
||||
void (__stdcall* glMaterialfv)(int mode, int type, float* v) = (void (__stdcall*)(int, int, float*))&"glMaterialfv";
|
||||
void (__stdcall* glMaterialf)(int mode, int type, float v) = (void (__stdcall*)(int, int, float))&"glMaterialf";
|
||||
void (__stdcall* glColorMaterial)(int mode, int type) = (void (__stdcall*)(int, int))&"glColorMaterial";
|
||||
void (__stdcall* glLightfv)(int light, int type, float* v) = (void (__stdcall*)(int, int, float*))&"glLightfv";
|
||||
//void (__stdcall* glLightf)(...) = (void (__stdcall*)(...))&"glLightf";
|
||||
//void (__stdcall* glLightModeli)(...) = (void (__stdcall*)(...))&"glLightModeli";
|
||||
void (__stdcall* glLightModelfv)(int pname, float* param) = (void (__stdcall*)(int, float*))&"glLightModelfv";
|
||||
//void (__stdcall* glFlush)(...) = (void (__stdcall*)(...))&"glFlush";
|
||||
//void (__stdcall* glHint)(...) = (void (__stdcall*)(...))&"glHint";
|
||||
//void (__stdcall* glGetIntegerv)(...) = (void (__stdcall*)(...))&"glGetIntegerv";
|
||||
//void (__stdcall* glGetFloatv)(...) = (void (__stdcall*)(...))&"glGetFloatv";
|
||||
//void (__stdcall* glFrontFace)(...) = (void (__stdcall*)(...))&"glFrontFace";
|
||||
//void (__stdcall* glEnableClientState)(...) = (void (__stdcall*)(...))&"glEnableClientState";
|
||||
//void (__stdcall* glDisableClientState)(...) = (void (__stdcall*)(...))&"glDisableClientState";
|
||||
//void (__stdcall* glArrayElement)(...) = (void (__stdcall*)(...))&"glArrayElement";
|
||||
//void (__stdcall* glDrawArrays)(...) = (void (__stdcall*)(...))&"glDrawArrays";
|
||||
//void (__stdcall* glDrawElements)(...) = (void (__stdcall*)(...))&"glDrawElements";
|
||||
//void (__stdcall* glVertexPointer)(...) = (void (__stdcall*)(...))&"glVertexPointer";
|
||||
//void (__stdcall* glColorPointer)(...) = (void (__stdcall*)(...))&"glColorPointer";
|
||||
//void (__stdcall* glNormalPointer)(...) = (void (__stdcall*)(...))&"glNormalPointer";
|
||||
//void (__stdcall* glTexCoordPointer)(...) = (void (__stdcall*)(...))&"glTexCoordPointer";
|
||||
//void (__stdcall* glPolygonOffset)(...) = (void (__stdcall*)(...))&"glPolygonOffset";
|
||||
//void (__stdcall* glOrtho)(...) = (void (__stdcall*)(...))&"glOrtho";
|
||||
//void (__stdcall* glDebug)(...) = (void (__stdcall*)(...))&"glDebug";
|
||||
//void (__stdcall* glInit)(...) = (void (__stdcall*)(...))&"glInit";
|
||||
//void (__stdcall* glClose)(...) = (void (__stdcall*)(...))&"glClose";
|
||||
//void (__stdcall* gluPerspective)(...) = (void (__stdcall*)(...))&"gluPerspective";
|
||||
//void (__stdcall* gluNewQuadric)(...) = (void (__stdcall*)(...))&"gluNewQuadric";
|
||||
//void (__stdcall* gluDeleteQuadric)(...) = (void (__stdcall*)(...))&"gluDeleteQuadric";
|
||||
//void (__stdcall* gluQuadricDrawStyle)(...) = (void (__stdcall*)(...))&"gluQuadricDrawStyle";
|
||||
//void (__stdcall* gluQuadricOrientation)(...) = (void (__stdcall*)(...))&"gluQuadricOrientation";
|
||||
//void (__stdcall* gluQuadricTexture)(...) = (void (__stdcall*)(...))&"gluQuadricTexture";
|
||||
//void (__stdcall* gluCylinder)(...) = (void (__stdcall*)(...))&"gluCylinder";
|
||||
//void (__stdcall* gluSphere)(...) = (void (__stdcall*)(...))&"gluSphere";
|
||||
void (__stdcall* kosglMakeCurrent)(long l, long t, long w, long h, TinyGLContext*) = (void (__stdcall*)(long, long, long, long, TinyGLContext*))&"kosglMakeCurrent";
|
||||
void (__stdcall* kosglSwapBuffers)() = (void (__stdcall*)())&"kosglSwapBuffers";
|
||||
asm{
|
||||
dd 0, 0
|
||||
}
|
||||
#endif
|
@ -10,12 +10,40 @@ glVertex4f: ;x, y, z, w
|
||||
pop eax
|
||||
ret 20 ;=sizeof(dd)*5
|
||||
|
||||
align 4
|
||||
proc glVertex4d, x:qword, y:qword, z:qword, w:qword
|
||||
add esp,-16
|
||||
fld qword[w]
|
||||
fstp dword[esp+12]
|
||||
fld qword[z]
|
||||
fstp dword[esp+8]
|
||||
fld qword[y]
|
||||
fstp dword[esp+4]
|
||||
fld qword[x]
|
||||
fstp dword[esp]
|
||||
call glVertex4f
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
proc glVertex2f, x:dword, y:dword
|
||||
stdcall glVertex4f,[x],[y],0.0,1.0
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
proc glVertex2d, x:qword, y:qword
|
||||
push 1.0
|
||||
push 0.0
|
||||
add esp,-8
|
||||
fld qword[y]
|
||||
fstp dword[esp+4]
|
||||
fld qword[x]
|
||||
fstp dword[esp]
|
||||
call glVertex4f
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
proc glVertex2fv uses eax, v:dword
|
||||
mov eax,[v]
|
||||
@ -23,12 +51,40 @@ proc glVertex2fv uses eax, v:dword
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
proc glVertex2dv uses eax, v:dword
|
||||
mov eax,[v]
|
||||
push 1.0
|
||||
push 0.0
|
||||
add esp,-8
|
||||
fld qword[eax+8]
|
||||
fstp dword[esp+4]
|
||||
fld qword[eax]
|
||||
fstp dword[esp]
|
||||
call glVertex4f
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
proc glVertex3f, x:dword, y:dword, z:dword
|
||||
stdcall glVertex4f,[x],[y],[z],1.0
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
proc glVertex3d, x:qword, y:qword, z:qword
|
||||
push 1.0
|
||||
add esp,-12
|
||||
fld qword[z]
|
||||
fstp dword[esp+8]
|
||||
fld qword[y]
|
||||
fstp dword[esp+4]
|
||||
fld qword[x]
|
||||
fstp dword[esp]
|
||||
call glVertex4f
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
proc glVertex3fv uses eax, v:dword
|
||||
mov eax,[v]
|
||||
@ -36,6 +92,21 @@ proc glVertex3fv uses eax, v:dword
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
proc glVertex3dv uses eax, v:dword
|
||||
mov eax,[v]
|
||||
push 1.0
|
||||
add esp,-12
|
||||
fld qword[eax+16]
|
||||
fstp dword[esp+8]
|
||||
fld qword[eax+8]
|
||||
fstp dword[esp+4]
|
||||
fld qword[eax]
|
||||
fstp dword[esp]
|
||||
call glVertex4f
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
proc glVertex4fv uses eax, v:dword
|
||||
mov eax,[v]
|
||||
@ -43,6 +114,22 @@ proc glVertex4fv uses eax, v:dword
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
proc glVertex4dv uses eax, v:dword
|
||||
mov eax,[v]
|
||||
add esp,-16
|
||||
fld qword[eax+24]
|
||||
fstp dword[esp+12]
|
||||
fld qword[eax+16]
|
||||
fstp dword[esp+8]
|
||||
fld qword[eax+8]
|
||||
fstp dword[esp+4]
|
||||
fld qword[eax]
|
||||
fstp dword[esp]
|
||||
call glVertex4f
|
||||
ret
|
||||
endp
|
||||
|
||||
; glNormal
|
||||
|
||||
align 4
|
||||
|
@ -6,7 +6,7 @@ use32
|
||||
include '../../../../../proc32.inc'
|
||||
include '../../../../../macros.inc'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../develop/libraries/box_lib/load_lib.mac'
|
||||
include '../../../../../load_lib.mac'
|
||||
include '../../../../../dll.inc'
|
||||
include '../opengl_const.inc'
|
||||
include 'fps.inc'
|
||||
@ -18,8 +18,7 @@ macro matr_cell c_funct,c_param,funct,param, dia
|
||||
dia dword[esp-4*(c_param*(c_funct-funct)+(1+c_param-param))]
|
||||
}
|
||||
|
||||
;Так как некоторые извращенческие функции OpenGL воспринимают только параметры
|
||||
;типа double (8 байт) то придется пихать их в стек макросом glpush
|
||||
;Макрос для параметров типа double (8 байт)
|
||||
macro glpush GLDoubleVar {
|
||||
push dword[GLDoubleVar+4]
|
||||
push dword[GLDoubleVar]
|
||||
@ -27,8 +26,7 @@ macro glpush GLDoubleVar {
|
||||
|
||||
align 4
|
||||
start:
|
||||
load_library name_tgl, cur_dir_path, library_path, system_path, \
|
||||
err_message_found_lib, head_f_l, import_lib_tinygl, err_message_import, head_f_i
|
||||
load_library name_tgl, library_path, system_path, import_tinygl
|
||||
cmp eax,SF_TERMINATE_PROCESS
|
||||
jz button.exit
|
||||
|
||||
@ -903,7 +901,7 @@ endp
|
||||
|
||||
;--------------------------------------------------
|
||||
align 4
|
||||
import_lib_tinygl:
|
||||
import_tinygl:
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
@ -920,11 +918,6 @@ include '../export.inc'
|
||||
;--------------------------------------------------
|
||||
system_path db '/sys/lib/'
|
||||
name_tgl db 'tinygl.obj',0
|
||||
|
||||
head_f_i:
|
||||
head_f_l db '"System error',0
|
||||
err_message_import db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0
|
||||
err_message_found_lib db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0
|
||||
;--------------------------------------------------
|
||||
|
||||
align 16
|
||||
@ -932,10 +925,8 @@ i_end:
|
||||
ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext
|
||||
;sizeof.TinyGLContext = 28
|
||||
procinfo process_information
|
||||
cur_dir_path rb 4096
|
||||
library_path rb 4096
|
||||
rb 4096
|
||||
stacktop:
|
||||
cur_dir_path:
|
||||
rb 4096
|
||||
library_path:
|
||||
rb 4096
|
||||
mem:
|
||||
|
@ -6,7 +6,7 @@ use32
|
||||
include '../../../../../proc32.inc'
|
||||
include '../../../../../macros.inc'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../develop/libraries/box_lib/load_lib.mac'
|
||||
include '../../../../../load_lib.mac'
|
||||
include '../../../../../dll.inc'
|
||||
include '../opengl_const.inc'
|
||||
|
||||
@ -14,8 +14,7 @@ include '../opengl_const.inc'
|
||||
|
||||
align 4
|
||||
start:
|
||||
load_library name_tgl, cur_dir_path, library_path, system_path, \
|
||||
err_message_found_lib, head_f_l, import_lib_tinygl, err_message_import, head_f_i
|
||||
load_library name_tgl, library_path, system_path, import_lib_tinygl
|
||||
cmp eax,SF_TERMINATE_PROCESS
|
||||
jz button.exit
|
||||
|
||||
@ -154,21 +153,14 @@ include '../export.inc'
|
||||
;--------------------------------------------------
|
||||
system_path db '/sys/lib/'
|
||||
name_tgl db 'tinygl.obj',0
|
||||
|
||||
head_f_i:
|
||||
head_f_l db '"System error',0
|
||||
err_message_import db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0
|
||||
err_message_found_lib db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0
|
||||
;--------------------------------------------------
|
||||
|
||||
align 16
|
||||
i_end:
|
||||
ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext
|
||||
ctx1 rb 28 ;TinyGLContext or KOSGLContext
|
||||
;sizeof.TinyGLContext = 28
|
||||
cur_dir_path rb 4096
|
||||
library_path rb 4096
|
||||
rb 1024
|
||||
stacktop:
|
||||
cur_dir_path:
|
||||
rb 4096
|
||||
library_path:
|
||||
rb 4096
|
||||
mem:
|
||||
|
@ -6,7 +6,7 @@ use32
|
||||
include '../../../../../proc32.inc'
|
||||
include '../../../../../macros.inc'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../develop/libraries/box_lib/load_lib.mac'
|
||||
include '../../../../../load_lib.mac'
|
||||
include '../../../../../dll.inc'
|
||||
include '../opengl_const.inc'
|
||||
|
||||
@ -14,8 +14,7 @@ include '../opengl_const.inc'
|
||||
|
||||
align 4
|
||||
start:
|
||||
load_library name_tgl, cur_dir_path, library_path, system_path, \
|
||||
err_message_found_lib, head_f_l, import_lib_tinygl, err_message_import, head_f_i
|
||||
load_library name_tgl, library_path, system_path, import_lib_tinygl
|
||||
cmp eax,SF_TERMINATE_PROCESS
|
||||
jz button.exit
|
||||
|
||||
@ -154,21 +153,14 @@ include '../export.inc'
|
||||
;--------------------------------------------------
|
||||
system_path db '/sys/lib/'
|
||||
name_tgl db 'tinygl.obj',0
|
||||
|
||||
head_f_i:
|
||||
head_f_l db '"System error',0
|
||||
err_message_import db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0
|
||||
err_message_found_lib db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0
|
||||
;--------------------------------------------------
|
||||
|
||||
align 16
|
||||
i_end:
|
||||
ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext
|
||||
ctx1 rb 28 ;TinyGLContext or KOSGLContext
|
||||
;sizeof.TinyGLContext = 28
|
||||
cur_dir_path rb 4096
|
||||
library_path rb 4096
|
||||
rb 1024
|
||||
stacktop:
|
||||
cur_dir_path:
|
||||
rb 4096
|
||||
library_path:
|
||||
rb 4096
|
||||
mem:
|
||||
|
@ -6,7 +6,7 @@ use32
|
||||
include '../../../../../proc32.inc'
|
||||
include '../../../../../macros.inc'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../develop/libraries/box_lib/load_lib.mac'
|
||||
include '../../../../../load_lib.mac'
|
||||
include '../../../../../dll.inc'
|
||||
include '../opengl_const.inc'
|
||||
|
||||
@ -14,8 +14,7 @@ include '../opengl_const.inc'
|
||||
|
||||
align 4
|
||||
start:
|
||||
load_library name_tgl, cur_dir_path, library_path, system_path, \
|
||||
err_message_found_lib, head_f_l, import_lib_tinygl, err_message_import, head_f_i
|
||||
load_library name_tgl, library_path, system_path, import_lib_tinygl
|
||||
cmp eax,SF_TERMINATE_PROCESS
|
||||
jz button.exit
|
||||
|
||||
@ -163,21 +162,14 @@ include '../export.inc'
|
||||
;--------------------------------------------------
|
||||
system_path db '/sys/lib/'
|
||||
name_tgl db 'tinygl.obj',0
|
||||
|
||||
head_f_i:
|
||||
head_f_l db '"System error',0
|
||||
err_message_import db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0
|
||||
err_message_found_lib db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0
|
||||
;--------------------------------------------------
|
||||
|
||||
align 16
|
||||
i_end:
|
||||
ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext
|
||||
ctx1 rb 28 ;TinyGLContext or KOSGLContext
|
||||
;sizeof.TinyGLContext = 28
|
||||
cur_dir_path rb 4096
|
||||
library_path rb 4096
|
||||
rb 1024
|
||||
stacktop:
|
||||
cur_dir_path:
|
||||
rb 4096
|
||||
library_path:
|
||||
rb 4096
|
||||
mem:
|
||||
|
@ -6,7 +6,7 @@ use32
|
||||
include '../../../../../proc32.inc'
|
||||
include '../../../../../macros.inc'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../develop/libraries/box_lib/load_lib.mac'
|
||||
include '../../../../../load_lib.mac'
|
||||
include '../../../../../dll.inc'
|
||||
include '../opengl_const.inc'
|
||||
|
||||
@ -14,8 +14,7 @@ include '../opengl_const.inc'
|
||||
|
||||
align 4
|
||||
start:
|
||||
load_library name_tgl, cur_dir_path, library_path, system_path, \
|
||||
err_message_found_lib, head_f_l, import_lib_tinygl, err_message_import, head_f_i
|
||||
load_library name_tgl, library_path, system_path, import_lib_tinygl
|
||||
cmp eax,SF_TERMINATE_PROCESS
|
||||
jz button.exit
|
||||
|
||||
@ -155,21 +154,14 @@ include '../export.inc'
|
||||
;--------------------------------------------------
|
||||
system_path db '/sys/lib/'
|
||||
name_tgl db 'tinygl.obj',0
|
||||
|
||||
head_f_i:
|
||||
head_f_l db '"System error',0
|
||||
err_message_import db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0
|
||||
err_message_found_lib db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0
|
||||
;--------------------------------------------------
|
||||
|
||||
align 16
|
||||
i_end:
|
||||
ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext
|
||||
ctx1 rb 28 ;TinyGLContext or KOSGLContext
|
||||
;sizeof.TinyGLContext = 28
|
||||
cur_dir_path rb 4096
|
||||
library_path rb 4096
|
||||
rb 1024
|
||||
stacktop:
|
||||
cur_dir_path:
|
||||
rb 4096
|
||||
library_path:
|
||||
rb 4096
|
||||
mem:
|
||||
|
@ -1,28 +1,24 @@
|
||||
use32
|
||||
org 0x0
|
||||
org 0
|
||||
db 'MENUET01'
|
||||
dd 0x1
|
||||
dd start
|
||||
dd i_end
|
||||
dd mem,stacktop
|
||||
dd 0,cur_dir_path
|
||||
dd 1,start,i_end,mem,stacktop,0,cur_dir_path
|
||||
|
||||
include '../../../../../../programs/proc32.inc'
|
||||
include '../../../../../../programs/macros.inc'
|
||||
include '../../../../../../programs/develop/libraries/box_lib/load_lib.mac'
|
||||
include '../../../../../../programs/dll.inc'
|
||||
include '../../../../../proc32.inc'
|
||||
include '../../../../../macros.inc'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../load_lib.mac'
|
||||
include '../../../../../dll.inc'
|
||||
include '../opengl_const.inc'
|
||||
|
||||
@use_library
|
||||
|
||||
align 4
|
||||
start:
|
||||
load_library name_tgl, cur_dir_path, library_path, system_path, \
|
||||
err_message_found_lib, head_f_l, import_lib_tinygl, err_message_import, head_f_i
|
||||
load_library name_tgl, library_path, system_path, import_tinygl
|
||||
cmp eax,-1
|
||||
jz button.exit
|
||||
|
||||
mcall 40,0x27
|
||||
mcall SF_SET_EVENTS_MASK,0x27
|
||||
|
||||
stdcall [kosglMakeCurrent], 10,10,400,350,ctx1
|
||||
stdcall [glEnable], GL_DEPTH_TEST
|
||||
@ -37,7 +33,7 @@ red_win:
|
||||
|
||||
align 4
|
||||
still:
|
||||
mcall 10
|
||||
mcall SF_WAIT_EVENT
|
||||
cmp al,1
|
||||
jz red_win
|
||||
cmp al,2
|
||||
@ -49,19 +45,18 @@ still:
|
||||
align 4
|
||||
draw_window:
|
||||
pushad
|
||||
mcall 12,1
|
||||
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
||||
|
||||
mov edx,0x33ffffff ;0x73ffffff
|
||||
mcall 0,(50 shl 16)+430,(30 shl 16)+400,,,caption
|
||||
stdcall [kosglSwapBuffers]
|
||||
mcall SF_CREATE_WINDOW,(50 shl 16)+430,(30 shl 16)+400,0x33ffffff,,caption
|
||||
call [kosglSwapBuffers]
|
||||
|
||||
mcall 12,2
|
||||
mcall SF_REDRAW,SSF_END_DRAW
|
||||
popad
|
||||
ret
|
||||
|
||||
align 4
|
||||
key:
|
||||
mcall 2
|
||||
mcall SF_GET_KEY
|
||||
|
||||
cmp ah,27 ;Esc
|
||||
je button.exit
|
||||
@ -72,7 +67,7 @@ key:
|
||||
fadd dword[delt_sc]
|
||||
fstp dword[scale]
|
||||
call draw_3d
|
||||
stdcall [kosglSwapBuffers]
|
||||
call [kosglSwapBuffers]
|
||||
@@:
|
||||
cmp ah,45 ;-
|
||||
jne @f
|
||||
@ -80,7 +75,7 @@ key:
|
||||
fsub dword[delt_sc]
|
||||
fstp dword[scale]
|
||||
call draw_3d
|
||||
stdcall [kosglSwapBuffers]
|
||||
call [kosglSwapBuffers]
|
||||
@@:
|
||||
cmp ah,178 ;Up
|
||||
jne @f
|
||||
@ -88,7 +83,7 @@ key:
|
||||
fadd dword[delt_size]
|
||||
fstp dword[angle_y]
|
||||
call draw_3d
|
||||
stdcall [kosglSwapBuffers]
|
||||
call [kosglSwapBuffers]
|
||||
@@:
|
||||
cmp ah,177 ;Down
|
||||
jne @f
|
||||
@ -96,7 +91,7 @@ key:
|
||||
fsub dword[delt_size]
|
||||
fstp dword[angle_y]
|
||||
call draw_3d
|
||||
stdcall [kosglSwapBuffers]
|
||||
call [kosglSwapBuffers]
|
||||
@@:
|
||||
cmp ah,176 ;Left
|
||||
jne @f
|
||||
@ -104,7 +99,7 @@ key:
|
||||
fadd dword[delt_size]
|
||||
fstp dword[angle_z]
|
||||
call draw_3d
|
||||
stdcall [kosglSwapBuffers]
|
||||
call [kosglSwapBuffers]
|
||||
@@:
|
||||
cmp ah,179 ;Right
|
||||
jne @f
|
||||
@ -112,30 +107,27 @@ key:
|
||||
fsub dword[delt_size]
|
||||
fstp dword[angle_z]
|
||||
call draw_3d
|
||||
stdcall [kosglSwapBuffers]
|
||||
call [kosglSwapBuffers]
|
||||
@@:
|
||||
|
||||
jmp still
|
||||
|
||||
align 4
|
||||
button:
|
||||
mcall 17
|
||||
mcall SF_GET_BUTTON
|
||||
cmp ah,1
|
||||
jne still
|
||||
.exit:
|
||||
mcall -1
|
||||
mcall SF_TERMINATE_PROCESS
|
||||
|
||||
|
||||
align 4
|
||||
caption db 'Test opengl 1.1 arrays, [Esc] - exit, [<-],[->],[Up],[Down] - rotate',0
|
||||
align 4
|
||||
ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext
|
||||
;sizeof.TinyGLContext = 28
|
||||
|
||||
align 4
|
||||
draw_3d:
|
||||
stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT ;очистим буфер цвета и глубины
|
||||
stdcall [glPushMatrix]
|
||||
call [glPushMatrix]
|
||||
|
||||
;масштаб и повороты
|
||||
stdcall [glTranslatef], 0.0,0.0,0.5
|
||||
@ -152,7 +144,7 @@ stdcall [glPushMatrix]
|
||||
stdcall [glDisableClientState], GL_COLOR_ARRAY ;отключаем режим рисования цветов
|
||||
stdcall [glDisableClientState], GL_VERTEX_ARRAY ;отключаем режим рисования вершин
|
||||
|
||||
stdcall [glPopMatrix]
|
||||
call [glPopMatrix]
|
||||
ret
|
||||
|
||||
align 4
|
||||
@ -168,7 +160,7 @@ Colors dd 0.0, 0.5, 1.0, 1.0, 0.0, 0.5, 1.0, 1.0, 1.0, 0.5, 1.0, 0.0 ;4 цвет
|
||||
|
||||
;--------------------------------------------------
|
||||
align 4
|
||||
import_lib_tinygl:
|
||||
import_tinygl:
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
@ -185,17 +177,13 @@ include '../export.inc'
|
||||
;--------------------------------------------------
|
||||
system_path db '/sys/lib/'
|
||||
name_tgl db 'tinygl.obj',0
|
||||
err_message_found_lib db 'Sorry I cannot load library tinygl.obj',0
|
||||
head_f_i:
|
||||
head_f_l db 'System error',0
|
||||
err_message_import db 'Error on load import library tinygl.obj',0
|
||||
;--------------------------------------------------
|
||||
|
||||
align 4
|
||||
i_end:
|
||||
ctx1 rb 28 ;sizeof.TinyGLContext = 28
|
||||
cur_dir_path rb 4096
|
||||
library_path rb 4096
|
||||
rb 4096
|
||||
stacktop:
|
||||
cur_dir_path:
|
||||
rb 4096
|
||||
library_path:
|
||||
rb 4096
|
||||
mem:
|
||||
|
@ -1,12 +1,12 @@
|
||||
use32
|
||||
org 0x0
|
||||
org 0
|
||||
db 'MENUET01'
|
||||
dd 1,start,i_end,mem,stacktop,0,cur_dir_path
|
||||
|
||||
include '../../../../../proc32.inc'
|
||||
include '../../../../../macros.inc'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../develop/libraries/box_lib/load_lib.mac'
|
||||
include '../../../../../load_lib.mac'
|
||||
include '../../../../../dll.inc'
|
||||
include '../opengl_const.inc'
|
||||
|
||||
@ -14,8 +14,7 @@ include '../opengl_const.inc'
|
||||
|
||||
align 4
|
||||
start:
|
||||
load_library name_tgl, cur_dir_path, library_path, system_path, \
|
||||
err_message_found_lib, head_f_l, import_lib_tinygl, err_message_import, head_f_i
|
||||
load_library name_tgl, library_path, system_path, import_tinygl
|
||||
cmp eax,SF_TERMINATE_PROCESS
|
||||
jz button.exit
|
||||
|
||||
@ -62,9 +61,8 @@ draw_window:
|
||||
pushad
|
||||
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
||||
|
||||
mov edx,0x33ffffff
|
||||
mcall SF_CREATE_WINDOW,(50 shl 16)+430,(30 shl 16)+400,,,caption
|
||||
stdcall [kosglSwapBuffers]
|
||||
mcall SF_CREATE_WINDOW,(50 shl 16)+430,(30 shl 16)+400,0x33ffffff,,caption
|
||||
call [kosglSwapBuffers]
|
||||
|
||||
mcall SF_REDRAW,SSF_END_DRAW
|
||||
popad
|
||||
@ -83,7 +81,7 @@ key:
|
||||
fadd dword[delt_sc]
|
||||
fstp dword[scale]
|
||||
call draw_3d
|
||||
stdcall [kosglSwapBuffers]
|
||||
call [kosglSwapBuffers]
|
||||
@@:
|
||||
cmp ah,45 ;-
|
||||
jne @f
|
||||
@ -91,7 +89,7 @@ key:
|
||||
fsub dword[delt_sc]
|
||||
fstp dword[scale]
|
||||
call draw_3d
|
||||
stdcall [kosglSwapBuffers]
|
||||
call [kosglSwapBuffers]
|
||||
@@:
|
||||
cmp ah,178 ;Up
|
||||
jne @f
|
||||
@ -99,7 +97,7 @@ key:
|
||||
fadd dword[delt_size]
|
||||
fstp dword[angle_y]
|
||||
call draw_3d
|
||||
stdcall [kosglSwapBuffers]
|
||||
call [kosglSwapBuffers]
|
||||
@@:
|
||||
cmp ah,177 ;Down
|
||||
jne @f
|
||||
@ -107,7 +105,7 @@ key:
|
||||
fsub dword[delt_size]
|
||||
fstp dword[angle_y]
|
||||
call draw_3d
|
||||
stdcall [kosglSwapBuffers]
|
||||
call [kosglSwapBuffers]
|
||||
@@:
|
||||
cmp ah,176 ;Left
|
||||
jne @f
|
||||
@ -115,7 +113,7 @@ key:
|
||||
fadd dword[delt_size]
|
||||
fstp dword[angle_x]
|
||||
call draw_3d
|
||||
stdcall [kosglSwapBuffers]
|
||||
call [kosglSwapBuffers]
|
||||
@@:
|
||||
cmp ah,179 ;Right
|
||||
jne @f
|
||||
@ -123,7 +121,7 @@ key:
|
||||
fsub dword[delt_size]
|
||||
fstp dword[angle_x]
|
||||
call draw_3d
|
||||
stdcall [kosglSwapBuffers]
|
||||
call [kosglSwapBuffers]
|
||||
@@:
|
||||
|
||||
jmp still
|
||||
@ -139,14 +137,11 @@ button:
|
||||
|
||||
align 4
|
||||
caption db 'Test opengl 1.1 arrays, [Esc] - exit, [<-],[->],[Up],[Down] - rotate',0
|
||||
align 4
|
||||
ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext
|
||||
;sizeof.TinyGLContext = 28
|
||||
|
||||
align 4
|
||||
draw_3d:
|
||||
stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT ;очистим буфер цвета и глубины
|
||||
stdcall [glPushMatrix]
|
||||
call [glPushMatrix]
|
||||
|
||||
;масштаб и повороты
|
||||
stdcall [glTranslatef], 0.0,0.0,0.5
|
||||
@ -155,7 +150,7 @@ stdcall [glPushMatrix]
|
||||
stdcall [glRotatef], [angle_y],0.0,1.0,0.0
|
||||
stdcall [glRotatef], [angle_x],1.0,0.0,0.0
|
||||
|
||||
;рисование через тндексный массив
|
||||
;рисование через индексный массив
|
||||
mov eax,house_3ds ;начало внедренного файла 3ds
|
||||
add eax,0xeb ;смещение по которому идут координаты вершин (получено с использованием программы info_3ds)
|
||||
stdcall [glVertexPointer], 3, GL_FLOAT, 0, eax ;задаем массив для вершин, 3 - число координат для одной вершины
|
||||
@ -163,7 +158,7 @@ stdcall [glPushMatrix]
|
||||
stdcall [glDrawElements], GL_TRIANGLES, 0x1a6*3, GL_UNSIGNED_SHORT, Indices ;mode, count, type, *indices
|
||||
stdcall [glDisableClientState], GL_VERTEX_ARRAY ;отключаем режим рисования вершин
|
||||
|
||||
stdcall [glPopMatrix]
|
||||
call [glPopMatrix]
|
||||
ret
|
||||
|
||||
align 4
|
||||
@ -199,17 +194,13 @@ include '../export.inc'
|
||||
;--------------------------------------------------
|
||||
system_path db '/sys/lib/'
|
||||
name_tgl db 'tinygl.obj',0
|
||||
err_message_found_lib db 'Sorry I cannot load library ',39,'tinygl.obj',39,0
|
||||
head_f_i:
|
||||
head_f_l db 'System error',0
|
||||
err_message_import db 'Error on load import library ',39,'tinygl.obj',39,0
|
||||
;--------------------------------------------------
|
||||
|
||||
align 4
|
||||
i_end:
|
||||
ctx1 rb 28 ;sizeof.TinyGLContext = 28
|
||||
cur_dir_path rb 4096
|
||||
library_path rb 4096
|
||||
rb 4096
|
||||
stacktop:
|
||||
cur_dir_path:
|
||||
rb 4096
|
||||
library_path:
|
||||
rb 4096
|
||||
mem:
|
||||
|
@ -6,7 +6,7 @@ use32
|
||||
include '../../../../../proc32.inc'
|
||||
include '../../../../../macros.inc'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../develop/libraries/box_lib/load_lib.mac'
|
||||
include '../../../../../load_lib.mac'
|
||||
include '../../../../../dll.inc'
|
||||
include '../opengl_const.inc'
|
||||
|
||||
@ -14,8 +14,7 @@ include '../opengl_const.inc'
|
||||
|
||||
align 4
|
||||
start:
|
||||
load_library name_tgl, cur_dir_path, library_path, system_path, \
|
||||
err_message_found_lib, head_f_l, import_lib_tinygl, err_message_import, head_f_i
|
||||
load_library name_tgl, library_path, system_path, import_tinygl
|
||||
cmp eax,SF_TERMINATE_PROCESS
|
||||
jz button.exit
|
||||
|
||||
@ -23,7 +22,7 @@ start:
|
||||
|
||||
stdcall [kosglMakeCurrent], 10,10,300,225,ctx1
|
||||
stdcall [glEnable], GL_DEPTH_TEST
|
||||
stdcall [gluNewQuadric]
|
||||
call [gluNewQuadric]
|
||||
mov [qObj],eax
|
||||
|
||||
stdcall [glClearColor], 0.5,0.5,0.5,0.0
|
||||
@ -170,7 +169,7 @@ delt_size dd 3.0
|
||||
|
||||
;--------------------------------------------------
|
||||
align 4
|
||||
import_lib_tinygl:
|
||||
import_tinygl:
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
@ -187,21 +186,13 @@ include '../export.inc'
|
||||
;--------------------------------------------------
|
||||
system_path db '/sys/lib/'
|
||||
name_tgl db 'tinygl.obj',0
|
||||
|
||||
head_f_i:
|
||||
head_f_l db '"System error',0
|
||||
err_message_import db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0
|
||||
err_message_found_lib db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0
|
||||
;--------------------------------------------------
|
||||
|
||||
align 16
|
||||
i_end:
|
||||
ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext
|
||||
;sizeof.TinyGLContext = 28
|
||||
ctx1 rb 28 ;sizeof.TinyGLContext = 28
|
||||
cur_dir_path rb 4096
|
||||
library_path rb 4096
|
||||
rb 2048
|
||||
stacktop:
|
||||
cur_dir_path:
|
||||
rb 4096
|
||||
library_path:
|
||||
rb 4096
|
||||
mem:
|
||||
|
@ -7,14 +7,13 @@ include '../../../../../proc32.inc'
|
||||
include '../../../../../macros.inc'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../load_img.inc'
|
||||
include '../../../../../load_lib.mac'
|
||||
include '../opengl_const.inc'
|
||||
include '../zbuffer.inc'
|
||||
include '../../../../../develop/info3ds/info_fun_float.inc'
|
||||
|
||||
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
|
||||
align 4
|
||||
image_data_toolbar dd 0
|
||||
IMAGE_TOOLBAR_ICON_SIZE equ 21*21*3
|
||||
|
||||
;Макрос для параметров типа double (8 байт)
|
||||
@ -366,7 +365,7 @@ lmodel_ambient dd 0.2, 0.2, 0.2, 1.0 ; Параметры фонового ос
|
||||
|
||||
;--------------------------------------------------
|
||||
align 4
|
||||
import_lib_tinygl:
|
||||
import_tinygl:
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
@ -490,14 +489,6 @@ system_dir_1 db '/sys/lib/'
|
||||
lib_name_1 db 'buf2d.obj',0
|
||||
system_dir_2 db '/sys/lib/'
|
||||
lib_name_2 db 'libimg.obj',0
|
||||
err_msg_found_lib_0 db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0
|
||||
err_msg_found_lib_1 db 'Sorry I cannot load library ',39,'buf2d.obj',39,'" -tE',0
|
||||
err_msg_found_lib_2 db 'Sorry I cannot load library ',39,'libimg.obj',39,'" -tE',0
|
||||
head_f_i:
|
||||
head_f_l db '"System error',0
|
||||
err_msg_import_0 db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0
|
||||
err_msg_import_1 db 'Error on load import library ',39,'buf2d.obj',39,'" -tE',0
|
||||
err_msg_import_2 db 'Error on load import library ',39,'libimg.obj',39,'" -tE',0
|
||||
;--------------------------------------------------
|
||||
|
||||
txt_scale:
|
||||
@ -535,23 +526,21 @@ buf_1:
|
||||
|
||||
align 4
|
||||
l_libs_start:
|
||||
lib_0 l_libs lib_name_0, cur_dir_path, file_name, system_dir_0,\
|
||||
err_msg_found_lib_0, head_f_l, import_lib_tinygl,err_msg_import_0,head_f_i
|
||||
lib_1 l_libs lib_name_1, cur_dir_path, file_name, system_dir_1,\
|
||||
err_msg_found_lib_1, head_f_l, import_buf2d, err_msg_import_1,head_f_i
|
||||
lib_2 l_libs lib_name_2, cur_dir_path, file_name, system_dir_2,\
|
||||
err_msg_found_lib_2, head_f_l, import_libimg, err_msg_import_2, head_f_i
|
||||
lib_0 l_libs lib_name_0, file_name, system_dir_0, import_tinygl
|
||||
lib_1 l_libs lib_name_1, file_name, system_dir_1, import_buf2d
|
||||
lib_2 l_libs lib_name_2, file_name, system_dir_2, import_libimg
|
||||
l_libs_end:
|
||||
|
||||
align 4
|
||||
i_end:
|
||||
ctx1 rb 28 ;sizeof.TinyGLContext = 28
|
||||
image_data_toolbar dd 0
|
||||
qObj dd 0
|
||||
run_file_70 FileInfoBlock
|
||||
sc system_colors
|
||||
align 16
|
||||
rb 4096
|
||||
stacktop:
|
||||
cur_dir_path rb 4096
|
||||
file_name rb 4096
|
||||
rb 4096
|
||||
stacktop:
|
||||
mem:
|
||||
|
@ -7,14 +7,13 @@ include '../../../../../proc32.inc'
|
||||
include '../../../../../macros.inc'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../load_img.inc'
|
||||
include '../../../../../load_lib.mac'
|
||||
include '../opengl_const.inc'
|
||||
include '../zbuffer.inc'
|
||||
include '../../../../../develop/info3ds/info_fun_float.inc'
|
||||
|
||||
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
|
||||
align 4
|
||||
image_data_toolbar dd 0
|
||||
IMAGE_TOOLBAR_ICON_SIZE equ 21*21*3
|
||||
|
||||
;Макрос для параметров типа double (8 байт)
|
||||
@ -357,7 +356,7 @@ lmodel_ambient dd 0.2, 0.2, 0.2, 1.0 ; Параметры фонового ос
|
||||
|
||||
;--------------------------------------------------
|
||||
align 4
|
||||
import_lib_tinygl:
|
||||
import_tinygl:
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
@ -481,14 +480,6 @@ system_dir_1 db '/sys/lib/'
|
||||
lib_name_1 db 'buf2d.obj',0
|
||||
system_dir_2 db '/sys/lib/'
|
||||
lib_name_2 db 'libimg.obj',0
|
||||
err_msg_found_lib_0 db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0
|
||||
err_msg_found_lib_1 db 'Sorry I cannot load library ',39,'buf2d.obj',39,'" -tE',0
|
||||
err_msg_found_lib_2 db 'Sorry I cannot load library ',39,'libimg.obj',39,'" -tE',0
|
||||
head_f_i:
|
||||
head_f_l db '"System error',0
|
||||
err_msg_import_0 db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0
|
||||
err_msg_import_1 db 'Error on load import library ',39,'buf2d.obj',39,'" -tE',0
|
||||
err_msg_import_2 db 'Error on load import library ',39,'libimg.obj',39,'" -tE',0
|
||||
;--------------------------------------------------
|
||||
|
||||
txt_scale:
|
||||
@ -526,23 +517,21 @@ buf_1:
|
||||
|
||||
align 4
|
||||
l_libs_start:
|
||||
lib_0 l_libs lib_name_0, cur_dir_path, file_name, system_dir_0,\
|
||||
err_msg_found_lib_0, head_f_l, import_lib_tinygl,err_msg_import_0,head_f_i
|
||||
lib_1 l_libs lib_name_1, cur_dir_path, file_name, system_dir_1,\
|
||||
err_msg_found_lib_1, head_f_l, import_buf2d, err_msg_import_1,head_f_i
|
||||
lib_2 l_libs lib_name_2, cur_dir_path, file_name, system_dir_2,\
|
||||
err_msg_found_lib_2, head_f_l, import_libimg, err_msg_import_2, head_f_i
|
||||
lib_0 l_libs lib_name_0, file_name, system_dir_0, import_tinygl
|
||||
lib_1 l_libs lib_name_1, file_name, system_dir_1, import_buf2d
|
||||
lib_2 l_libs lib_name_2, file_name, system_dir_2, import_libimg
|
||||
l_libs_end:
|
||||
|
||||
align 4
|
||||
i_end:
|
||||
ctx1 rb 28 ;sizeof.TinyGLContext = 28
|
||||
image_data_toolbar dd 0
|
||||
qObj dd 0
|
||||
run_file_70 FileInfoBlock
|
||||
sc system_colors
|
||||
align 16
|
||||
rb 4096
|
||||
stacktop:
|
||||
cur_dir_path rb 4096
|
||||
file_name rb 4096
|
||||
rb 4096
|
||||
stacktop:
|
||||
mem:
|
||||
|
@ -7,11 +7,12 @@ include '../../../../../proc32.inc'
|
||||
include '../../../../../macros.inc'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../load_img.inc'
|
||||
include '../../../../../load_lib.mac'
|
||||
include '../opengl_const.inc'
|
||||
include '../zbuffer.inc'
|
||||
include '../../../../../develop/info3ds/info_fun_float.inc'
|
||||
|
||||
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
|
||||
;Макрос для параметров типа double (8 байт)
|
||||
macro glpush GLDoubleVar {
|
||||
@ -19,8 +20,6 @@ macro glpush GLDoubleVar {
|
||||
push dword[GLDoubleVar]
|
||||
}
|
||||
|
||||
align 4
|
||||
image_data_toolbar dd 0
|
||||
IMAGE_TOOLBAR_ICON_SIZE equ 21*21*3
|
||||
|
||||
align 4
|
||||
@ -407,7 +406,7 @@ lmodel_ambient dd 0.2, 0.2, 0.2, 1.0 ; Параметры фонового ос
|
||||
|
||||
;--------------------------------------------------
|
||||
align 4
|
||||
import_lib_tinygl:
|
||||
import_tinygl:
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
@ -531,14 +530,6 @@ system_dir_1 db '/sys/lib/'
|
||||
lib_name_1 db 'buf2d.obj',0
|
||||
system_dir_2 db '/sys/lib/'
|
||||
lib_name_2 db 'libimg.obj',0
|
||||
err_msg_found_lib_0 db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0
|
||||
err_msg_found_lib_1 db 'Sorry I cannot load library ',39,'buf2d.obj',39,'" -tE',0
|
||||
err_msg_found_lib_2 db 'Sorry I cannot load library ',39,'libimg.obj',39,'" -tE',0
|
||||
head_f_i:
|
||||
head_f_l db '"System error',0
|
||||
err_msg_import_0 db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0
|
||||
err_msg_import_1 db 'Error on load import library ',39,'buf2d.obj',39,'" -tE',0
|
||||
err_msg_import_2 db 'Error on load import library ',39,'libimg.obj',39,'" -tE',0
|
||||
;--------------------------------------------------
|
||||
|
||||
txt_scale:
|
||||
@ -576,17 +567,15 @@ buf_1:
|
||||
|
||||
align 4
|
||||
l_libs_start:
|
||||
lib_0 l_libs lib_name_0, cur_dir_path, file_name, system_dir_0,\
|
||||
err_msg_found_lib_0, head_f_l, import_lib_tinygl,err_msg_import_0,head_f_i
|
||||
lib_1 l_libs lib_name_1, cur_dir_path, file_name, system_dir_1,\
|
||||
err_msg_found_lib_1, head_f_l, import_buf2d, err_msg_import_1,head_f_i
|
||||
lib_2 l_libs lib_name_2, cur_dir_path, file_name, system_dir_2,\
|
||||
err_msg_found_lib_2, head_f_l, import_libimg, err_msg_import_2, head_f_i
|
||||
lib_0 l_libs lib_name_0, file_name, system_dir_0, import_tinygl
|
||||
lib_1 l_libs lib_name_1, file_name, system_dir_1, import_buf2d
|
||||
lib_2 l_libs lib_name_2, file_name, system_dir_2, import_libimg
|
||||
l_libs_end:
|
||||
|
||||
align 4
|
||||
i_end:
|
||||
ctx1 rb 28 ;sizeof.TinyGLContext = 28
|
||||
image_data_toolbar dd 0
|
||||
dr_figure dd 0
|
||||
qObj dd 0
|
||||
TexObj dd 0 ;массив указателей на текстуры (в данном случае 1 шт.)
|
||||
@ -596,8 +585,8 @@ i_end:
|
||||
run_file_70 FileInfoBlock
|
||||
sc system_colors
|
||||
align 16
|
||||
rb 4096
|
||||
stacktop:
|
||||
cur_dir_path rb 4096
|
||||
file_name rb 4096
|
||||
rb 4096
|
||||
stacktop:
|
||||
mem:
|
||||
|
@ -7,11 +7,12 @@ include '../../../../../proc32.inc'
|
||||
include '../../../../../macros.inc'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../load_img.inc'
|
||||
include '../../../../../load_lib.mac'
|
||||
include '../opengl_const.inc'
|
||||
include '../zbuffer.inc'
|
||||
include '../../../../../develop/info3ds/info_fun_float.inc'
|
||||
|
||||
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
|
||||
;Макрос для параметров типа double (8 байт)
|
||||
macro glpush GLDoubleVar {
|
||||
@ -19,8 +20,6 @@ macro glpush GLDoubleVar {
|
||||
push dword[GLDoubleVar]
|
||||
}
|
||||
|
||||
align 4
|
||||
image_data_toolbar dd 0
|
||||
IMAGE_TOOLBAR_ICON_SIZE equ 21*21*3
|
||||
|
||||
align 4
|
||||
@ -337,7 +336,7 @@ delt_size dd 3.0
|
||||
|
||||
;--------------------------------------------------
|
||||
align 4
|
||||
import_lib_tinygl:
|
||||
import_tinygl:
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
@ -461,14 +460,6 @@ system_dir_1 db '/sys/lib/'
|
||||
lib_name_1 db 'buf2d.obj',0
|
||||
system_dir_2 db '/sys/lib/'
|
||||
lib_name_2 db 'libimg.obj',0
|
||||
err_msg_found_lib_0 db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0
|
||||
err_msg_found_lib_1 db 'Sorry I cannot load library ',39,'buf2d.obj',39,'" -tE',0
|
||||
err_msg_found_lib_2 db 'Sorry I cannot load library ',39,'libimg.obj',39,'" -tE',0
|
||||
head_f_i:
|
||||
head_f_l db '"System error',0
|
||||
err_msg_import_0 db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0
|
||||
err_msg_import_1 db 'Error on load import library ',39,'buf2d.obj',39,'" -tE',0
|
||||
err_msg_import_2 db 'Error on load import library ',39,'libimg.obj',39,'" -tE',0
|
||||
;--------------------------------------------------
|
||||
|
||||
txt_scale:
|
||||
@ -512,17 +503,15 @@ buf_1:
|
||||
|
||||
align 4
|
||||
l_libs_start:
|
||||
lib_0 l_libs lib_name_0, cur_dir_path, file_name, system_dir_0,\
|
||||
err_msg_found_lib_0, head_f_l, import_lib_tinygl,err_msg_import_0,head_f_i
|
||||
lib_1 l_libs lib_name_1, cur_dir_path, file_name, system_dir_1,\
|
||||
err_msg_found_lib_1, head_f_l, import_buf2d, err_msg_import_1,head_f_i
|
||||
lib_2 l_libs lib_name_2, cur_dir_path, file_name, system_dir_2,\
|
||||
err_msg_found_lib_2, head_f_l, import_libimg, err_msg_import_2, head_f_i
|
||||
lib_0 l_libs lib_name_0, file_name, system_dir_0, import_tinygl
|
||||
lib_1 l_libs lib_name_1, file_name, system_dir_1, import_buf2d
|
||||
lib_2 l_libs lib_name_2, file_name, system_dir_2, import_libimg
|
||||
l_libs_end:
|
||||
|
||||
align 4
|
||||
i_end:
|
||||
ctx1 rb 28 ;sizeof.TinyGLContext = 28
|
||||
image_data_toolbar dd 0
|
||||
dr_figure dd 0
|
||||
qObj dd 0
|
||||
TexObj dd 0 ;массив указателей на текстуры (в данном случае 1 шт.)
|
||||
@ -532,8 +521,8 @@ i_end:
|
||||
run_file_70 FileInfoBlock
|
||||
sc system_colors
|
||||
align 16
|
||||
rb 4096
|
||||
stacktop:
|
||||
cur_dir_path rb 4096
|
||||
file_name rb 4096
|
||||
rb 4096
|
||||
stacktop:
|
||||
mem:
|
||||
|
@ -7,11 +7,12 @@ include '../../../../../proc32.inc'
|
||||
include '../../../../../macros.inc'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../load_img.inc'
|
||||
include '../../../../../load_lib.mac'
|
||||
include '../opengl_const.inc'
|
||||
include '../zbuffer.inc'
|
||||
include '../../../../../develop/info3ds/info_fun_float.inc'
|
||||
|
||||
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
|
||||
;Макрос для параметров типа double (8 байт)
|
||||
macro glpush GLDoubleVar {
|
||||
@ -19,8 +20,6 @@ macro glpush GLDoubleVar {
|
||||
push dword[GLDoubleVar]
|
||||
}
|
||||
|
||||
align 4
|
||||
image_data_toolbar dd 0
|
||||
IMAGE_TOOLBAR_ICON_SIZE equ 21*21*3
|
||||
|
||||
align 4
|
||||
@ -294,7 +293,7 @@ delt_size dd 3.0
|
||||
|
||||
;--------------------------------------------------
|
||||
align 4
|
||||
import_lib_tinygl:
|
||||
import_tinygl:
|
||||
|
||||
macro E_LIB n
|
||||
{
|
||||
@ -418,14 +417,6 @@ system_dir_1 db '/sys/lib/'
|
||||
lib_name_1 db 'buf2d.obj',0
|
||||
system_dir_2 db '/sys/lib/'
|
||||
lib_name_2 db 'libimg.obj',0
|
||||
err_msg_found_lib_0 db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0
|
||||
err_msg_found_lib_1 db 'Sorry I cannot load library ',39,'buf2d.obj',39,'" -tE',0
|
||||
err_msg_found_lib_2 db 'Sorry I cannot load library ',39,'libimg.obj',39,'" -tE',0
|
||||
head_f_i:
|
||||
head_f_l db '"System error',0
|
||||
err_msg_import_0 db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0
|
||||
err_msg_import_1 db 'Error on load import library ',39,'buf2d.obj',39,'" -tE',0
|
||||
err_msg_import_2 db 'Error on load import library ',39,'libimg.obj',39,'" -tE',0
|
||||
;--------------------------------------------------
|
||||
|
||||
txt_scale:
|
||||
@ -469,17 +460,15 @@ buf_1:
|
||||
|
||||
align 4
|
||||
l_libs_start:
|
||||
lib_0 l_libs lib_name_0, cur_dir_path, file_name, system_dir_0,\
|
||||
err_msg_found_lib_0, head_f_l, import_lib_tinygl,err_msg_import_0,head_f_i
|
||||
lib_1 l_libs lib_name_1, cur_dir_path, file_name, system_dir_1,\
|
||||
err_msg_found_lib_1, head_f_l, import_buf2d, err_msg_import_1,head_f_i
|
||||
lib_2 l_libs lib_name_2, cur_dir_path, file_name, system_dir_2,\
|
||||
err_msg_found_lib_2, head_f_l, import_libimg, err_msg_import_2, head_f_i
|
||||
lib_0 l_libs lib_name_0, file_name, system_dir_0, import_tinygl
|
||||
lib_1 l_libs lib_name_1, file_name, system_dir_1, import_buf2d
|
||||
lib_2 l_libs lib_name_2, file_name, system_dir_2, import_libimg
|
||||
l_libs_end:
|
||||
|
||||
align 4
|
||||
i_end:
|
||||
ctx1 rb 28 ;sizeof.TinyGLContext = 28
|
||||
image_data_toolbar dd 0
|
||||
qObj dd 0
|
||||
TexObj dd 0 ;массив указателей на текстуры (в данном случае 1 шт.)
|
||||
texture dd 0 ;указатель на память с текстурой
|
||||
@ -488,8 +477,8 @@ i_end:
|
||||
run_file_70 FileInfoBlock
|
||||
sc system_colors
|
||||
align 16
|
||||
rb 4096
|
||||
stacktop:
|
||||
cur_dir_path rb 4096
|
||||
file_name rb 4096
|
||||
rb 4096
|
||||
stacktop:
|
||||
mem:
|
||||
|
@ -5,7 +5,7 @@
|
||||
; Š®«¨ç¥á⢮ § ª®¢ ç¨á« ¯®á«¥ § ¯ï⮩ (1-17)
|
||||
NumberSymbolsAD DW 5
|
||||
; Š®áâ âë (10 ¢ á⥯¥¨ N)
|
||||
MConst DQ 1.0E1,1.0E2,1.0E3,1.0E4,1.0E5
|
||||
MConst: DQ 1.0E1,1.0E2,1.0E3,1.0E4,1.0E5
|
||||
DQ 1.0E6,1.0E7,1.0E8,1.0E9,1.0E10
|
||||
DQ 1.0E11,1.0E12,1.0E13,1.0E14,1.0E15
|
||||
DQ 1.0E16,1.0E17,1.0E18,1.0E19,1.0E20
|
||||
@ -31,6 +31,7 @@ MConst DQ 1.0E1,1.0E2,1.0E3,1.0E4,1.0E5
|
||||
DQ 1.0E116,1.0E117,1.0E118,1.0E119,1.0E120
|
||||
DQ 1.0E121,1.0E122,1.0E123,1.0E124,1.0E125
|
||||
DQ 1.0E126,1.0E127,1.0E128
|
||||
.end:
|
||||
; —¨á«® á ¯« ¢ î饩 § ¯ï⮩ ¤¢®©®© â®ç®áâ¨
|
||||
Data_Double DQ ?
|
||||
; —¨á«® ¢ BCD-ä®à¬ â¥
|
||||
@ -39,9 +40,10 @@ Data_BCD DT ?
|
||||
Data_Flag DB ?
|
||||
; ‡ ª १ã«ìâ â (¥á«¨ ¥ 0 - ®âà¨æ ⥫쮥 ç¨á«®)
|
||||
Data_Sign DB ?
|
||||
; ‡ ª १ã«ìâ â - 0 ¤«ï ..e+.. ¨ 1 ¤«ï ..e-..
|
||||
Data_Sign_Exp DB ?
|
||||
|
||||
|
||||
db 0 ;㪠§ ⥫ì ᤢ¨£ ¢ ¯ ¬ïâ¨
|
||||
align 4
|
||||
; ‘âப ¤«ï åà ¥¨ï ç¨á« ¢ ª®¤¥ ASCII
|
||||
Data_String DB 32 DUP (?)
|
||||
|
||||
@ -59,10 +61,11 @@ Data_String DB 32 DUP (?)
|
||||
;* ‚ëå®¤ë¥ ¯ à ¬¥âàë: *
|
||||
;* Data_String - áâப -१ã«ìâ â. *
|
||||
;*******************************************************
|
||||
align 4
|
||||
DoubleFloat_to_String:
|
||||
pushad
|
||||
; <EFBFBD>¥§ã«ìâ â § ¯¨áë¢ âì ¢ áâபã Data_String
|
||||
lea EDI, [Data_String]
|
||||
mov EDI, Data_String
|
||||
|
||||
; ‘¤¢¨£ ¥¬ ç¨á«® ¢«¥¢® NumberSymbolsAD
|
||||
; ¤¥áïâ¨çëå à §à冷¢
|
||||
@ -74,9 +77,7 @@ DoubleFloat_to_String:
|
||||
je .NoShifts ;¥â æ¨äà ¯®á«¥ § ¯ï⮩
|
||||
jl .Error ;®è¨¡ª
|
||||
dec BX
|
||||
shl BX, 3 ;㬮¦ ¥¬ 8
|
||||
lea eax,[MConst]
|
||||
add EBX, eax
|
||||
lea ebx,[MConst+8*ebx]
|
||||
fmul qword [EBX] ;㬮¦¨âì ª®áâ âã
|
||||
.NoShifts:
|
||||
; ˆ§¢«¥çì ç¨á«® ¢ ª®¤¥ BCD
|
||||
@ -130,8 +131,8 @@ DoubleFloat_to_String:
|
||||
stosb
|
||||
|
||||
; “¡à âì ¥§ ç 騥 㫨 á«¥¢
|
||||
lea EDI, [Data_String]
|
||||
lea ESI, [Data_String]
|
||||
mov EDI, Data_String
|
||||
mov ESI, Data_String
|
||||
; <EFBFBD>யãáâ¨âì § ª ç¨á« , ¥á«¨ ® ¥áâì
|
||||
cmp byte [ESI],'-'
|
||||
jne .N2
|
||||
@ -151,10 +152,11 @@ DoubleFloat_to_String:
|
||||
; Žè¨¡ª - ¥â § ç é¨å æ¨äà
|
||||
jmp .Error
|
||||
; ‘ª®¯¨à®¢ âì § ç éãî ç áâì ç¨á« ¢ ç «® áâப¨
|
||||
align 4
|
||||
.N4: rep movsb
|
||||
jmp .End
|
||||
|
||||
; Žè¨¡ª
|
||||
align 4
|
||||
.Error:
|
||||
mov AL,'E'
|
||||
stosb
|
||||
@ -166,12 +168,14 @@ DoubleFloat_to_String:
|
||||
stosb
|
||||
jmp .End
|
||||
; <EFBFBD>¥à¥¯®«¥¨¥ à §à冷© á¥âª¨
|
||||
align 4
|
||||
.Overflow:
|
||||
mov AL,'#'
|
||||
stosb
|
||||
xor AL,AL
|
||||
stosb
|
||||
; Š®¥æ ¯à®æ¥¤ãàë
|
||||
align 4
|
||||
.End:
|
||||
popad
|
||||
ret
|
||||
@ -184,6 +188,7 @@ DoubleFloat_to_String:
|
||||
;* ‚ëå®¤ë¥ ¯ à ¬¥âàë: *
|
||||
;* Data_Double - ç¨á«® ¢ ¤¢®¨ç®¬ ª®¤¥. *
|
||||
;****************************************************
|
||||
align 4
|
||||
String_to_DoubleFloat:
|
||||
pushad
|
||||
cld
|
||||
@ -193,110 +198,200 @@ String_to_DoubleFloat:
|
||||
mov word [Data_BCD+8],0
|
||||
; Žç¨é ¥¬ ¡ ©â § ª
|
||||
mov [Data_Sign],0
|
||||
; ‡ ®á¨¬ ¢ SI 㪠§ ⥫ì áâபã
|
||||
lea ESI, [Data_String]
|
||||
; ‡ ®á¨¬ ¢ esi 㪠§ ⥫ì áâபã
|
||||
mov esi, Data_String
|
||||
; <EFBFBD>யã᪠¥¬ ¯à®¡¥«ë ¯¥à¥¤ ç¨á«®¬
|
||||
mov ecx,64 ;§ é¨â ®â § 横«¨¢ ¨ï
|
||||
.ShiftIgnore:
|
||||
lodsb
|
||||
cmp AL,' '
|
||||
jne .ShiftIgnoreEnd
|
||||
loop .ShiftIgnore
|
||||
jmp .Error
|
||||
cmp al,' '
|
||||
jne .ShiftIgnoreEnd
|
||||
loop .ShiftIgnore
|
||||
jmp .Error
|
||||
align 4
|
||||
.ShiftIgnoreEnd:
|
||||
; <EFBFBD>஢¥à塞 § ª ç¨á«
|
||||
cmp AL,'-'
|
||||
cmp al,'-'
|
||||
jne .Positive
|
||||
mov [Data_Sign],80h
|
||||
lodsb
|
||||
.Positive:
|
||||
mov [Data_Flag],0 ;¯à¨§ ª «¨ç¨ï â®çª¨
|
||||
mov DX,0 ;¯®§¨æ¨ï â®çª¨
|
||||
xor edx,edx ;¯®§¨æ¨ï â®çª¨
|
||||
mov ecx,18 ;¬ ªá. ç¨á«® à §à冷¢
|
||||
align 4
|
||||
.ASCIItoBCDConversion:
|
||||
cmp AL,'.' ;â®çª ?
|
||||
cmp al,'.' ;â®çª ?
|
||||
jne .NotDot
|
||||
cmp [Data_Flag],0 ;â®çª ¥ ¢áâà¥ç « áì?
|
||||
jne .Error
|
||||
jne .Error ;¥á«¨ â®çª 㦥 ¡ë«
|
||||
mov [Data_Flag],1
|
||||
lodsb
|
||||
cmp AL,0 ;ª®¥æ áâப¨?
|
||||
jne .NotDot
|
||||
or al,al ;ª®¥æ áâப¨?
|
||||
jnz .NotDot
|
||||
jmp .ASCIItoBCDConversionEnd
|
||||
align 4
|
||||
.NotDot:
|
||||
; “¢¥«¨ç¨âì 1 § 票¥ ¯®§¨æ¨¨ â®çª¨,
|
||||
; ¥á«¨ ® ¥é¥ ¥ ¢áâà¥ç « áì
|
||||
cmp [Data_Flag],0
|
||||
jnz .Figures
|
||||
inc DX
|
||||
inc edx
|
||||
.Figures:
|
||||
cmp al,'e'
|
||||
je .exp_form
|
||||
cmp al,'E'
|
||||
jne @f
|
||||
.exp_form:
|
||||
call string_ExpForm ;¥á«¨ ç¨á«® ¢ ä®à¬ ⥠..e..
|
||||
or al,al
|
||||
jnz .Error
|
||||
jmp .ASCIItoBCDConversionEnd
|
||||
@@:
|
||||
; ‘¨¬¢®«ë ç¨á« ¤®«¦ë ¡ëâì æ¨äà ¬¨
|
||||
cmp AL,'0'
|
||||
cmp al,'0'
|
||||
jb .Error
|
||||
cmp AL,'9'
|
||||
cmp al,'9'
|
||||
ja .Error
|
||||
; <EFBFBD>¨è¥¬ ®ç¥à¥¤ãî æ¨äàã ¢ ¬« ¤èãî â¥âà ¤ã BCD
|
||||
and AL,0Fh
|
||||
or byte [Data_BCD],AL
|
||||
and al,15 ;ᨬ¢®«ë 0-9 ¯¥à¥¢®¤¨¬ ¢ ç¨á«®
|
||||
or byte [Data_BCD],al
|
||||
; <EFBFBD>஢¥àª ª®¥æ áâப¨
|
||||
cmp byte [ESI],0
|
||||
cmp byte [esi],0
|
||||
je .ASCIItoBCDConversionEnd
|
||||
; ‘¤¢¨£ ¥¬ BCD 4 à §àï¤ ¢«¥¢®
|
||||
; (ᤢ¨£ ¥¬ áâ à訥 2 ¡ ©â )
|
||||
mov AX,word [Data_BCD+6]
|
||||
shld word [Data_BCD+8],AX,4
|
||||
mov ax,word [Data_BCD+6]
|
||||
shld word [Data_BCD+8],ax,4
|
||||
; (ᤢ¨£ ¥¬ á।¨¥ 4 ¡ ©â )
|
||||
mov EAX, dword [Data_BCD]
|
||||
shld dword [Data_BCD+4],EAX,4
|
||||
mov eax,dword [Data_BCD]
|
||||
shld dword [Data_BCD+4],eax,4
|
||||
; (ᤢ¨£ ¥¬ ¬« ¤è¨¥ 4 ¡ ©â )
|
||||
shl dword [Data_BCD],4
|
||||
; ‡ £à㦠¥¬ á«¥¤ãî騩 ᨬ¢®« ¢ AL
|
||||
lodsb
|
||||
loop .ASCIItoBCDConversion
|
||||
loop .ASCIItoBCDConversion ;¥á«¨ ¥ ª®¬¯¨«. â® ¯®áâ ¢¨âì dec ecx, jnz ...
|
||||
; …᫨ 19-© ᨬ¢®« ¥ 0 ¨ ¥ â®çª ,
|
||||
; â® ®è¨¡ª ¯¥à¥¯®«¥¨ï
|
||||
cmp AL,'.'
|
||||
cmp al,'.'
|
||||
jne .NotDot2
|
||||
inc ecx
|
||||
inc ecx ;¯à®¯ã᪠â®çª¨ ¢ ª®æ¥ ®ç¥ì ¡®«ì讣® ç¨á«
|
||||
lodsb
|
||||
.NotDot2:
|
||||
cmp AL,0
|
||||
jne .Error ;¯¥à¥¯®«¥¨¥ à §à冷© á¥âª¨
|
||||
or al,al ;¯¥à¥¯®«¥¨¥ à §à冷© á¥âª¨?
|
||||
jz .ASCIItoBCDConversionEnd
|
||||
align 4
|
||||
.Error: ; <EFBFBD>ਠ«î¡®© ®è¨¡ª¥ ®¡ã«¨âì १ã«ìâ â
|
||||
fldz ;§ ¥á⨠®«ì á á⥪ ᮯà®æ¥áá®à
|
||||
fstp [Data_Double]
|
||||
jmp .End
|
||||
|
||||
; <EFBFBD><EFBFBD>…Ž<EFBFBD><EFBFBD>€‡Ž‚€’œ —ˆ‘‹Ž ˆ‡ ŠŽ„€ BCD ‚ ‚…™…‘’‚…<EFBFBD><EFBFBD>Ž… —ˆ‘‹Ž
|
||||
.ASCIItoBCDConversionEnd:
|
||||
; ‚¯¨á âì § ª ¢ áâ à訩 ¡ ©â
|
||||
mov AL,[Data_Sign]
|
||||
mov byte [Data_BCD+9],AL
|
||||
mov al,[Data_Sign]
|
||||
mov byte [Data_BCD+9],al
|
||||
; ‘¡à®á¨âì ॣ¨áâàë ᮯà®æ¥áá®à
|
||||
fninit
|
||||
; ‡ £à㧨âì ¢ ᮯà®æ¥áá®à ç¨á«® ¢ BCD-ä®à¬ â¥
|
||||
fbld [Data_BCD]
|
||||
; ‚ëç¨á«¨âì ®¬¥à ¤¥«¨â¥«ï
|
||||
mov EBX,18+1
|
||||
sub BX,CX
|
||||
sub BX,DX
|
||||
cmp EBX,0
|
||||
je .NoDiv
|
||||
dec EBX
|
||||
shl EBX,3 ;㬮¦ ¥¬ 8
|
||||
lea eax,[MConst]
|
||||
add EBX,eax
|
||||
fdiv qword [EBX] ;à §¤¥«¨âì ª®áâ âã
|
||||
.NoDiv:; ‚ë£à㧨âì ç¨á«® ¢ ¤¢®¨ç®¬ ä®à¬ â¥
|
||||
fstp [Data_Double]
|
||||
jmp .End
|
||||
|
||||
.Error:; <EFBFBD>ਠ«î¡®© ®è¨¡ª¥ ®¡ã«¨âì १ã«ìâ â
|
||||
fldz ;§ ¥á⨠®«ì á á⥪ ᮯà®æ¥áá®à
|
||||
fstp [Data_Double]
|
||||
; ‚ëç¨á«¨âì ®¬¥à ¤¥«¨â¥«ï ¨«¨ ¬®¦¨â¥«ï
|
||||
lea ebx,[ecx+edx-18]
|
||||
cmp ebx,0
|
||||
jle .NoMul ;¥á«¨ ç¨á«® e-..
|
||||
dec ebx
|
||||
jz .NoDiv ;¥á«¨ ç¨á«® e+0
|
||||
dec ebx
|
||||
lea ebx,[MConst+8*ebx]
|
||||
cmp ebx,MConst.end
|
||||
jl @f
|
||||
ffree st0
|
||||
fincstp
|
||||
jmp .Error ;¥á«¨ ®ç¥ì ¡®«ì讥 ç¨á«® e+**
|
||||
@@:
|
||||
fmul qword [ebx] ;㬮¦¨âì ª®áâ âã (¤«ï ç¨á¥« á ¯à¨áâ ¢ª®© e+..)
|
||||
jmp .NoDiv
|
||||
.NoMul:
|
||||
neg ebx
|
||||
lea ebx,[MConst+8*ebx]
|
||||
cmp ebx,MConst.end
|
||||
jl @f
|
||||
ffree st0
|
||||
fincstp
|
||||
jmp .Error ;¥á«¨ ®ç¥ì ¬ «¥ìª®¥ ç¨á«® e-**
|
||||
@@:
|
||||
fdiv qword [ebx] ;à §¤¥«¨âì ª®áâ âã
|
||||
.NoDiv: ;‚ë£à㧨âì ç¨á«® ¢ ¤¢®¨ç®¬ ä®à¬ â¥
|
||||
fstp [Data_Double]
|
||||
.End:
|
||||
popad
|
||||
ret
|
||||
|
||||
;output:
|
||||
; eax - 1 if error
|
||||
; edx += size
|
||||
align 4
|
||||
proc str_cat, str1:dword, str2:dword
|
||||
push eax ecx edi esi
|
||||
proc string_ExpForm uses ebx
|
||||
mov [Data_Sign_Exp],0
|
||||
xor eax,eax
|
||||
lodsb
|
||||
cmp al,'+'
|
||||
jne @f
|
||||
lodsb
|
||||
@@:
|
||||
cmp al,'-'
|
||||
jne @f
|
||||
inc [Data_Sign_Exp]
|
||||
lodsb
|
||||
@@:
|
||||
|
||||
xor ebx,ebx
|
||||
.cycle0:
|
||||
cmp al,0
|
||||
je .cycle0end
|
||||
cmp al,9
|
||||
je .cycle0end
|
||||
cmp al,10
|
||||
je .cycle0end
|
||||
cmp al,13
|
||||
je .cycle0end
|
||||
cmp al,' '
|
||||
je .cycle0end
|
||||
cmp al,'0'
|
||||
jb .Error
|
||||
cmp al,'9'
|
||||
ja .Error
|
||||
|
||||
imul ebx,10
|
||||
and eax,15 ;ᨬ¢®«ë 0-9 ¯¥à¥¢®¤¨¬ ¢ ç¨á«®
|
||||
add ebx,eax
|
||||
lodsb
|
||||
jmp .cycle0
|
||||
.cycle0end:
|
||||
|
||||
cmp ebx,328 ;308 - ¬ ªá. à §¬¥à á⥯¥¨ ¤«ï double + 20 - ç¨á«® à §à冷¢ ¢ BCD
|
||||
ja .Error
|
||||
cmp [Data_Sign_Exp],0
|
||||
je @f
|
||||
neg ebx
|
||||
@@:
|
||||
cmp [Data_Flag],0 ;â®çª ¥ ¢áâà¥ç « áì?
|
||||
jne @f
|
||||
dec edx
|
||||
@@:
|
||||
add edx,ebx
|
||||
|
||||
xor eax,eax
|
||||
jmp @f
|
||||
.Error:
|
||||
xor eax,eax
|
||||
inc eax
|
||||
@@:
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
proc str_cat uses eax ecx edi esi, str1:dword, str2:dword
|
||||
mov esi,dword[str2]
|
||||
stdcall str_len,esi
|
||||
mov ecx,eax
|
||||
@ -306,7 +401,6 @@ proc str_cat, str1:dword, str2:dword
|
||||
add edi,eax
|
||||
cld
|
||||
repne movsb
|
||||
pop esi edi ecx eax
|
||||
ret
|
||||
endp
|
||||
|
||||
@ -324,3 +418,33 @@ proc str_len, str1:dword
|
||||
sub eax,[str1]
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
proc String_crop_0 uses eax ebx ecx edi
|
||||
mov edi,Data_String
|
||||
mov al,'.'
|
||||
mov ecx,32
|
||||
repne scasb
|
||||
mov ebx,edi
|
||||
mov edi,Data_String
|
||||
xor al,al
|
||||
mov ecx,32
|
||||
repne scasb
|
||||
cmp ebx,edi
|
||||
jg .end_f
|
||||
dec edi
|
||||
.cycle0:
|
||||
dec edi
|
||||
cmp edi,Data_String
|
||||
jle .end_f
|
||||
cmp byte[edi],'0'
|
||||
jne .cycle0end
|
||||
mov byte[edi],0
|
||||
jmp .cycle0
|
||||
.cycle0end:
|
||||
cmp byte[edi],'.'
|
||||
jne .end_f
|
||||
mov byte[edi],0
|
||||
.end_f:
|
||||
ret
|
||||
endp
|
@ -105,12 +105,6 @@ align 4
|
||||
end if
|
||||
|
||||
; ***
|
||||
glVertex2d: ;(double ,double)
|
||||
glVertex2dv: ;(double *)
|
||||
glVertex3d: ;(double ,double ,double)
|
||||
glVertex3dv: ;(double *)
|
||||
glVertex4d: ;(double ,double ,double, double )
|
||||
glVertex4dv: ;(double *)
|
||||
glColor3d: ;(double ,double ,double)
|
||||
glColor3dv: ;(double *)
|
||||
glColor4d: ;(double ,double ,double, double )
|
||||
|
@ -48,8 +48,8 @@ proc png_set_sig_bytes uses eax edi, png_ptr:dword, num_bytes:dword
|
||||
png_debug 1, 'in png_set_sig_bytes'
|
||||
|
||||
mov edi,[png_ptr]
|
||||
cmp edi,0
|
||||
je .end_f ;if (..==0) return
|
||||
or edi,edi
|
||||
jz .end_f ;if (..==0) return
|
||||
|
||||
mov eax,[num_bytes]
|
||||
cmp eax,0
|
||||
@ -101,13 +101,10 @@ endp
|
||||
align 4
|
||||
proc png_zalloc uses edx ecx, png_ptr:dword, items:dword, size:dword
|
||||
|
||||
cmp dword[png_ptr],0
|
||||
jne @f
|
||||
xor eax,eax
|
||||
jmp .end_f ;if (..==0) return 0
|
||||
@@:
|
||||
|
||||
xor eax,eax
|
||||
cmp dword[png_ptr],eax
|
||||
je .end_f ;if (..==0) return 0
|
||||
|
||||
not eax
|
||||
xor edx,edx
|
||||
mov ecx,[size]
|
||||
@ -161,8 +158,8 @@ locals
|
||||
endl
|
||||
mov edi,[png_ptr]
|
||||
PNG_CHUNK_ANCILLARY [edi+png_struct.chunk_name]
|
||||
cmp eax,0 ;if (..!=0)
|
||||
je @f
|
||||
or eax,eax ;if (..!=0)
|
||||
jz @f
|
||||
mov eax,[edi+png_struct.flags]
|
||||
and eax,PNG_FLAG_CRC_ANCILLARY_MASK
|
||||
cmp eax,PNG_FLAG_CRC_ANCILLARY_USE or PNG_FLAG_CRC_ANCILLARY_NOWARN
|
||||
@ -340,12 +337,12 @@ end if
|
||||
; Call the general version checker (shared with read and write code):
|
||||
|
||||
stdcall png_user_version_check, ebx, [user_png_ver]
|
||||
cmp eax,0
|
||||
je .end0 ;if (..!=0)
|
||||
or eax,eax
|
||||
jz .end0 ;if (..!=0)
|
||||
stdcall png_malloc_warn, ebx, sizeof.png_struct
|
||||
;eax = png_ptr
|
||||
cmp eax,0
|
||||
je .end0 ;if (..!=0)
|
||||
or eax,eax
|
||||
jz .end0 ;if (..!=0)
|
||||
; png_ptr->zstream holds a back-pointer to the png_struct, so
|
||||
; this can only be done now:
|
||||
|
||||
@ -379,34 +376,27 @@ endp
|
||||
; Allocate the memory for an info_struct for the application.
|
||||
;png_infop (png_structrp png_ptr)
|
||||
align 4
|
||||
proc png_create_info_struct uses ebx ecx edi, png_ptr:dword
|
||||
proc png_create_info_struct uses ecx edi, png_ptr:dword
|
||||
png_debug 1, 'in png_create_info_struct'
|
||||
;ebx - info_ptr dd ? ;png_inforp
|
||||
|
||||
mov edi,[png_ptr]
|
||||
cmp edi,0
|
||||
jne @f ;if (..==0) return 0
|
||||
xor eax,eax
|
||||
jmp .end_f
|
||||
@@:
|
||||
mov eax,[png_ptr]
|
||||
or eax,eax
|
||||
jz .end_f ;if (..==0) return 0
|
||||
|
||||
; Use the internal API that does not (or at least should not) error out, so
|
||||
; that this call always returns ok. The application typically sets up the
|
||||
; error handling *after* creating the info_struct because this is the way it
|
||||
; has always been done in 'example.asm'.
|
||||
|
||||
stdcall png_malloc_base, edi, sizeof.png_info_def
|
||||
mov ebx,eax
|
||||
|
||||
cmp eax,0
|
||||
je @f
|
||||
stdcall png_malloc_base, eax, sizeof.png_info_def
|
||||
or eax,eax
|
||||
jz .end_f
|
||||
push eax
|
||||
mov edi,eax
|
||||
xor eax,eax
|
||||
mov ecx,sizeof.png_info_def
|
||||
rep stosb ;memset(...
|
||||
@@:
|
||||
|
||||
mov eax,ebx
|
||||
pop eax
|
||||
.end_f:
|
||||
ret
|
||||
endp
|
||||
@ -428,8 +418,8 @@ proc png_destroy_info_struct uses eax ebx ecx edi, png_ptr:dword, info_ptr_ptr:d
|
||||
je .end_f ;if (..==0) return
|
||||
|
||||
mov edi,[info_ptr_ptr]
|
||||
cmp edi,0 ;if (..!=0)
|
||||
je .end_f
|
||||
or edi,edi ;if (..!=0)
|
||||
jz .end_f
|
||||
; Do this first in case of an error below; if the app implements its own
|
||||
; memory management this can lead to png_free calling png_error, which
|
||||
; will abort this routine and return control to the app error handler.
|
||||
@ -490,11 +480,11 @@ proc png_data_freer uses edi esi, png_ptr:dword, info_ptr:dword, freer:dword, ma
|
||||
png_debug 1, 'in png_data_freer'
|
||||
|
||||
mov edi,[png_ptr]
|
||||
cmp edi,0
|
||||
je .end_f
|
||||
or edi,edi
|
||||
jz .end_f
|
||||
mov esi,[info_ptr]
|
||||
cmp esi,0
|
||||
je .end_f ;if (..==0 || ..==0) return
|
||||
or esi,esi
|
||||
jz .end_f ;if (..==0 || ..==0) return
|
||||
|
||||
; if (freer == PNG_DESTROY_WILL_FREE_DATA)
|
||||
; info_ptr->free_me |= mask;
|
||||
@ -514,11 +504,11 @@ proc png_free_data uses eax edi esi, png_ptr:dword, info_ptr:dword, mask:dword,
|
||||
png_debug 1, 'in png_free_data'
|
||||
|
||||
mov edi,[png_ptr]
|
||||
cmp edi,0
|
||||
je .end_f
|
||||
or edi,edi
|
||||
jz .end_f
|
||||
mov esi,[info_ptr]
|
||||
cmp esi,0
|
||||
je .end_f ;if (..==0 || ..==0) return
|
||||
or esi,esi
|
||||
jz .end_f ;if (..==0 || ..==0) return
|
||||
|
||||
if PNG_TEXT_SUPPORTED eq 1
|
||||
; Free text item num or (if num == -1) all text items
|
||||
@ -722,8 +712,8 @@ endp
|
||||
align 4
|
||||
proc png_get_io_ptr, png_ptr:dword
|
||||
mov eax,[png_ptr]
|
||||
cmp eax,0
|
||||
je @f ;if (..==0) return 0
|
||||
or eax,eax
|
||||
jz @f ;if (..==0) return 0
|
||||
mov eax,[eax+png_struct.io_ptr]
|
||||
@@:
|
||||
ret
|
||||
@ -742,8 +732,8 @@ proc png_init_io uses eax edi, png_ptr:dword, fp:dword
|
||||
png_debug 1, 'in png_init_io'
|
||||
|
||||
mov edi,[png_ptr]
|
||||
cmp edi,0
|
||||
je @f ;if (..==0) return
|
||||
or edi,edi
|
||||
jz @f ;if (..==0) return
|
||||
mov eax,[fp]
|
||||
mov [edi+png_struct.io_ptr],eax
|
||||
@@:
|
||||
@ -967,8 +957,8 @@ proc png_handle_as_unknown uses ecx edi esi, png_ptr:dword, chunk_name:dword
|
||||
; bytep p, p_end;
|
||||
|
||||
mov edi,[png_ptr]
|
||||
cmp edi,0
|
||||
je .end0
|
||||
or edi,edi
|
||||
jz .end0
|
||||
cmp dword[chunk_name],0
|
||||
je .end0
|
||||
cmp dword[edi+png_struct.num_chunk_list],0
|
||||
@ -1020,8 +1010,8 @@ endp
|
||||
align 4
|
||||
proc png_reset_zstream, png_ptr:dword
|
||||
mov eax,[png_ptr]
|
||||
cmp eax,0
|
||||
jne @f ;if (..==0)
|
||||
or eax,eax
|
||||
jnz @f ;if (..==0)
|
||||
mov eax,Z_STREAM_ERROR
|
||||
jmp .end_f
|
||||
@@:
|
||||
@ -1289,8 +1279,8 @@ endp
|
||||
align 4
|
||||
proc png_colorspace_sync uses ecx edi esi, png_ptr:dword, info_ptr:dword
|
||||
mov edi,[info_ptr]
|
||||
cmp edi,0
|
||||
je @f ;if (..==0) ;reduce code size; check here not in the caller
|
||||
or edi,edi
|
||||
jz @f ;if (..==0) ;reduce code size; check here not in the caller
|
||||
mov ecx,sizeof.png_colorspace
|
||||
mov esi,[png_ptr]
|
||||
add esi,png_struct.colorspace
|
||||
@ -1935,8 +1925,8 @@ locals
|
||||
message rb 196 ;char[] ;see below for calculation
|
||||
endl
|
||||
mov eax,[colorspace]
|
||||
cmp eax,0
|
||||
je @f ;if (..!=0)
|
||||
or eax,eax
|
||||
jz @f ;if (..!=0)
|
||||
or word[eax+png_colorspace.flags], PNG_COLORSPACE_INVALID
|
||||
@@:
|
||||
|
||||
@ -2857,8 +2847,8 @@ else
|
||||
@@:
|
||||
end if
|
||||
|
||||
cmp ebx,0
|
||||
je @f
|
||||
or ebx,ebx
|
||||
jz @f
|
||||
png_error edi, 'Invalid IHDR data'
|
||||
@@:
|
||||
ret
|
||||
@ -4432,8 +4422,8 @@ endp
|
||||
align 4
|
||||
proc png_set_option uses ecx, png_ptr:dword, option:dword, onoff:dword
|
||||
mov eax,[png_ptr]
|
||||
cmp eax,0
|
||||
je @f
|
||||
or eax,eax
|
||||
jz @f
|
||||
mov ecx,[option]
|
||||
cmp ecx,0
|
||||
jl @f
|
||||
@ -4695,8 +4685,8 @@ proc png_image_free uses eax ebx, image:dword
|
||||
; png_safe_execute will call this API after the return.
|
||||
|
||||
mov ebx,[image]
|
||||
cmp ebx,0
|
||||
je @f
|
||||
or ebx,ebx
|
||||
jz @f
|
||||
cmp dword[ebx+png_image.opaque],0
|
||||
je @f
|
||||
mov eax,[ebx+png_image.opaque]
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,5 +1,5 @@
|
||||
use32
|
||||
org 0x0
|
||||
org 0
|
||||
db 'MENUET01' ;¨¤¥â¨ä. ¨á¯®«ï¥¬®£® ä ©« ¢á¥£¤ 8 ¡ ©â
|
||||
dd 1,start,i_end,mem,stacktop,0,sys_path
|
||||
|
||||
@ -42,11 +42,12 @@ include '../../../macros.inc'
|
||||
include '../../../proc32.inc'
|
||||
include '../../../KOSfuncs.inc'
|
||||
include '../../../load_img.inc'
|
||||
include '../../../load_lib.mac'
|
||||
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include 'le_pole.inc'
|
||||
include 'le_signal.inc'
|
||||
|
||||
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
caption db '‹®£¨ç¥áª¨¥ í«¥¬¥âë 13.02.16',0 ;¯®¤¯¨áì ®ª
|
||||
|
||||
panel_0_coord_top equ 5 ;¢¥àåïï ª®®à¤¨ â 0-£® àï¤ ¯ ¥«¨ ¨áâà㬥⮢
|
||||
@ -171,12 +172,6 @@ mcs dd 1, 0, 0, 1,\
|
||||
0,-1, 1, 0
|
||||
|
||||
IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
|
||||
image_data_toolbar dd 0
|
||||
|
||||
icon_tl_sys dd 0 ;㪠§ â¥«ì ¯ ¬ïâì ¤«ï åà ¥¨ï á¨á⥬ëå ¨ª®®ª
|
||||
icon_toolbar dd 0 ;㪠§ â¥«ì ¯ ¬ïâì ¤«ï åà ¥¨ï ¨ª®®ª ®¡ê¥ªâ®¢
|
||||
|
||||
image_data_gray dd 0 ;¯ ¬ïâì á ¢à¥¬¥ë¬¨ á¥à묨 ¨§®¡à ¦¥¨ï¬¨ ¢ ä®à¬ ⥠24-bit, ¨§ ª®â®àëå ¡ã¤ãâ ᮧ¤ ¢ âìáï âà ä à¥âë
|
||||
|
||||
cursors_count equ 4
|
||||
|
||||
@ -196,7 +191,7 @@ align 4
|
||||
start:
|
||||
load_libraries l_libs_start,l_libs_end
|
||||
;¯à®¢¥àª ᪮«ìª® ã¤ ç® § £ã§¨« áì ¡¨¡«¨®â¥ª
|
||||
mov ebp,lib_7
|
||||
mov ebp,lib4
|
||||
cmp dword [ebp+ll_struc_size-4],0
|
||||
jz @f
|
||||
mcall SF_TERMINATE_PROCESS
|
||||
@ -205,7 +200,7 @@ start:
|
||||
mcall SF_SET_EVENTS_MASK,0x27
|
||||
|
||||
;*** áç¨âë¢ ¨¥ áâ஥ª ¨§ *.ini ä ©«
|
||||
copy_path ini_name,sys_path,file_name,0x0
|
||||
copy_path ini_name,sys_path,file_name,0
|
||||
|
||||
stdcall dword[ini_get_color],file_name,ini_sec_color,key_color_bkgnd,ini_def_c_bkgnd
|
||||
mov dword[buf_0.color],eax
|
||||
@ -642,7 +637,7 @@ pushad
|
||||
mcall SF_CREATE_WINDOW, (20 shl 16)+580,(20 shl 16)+415
|
||||
|
||||
; *** ᮧ¤ ¨¥ ª®¯®ª ¯ ¥«ì ***
|
||||
mcall SF_DEFINE_BUTTON, (5 shl 16)+20, (panel_0_coord_top shl 16)+20, 3,, [sc.work_button]
|
||||
mcall SF_DEFINE_BUTTON, (5 shl 16)+20, (panel_0_coord_top shl 16)+20, 3, [sc.work_button]
|
||||
|
||||
add ebx,25 shl 16
|
||||
mov edx,4
|
||||
@ -758,27 +753,26 @@ pushad
|
||||
stdcall pole_draw_pok, pole
|
||||
|
||||
; *** ᮧ¤ ¨¥ ª®¯®ª ãáâ ®¢ª¨ ᨣ «®¢ set_0 ¨ set_1 ***
|
||||
mov esi,[sc.work_button]
|
||||
mcall SF_DEFINE_BUTTON, (5 shl 16)+20, (panel_1_coord_top shl 16)+20, 20
|
||||
mcall SF_DEFINE_BUTTON, (5 shl 16)+20, (panel_1_coord_top shl 16)+20, 20, [sc.work_button]
|
||||
|
||||
add ebx,25 shl 16
|
||||
mov edx,21
|
||||
inc edx
|
||||
int 0x40
|
||||
|
||||
add ebx,30 shl 16
|
||||
mov edx,22
|
||||
inc edx
|
||||
int 0x40
|
||||
|
||||
add ebx,25 shl 16
|
||||
mov edx,23
|
||||
inc edx
|
||||
int 0x40
|
||||
|
||||
add ebx,25 shl 16
|
||||
mov edx,24
|
||||
inc edx
|
||||
int 0x40
|
||||
|
||||
add ebx,25 shl 16
|
||||
mov edx,25
|
||||
inc edx
|
||||
int 0x40
|
||||
|
||||
mov ecx,[sc.work_text]
|
||||
@ -808,8 +802,7 @@ pushad
|
||||
int 0x40
|
||||
|
||||
; *** ᮧ¤ ¨¥ ª®¯®ª à¨á®¢ ¨ï ¯à®¢®¤ ***
|
||||
mov esi,[sc.work_button]
|
||||
mcall SF_DEFINE_BUTTON, (5 shl 16)+20, (panel_2_coord_top shl 16)+20, 30
|
||||
mcall SF_DEFINE_BUTTON, (5 shl 16)+20, (panel_2_coord_top shl 16)+20, 30, [sc.work_button]
|
||||
|
||||
add ebx,30 shl 16
|
||||
mov edx,31
|
||||
@ -1042,11 +1035,6 @@ shem_colors:
|
||||
dd color_s0, color_s1, color_s2, color_s3
|
||||
color_captions dd 0x808080
|
||||
|
||||
align 4
|
||||
open_file_lif:
|
||||
rb 2*4096 ;®¡« áâì ¤«ï ®âªàëâ¨ï ä ©«®¢
|
||||
.end:
|
||||
|
||||
align 4
|
||||
but_open_file:
|
||||
pushad
|
||||
@ -1080,8 +1068,8 @@ but_open_file:
|
||||
|
||||
mov esi,txt_size
|
||||
call str_analiz_r
|
||||
cmp edi,0
|
||||
je @f
|
||||
or edi,edi
|
||||
jz @f
|
||||
stdcall str_len,esi
|
||||
add edi,eax
|
||||
stdcall conv_str_to_int,edi
|
||||
@ -1104,8 +1092,8 @@ but_open_file:
|
||||
|
||||
mov esi,txt_elements
|
||||
call str_analiz_r
|
||||
cmp edi,0
|
||||
je .end_elems
|
||||
or edi,edi
|
||||
jz .end_elems
|
||||
stdcall str_len,esi
|
||||
add edi,eax
|
||||
stdcall conv_str_to_int,edi
|
||||
@ -1416,8 +1404,8 @@ pushad
|
||||
inc edx
|
||||
push edx
|
||||
stdcall pole_cell_find, edi
|
||||
cmp eax,0
|
||||
je @f
|
||||
or eax,eax
|
||||
jz @f
|
||||
or dword[napr],1
|
||||
@@:
|
||||
|
||||
@ -1427,8 +1415,8 @@ pushad
|
||||
mov edx,[ebx+offs_cell_x]
|
||||
push edx
|
||||
stdcall pole_cell_find, edi
|
||||
cmp eax,0
|
||||
je @f
|
||||
or eax,eax
|
||||
jz @f
|
||||
or dword[napr],2
|
||||
@@:
|
||||
|
||||
@ -1438,8 +1426,8 @@ pushad
|
||||
dec edx
|
||||
push edx
|
||||
stdcall pole_cell_find, edi
|
||||
cmp eax,0
|
||||
je @f
|
||||
or eax,eax
|
||||
jz @f
|
||||
or dword[napr],4
|
||||
@@:
|
||||
|
||||
@ -1449,8 +1437,8 @@ pushad
|
||||
mov edx,[ebx+offs_cell_x]
|
||||
push edx
|
||||
stdcall pole_cell_find, edi
|
||||
cmp eax,0
|
||||
je @f
|
||||
or eax,eax
|
||||
jz @f
|
||||
or dword[napr],8
|
||||
@@:
|
||||
|
||||
@ -1970,15 +1958,13 @@ proc move_rotate_n90 uses ecx edi, d_x:dword, d_y:dword, angle:dword
|
||||
endp
|
||||
|
||||
align 4
|
||||
proc mem_copy, destination:dword, source:dword, len:dword
|
||||
push ecx esi edi
|
||||
cld
|
||||
mov esi, dword[source]
|
||||
mov edi, dword[destination]
|
||||
mov ecx, dword[len]
|
||||
rep movsb
|
||||
pop edi esi ecx
|
||||
ret
|
||||
proc mem_copy uses ecx esi edi, destination:dword, source:dword, len:dword
|
||||
cld
|
||||
mov edi,[destination]
|
||||
mov esi,[source]
|
||||
mov ecx,[len]
|
||||
rep movsb
|
||||
ret
|
||||
endp
|
||||
|
||||
;description:
|
||||
@ -2290,8 +2276,8 @@ proc set_pen_mode uses eax ebx ecx edx, mode:dword, icon:dword, hot_p:dword
|
||||
add ecx,[buf_curs.data]
|
||||
mcall SF_MOUSE_GET,SSF_LOAD_CURSOR
|
||||
|
||||
cmp eax,0
|
||||
je @f
|
||||
or eax,eax
|
||||
jz @f
|
||||
mov [cursor_pointer],eax
|
||||
mcall SF_MOUSE_GET,SSF_SET_CURSOR,[cursor_pointer]
|
||||
@@:
|
||||
@ -2339,15 +2325,6 @@ db 0
|
||||
|
||||
include 'le_libs.inc'
|
||||
|
||||
mouse_dd dd 0x0
|
||||
sc system_colors
|
||||
last_time dd 0
|
||||
|
||||
|
||||
|
||||
align 16
|
||||
procinfo process_information
|
||||
|
||||
align 4
|
||||
buf_0: dd 0 ;
|
||||
.l: dw 170 ;+4 left
|
||||
@ -2360,8 +2337,7 @@ buf_0: dd 0 ;
|
||||
align 4
|
||||
buf_font: ;¡ãä¥à á® èà¨ä⮬
|
||||
dd 0 ;㪠§ â¥«ì ¡ãä¥à ¨§®¡à ¦¥¨ï
|
||||
dw 25 ;+4 left
|
||||
dw 25 ;+6 top
|
||||
dw 25,25 ;+4 left,top
|
||||
dd 96 ;+8 w
|
||||
dd 144 ;+12 h
|
||||
dd 0 ;+16 color
|
||||
@ -2370,8 +2346,7 @@ buf_font: ;
|
||||
align 4
|
||||
buf_curs: ;¡ãä¥à á ªãàá®à ¬¨
|
||||
.data: dd 0 ;㪠§ â¥«ì ¡ãä¥à ¨§®¡à ¦¥¨ï
|
||||
dw 0 ;+4 left
|
||||
dw 0 ;+6 top
|
||||
dw 0,0 ;+4 left,top
|
||||
dd 32 ;+8 w
|
||||
dd 32*cursors_count ;+12 h
|
||||
dd 0 ;+16 color
|
||||
@ -2380,8 +2355,7 @@ buf_curs: ;
|
||||
align 4
|
||||
buf_curs_8: ;¡ãä¥à á ªãàá®à ¬¨
|
||||
.data: dd 0 ;㪠§ â¥«ì ¡ãä¥à ¨§®¡à ¦¥¨ï
|
||||
dw 0 ;+4 left
|
||||
dw 0 ;+6 top
|
||||
dw 0,0 ;+4 left,top
|
||||
dd 32 ;+8 w
|
||||
dd 32*cursors_count ;+12 h
|
||||
dd 0 ;+16 color
|
||||
@ -2618,13 +2592,22 @@ align 4
|
||||
|
||||
align 16
|
||||
i_end:
|
||||
image_data_toolbar dd 0
|
||||
icon_tl_sys dd 0 ;㪠§ â¥«ì ¯ ¬ïâì ¤«ï åà ¥¨ï á¨á⥬ëå ¨ª®®ª
|
||||
icon_toolbar dd 0 ;㪠§ â¥«ì ¯ ¬ïâì ¤«ï åà ¥¨ï ¨ª®®ª ®¡ê¥ªâ®¢
|
||||
image_data_gray dd 0 ;¯ ¬ïâì á ¢à¥¬¥ë¬¨ á¥à묨 ¨§®¡à ¦¥¨ï¬¨ ¢ ä®à¬ ⥠24-bit, ¨§ ª®â®àëå ¡ã¤ãâ ᮧ¤ ¢ âìáï âà ä à¥âë
|
||||
mouse_dd dd 0
|
||||
last_time dd 0
|
||||
sc system_colors
|
||||
procinfo process_information
|
||||
run_file_70 FileInfoBlock
|
||||
open_file_lif:
|
||||
rb 2*4096 ;®¡« áâì ¤«ï ®âªàëâ¨ï ä ©«®¢
|
||||
.end:
|
||||
rb 1024
|
||||
stacktop:
|
||||
sys_path rb 1024
|
||||
file_name:
|
||||
rb 1024 ;4096
|
||||
library_path rb 1024
|
||||
file_name rb 2048 ;4096
|
||||
plugin_path rb 4096
|
||||
openfile_path rb 4096
|
||||
filename_area rb 256
|
||||
|
@ -44,8 +44,9 @@ include 'lang.inc' ;
|
||||
include '../../macros.inc'
|
||||
include '../../proc32.inc'
|
||||
include '../../dll.inc'
|
||||
include '../../KOSfuncs.inc'
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac' ;êîìïîíåíòû checkBox è editBox
|
||||
include '../../develop/libraries/box_lib/load_lib.mac' ;ìàêðîñ äëÿ çàãðóçêè áèáëèîòåê
|
||||
include '../../load_lib.mac' ;ìàêðîñ äëÿ çàãðóçêè áèáëèîòåê
|
||||
@use_library
|
||||
|
||||
KMENUITEM_NORMAL equ 0
|
||||
@ -1431,13 +1432,6 @@ valueModeMenu1 db '
|
||||
valueModeMenu2 db '०¨¬ £®àï祩 ª« ¢¨è¨ ',0
|
||||
valueModeMenu3 db '०¨¬ ¦¥áâ ¯® ª« ¢¨è¥ ªâ¨¢ 樨',0
|
||||
|
||||
head_f_i:
|
||||
head_f_l db '‘¨á⥬ ï ®è¨¡ª ',0
|
||||
err_message_found_lib0 db '<27>¥ ©¤¥ ¡¨¡«¨®â¥ª ',39,'proc_lib.obj',39,0
|
||||
err_message_import0 db 'Žè¨¡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'proc_lib.obj',39,0
|
||||
err_message_found_lib1 db '<27>¥ ©¤¥ ¡¨¡«¨®â¥ª ',39,'kmenu.obj',39,0
|
||||
err_message_import1 db 'Žè¨¡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'kmenu',39,0
|
||||
|
||||
hkCaption: db 'Š« ¢¨è :',0
|
||||
;hkHint: db '<27> ¦¬¨â¥ «î¡ãî ª« ¢¨èã',0
|
||||
radiusCaption: db '<27> ¤¨ãá:',0
|
||||
@ -1468,13 +1462,6 @@ valueModeMenu1 db 'classic mode ',0
|
||||
valueModeMenu2 db 'hot key mode ',0
|
||||
valueModeMenu3 db 'activation key gesture mode ',0
|
||||
|
||||
head_f_i:
|
||||
head_f_l db 'System error',0
|
||||
err_message_found_lib0 db 'Could not find library ',39,'proc_lib.obj',39,0
|
||||
err_message_import0 db 'Error importing library ',39,'proc_lib.obj',39,0
|
||||
err_message_found_lib1 db 'Could not find library ',39,'kmenu.obj',39,0
|
||||
err_message_import1 db 'Error importing library ',39,'kmenu',39,0
|
||||
|
||||
hkCaption: db 'Key:',0
|
||||
;hkHint: db 'press any key',0
|
||||
radiusCaption: db 'Radius:',0
|
||||
@ -1717,24 +1704,17 @@ coordModeMenu:
|
||||
.y dw 200
|
||||
|
||||
|
||||
align 4
|
||||
proclib_import: ;îïèñàíèå ýêñïîðòèðóåìûõ ôóíêöèé
|
||||
OpenDialog_Init dd aOpenDialog_Init
|
||||
OpenDialog_Start dd aOpenDialog_Start
|
||||
dd 0,0
|
||||
aOpenDialog_Init db 'OpenDialog_init',0
|
||||
aOpenDialog_Start db 'OpenDialog_start',0
|
||||
|
||||
system_dir0 db '/sys/lib/'
|
||||
lib0_name db 'proc_lib.obj',0
|
||||
system_dir1 db '/sys/lib/'
|
||||
lib1_name db 'kmenu.obj',0
|
||||
|
||||
symbolDownArrow db 25,0
|
||||
|
||||
;library structures
|
||||
l_libs_start:
|
||||
lib0 l_libs lib0_name, sys_path, file_name, system_dir0, err_message_found_lib0, head_f_l, proclib_import,err_message_import0, head_f_i
|
||||
lib1 l_libs lib1_name, sys_path, file_name, system_dir0, err_message_found_lib1, head_f_l, import_libkmenu,err_message_import1,head_f_i
|
||||
lib0 l_libs lib0_name, file_name, system_dir0, import_proclib
|
||||
lib1 l_libs lib1_name, file_name, system_dir1, import_libkmenu
|
||||
load_lib_end:
|
||||
|
||||
|
||||
@ -1748,6 +1728,14 @@ editRU edit_box 230-buttonW,290,85, 0xffffff, 0x6a9480, 0, 0xAABBCC, 0x1000000
|
||||
editRD edit_box 230-buttonW,290,120, 0xffffff, 0x6a9480, 0, 0xAABBCC, 0x10000000, edMaxSize, dataBuffer.4, mouse_dd, 0, edMax, edMax
|
||||
editRadius edit_box 40,(buttonHotKeyX + buttonHotKeyWidth + 20),buttonModeY, 0xffffff, 0x6a9480, 0, 0xAABBCC, 0x10000000, 4, radiusBuffer.data, mouse_dd, ed_figure_only, edMax, edMax
|
||||
|
||||
align 4
|
||||
import_proclib:
|
||||
OpenDialog_Init dd aOpenDialog_Init
|
||||
OpenDialog_Start dd aOpenDialog_Start
|
||||
dd 0,0
|
||||
aOpenDialog_Init db 'OpenDialog_init',0
|
||||
aOpenDialog_Start db 'OpenDialog_start',0
|
||||
|
||||
align 4
|
||||
import_libkmenu:
|
||||
kmenu_init dd akmenu_init
|
||||
|
Loading…
Reference in New Issue
Block a user