Skip to content

Commit 11a8128

Browse files
Hotfix for Squeak3D on 64bits VM
The B3DRasterizer state.objects store pointers to B3D objects into a 4-bytes Smalltalk WordArray. This means that appropriate arithmetic has to take place in order to compute the number of objects stored in that WordArray Indeed, on 64bits VM, each object pointer is going to consume 8-bytes (2 words). That also means that proper allocation of Smalltalk WordArray has to take place at image side. A fix to `B3DPrimitiveRasterizerState>>initObjects:` is thus also required objects := B3DPrimitiveRasterizerData new: nObjects * (Smalltalk wordSize / 4) The slang and image Smalltalk code have not been published yet. They are waiting for approval of my Developer status on http://www.squeaksource.com/Balloon3D.html
1 parent 98f6b50 commit 11a8128

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/plugins/Squeak3D/Squeak3D.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* Automatically generated by
2-
VMPluginCodeGenerator VMMaker.oscog-eem.2719 uuid: e40f3e94-3a54-411b-9613-5d19114ea131
2+
VMPluginCodeGenerator VMMaker.oscog-eem.2721 uuid: ae80c101-9b76-4d26-907a-6466e4269ad7
33
from
4-
B3DEnginePlugin Balloon3D-Plugins-eem.15 uuid: d694149b-363b-4754-aa4a-7ef0cb2c5eab
4+
B3DEnginePlugin Balloon3D-Plugins-nice.16 uuid: 961cec73-badd-4b71-8d02-9233e3122e21
55
*/
6-
static char __buildInfo[] = "B3DEnginePlugin Balloon3D-Plugins-eem.15 uuid: d694149b-363b-4754-aa4a-7ef0cb2c5eab " __DATE__ ;
6+
static char __buildInfo[] = "B3DEnginePlugin Balloon3D-Plugins-nice.16 uuid: 961cec73-badd-4b71-8d02-9233e3122e21 " __DATE__ ;
77

88

99

@@ -280,7 +280,7 @@ static double l2vSpecDir[3];
280280
static sqInt lightFlags;
281281
static float* litVertex;
282282
static sqInt loadBBFn;
283-
static const char *moduleName = "Squeak3D Balloon3D-Plugins-eem.15 " INT_EXT;
283+
static const char *moduleName = "Squeak3D Balloon3D-Plugins-nice.16 " INT_EXT;
284284
static float* primLight;
285285
static float* primMaterial;
286286
static sqInt vbFlags;
@@ -2942,10 +2942,10 @@ loadRasterizerState(sqInt stackIndex)
29422942
if (!(isWords(obj))) {
29432943
return 0;
29442944
}
2945-
objLen = slotSizeOf(obj);
2945+
objLen = byteSizeOf(obj);
29462946
objPtr = firstIndexableField(obj);
29472947
state.objects = (B3DPrimitiveObject **)objPtr;
2948-
state.nObjects = objLen;
2948+
state.nObjects = objLen/sizeof(B3DPrimitiveObject *);
29492949
}
29502950
obj = fetchPointerofObject(7, stateOop);
29512951
if (obj == (nilObject())) {

0 commit comments

Comments
 (0)